3v4l.org

run code in 300+ PHP versions simultaneously
<?php function create_path($hash) { return preg_replace('#\w\K((?<=\w{5}).+)?#', '/', strtolower($hash)); } // will output something like "a/h/q/6/d/" echo create_path('aHq6dc93d7b');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y9JON
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'create_path'
          1        SEND_VAL                                                 'aHq6dc93d7b'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function create_path:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y9JON
function name:  create_path
number of ops:  11
compiled vars:  !0 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%23%5Cw%5CK%28%28%3F%3C%3D%5Cw%7B5%7D%29.%2B%29%3F%23'
          3        SEND_VAL                                                 '%2F'
          4        INIT_FCALL                                               'strtolower'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
    6    10*     > RETURN                                                   null

End of function create_path

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.59 ms | 1002 KiB | 16 Q