php-src/Zend/tests/bug69761.phpt
Xinchen Hui d96dda8d49 Fixed Bug #69761 (Serialization of anonymous classes should be prevented)
And also cleanup anonymous class compiling, it make no sense prefix a
namespace to anonymous class name. and it is always lowcased and
interned string.
2015-06-13 10:49:20 +08:00

16 lines
414 B
PHP

--TEST--
Bug #69761 (Serialization of anonymous classes should be prevented)
--FILE--
<?php
$instance = new class('foo') {
public function __construct($i) {
}
};
var_dump(serialize($instance));
?>
--EXPECTF--
Fatal error: Uncaught Exception: Serialization of 'class@%s' is not allowed in %sbug69761.php:%d
Stack trace:
#0 %sbug69761.php(%d): serialize(Object(class@%s
thrown in %sbug69761.php on line %d