3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<p class="example">example</p> <p class="example" style="visibility:hidden">example</p> <script type="text/javascript">var example = 1 ....other stuff.... </script>'; $arr = explode(PHP_EOL, $str); //var_dump($arr); for($i = 0; $i < count($arr); $i++){ if(strpos($arr[$i], "hidden") !== false){ echo $arr[$i]; unset($arr[$i]); } if(strpos($arr[$i], "<script") !== false){ while(strpos($arr[$i], "</script") === false){ unset($arr[$i]); $i++; } } } $str = implode(PHP_EOL, $arr); //echo $str; Echo substr_count(strip_tags($str), "example");
Output for git.master, git.master_jit, rfc.property-hooks
<p class="example" style="visibility:hidden">example</p> Warning: Undefined array key 1 in /in/sASnn on line 17 Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /in/sASnn on line 17 1

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