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, '/'); if (null !== $res = preg_replace('/' . $quoted . '/', $key, $dataKey)) { echo $res; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/MneeP
function name:  (null)
number of ops:  24
compiled vars:  !0 = $config, !1 = $key, !2 = $url, !3 = $quoted, !4 = $res, !5 = $dataKey
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, ->22
          3    > > FE_FETCH_R                                       ~9      $8, !1, ->22
          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        INIT_FCALL                                               'preg_replace'
         11        CONCAT                                           ~13     '%2F', !3
         12        CONCAT                                           ~14     ~13, '%2F'
         13        SEND_VAL                                                 ~14
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !5
         16        DO_ICALL                                         $15     
         17        ASSIGN                                           ~16     !4, $15
         18        TYPE_CHECK                                  1020          ~16
         19      > JMPZ                                                     ~17, ->21
    8    20    >   ECHO                                                     !4
    5    21    > > JMP                                                      ->3
         22    >   FE_FREE                                                  $8
   10    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.67 ms | 1400 KiB | 17 Q