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("hidden", $arr[$i]) === false){ echo $arr[$i]; 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 $str; Echo substr_count(strip_tags($str), "example");
Output for git.master, git.master_jit, rfc.property-hooks
<p class="example">example</p> Warning: Undefined array key 0 in /in/L301T on line 17 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in /in/L301T on line 17 <p class="example" style="visibility:hidden">example</p> Warning: Undefined array key 1 in /in/L301T on line 17 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in /in/L301T on line 17 <script type="text/javascript">var example = 1 Warning: Undefined array key 2 in /in/L301T on line 17 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in /in/L301T on line 17 ....other stuff.... </script>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:
73.72 ms | 402 KiB | 8 Q