3v4l.org

run code in 300+ PHP versions simultaneously
<?php<?php define('SECONDE', 1); define('MINUUT', 60*SECONDE); define('UUR', 60*MINUUT); define('DAG', 24*UUR); // Bezochtte tijd function timetostr($tijd) { $result['dag'] = (int) ($tijd/DAG); $tijd = $tijd % DAG; $result['uur'] = (int) ($tijd/UUR); $tijd = $tijd % UUR; $result['minuut'] = (int) ($tijd/MINUUT); $tijd = $tijd % MINUUT; $result['seconde'] = $tijd; if ($result['dag']) $output[] = $result['dag'] . ($result['dag'] == 1 ? ' dag' : ' dagen'); if ($output || $result['uur']) $output[] = $result['uur'] . ($result['uur'] == 1 ? ' uur' : ' uren'); if ($output || $result['minuut']) $output[] = $result['minuut'] . ($result['minuut'] == 1 ? ' minuut' : ' minuten'); $output[] = $result['seconde'] . ($result['seconde'] == 1 ? ' seconde' : ' seconden'); $return = join($output, ', '); $return = preg_replace('/^(.*), ([^,]+)$/', '\\1 en \\2', $return); return $return; } echo timetostr(12345); ?>
Output for git.master, git.master_jit, rfc.property-hooks
<?php Warning: Undefined variable $output in /in/NH5FK on line 18 Fatal error: Uncaught TypeError: join(): Argument #2 ($array) must be of type ?array, string given in /in/NH5FK:23 Stack trace: #0 /in/NH5FK(23): join(Array, ', ') #1 /in/NH5FK(28): timetostr(45) #2 {main} thrown in /in/NH5FK on line 23
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:
38.12 ms | 401 KiB | 8 Q