3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); //of the INI constants (On, Off, True, False, Yes, No and None) foreach([["Shit"=>"On"],["Shit"=>"Off"],["Shit"=>"True"],["Shit"=>"False"],["Shit"=>"Yes"],["Shit"=>"No"],["Shit"=>"None"]] as $key=>$val) { var_dump($key,$val,ini_set($key,$val),ini_get($key)); }
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: ini_set() expects parameter 2 to be string, array given in /in/4682F on line 6 int(0) array(1) { ["Shit"]=> string(2) "On" } NULL bool(false) Warning: ini_set() expects parameter 2 to be string, array given in /in/4682F on line 6 int(1) array(1) { ["Shit"]=> string(3) "Off" } NULL bool(false) Warning: ini_set() expects parameter 2 to be string, array given in /in/4682F on line 6 int(2) array(1) { ["Shit"]=> string(4) "True" } NULL bool(false) Warning: ini_set() expects parameter 2 to be string, array given in /in/4682F on line 6 int(3) array(1) { ["Shit"]=> string(5) "False" } NULL bool(false) Warning: ini_set() expects parameter 2 to be string, array given in /in/4682F on line 6 int(4) array(1) { ["Shit"]=> string(3) "Yes" } NULL bool(false) Warning: ini_set() expects parameter 2 to be string, array given in /in/4682F on line 6 int(5) array(1) { ["Shit"]=> string(2) "No" } NULL bool(false) Warning: ini_set() expects parameter 2 to be string, array given in /in/4682F on line 6 int(6) array(1) { ["Shit"]=> string(4) "None" } NULL bool(false)
Output for hhvm-3.10.0 - 3.12.0
int(0) array(1) { ["Shit"]=> string(2) "On" } bool(false) bool(false) int(1) array(1) { ["Shit"]=> string(3) "Off" } bool(false) bool(false) int(2) array(1) { ["Shit"]=> string(4) "True" } bool(false) bool(false) int(3) array(1) { ["Shit"]=> string(5) "False" } bool(false) bool(false) int(4) array(1) { ["Shit"]=> string(3) "Yes" } bool(false) bool(false) int(5) array(1) { ["Shit"]=> string(2) "No" } bool(false) bool(false) int(6) array(1) { ["Shit"]=> string(4) "None" } bool(false) bool(false)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/4682F on line 4
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/4682F on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/4682F on line 4
Process exited with code 255.