3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = 'Hello_world!'; $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/-'; $max = strlen($chars) - 1; echo preg_replace_callback( '/.\K/', fn() => $chars[rand(0, $max)], $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mu32m
function name:  (null)
number of ops:  15
compiled vars:  !0 = $str, !1 = $chars, !2 = $max
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Hello_world%21'
    4     1        ASSIGN                                                       !1, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%2F-'
    5     2        STRLEN                                               ~5      !1
          3        SUB                                                  ~6      ~5, 1
          4        ASSIGN                                                       !2, ~6
    7     5        INIT_FCALL                                                   'preg_replace_callback'
    8     6        SEND_VAL                                                     '%2F.%5CK%2F'
    9     7        DECLARE_LAMBDA_FUNCTION                              ~8      [0]
          8        BIND_LEXICAL                                                 ~8, !1
          9        BIND_LEXICAL                                                 ~8, !2
         10        SEND_VAL                                                     ~8
   10    11        SEND_VAR                                                     !0
    7    12        DO_ICALL                                             $9      
   10    13        ECHO                                                         $9
   11    14      > 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/Mu32m
function name:  {closure:/in/Mu32m:9}
number of ops:  9
compiled vars:  !0 = $chars, !1 = $max
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                                  !0
          1        BIND_STATIC                                                  !1
          2        INIT_FCALL                                                   'rand'
          3        SEND_VAL                                                     0
          4        SEND_VAR                                                     !1
          5        DO_ICALL                                             $2      
          6        FETCH_DIM_R                                          ~3      !0, $2
          7      > RETURN                                                       ~3
          8*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
180.96 ms | 1429 KiB | 14 Q