3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tags = array("start" => "[highlight]", "finish" => "[/highlight]"); $text = 'Some normal text. [highlight]<?php echo $somedata; ?>[/highlight] Some normal text.'; $start = strpos($text,$tags['start']); $finish = strpos($text,$tags['finish']); $code = substr($text,$start+strlen($tags['start']),($finish-($start+strlen($tags['start'])))); $highlighted = highlight_string($code,true); $text = str_replace($code,"¬",$text); $text = str_replace("¬",$highlighted,$text); $text = str_replace($tags['start'],"",$text); $text = str_replace($tags['finish'],"",$text); echo $text.'<br />';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kkEWv
function name:  (null)
number of ops:  61
compiled vars:  !0 = $tags, !1 = $text, !2 = $start, !3 = $finish, !4 = $code, !5 = $highlighted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'Some+normal+text.+%5Bhighlight%5D%3C%3Fphp+echo+%24somedata%3B+%3F%3E%5B%2Fhighlight%5D+Some+normal+text.'
    6     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !1
          4        FETCH_DIM_R                                      ~8      !0, 'start'
          5        SEND_VAL                                                 ~8
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
    8     8        INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !1
         10        FETCH_DIM_R                                      ~11     !0, 'finish'
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !3, $12
   11    14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !1
         16        FETCH_DIM_R                                      ~14     !0, 'start'
         17        STRLEN                                           ~15     ~14
         18        ADD                                              ~16     !2, ~15
         19        SEND_VAL                                                 ~16
         20        FETCH_DIM_R                                      ~17     !0, 'start'
         21        STRLEN                                           ~18     ~17
         22        ADD                                              ~19     !2, ~18
         23        SUB                                              ~20     !3, ~19
         24        SEND_VAL                                                 ~20
         25        DO_ICALL                                         $21     
         26        ASSIGN                                                   !4, $21
   14    27        INIT_FCALL                                               'highlight_string'
         28        SEND_VAR                                                 !4
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $23     
         31        ASSIGN                                                   !5, $23
   16    32        INIT_FCALL                                               'str_replace'
         33        SEND_VAR                                                 !4
         34        SEND_VAL                                                 '%C2%AC'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                         $25     
         37        ASSIGN                                                   !1, $25
   20    38        INIT_FCALL                                               'str_replace'
         39        SEND_VAL                                                 '%C2%AC'
         40        SEND_VAR                                                 !5
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                         $27     
         43        ASSIGN                                                   !1, $27
   23    44        INIT_FCALL                                               'str_replace'
         45        FETCH_DIM_R                                      ~29     !0, 'start'
         46        SEND_VAL                                                 ~29
         47        SEND_VAL                                                 ''
         48        SEND_VAR                                                 !1
         49        DO_ICALL                                         $30     
         50        ASSIGN                                                   !1, $30
   24    51        INIT_FCALL                                               'str_replace'
         52        FETCH_DIM_R                                      ~32     !0, 'finish'
         53        SEND_VAL                                                 ~32
         54        SEND_VAL                                                 ''
         55        SEND_VAR                                                 !1
         56        DO_ICALL                                         $33     
         57        ASSIGN                                                   !1, $33
   27    58        CONCAT                                           ~35     !1, '%3Cbr+%2F%3E'
         59        ECHO                                                     ~35
         60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.19 ms | 1400 KiB | 21 Q