3v4l.org

run code in 500+ PHP versions simultaneously
<?php $params = ['first param ?', 'second param']; $query = 'my string ? other string ?'; $str = ''; foreach(explode('?', $query, count($params) + 1) as $token) { $str .= $token . array_shift($params); } echo $str;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/ErMJn
function name:  (null)
number of ops:  21
compiled vars:  !0 = $params, !1 = $query, !2 = $str, !3 = $token
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, 'my+string+%3F+other+string+%3F'
    5     2        ASSIGN                                                       !2, ''
    7     3        INIT_FCALL                                                   'explode'
          4        SEND_VAL                                                     '%3F'
          5        SEND_VAR                                                     !1
          6        COUNT                                                ~7      !0
          7        ADD                                                  ~8      ~7, 1
          8        SEND_VAL                                                     ~8
          9        DO_ICALL                                             $9      
         10      > FE_RESET_R                                           $10     $9, ->18
         11    > > FE_FETCH_R                                                   $10, !3, ->18
    8    12    >   INIT_FCALL                                                   'array_shift'
         13        SEND_REF                                                     !0
         14        DO_ICALL                                             $11     
         15        CONCAT                                               ~12     !3, $11
         16        ASSIGN_OP                                         8          !2, ~12
    7    17      > JMP                                                          ->11
         18    >   FE_FREE                                                      $10
   11    19        ECHO                                                         !2
   12    20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.49 ms | 2230 KiB | 15 Q