3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a{ public $x = $b; return $x; } $q="asdffg"; $z=new a(); echo $z->b = $q;
Output for 7.0.0 - 7.0.9
Parse error: syntax error, unexpected 'return' (T_RETURN), expecting function (T_FUNCTION) in /in/BhI1H on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.24
Parse error: syntax error, unexpected '$b' (T_VARIABLE) in /in/BhI1H on line 4
Process exited with code 255.

preferences:
188.29 ms | 1395 KiB | 80 Q