3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Esempio { var $variable; } function ciao($a) { $a->variable = 5; } $obj =& new Esempio; $obj->variable = 2; ciao($obj); var_dump($obj);
Output for 7.0.0
Parse error: syntax error, unexpected 'new' (T_NEW) in /in/WLjl7 on line 13
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Deprecated: Assigning the return value of new by reference is deprecated in /in/WLjl7 on line 13 object(Esempio)#1 (1) { ["variable"]=> int(5) }

preferences:
184.97 ms | 1400 KiB | 35 Q