mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
29 lines
692 B
PHP
29 lines
692 B
PHP
--TEST--
|
|
Bug #76737: Unserialized reflection objects are broken, they shouldn't be serializable
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
$r = new ReflectionClass('stdClass');
|
|
var_dump(serialize($r));
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$s = 'C:15:"ReflectionClass":0:{}';
|
|
var_dump(unserialize($s));
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$s = 'O:15:"ReflectionClass":0:{}';
|
|
var_dump(unserialize($s));
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Serialization of 'ReflectionClass' is not allowed
|
|
Unserialization of 'ReflectionClass' is not allowed
|
|
Unserialization of 'ReflectionClass' is not allowed
|