summaryrefslogtreecommitdiff
path: root/Zend/tests/bug24884.phpt
blob: 3788479cb099f3e8dcf8750e57518de7c8eaa523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--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) {
}