3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(?:"\K([^_\r\n]+)|\G(?!^))(?=[^":\r\n]*")(?=[^:\r\n]*:)_?([a-zA-Z])([^"_\r\n]*)/'; $str = '"aa_bb" : "foo" "pp_Qq" : "bar" "Xx_yY_zz" : "foobar" "Xx_yYyyyyyYyY_zz_a" : "foobar"'; $result = preg_replace_callback($re, function($matches) { return strtolower($matches[1]) . strtoupper($matches[2]) . strtolower($matches[3]); }, $str); echo $result;
Output for git.master, git.master_jit, rfc.property-hooks
"aaBb" : "foo" "ppQq" : "bar" "xxYyZz" : "foobar" "xxYyyyyyyyyyZzA" : "foobar"

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:
187.08 ms | 405 KiB | 5 Q