1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/date/tests/DateTimeZone_serialize_errors.phpt
2023-02-08 10:27:33 +00:00

15 lines
380 B
PHP

--TEST--
Test unserialization of DateTimeZone with null byte
--FILE--
<?php
$serialized = 'O:12:"DateTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:17:"Ame' . "\0" .'rica/New_York";}';
try {
$tz = unserialize($serialized);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Error: Invalid serialization data for DateTimeZone object