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