php-src/Zend/tests/bug24884.phpt

27 lines
424 B
Plaintext
Raw Normal View History

2003-08-04 09:31:58 +00:00
--TEST--
Bug #24884 (calling $this->__clone(); crashes php)
--FILE--
<?php
class Test {
function __copy()
{
$string = PHP_VERSION;
2005-11-16 16:57:27 +00:00
$version = $string[0];
2003-08-04 09:31:58 +00:00
if($string < 5)
{
return $this;
}
else
{
2004-02-03 22:07:29 +00:00
return clone $this;
2003-08-04 09:31:58 +00:00
}
}
}
$test = new Test();
$test2 = $test->__copy();
var_dump($test2);
?>
2006-09-11 08:08:20 +00:00
--EXPECTF--
object(Test)#%d (0) {
2003-08-04 09:31:58 +00:00
}