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 git.master, git.master_jit, rfc.property-hooks
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.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.12 ms | 401 KiB | 8 Q