3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*$a = '12:21'; $b = '17:00'; $c = '09:00'; $d = '13:53'; $t1 = convertToSeconds(getTimeDiff($a,$b)); echo "\n"; $t2 = convertToSeconds(getTimeDiff($c,$d)); echo "\n"; echo gmdate("H:i",$t1+$t2);*/ $d = 4371960; $h = int($d/3600); $m = int(($d%3600)/60); echo "son $h:$m"; function convertToSeconds($time){ $a = explode(":", $time); $hora = $a[0]; $min = $a[1]; return $hora*3600+$min*60; } function getTimeDiff($dtime,$atime){ $nextDay=$dtime>$atime?1:0; $dep=explode(':',$dtime); $arr=explode(':',$atime); $diff=abs(mktime($dep[0],$dep[1],0,date('n'),date('j'),date('y'))-mktime($arr[0],$arr[1],0,date('n'),date('j')+$nextDay,date('y'))); $hours=floor($diff/(60*60)); $mins=floor(($diff-($hours*60*60))/(60)); $secs=floor(($diff-(($hours*60*60)+($mins*60)))); if(strlen($hours)<2){ $hours="0".$hours; } if(strlen($mins)<2){ $mins="0".$mins; } if(strlen($secs)<2){ $secs="0".$secs; } return $hours.':'.$mins.':'.$secs; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function int() in /in/UPHH5:15 Stack trace: #0 {main} thrown in /in/UPHH5 on line 15
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:
51.23 ms | 401 KiB | 8 Q