3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "helloworld"; echo preg_replace('~.\L.~', ' ', $str); echo "\n---\n"; echo array_reduce(str_split($str, 2), function($carry, $item) { return $carry . $item[0] . (isset($item[1]) ? ' ' : ''); }); echo "\n---\n"; for ($offset = 1, $length = strlen($str); $offset < $length; $offset += 2) { $str[$offset] = ' '; } echo $str;
Output for git.master_jit, git.master
Warning: preg_replace(): Compilation failed: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u at offset 3 in /in/JuJkJ on line 5 --- h l o o l --- h l o o l

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