3v4l.org

run code in 300+ PHP versions simultaneously
<?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') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IRgNB
function name:  (null)
number of ops:  14
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                               'ob_start'
          1        DO_ICALL                                                 
    2     2        ECHO                                                     'flarg%0Ablarg%0Adlarg%0A%3C%21--+BEGIN+DYNAMIC+BLOCK%3A+guide_greeting+--%3E%0Afiller+content%0A%3C%21--+END+DYNAMIC+BLOCK%3A+guide_greeting+--%3E%0Aflarg%0Ablarg%0Adlarg%0A'
   11     3        INIT_FCALL                                               'ob_get_clean'
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
   27     6        INIT_FCALL                                               'var_dump'
   28     7        INIT_FCALL                                               'getdyanmicblockcontent'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'guide_greeting'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
   29    13      > RETURN                                                   1

Function getdyanmicblockcontent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IRgNB
function name:  getDyanmicBlockContent
number of ops:  30
compiled vars:  !0 = $content, !1 = $tag, !2 = $boundaries, !3 = $results, !4 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%3C%21--+BEGIN+DYNAMIC+BLOCK%3A+%25s+--%3E'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        INIT_ARRAY                                       ~6      $5, 'start'
   16     7        INIT_FCALL                                               'sprintf'
          8        SEND_VAL                                                 '%3C%21--+END+DYNAMIC+BLOCK%3A+%25s+--%3E'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ADD_ARRAY_ELEMENT                                ~6      $7, 'end'
         12        CAST                                          8  ~8      ~6
   14    13        ASSIGN                                                   !2, ~8
   20    14        INIT_FCALL                                               'stripos'
         15        SEND_VAR                                                 !4
         16        FETCH_OBJ_R                                      ~10     !2, 'start'
         17        SEND_VAL                                                 ~10
         18        DO_ICALL                                         $11     
         19        INIT_ARRAY                                       ~12     $11, 'start'
   21    20        INIT_FCALL                                               'stripos'
         21        SEND_VAR                                                 !4
         22        FETCH_OBJ_R                                      ~13     !2, 'end'
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                         $14     
         25        ADD_ARRAY_ELEMENT                                ~12     $14, 'end'
         26        CAST                                          8  ~15     ~12
   19    27        ASSIGN                                                   !3, ~15
   24    28      > RETURN                                                   !3
   25    29*     > RETURN                                                   null

End of function getdyanmicblockcontent

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.91 ms | 1394 KiB | 24 Q