3v4l.org

run code in 300+ PHP versions simultaneously
<?php function IEEE64Float($strHex) { // Thanx Chung Leong https://bytes.com/topic/php/answers/9237-hex-floating-point#post38346 $hex = sscanf($strHex, "%02x%02x%02x%02x%02x%02x%02x%02x"); $hex = array_reverse($hex); $bin = implode('', array_map('chr', $hex)); $array = unpack("dnum", $bin); return $array['num']; } function UnMicrosoftify($fDateValue = 0, $iDateBase = 1900) { //http://stackoverflow.com/q/26589406/795054 if ($iDateBase == 1900) { $iMyDateBase = 25569; //Adjust for the fictional 29-Feb-1900 (Day 60) if ($fDateValue < 60) { --$iMyDateBase; } } else { $iMyDateBase = 24107; } // Perform conversion if ($fDateValue >= 1) { $utcDays = $fDateValue - $iMyDateBase; $iReturnValue = round($utcDays * 86400); if (($iReturnValue <= PHP_INT_MAX) && ($iReturnValue >= -PHP_INT_MAX)) { $iReturnValue = (integer) $iReturnValue; } } else { $hours = round($fDateValue * 24); $mins = round($fDateValue * 1440) - round($hours * 60); $secs = round($fDateValue * 86400) - round($hours * 3600) - round($mins * 60); $iReturnValue = (integer) gmmktime($hours, $mins, $secs); } return $iReturnValue; } function PGODdate($strhex) { return date('Y-m-d', UnMicrosoftify(IEEE64Float($strhex))); } echo PGODdate('FE37E43C8800759C');
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught TypeError: gmmktime(): Argument #1 ($hour) must be of type int, float given in /in/hAopB:37 Stack trace: #0 /in/hAopB(37): gmmktime(-2.4E+301, 0.0, 0.0) #1 /in/hAopB(43): UnMicrosoftify(-1.0E+300) #2 /in/hAopB(46): PGODdate('FE37E43C8800759...') #3 {main} thrown in /in/hAopB on line 37
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught TypeError: gmmktime(): Argument #1 ($hour) must be of type int, float given in /in/hAopB:37 Stack trace: #0 /in/hAopB(37): gmmktime(-2.4E+301, 0.0, 0.0) #1 /in/hAopB(43): UnMicrosoftify(-1.0E+300) #2 /in/hAopB(46): PGODdate('FE37E43C8800759...') #3 {main} thrown in /in/hAopB on line 37
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught TypeError: gmmktime(): Argument #1 ($hour) must be of type int, float given in /in/hAopB:37 Stack trace: #0 /in/hAopB(37): gmmktime(-2.4E+301, 0, 0) #1 /in/hAopB(43): UnMicrosoftify(-1.0E+300) #2 /in/hAopB(46): PGODdate('FE37E43C8800759...') #3 {main} thrown in /in/hAopB on line 37
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: gmmktime() expects parameter 1 to be int, float given in /in/hAopB on line 37 1970-01-01
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Warning: gmmktime() expects parameter 1 to be integer, float given in /in/hAopB on line 37 1970-01-01
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
2015-12-01

preferences:
253.31 ms | 401 KiB | 326 Q