3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = 'base_url'; $value = 'new_value'; $config = '$config["base_url"] = "old_value";'; $config = preg_replace('/\[(?:\'|\")'.$name.'(?:\'|\")\]\s*=\s*(\'|\")(.*)\\1;/', "['".$name."'] = '$value';", $config); echo '<pre>', var_dump($config), '</pre>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sYGD0
function name:  (null)
number of ops:  23
compiled vars:  !0 = $name, !1 = $value, !2 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'base_url'
    3     1        ASSIGN                                                   !1, 'new_value'
    4     2        ASSIGN                                                   !2, '%24config%5B%22base_url%22%5D+%3D+%22old_value%22%3B'
    6     3        INIT_FCALL                                               'preg_replace'
          4        CONCAT                                           ~6      '%2F%5C%5B%28%3F%3A%27%7C%5C%22%29', !0
          5        CONCAT                                           ~7      ~6, '%28%3F%3A%27%7C%5C%22%29%5C%5D%5Cs%2A%3D%5Cs%2A%28%27%7C%5C%22%29%28.%2A%29%5C1%3B%2F'
          6        SEND_VAL                                                 ~7
          7        CONCAT                                           ~8      '%5B%27', !0
          8        ROPE_INIT                                     3  ~10     '%27%5D+%3D+%27'
          9        ROPE_ADD                                      1  ~10     ~10, !1
         10        ROPE_END                                      2  ~9      ~10, '%27%3B'
         11        CONCAT                                           ~12     ~8, ~9
         12        SEND_VAL                                                 ~12
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !2, $13
    8    16        ECHO                                                     '%3Cpre%3E'
         17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $15     
         20        ECHO                                                     $15
         21        ECHO                                                     '%3C%2Fpre%3E'
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.48 ms | 1395 KiB | 17 Q