3v4l.org

run code in 500+ PHP versions simultaneously
<?php $this_entered_uri = "some/ads123/test1"; echo preg_replace_callback('/some\/([^\/]+)\/([^\/]+).*/', function($x) { return 'some/' . preg_replace('~\D+~', '', $x[1]) . '/' . $x[2]; }, $this_entered_uri);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHHeO
function name:  (null)
number of ops:  9
compiled vars:  !0 = $this_entered_uri
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'some%2Fads123%2Ftest1'
    4     1        INIT_FCALL                                                   'preg_replace_callback'
          2        SEND_VAL                                                     '%2Fsome%5C%2F%28%5B%5E%5C%2F%5D%2B%29%5C%2F%28%5B%5E%5C%2F%5D%2B%29.%2A%2F'
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
    6     4        SEND_VAL                                                     ~2
          5        SEND_VAR                                                     !0
    4     6        DO_ICALL                                             $3      
    6     7        ECHO                                                         $3
          8      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHHeO
function name:  {closure:/in/cHHeO:4}
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        FETCH_DIM_R                                          ~1      !0, 1
          2        FRAMELESS_ICALL_3                preg_replace        ~2      '%7E%5CD%2B%7E', ''
          3        OP_DATA                                                      ~1
          4        CONCAT                                               ~3      'some%2F', ~2
          5        CONCAT                                               ~4      ~3, '%2F'
          6        FETCH_DIM_R                                          ~5      !0, 2
          7        CONCAT                                               ~6      ~4, ~5
          8      > RETURN                                                       ~6
    6     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
219.84 ms | 1528 KiB | 9 Q