3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array("28000000000000003" => 'ABC',"28000000000000001" => 'PQR'); $keys = array("28000000000000003","28000000000000001"); $keysDerived = array_keys($data); var_dump($keys == $keysDerived, $keys === $keysDerived); var_dump($keys,$keysDerived); var_dump(in_array("28000000000000003", $keysDerived, true)); var_dump(in_array("28000000000000003", $keysDerived)); var_dump(in_array("28000000000000003", $keys, true)); var_dump(in_array("28000000000000003", $keys)); foreach ( $data as $k => $d ) { foreach ( $keys as $key ) { if ($key == $k) { var_dump($k, "=", $key); } if ($key === $k) { var_dump($k, "===", $key); } } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) bool(false) array(2) { [0]=> string(17) "28000000000000003" [1]=> string(17) "28000000000000001" } array(2) { [0]=> int(28000000000000003) [1]=> int(28000000000000001) } bool(false) bool(true) bool(true) bool(true) int(28000000000000003) string(1) "=" string(17) "28000000000000003" int(28000000000000001) string(1) "=" string(17) "28000000000000001"