3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ob_start(); ?> flarg blarg dlarg <!-- BEGIN DYNAMIC BLOCK: guide_greeting --> filler content <!-- END DYNAMIC BLOCK: guide_greeting --> flarg blarg dlarg <?php $content = ob_get_clean(); function getDyanmicBlockContent($content, $tag) { $boundaries = (object) [ 'start' => sprintf('<!-- BEGIN DYNAMIC BLOCK: %s -->', $tag), 'end' => sprintf('<!-- END DYNAMIC BLOCK: %s -->', $tag), ]; $results = (object) [ 'start' => stripos($str, $boundaries->start), 'end' => stripos($str, $boundaries->end), ]; return $results; } var_dump( getDyanmicBlockContent($content, 'guide_greeting') );
based on PNfG4
Output for 5.6.30, hhvm-3.21.3, 7.0.30 - 7.3.0beta1
Notice: Undefined variable: str in /in/IRgNB on line 20 Notice: Undefined variable: str in /in/IRgNB on line 21 object(stdClass)#2 (2) { ["start"]=> bool(false) ["end"]=> bool(false) }
Output for hhvm-3.22.0
Notice: Undefined variable: str in /in/IRgNB on line -1 Notice: Undefined variable: str in /in/IRgNB on line -1 object(stdClass)#2 (2) { ["start"]=> bool(false) ["end"]=> bool(false) }
Output for hhvm-3.18.5
Notice: Undefined variable: str in /in/IRgNB on line 20 Warning: stripos() expects parameter 1 to be string, null given in /in/IRgNB on line 20 Notice: Undefined variable: str in /in/IRgNB on line 21 Warning: stripos() expects parameter 1 to be string, null given in /in/IRgNB on line 21 object(stdClass)#2 (2) { ["start"]=> NULL ["end"]=> NULL }