3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array=array( [0] => array ( 'id' => 1, 'title' => 'ficton', 'modules' => array( [0] => array( 'other_id' => 1, 'other_title' => 'James Clavell' ), [1] => array( 'other_id' => 2, 'other_title' => 'Terry Pratchett' ), [2] => array( 'other_id' => 3, 'other_title' => 'Robert Ludlum' ), ), [1] => array ( 'id' => 2, 'title' => 'non-ficton', 'modules' => array( [1] => array( 'other_id' => 5, 'other_title' => 'An excessive book of excessively interesting things' ), [2] => array( 'other_id' => 6, 'other_title' => 'It\'s late, I can\'t think of what to put here' ), ) ) )); print_r($array);
Output for 5.4.0 - 5.6.28
Warning: Illegal offset type in /in/j69FK on line 10 Warning: Illegal offset type in /in/j69FK on line 14 Warning: Illegal offset type in /in/j69FK on line 18 Warning: Illegal offset type in /in/j69FK on line 27 Warning: Illegal offset type in /in/j69FK on line 31 Warning: Illegal offset type in /in/j69FK on line 34 Warning: Illegal offset type in /in/j69FK on line 34 Array ( )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.27
Parse error: syntax error, unexpected '[', expecting ')' in /in/j69FK on line 3
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 '[', expecting ')' in /in/j69FK on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/j69FK on line 3
Process exited with code 255.