bug69761.phpt 433 B

12345678910111213141516
  1. --TEST--
  2. Bug #69761 (Serialization of anonymous classes should be prevented)
  3. --FILE--
  4. <?php
  5. $instance = new class('foo') {
  6. public function __construct($i) {
  7. }
  8. };
  9. var_dump(serialize($instance));
  10. ?>
  11. --EXPECTF--
  12. Fatal error: Uncaught Exception: Serialization of 'class@%s' is not allowed in %sbug69761.php:%d
  13. Stack trace:
  14. #0 %sbug69761.php(%d): serialize(Object(class@anonymous))
  15. #1 {main}
  16. thrown in %sbug69761.php on line %d