summaryrefslogtreecommitdiff
path: root/Zend/tests/bug69761.phpt
blob: 4b7e2787d81df5400e239d92062e3e6329a81c9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--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