1--TEST-- 2DateInterval invalid serialization data with date_string 3--FILE-- 4<?php 5$propertySets = [ 6 '2023-01-16 17:01:19', 7 '2023-01-16-foobar$*', 8]; 9 10foreach( $propertySets as $propertySet ) 11{ 12 try { 13 $d = DateInterval::__set_state( [ 'date_string' => $propertySet ] ); 14 echo "OK\n"; 15 } catch (\Error $e) { 16 echo $e::class, ': ', $e->getMessage(), "\n"; 17 } 18} 19?> 20--EXPECT-- 21OK 22Error: Unknown or bad format (2023-01-16-foobar$*) at position 10 (-) while unserializing: Unexpected character 23