bug73288.phpt 593 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. Bug #73288 (Segfault in __clone > Exception.toString > __get)
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. --FILE--
  7. <?php
  8. class NoClone {
  9. public function __clone() {
  10. throw new Exception("No Cloneable");
  11. }
  12. }
  13. class C {
  14. public function __get($name) {
  15. return new NoClone;
  16. }
  17. }
  18. function test_clone() {
  19. $c = new C;
  20. $b = clone $c->x;
  21. }
  22. test_clone();
  23. ?>
  24. --EXPECTF--
  25. Fatal error: Uncaught Exception: No Cloneable in %sbug73288.php:%d
  26. Stack trace:
  27. #0 %s(%d): NoClone->__clone()
  28. #1 %s(%d): test_clone()
  29. #2 {main}
  30. thrown in %sbug73288.php on line %d