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); for($i = 0; $i < count($arr); $i++){ if(strpos("hidden", $arr[$i]) === false){ unset($arr[$i]); } if(strpos("<script", $arr[$i]) === false){ while(!strpos("</script", $arr[$i]) === false){ unset($arr[$i]); $i++; } } } $str = implode(PHP_EOL, $arr); Echo substr_count(strip_tags($str), "example");
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key 0 in /in/YMd7q on line 15 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in /in/YMd7q on line 15 Warning: Undefined array key 1 in /in/YMd7q on line 15 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in /in/YMd7q on line 15 Warning: Undefined array key 2 in /in/YMd7q on line 15 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in /in/YMd7q on line 15 0

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:
48.54 ms | 402 KiB | 8 Q