3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $superheroes = array( "spider-man" => array( "name" => "Peter Parker", "email" => "peterparker@mail.com", ), "super-man" => array( "name" => "Clark Kent", "email" => "clarkkent@mail.com", ), "iron-man" => array( "name" => "Harry Potter", "email" => "harrypotter@mail.com", ) ); print_r($superheroes); print_r($superheroes[spider-man]);
based on M5PLr
Output for 7.2.0
Array ( [spider-man] => Array ( [name] => Peter Parker [email] => peterparker@mail.com ) [super-man] => Array ( [name] => Clark Kent [email] => clarkkent@mail.com ) [iron-man] => Array ( [name] => Harry Potter [email] => harrypotter@mail.com ) ) Warning: Use of undefined constant spider - assumed 'spider' (this will throw an Error in a future version of PHP) in /in/k9NWB on line 17 Warning: Use of undefined constant man - assumed 'man' (this will throw an Error in a future version of PHP) in /in/k9NWB on line 17 Warning: A non-numeric value encountered in /in/k9NWB on line 17 Warning: A non-numeric value encountered in /in/k9NWB on line 17 Notice: Undefined offset: 0 in /in/k9NWB on line 17
Output for 7.1.0 - 7.1.10
Array ( [spider-man] => Array ( [name] => Peter Parker [email] => peterparker@mail.com ) [super-man] => Array ( [name] => Clark Kent [email] => clarkkent@mail.com ) [iron-man] => Array ( [name] => Harry Potter [email] => harrypotter@mail.com ) ) Notice: Use of undefined constant spider - assumed 'spider' in /in/k9NWB on line 17 Notice: Use of undefined constant man - assumed 'man' in /in/k9NWB on line 17 Warning: A non-numeric value encountered in /in/k9NWB on line 17 Warning: A non-numeric value encountered in /in/k9NWB on line 17 Notice: Undefined offset: 0 in /in/k9NWB on line 17
Output for 5.3.21 - 7.0.20
Array ( [spider-man] => Array ( [name] => Peter Parker [email] => peterparker@mail.com ) [super-man] => Array ( [name] => Clark Kent [email] => clarkkent@mail.com ) [iron-man] => Array ( [name] => Harry Potter [email] => harrypotter@mail.com ) ) Notice: Use of undefined constant spider - assumed 'spider' in /in/k9NWB on line 17 Notice: Use of undefined constant man - assumed 'man' in /in/k9NWB on line 17 Notice: Undefined offset: 0 in /in/k9NWB on line 17