mirror of
https://github.com/php/php-src.git
synced 2024-12-01 13:54:10 +08:00
29 lines
535 B
PHP
Executable File
29 lines
535 B
PHP
Executable File
--TEST--
|
|
Bug #24884 (calling $this->__clone(); crashes php)
|
|
--SKIPIF--
|
|
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
|
--FILE--
|
|
<?php
|
|
class Test {
|
|
function __copy()
|
|
{
|
|
$string = PHP_VERSION;
|
|
$version = $string{0};
|
|
if($string < 5)
|
|
{
|
|
return $this;
|
|
}
|
|
else
|
|
{
|
|
return $this->__clone();
|
|
}
|
|
}
|
|
}
|
|
$test = new Test();
|
|
$test2 = $test->__copy();
|
|
var_dump($test2);
|
|
?>
|
|
--EXPECT--
|
|
object(Test)#2 (0) {
|
|
}
|