mirror of
https://github.com/php/php-src.git
synced 2024-12-21 16:00:18 +08:00
27 lines
424 B
PHP
27 lines
424 B
PHP
--TEST--
|
|
Bug #24884 (calling $this->__clone(); crashes php)
|
|
--FILE--
|
|
<?php
|
|
class Test {
|
|
function __copy()
|
|
{
|
|
$string = PHP_VERSION;
|
|
$version = $string[0];
|
|
if($string < 5)
|
|
{
|
|
return $this;
|
|
}
|
|
else
|
|
{
|
|
return clone $this;
|
|
}
|
|
}
|
|
}
|
|
$test = new Test();
|
|
$test2 = $test->__copy();
|
|
var_dump($test2);
|
|
?>
|
|
--EXPECTF--
|
|
object(Test)#%d (0) {
|
|
}
|