xref: /PHP-5.6/Zend/tests/bug24884.phpt (revision 610c7fbe)
1--TEST--
2Bug #24884 (calling $this->__clone(); crashes php)
3--SKIPIF--
4<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
5--FILE--
6<?php
7class Test {
8    function __copy()
9    {
10        $string = PHP_VERSION;
11        $version = $string[0];
12        if($string < 5)
13        {
14            return $this;
15        }
16        else
17        {
18            return clone $this;
19        }
20    }
21}
22$test = new Test();
23$test2 = $test->__copy();
24var_dump($test2);
25?>
26--EXPECTF--
27object(Test)#%d (0) {
28}
29