3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'thing_1'; $pieces = explode('_', $str); $suffix = array_pop($pieces); if ($str == $suffix) { $pieces[] = 1; } else { (int) $suffix; $pieces[count($pieces - 1)] = $suffix + 1; } $new_str = implode('_', $pieces);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Unsupported operand types: array - int in /in/0A0eo:12 Stack trace: #0 {main} thrown in /in/0A0eo on line 12
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:
56.17 ms | 401 KiB | 8 Q