3v4l.org

run code in 300+ PHP versions simultaneously
<?php $find = array( "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ); $replace = array( "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p" ); $find = array_flip($find); echo preg_replace_callback('/[a-f0-9]/', function ($v) use($replace, $find) { return $replace[$find[$v[0]]]; }, $haystack); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mTNma
function name:  (null)
number of ops:  16
compiled vars:  !0 = $find, !1 = $replace, !2 = $haystack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_flip'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !0, $5
    7     6        INIT_FCALL                                               'preg_replace_callback'
          7        SEND_VAL                                                 '%2F%5Ba-f0-9%5D%2F'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmTNma%3A7%240'
          9        BIND_LEXICAL                                             ~7, !1
         10        BIND_LEXICAL                                             ~7, !0
    9    11        SEND_VAL                                                 ~7
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $8      
         14        ECHO                                                     $8
   11    15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FmTNma%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mTNma
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $replace, !2 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
    8     3        FETCH_DIM_R                                      ~3      !0, 0
          4        FETCH_DIM_R                                      ~4      !2, ~3
          5        FETCH_DIM_R                                      ~5      !1, ~4
          6      > RETURN                                                   ~5
    9     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmTNma%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.44 ms | 1395 KiB | 17 Q