3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function is32Bit() { // This is for max compatibility: // PHP_INT_MAX doesn't exist in PHP4 // current() *requires* a reference in PHP <5.1.0 (except 4.4.1, dafuq) $test = unpack('N', "\xFF\xFF\xFF\xFF"); var_dump($test); return current($test) === -1; } var_dump(is32Bit());
Output for 4.3.5 - 5.2.0, 5.2.10 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
array(1) { [1]=> int(4294967295) } bool(false)
Output for 5.2.1 - 5.2.9
array(1) { [1]=> int(-1) } bool(true)
Output for 4.3.0 - 4.3.4
array(1) { [""]=> int(4294967295) } bool(false)