3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $record = [ [ firstname => 'Joe', lastname => 'McDonald' ] ]; echo $record[1][lastname];
Output for 7.2.0
Warning: Use of undefined constant firstname - assumed 'firstname' (this will throw an Error in a future version of PHP) in /in/aM2ud on line 5 Warning: Use of undefined constant lastname - assumed 'lastname' (this will throw an Error in a future version of PHP) in /in/aM2ud on line 5 Warning: Use of undefined constant lastname - assumed 'lastname' (this will throw an Error in a future version of PHP) in /in/aM2ud on line 8 Notice: Undefined offset: 1 in /in/aM2ud on line 8
Output for 5.4.0 - 7.1.10
Notice: Use of undefined constant firstname - assumed 'firstname' in /in/aM2ud on line 5 Notice: Use of undefined constant lastname - assumed 'lastname' in /in/aM2ud on line 5 Notice: Use of undefined constant lastname - assumed 'lastname' in /in/aM2ud on line 8 Notice: Undefined offset: 1 in /in/aM2ud on line 8
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/aM2ud on line 3
Process exited with code 255.