3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP function inc_uuid($uuid) { $n = ''; $c = 0; foreach (str_split(strrev($uuid)) as $s) { $c++; $s++; if ($s === 'aa') { $n = 'a'.$n; continue; } elseif ($s === 10) { $n .= 'a'; continue; } else { $n = $s.$n; break; } } $x = implode(array_slice(str_split($uuid), 0, strlen($uuid-$c)+1)); $n = $x.$n; return $n; } function get_uuid() { global $__uuid; if ($__uuid == NULL) { return '0a000000'; } else return inc_uuid($__uuid); } echo inc_uuid('a2b9'); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Unsupported operand types: string - int in /in/tONDU:22 Stack trace: #0 /in/tONDU(35): inc_uuid('a2b9') #1 {main} thrown in /in/tONDU on line 22
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:
42.42 ms | 401 KiB | 8 Q