3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "The quick (brown fox jumps) over (the lazy dog)"; //First preg search all string in () preg_match_all('/\(.(.*?).\)/', $string, $match); foreach ($match[0] as $key => $value) { $result = preg_replace('/\s+/', '', $value); if(isset($new_string)){ $new_string = str_replace($value, $result, $new_string); }else{ $new_string = str_replace($value, $result, $string); } } echo $new_string; ?>
Output for git.master, git.master_jit, rfc.property-hooks
The quick (brownfoxjumps) over (thelazydog)

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