3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php ini_set('precision', 100); $foo = PHP_INT_MAX * 2; var_dump($foo); var_dump($foo); if ($foo == 1.844674407371E+19) { echo "true"; } else { $expectedString = "1.844674407371E+19"; echo "$foo != ".$expectedString.PHP_EOL; $fooAsString = (string)$foo; if (strcmp($expectedString, $fooAsString) === 0) { echo "String representation is the same."; } }
based on t1irb
Output for 5.4.35 - 7.1.0
float(18446744073709551616) float(18446744073709551616) 18446744073709551616 != 1.844674407371E+19
Output for 4.4.0 - 4.4.9, 5.0.5 - 5.4.34
Warning: ini_set() has been disabled for security reasons in /in/oAd0d on line 2 float(1.844674407371E+19) float(1.844674407371E+19) 1.844674407371E+19 != 1.844674407371E+19 String representation is the same.
Output for 4.3.10 - 4.3.11, 5.0.2 - 5.0.4
Warning: ini_set() has been disabled for security reasons in /in/oAd0d on line 2 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/oAd0d on line 3 int(0) int(0) 0 != 1.844674407371E+19
Output for 4.3.5 - 4.3.9, 5.0.0 - 5.0.1
Warning: ini_set() has been disabled for security reasons in /in/oAd0d on line 2 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/oAd0d on line 3 int(0) int(0) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oAd0d on line 13 0 != 1.844674407371E+19PHP_EOL
Output for 4.3.1 - 4.3.4
Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/oAd0d on line 2 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/oAd0d on line 3 int(0) int(0) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oAd0d on line 13 0 != 1.844674407371E+19PHP_EOL
Output for 4.3.0
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/oAd0d on line 3 int(0) int(0) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oAd0d on line 13 0 != 1.844674407371E+19PHP_EOL