3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.39 ms | 1388 KiB | 19 Q