3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Some text at the start {{if|service_name=DJ Booth}} This is the text for DJs {{endif}} Some text in the middle {{if|service_name=Dancefloor Hire}} This is the text for dancefloor hire {{endif}} Some text at the end'; $service = "Dancefloor Hire"; echo preg_replace(["/{{if\|service_name=$service}}\s*(.*?)\R{{endif}}/s", "/\R?{{if.*?}}.*?{{endif}}\R?/s"], ["$1", ""], $text);
Output for git.master, git.master_jit, rfc.property-hooks
Some text at the start Some text in the middle This is the text for dancefloor hire Some text at the end

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