3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'The quick brown fox jumped over the lazy dog.'; $patterns = array(); $patterns[0] = '/quick/'; $patterns[1] = '/brown/'; $patterns[2] = '/fox/'; $replacements = array(); $replacements[2] = 'bear'; $replacements[1] = 'black'; $replacements[0] = 'slow'; echo preg_replace($patterns, $replacements, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NRgXa
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string, !1 = $patterns, !2 = $replacements
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'The+quick+brown+fox+jumped+over+the+lazy+dog.'
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN_DIM                                               !1, 0
          3        OP_DATA                                                  '%2Fquick%2F'
    5     4        ASSIGN_DIM                                               !1, 1
          5        OP_DATA                                                  '%2Fbrown%2F'
    6     6        ASSIGN_DIM                                               !1, 2
          7        OP_DATA                                                  '%2Ffox%2F'
    7     8        ASSIGN                                                   !2, <array>
    8     9        ASSIGN_DIM                                               !2, 2
         10        OP_DATA                                                  'bear'
    9    11        ASSIGN_DIM                                               !2, 1
         12        OP_DATA                                                  'black'
   10    13        ASSIGN_DIM                                               !2, 0
         14        OP_DATA                                                  'slow'
   11    15        INIT_FCALL                                               'preg_replace'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $12     
         20        ECHO                                                     $12
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.09 ms | 1395 KiB | 15 Q