3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "The house is very big."; function highlight($string, $keywords) { $keywords = is_array($keywords) ? implode('|', array_map('preg_quote', $keywords)) : preg_quote($keywords); return preg_replace("/$keywords/ui", "<span class=\"h\">$0</span>", $string); } echo highlight($string, array("house", "big"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1OhEB
function name:  (null)
number of ops:  7
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'The+house+is+very+big.'
   12     1        INIT_FCALL                                               'highlight'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <array>
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function highlight:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1OhEB
function name:  highlight
number of ops:  29
compiled vars:  !0 = $string, !1 = $keywords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        TYPE_CHECK                                  128          !1
          3      > JMPZ                                                     ~2, ->14
    7     4    >   INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '%7C'
          6        INIT_FCALL                                               'array_map'
          7        SEND_VAL                                                 'preg_quote'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                         $4      
         12        QM_ASSIGN                                        ~5      $4
         13      > JMP                                                      ->18
    8    14    >   INIT_FCALL                                               'preg_quote'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $6      
         17        QM_ASSIGN                                        ~5      $6
    6    18    >   ASSIGN                                                   !1, ~5
    9    19        INIT_FCALL                                               'preg_replace'
         20        ROPE_INIT                                     3  ~9      '%2F'
         21        ROPE_ADD                                      1  ~9      ~9, !1
         22        ROPE_END                                      2  ~8      ~9, '%2Fui'
         23        SEND_VAL                                                 ~8
         24        SEND_VAL                                                 '%3Cspan+class%3D%22h%22%3E%240%3C%2Fspan%3E'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $11     
         27      > RETURN                                                   $11
   10    28*     > RETURN                                                   null

End of function highlight

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.85 ms | 1017 KiB | 18 Q