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); function checkArray($array) { forEach($array as $index => $item) { if(is_Array($item)) { echo "YES-" . ": " . $array . $index . $item . "\n"; checkArray($item); } else { echo "NO-" . ": " . $item . "\n"; } } } checkArray($superheroes);
based on teaai
Output for 5.4.9 - 7.3.0rc3
Notice: Array to string conversion in /in/omJEX on line 22 Notice: Array to string conversion in /in/omJEX on line 22 YES-: Arrayspider-manArray NO-: Peter Parker NO-: peterparker@mail.com Notice: Array to string conversion in /in/omJEX on line 22 Notice: Array to string conversion in /in/omJEX on line 22 YES-: Arraysuper-manArray NO-: Clark Kent NO-: clarkkent@mail.com Notice: Array to string conversion in /in/omJEX on line 22 Notice: Array to string conversion in /in/omJEX on line 22 YES-: Arrayiron-manArray NO-: Harry Potter NO-: harrypotter@mail.com
Output for 5.3.19 - 5.3.29
YES-: Arrayspider-manArray NO-: Peter Parker NO-: peterparker@mail.com YES-: Arraysuper-manArray NO-: Clark Kent NO-: clarkkent@mail.com YES-: Arrayiron-manArray NO-: Harry Potter NO-: harrypotter@mail.com