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", ) ); function checkArray($array) { forEach($array as $index => $item) { if(is_Array ($item)) { echo "========== \n"; $dimensionPath = $array + $index; echo "YES-" + $dimensionPath + ": " + $item + "\n"; checkArray($item); } else { echo "NO-" . $index . ": " . $item . "\n"; } } } checkArray($superheroes);
based on AmisR
Output for 7.1.0 - 7.2.0
========== Warning: A non-numeric value encountered in /in/IkM9L on line 21 Fatal error: Uncaught Error: Unsupported operand types in /in/IkM9L:21 Stack trace: #0 /in/IkM9L(31): checkArray(Array) #1 {main} thrown in /in/IkM9L on line 21
Process exited with code 255.
Output for 7.0.0 - 7.0.20
========== Fatal error: Uncaught Error: Unsupported operand types in /in/IkM9L:21 Stack trace: #0 /in/IkM9L(31): checkArray(Array) #1 {main} thrown in /in/IkM9L on line 21
Process exited with code 255.
Output for 5.3.19 - 5.6.28
========== Fatal error: Unsupported operand types in /in/IkM9L on line 21
Process exited with code 255.