3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Some text {spoiler}He <span class="just_testing">dies</span> in the end{/spoiler} but {spoiler}not before becoming a Jedi{/spoiler}'; echo preg_replace_callback('~{spoiler}(.*?)({/spoiler})~s', function($m) { return '<span class="spoiler">' . preg_replace('~</?span[^>]*>~i', '', $m[1]) . '</span>'; }, $string, -1, $count); echo "\n---\n"; echo $count;
Output for git.master, git.master_jit, rfc.property-hooks
Some text <span class="spoiler">He dies in the end</span> but <span class="spoiler">not before becoming a Jedi</span> --- 2

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:
34.83 ms | 401 KiB | 8 Q