<?php
class a
{
public $a = 'azerty';
function test()
{
$this->this = &$this;
$this->a = $a;
// $this->this = new a(0);
}
}
$a = new a(10);
$a->test();
var_dump($a);
Deprecated: Creation of dynamic property a::$this is deprecated in /in/bs8qH on line 8
Warning: Undefined variable $a in /in/bs8qH on line 9
object(a)#1 (2) {
["a"]=>
NULL
["this"]=>
*RECURSION*
}
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Warning: Undefined variable $a in /in/bs8qH on line 9
object(a)#1 (2) {
["a"]=>
NULL
["this"]=>
*RECURSION*
}
Notice: Undefined variable: a in /in/bs8qH on line 9
object(a)#1 (2) {
["a"]=>
NULL
["this"]=>
object(a)#1 (2) {
["a"]=>
NULL
["this"]=>
*RECURSION*
}
}
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: a in /in/bs8qH on line 9
object(a)#1 (2) {
["a"]=>
NULL
["this"]=>
object(a)#1 (2) {
["a"]=>
NULL
["this"]=>
*RECURSION*
}
}
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/bs8qH on line 4
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/bs8qH on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/bs8qH on line 4
Process exited with code 255.