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, $dimensionName) { if(is_Array ($array)) { echo "======== \n"; forEach($array as $index => $item) { $dimensionPath = $array[$index]; $dimensionName = ($array) . ($index); echo "YES-" . (($dimensionName) . ": " . ($item) . "\n"); checkArray($dimensionPath); } } } checkArray($superheroes);
based on 4tWEl
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function checkArray(), 1 passed in /in/amPml on line 29 and exactly 2 expected in /in/amPml:17 Stack trace: #0 /in/amPml(29): checkArray(Array) #1 {main} thrown in /in/amPml on line 17
Process exited with code 255.
Output for 5.4.9 - 7.0.20
Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 29 and defined in /in/amPml on line 17 ======== Notice: Array to string conversion in /in/amPml on line 22 Notice: Array to string conversion in /in/amPml on line 23 YES-Arrayspider-man: Array Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 ======== Notice: Array to string conversion in /in/amPml on line 22 YES-Arrayname: Peter Parker Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 Notice: Array to string conversion in /in/amPml on line 22 YES-Arrayemail: peterparker@mail.com Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 Notice: Array to string conversion in /in/amPml on line 22 Notice: Array to string conversion in /in/amPml on line 23 YES-Arraysuper-man: Array Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 ======== Notice: Array to string conversion in /in/amPml on line 22 YES-Arrayname: Clark Kent Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 Notice: Array to string conversion in /in/amPml on line 22 YES-Arrayemail: clarkkent@mail.com Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 Notice: Array to string conversion in /in/amPml on line 22 Notice: Array to string conversion in /in/amPml on line 23 YES-Arrayiron-man: Array Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 ======== Notice: Array to string conversion in /in/amPml on line 22 YES-Arrayname: Harry Potter Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 Notice: Array to string conversion in /in/amPml on line 22 YES-Arrayemail: harrypotter@mail.com Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17
Output for 5.3.19 - 5.3.29
Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 29 and defined in /in/amPml on line 17 ======== YES-Arrayspider-man: Array Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 ======== YES-Arrayname: Peter Parker Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 YES-Arrayemail: peterparker@mail.com Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 YES-Arraysuper-man: Array Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 ======== YES-Arrayname: Clark Kent Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 YES-Arrayemail: clarkkent@mail.com Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 YES-Arrayiron-man: Array Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 ======== YES-Arrayname: Harry Potter Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17 YES-Arrayemail: harrypotter@mail.com Warning: Missing argument 2 for checkArray(), called in /in/amPml on line 24 and defined in /in/amPml on line 17