3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = ['yellow', 'green', 'red']; $myString = 'banana is ?, apple is ?, tomato is ?'; do { $myString = preg_replace( '/\?/', array_shift($myArray), $myString, 1, $count ); } while ($count && $myArray); echo $myString; echo "\n\n"; var_export($myArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
Branch analysis from position: 15
filename:       /in/difQO
function name:  (null)
number of ops:  22
compiled vars:  !0 = $myArray, !1 = $myString, !2 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 'banana+is+%3F%2C+apple+is+%3F%2C+tomato+is+%3F'
    8     2    >   INIT_FCALL                                               'preg_replace'
    9     3        SEND_VAL                                                 '%2F%5C%3F%2F'
   10     4        INIT_FCALL                                               'array_shift'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
   11     8        SEND_VAR                                                 !1
   12     9        SEND_VAL                                                 1
   13    10        SEND_REF                                                 !2
    8    11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
   15    13      > JMPZ_EX                                          ~8      !2, ->15
         14    >   BOOL                                             ~8      !0
         15    > > JMPNZ                                                    ~8, ->2
   16    16    >   ECHO                                                     !1
   17    17        ECHO                                                     '%0A%0A'
   18    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.91 ms | 1001 KiB | 16 Q