3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = StdClass(); $y = '0'; $x->$y->$ = 'ALPHA'; print $x;
Output for 5.4.13
Parse error: syntax error, unexpected '=', expecting variable (T_VARIABLE) or '$' in /in/L8v9J on line 4
Process exited with code 255.
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected '=', expecting variable (T_VARIABLE) or '$' in C4Xll on line 4
Process exited with code 255.
Output for 5.3.23
Parse error: syntax error, unexpected '=', expecting T_VARIABLE or '$' in /in/L8v9J on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.22
Parse error: syntax error, unexpected '=', expecting T_VARIABLE or '$' in C4Xll on line 4
Process exited with code 255.

preferences:
183.81 ms | 1395 KiB | 45 Q