3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(123456789012345678901234567890); $a = array( "42" => "42", "123456789012345678901234567890" => "123456789012345678901234567890", ); var_dump($a); var_dump(array_key_exists("42", $a)); var_dump(array_key_exists("123456789012345678901234567890", $a)); var_dump(array_key_exists(42, $a)); var_dump(array_key_exists(123456789012345678901234567890, $a)); var_dump(isset($a["42"])); var_dump(isset($a["123456789012345678901234567890"])); var_dump(isset($a[42])); var_dump(isset($a[123456789012345678901234567890])); $a = array( 42 => 42, 123456789012345678901234567890 => 123456789012345678901234567890, ); var_dump($a); var_dump(array_key_exists("42", $a)); var_dump(array_key_exists("123456789012345678901234567890", $a)); var_dump(array_key_exists(42, $a)); var_dump(array_key_exists(123456789012345678901234567890, $a)); var_dump(isset($a["42"])); var_dump(isset($a["123456789012345678901234567890"])); var_dump(isset($a[42])); var_dump(isset($a[123456789012345678901234567890]));
Output for 5.5.24 - 7.2.0
float(1.2345678901235E+29) array(2) { [42]=> string(2) "42" ["123456789012345678901234567890"]=> string(30) "123456789012345678901234567890" } bool(true) bool(true) bool(true) Warning: array_key_exists(): The first argument should be either a string or an integer in /in/8BTTS on line 13 bool(false) bool(true) bool(true) bool(true) bool(false) array(2) { [42]=> int(42) [-4362897323387256832]=> float(1.2345678901235E+29) } bool(true) bool(false) bool(true) Warning: array_key_exists(): The first argument should be either a string or an integer in /in/8BTTS on line 27 bool(false) bool(true) bool(false) bool(true) bool(true)
Output for 5.3.0 - 5.4.45
float(1.2345678901235E+29) array(2) { [42]=> string(2) "42" ["123456789012345678901234567890"]=> string(30) "123456789012345678901234567890" } bool(true) bool(true) bool(true) Warning: array_key_exists(): The first argument should be either a string or an integer in /in/8BTTS on line 13 bool(false) bool(true) bool(true) bool(true) bool(false) array(2) { [42]=> int(42) [0]=> float(1.2345678901235E+29) } bool(true) bool(false) bool(true) Warning: array_key_exists(): The first argument should be either a string or an integer in /in/8BTTS on line 27 bool(false) bool(true) bool(false) bool(true) bool(true)
Output for 4.3.2 - 5.2.17
float(1.2345678901235E+29) array(2) { [42]=> string(2) "42" ["123456789012345678901234567890"]=> string(30) "123456789012345678901234567890" } bool(true) bool(true) bool(true) Warning: array_key_exists(): The first argument should be either a string or an integer in /in/8BTTS on line 13 bool(false) bool(true) bool(true) bool(true) bool(false) array(2) { [42]=> int(42) [-9223372036854775808]=> float(1.2345678901235E+29) } bool(true) bool(false) bool(true) Warning: array_key_exists(): The first argument should be either a string or an integer in /in/8BTTS on line 27 bool(false) bool(true) bool(false) bool(true) bool(true)
Output for 4.3.0 - 4.3.1
float(1.2345678901235E+29) array(2) { [42]=> string(2) "42" ["123456789012345678901234567890"]=> string(30) "123456789012345678901234567890" } bool(true) bool(true) bool(true) Warning: array_key_exists() [http://www.php.net/function.array-key-exists]: The first argument should be either a string or an integer in /in/8BTTS on line 13 bool(false) bool(true) bool(true) bool(true) bool(false) array(2) { [42]=> int(42) [-9223372036854775808]=> float(1.2345678901235E+29) } bool(true) bool(false) bool(true) Warning: array_key_exists() [http://www.php.net/function.array-key-exists]: The first argument should be either a string or an integer in /in/8BTTS on line 27 bool(false) bool(true) bool(false) bool(true) bool(true)