3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function to_int32($value) { $intval = hexdec($value); // If 64 bit if (PHP_INT_SIZE === 8) { return ($intval | 0x800000000); } // 32 bit return $intval; } echo to_int32('c0f672d4'); echo to_int32('83f6234');
Output for 4.4.0 - 4.4.9, 5.0.5 - 7.1.0
3759711509234498110004
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.4
Notice: Use of undefined constant PHP_INT_SIZE - assumed 'PHP_INT_SIZE' in /in/m4Q5n on line 7 3237376724 Notice: Use of undefined constant PHP_INT_SIZE - assumed 'PHP_INT_SIZE' in /in/m4Q5n on line 7 138371636