2003-08-04 17:31:58 +08:00
|
|
|
--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;
|
2005-11-17 00:57:27 +08:00
|
|
|
$version = $string[0];
|
2003-08-04 17:31:58 +08:00
|
|
|
if($string < 5)
|
|
|
|
{
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-02-04 06:07:29 +08:00
|
|
|
return clone $this;
|
2003-08-04 17:31:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$test = new Test();
|
|
|
|
$test2 = $test->__copy();
|
|
|
|
var_dump($test2);
|
|
|
|
?>
|
2006-09-11 16:08:20 +08:00
|
|
|
--EXPECTF--
|
|
|
|
object(Test)#%d (0) {
|
2003-08-04 17:31:58 +08:00
|
|
|
}
|