summaryrefslogtreecommitdiff
path: root/Zend/tests/bug69761.phpt
blob: 2ec7cc10e1b9d7e9334ca992d04ba7ed5f76fb6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--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@anonymous))
#1 {main}
  thrown in %sbug69761.php on line %d