3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php ini_set('precision', 100); $foo = PHP_INT_MAX * 2; $expectedString = sprintf("%d", $foo); if ($foo == $expectedString) { 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 oAd0d
Output for 5.4.35 - 7.1.0
18446744073709551616 != 0
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/VX2bV on line 2 1.844674407371E+19 != 0
Output for 4.3.5 - 4.3.11, 5.0.0 - 5.0.4
Warning: ini_set() has been disabled for security reasons in /in/VX2bV on line 2 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/VX2bV on line 3 true
Output for 4.3.1 - 4.3.4
Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/VX2bV on line 2 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/VX2bV on line 3 true
Output for 4.3.0
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/VX2bV on line 3 true