3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = false; $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;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 56
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 56
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
Branch analysis from position: 56
Branch analysis from position: 28
Branch analysis from position: 25
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
Branch analysis from position: 25
filename:       /in/4oQjS
function name:  (null)
number of ops:  58
compiled vars:  !0 = $html, !1 = $source, !2 = $return, !3 = $ad_loop_regex, !4 = $end_loop_regex, !5 = $master, !6 = $temp_preg_arr, !7 = $start_tag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <false>
    3     1        ASSIGN                                                   !1, '%3Cstyle%3E%0A++++test_css+%7B%0A++++somerule%3Aval%3B%0A++++%7D%0A++++%3C%2Fstyle%3E'
    8     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%3C%21--+DEFAULT+--%3E'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $10     
          6        ASSIGN                                                   !1, $10
    9     7        COUNT                                            ~12     !1
          8        IS_SMALLER                                               1, ~12
          9      > JMPZ                                                     ~13, ->13
         10    >   FETCH_DIM_R                                      ~14     !1, 1
         11        QM_ASSIGN                                        ~15     ~14
         12      > JMP                                                      ->15
         13    >   FETCH_DIM_R                                      ~16     !1, 0
         14        QM_ASSIGN                                        ~15     ~16
         15    >   ASSIGN                                                   !2, ~15
   10    16        ASSIGN                                                   !3, '%2F%5B%5Cs%5CS%5D%2A%5C%7B%25%5B%5Cs%5D%2Afor%5B%5Cs%5D%2Aad%5B%5Cs%5D%2Ain%5B%5Cs%5D%2Aads%5B%5Cs%5D%2A%25%5C%7D%5Cs%2F'
   11    17        ASSIGN                                                   !4, '%2F%5B%5C.%5Cs%5CS%5D%2A%5C%7B%25%5B%5Cs%5CS%5D%2Aendfor%5B%5Cs%5CS%5D%2A%25%5C%7D%2F'
   12    18        BOOL                                             ~20     !0
         19      > JMPZ_EX                                          ~20     ~20, ->25
         20    >   INIT_FCALL                                               'preg_match'
         21        SEND_VAR                                                 !3
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $21     
         24        BOOL                                             ~20     $21
         25    > > JMPZ_EX                                          ~20     ~20, ->28
         26    >   BOOL_NOT                                         ~22     !5
         27        BOOL                                             ~20     ~22
         28    > > JMPZ                                                     ~20, ->56
   13    29    >   INIT_FCALL                                               'preg_replace'
         30        SEND_VAR                                                 !3
         31        SEND_VAL                                                 ''
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $23     
         34        ASSIGN                                                   !2, $23
   14    35        INIT_FCALL                                               'preg_match'
         36        SEND_VAR                                                 !4
         37        SEND_VAR                                                 !2
         38        SEND_REF                                                 !6
         39        DO_ICALL                                                 
   15    40        COUNT                                            ~26     !6
         41        IS_SMALLER                                               0, ~26
         42      > JMPZ                                                     ~27, ->56
   16    43    >   FETCH_DIM_R                                      ~28     !6, 0
         44        ASSIGN                                                   !2, ~28
   17    45        INIT_FCALL                                               'strrpos'
         46        SEND_VAR                                                 !2
         47        SEND_VAL                                                 '%7B'
         48        DO_ICALL                                         $30     
         49        ASSIGN                                                   !7, $30
   18    50        INIT_FCALL                                               'substr'
         51        SEND_VAR                                                 !2
         52        SEND_VAL                                                 0
         53        SEND_VAR                                                 !7
         54        DO_ICALL                                         $32     
         55        ASSIGN                                                   !2, $32
   21    56    >   ECHO                                                     !2
         57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.75 ms | 1400 KiB | 23 Q