3v4l.org

run code in 300+ PHP versions simultaneously
<?php function boldify($pattern, $array){ $new_array = array(); foreach($array as $a) $new_array[] = $pattern."<b>".substr($a,strlen($pattern))."</b>"; return $new_array; } $starting_pattern = "Foo"; $array = array("Foo", "Foo RH 80", "Foo Foo RH 50 Foo", "Foo (RH 80 + 10) foo"); $new_array = boldify($starting_pattern, $array); var_dump($new_array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0LQJt
function name:  (null)
number of ops:  11
compiled vars:  !0 = $starting_pattern, !1 = $array, !2 = $new_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'Foo'
   10     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'boldify'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   12     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function boldify:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/0LQJt
function name:  boldify
number of ops:  19
compiled vars:  !0 = $pattern, !1 = $array, !2 = $new_array, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, <array>
    5     3      > FE_RESET_R                                       $5      !1, ->16
          4    > > FE_FETCH_R                                               $5, !3, ->16
          5    >   CONCAT                                           ~7      !0, '%3Cb%3E'
          6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !3
          8        STRLEN                                           ~8      !0
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        CONCAT                                           ~10     ~7, $9
         12        CONCAT                                           ~11     ~10, '%3C%2Fb%3E'
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  ~11
         15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $5
    6    17      > RETURN                                                   !2
    7    18*     > RETURN                                                   null

End of function boldify

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.09 ms | 1403 KiB | 18 Q