3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $results = []; $results[] = ['topic' => 'Command Line']; $results[] = ['topic' => 'Symfony General']; $results[] = ['topic' => 'Dependency Injection']; $results[] = ['topic' => 'Validation']; $results[] = ['topic' => 'Cache']; $results[] = ['topic' => 'Form']; $results[] = ['topic' => 'Doctrine']; var_dump($results); var_dump(iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveArrayIterator($results)), false));
based on mKftb
Output for 5.4.0 - 7.2.0
array(7) { [0]=> array(1) { ["topic"]=> string(12) "Command Line" } [1]=> array(1) { ["topic"]=> string(15) "Symfony General" } [2]=> array(1) { ["topic"]=> string(20) "Dependency Injection" } [3]=> array(1) { ["topic"]=> string(10) "Validation" } [4]=> array(1) { ["topic"]=> string(5) "Cache" } [5]=> array(1) { ["topic"]=> string(4) "Form" } [6]=> array(1) { ["topic"]=> string(8) "Doctrine" } } array(7) { [0]=> string(12) "Command Line" [1]=> string(15) "Symfony General" [2]=> string(20) "Dependency Injection" [3]=> string(10) "Validation" [4]=> string(5) "Cache" [5]=> string(4) "Form" [6]=> string(8) "Doctrine" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/WIUqc on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/WIUqc on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/WIUqc on line 2
Process exited with code 255.