3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $vars = array(11, '11', '11.0', '11e1', '11f1', '11e0', '11f0', '11e2', '11f2'); $size = count($vars); for($ii = 0; $ii < $size - 1; $ii++) { for($jj = $ii + 1; $jj < $size; $jj++) { if ($vars[$ii] == $vars[$jj]) { echo "$vars[$ii] == $vars[$jj]\n"; var_dump($vars[$ii], $vars[$jj]); } } } var_dump($vars);
based on jNEMl
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
11 == 11 int(11) string(2) "11" 11 == 11.0 int(11) string(4) "11.0" 11 == 11f1 int(11) string(4) "11f1" 11 == 11e0 int(11) string(4) "11e0" 11 == 11f0 int(11) string(4) "11f0" 11 == 11f2 int(11) string(4) "11f2" 11 == 11.0 string(2) "11" string(4) "11.0" 11 == 11e0 string(2) "11" string(4) "11e0" 11.0 == 11e0 string(4) "11.0" string(4) "11e0" array(9) { [0]=> int(11) [1]=> string(2) "11" [2]=> string(4) "11.0" [3]=> string(4) "11e1" [4]=> string(4) "11f1" [5]=> string(4) "11e0" [6]=> string(4) "11f0" [7]=> string(4) "11e2" [8]=> string(4) "11f2" }