3v4l.org

run code in 300+ PHP versions simultaneously
<?php $config = array( 'key' => array( '/' => '/main/') ); $dataKey='/'; foreach ($config['key'] as $url => $key) { $quoted = preg_quote($url, '/'); if (null !== $res = preg_replace('/' . $quoted . '/', $key, $dataKey)) { var_dump( $res ); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 25
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 24
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/XQAs6
function name:  (null)
number of ops:  27
compiled vars:  !0 = $config, !1 = $dataKey, !2 = $key, !3 = $url, !4 = $quoted, !5 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, '%2F'
    6     2        FETCH_DIM_R                                      ~8      !0, 'key'
          3      > FE_RESET_R                                       $9      ~8, ->25
          4    > > FE_FETCH_R                                       ~10     $9, !2, ->25
          5    >   ASSIGN                                                   !3, ~10
    7     6        INIT_FCALL                                               'preg_quote'
          7        SEND_VAR                                                 !3
          8        SEND_VAL                                                 '%2F'
          9        DO_ICALL                                         $12     
         10        ASSIGN                                                   !4, $12
    9    11        INIT_FCALL                                               'preg_replace'
         12        CONCAT                                           ~14     '%2F', !4
         13        CONCAT                                           ~15     ~14, '%2F'
         14        SEND_VAL                                                 ~15
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $16     
         18        ASSIGN                                           ~17     !5, $16
         19        TYPE_CHECK                                  1020          ~17
         20      > JMPZ                                                     ~18, ->24
   10    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !5
         23        DO_ICALL                                                 
    6    24    > > JMP                                                      ->4
         25    >   FE_FREE                                                  $9
   13    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.84 ms | 1388 KiB | 19 Q