bug24884.phpt 424 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Bug #24884 (calling $this->__clone(); crashes php)
  3. --FILE--
  4. <?php
  5. class Test {
  6. function __copy()
  7. {
  8. $string = PHP_VERSION;
  9. $version = $string[0];
  10. if($string < 5)
  11. {
  12. return $this;
  13. }
  14. else
  15. {
  16. return clone $this;
  17. }
  18. }
  19. }
  20. $test = new Test();
  21. $test2 = $test->__copy();
  22. var_dump($test2);
  23. ?>
  24. --EXPECTF--
  25. object(Test)#%d (0) {
  26. }