3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "Numeric strings will be converted into an integer\n"; var_dump(array( -1 => -1, 1 => 1, '1' => '1', '-1' => '-1', '1.1' => '1.1', 's1' => 's1', )); echo "Floating point numbers will be converted into an integer:\n": var_dump(array( -1 => -1, 0 => 0, 1 => 1, -1.9 => -1.9, 0.9 => 0.9, 1.9 => 1.9 )); echo "Booleans will be converted into an integer:\n"; var_dump(array( 0 => 0, 1 => 1, true => true, false => false, )); echo "NULL will be converted into an empty string:\n"; var_dump(array( '' => '', null => null, ));
Output for 5.3.0 - 5.4.21
Parse error: syntax error, unexpected ':', expecting ',' or ';' in /in/gNHTO on line 14
Process exited with code 255.