3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $source = "<style> test_css { somerule:val; } </style>"; $source = explode('<!-- DEFAULT -->',$source); $return =(count($source)>1)?$source[1]:$source[0]; $ad_loop_regex = "/[\s\S]*\{%[\s]*for[\s]*ad[\s]*in[\s]*ads[\s]*%\}\s/"; $end_loop_regex = '/[\.\s\S]*\{%[\s\S]*endfor[\s\S]*%\}/'; if ($html==true&&preg_match($ad_loop_regex, $return)&&!$master) { $return = preg_replace($ad_loop_regex,'',$return); preg_match($end_loop_regex,$return,$temp_preg_arr); if (count($temp_preg_arr)>0) { $return = $temp_preg_arr[0]; $start_tag = strrpos($return,'{'); $return = substr($return,0,$start_tag); } } echo $return;
Output for 5.0.4 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined variable: html in /in/SvCFA on line 11 <style> test_css { somerule:val; } </style>
Output for hhvm-3.12.0
Notice: Undefined variable: html in /in/SvCFA on line -1 <style> test_css { somerule:val; } </style>
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: html in /in/SvCFA on line 11 <style> test_css { somerule:val; } </style>