3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldValue = 'new_name_spacing'; $newValue = preg_replace_callback( '/(_[a-z])/', function ($match) { return substr($match, 1, strlen($match)); }, $oldValue ); echo $newValue;
Output for git.master, git.master_jit
Fatal error: Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in /in/GI59E:9 Stack trace: #0 [internal function]: {closure}(Array) #1 /in/GI59E(6): preg_replace_callback('/(_[a-z])/', Object(Closure), 'new_name_spacin...') #2 {main} thrown in /in/GI59E on line 9
Process exited with code 255.
Output for rfc.property-hooks
Fatal error: Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, array given in /in/GI59E:9 Stack trace: #0 [internal function]: {closure}(Array) #1 /in/GI59E(6): preg_replace_callback('/(_[a-z])/', Object(Closure), 'new_name_spacin...') #2 {main} thrown in /in/GI59E on line 9
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:
57.89 ms | 401 KiB | 8 Q