3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'yes or yes no or yes yes or no maybe yes or yes maybe yes or no yes maybe or yes maybe yes maybe yes maybe or'; $array = explode("\n", $string); $expected = []; //print_r($array); foreach($array as $line){ $words = substr_count($line,'yes'); if($words==2 && strpos($line, 'or') !== false ){ $expected[]= $line; } } echo implode("\n",$expected);
Output for git.master, git.master_jit, rfc.property-hooks
yes or yes maybe yes or yes yes maybe or yes maybe yes maybe yes maybe or

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