3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printPh($string,Array $params){ $tok = strtok($string,':'); $msg = ''; while($tok !== false){ $msg .= array_key_exists($tok,$params) ? $params[$tok] : $tok; $tok = strtok(':'); } return $msg; } echo printPh('<p>:ph1: :ph2:</p>',['ph1'=>'placerholder 1','ph2'=>'placeholder 2']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i8TKJ
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'printph'
          1        SEND_VAL                                                 '%3Cp%3E%3Aph1%3A+%3Aph2%3A%3C%2Fp%3E'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function printph:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
Branch analysis from position: 9
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
Branch analysis from position: 9
filename:       /in/i8TKJ
function name:  printPh
number of ops:  24
compiled vars:  !0 = $string, !1 = $params, !2 = $tok, !3 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'strtok'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%3A'
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !2, $4
    5     7        ASSIGN                                                   !3, ''
    6     8      > JMP                                                      ->20
    7     9    >   ARRAY_KEY_EXISTS                                         !2, !1
         10      > JMPZ                                                     ~7, ->14
         11    >   FETCH_DIM_R                                      ~8      !1, !2
         12        QM_ASSIGN                                        ~9      ~8
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~9      !2
         15    >   ASSIGN_OP                                     8          !3, ~9
    8    16        INIT_FCALL                                               'strtok'
         17        SEND_VAL                                                 '%3A'
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !2, $11
    6    20    >   TYPE_CHECK                                  1018          !2
         21      > JMPNZ                                                    ~13, ->9
   11    22    > > RETURN                                                   !3
   12    23*     > RETURN                                                   null

End of function printph

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.03 ms | 1399 KiB | 16 Q