3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'derp', 'test', 'othershit' ); $someUnknowableTemplate = "the first var is @VAR0, the third is @VAR2"; echo preg_replace('/@VAR(\d)/e','$arr[\1]',$someUnknowableTemplate);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rqe5s
function name:  (null)
number of ops:  9
compiled vars:  !0 = $arr, !1 = $someUnknowableTemplate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 'the+first+var+is+%40VAR0%2C+the+third+is+%40VAR2'
   10     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%40VAR%28%5Cd%29%2Fe'
          4        SEND_VAL                                                 '%24arr%5B%5C1%5D'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.04 ms | 1394 KiB | 15 Q