3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2); $query = 'found {{$the}}'; $the = 'var'; preg_match('/({{\$(.*)}})/',$query,$matches); var_dump($matches[2]); var_dump(${$matches[2]}); $new = preg_replace('/({{\$(.*)}})/',${$matches[2]},$query); echo $new;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Da4UM
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $query, !2 = $the, !3 = $matches, !4 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'found+%7B%7B%24the%7D%7D'
    4     2        ASSIGN                                                   !2, 'var'
    6     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2F%28%7B%7B%5C%24%28.%2A%29%7D%7D%29%2F'
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !3
          7        DO_ICALL                                                 
    7     8        INIT_FCALL                                               'var_dump'
          9        FETCH_DIM_R                                      ~9      !3, 2
         10        SEND_VAL                                                 ~9
         11        DO_ICALL                                                 
    8    12        INIT_FCALL                                               'var_dump'
         13        FETCH_DIM_R                                      ~11     !3, 2
         14        FETCH_R                      local               ~12     ~11
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
    9    17        INIT_FCALL                                               'preg_replace'
         18        SEND_VAL                                                 '%2F%28%7B%7B%5C%24%28.%2A%29%7D%7D%29%2F'
         19        FETCH_DIM_R                                      ~14     !3, 2
         20        FETCH_R                      local               ~15     ~14
         21        SEND_VAL                                                 ~15
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $16     
         24        ASSIGN                                                   !4, $16
   10    25        ECHO                                                     !4
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.02 ms | 1395 KiB | 19 Q