3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'аяruski', 'string', '54345', 'é', 'аяruski foo', 'string foo', '54345 foo', 'é foo', ]; var_export( preg_replace_callback( '/^(.)(.*)/u', fn($m) => mb_strtoupper($m[1]) . mb_strtolower($m[2]), $tests ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oUivo
function name:  (null)
number of ops:  11
compiled vars:  !0 = $tests
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'var_export'
   14     2        INIT_FCALL                                               'preg_replace_callback'
   15     3        SEND_VAL                                                 '%2F%5E%28.%29%28.%2A%29%2Fu'
   16     4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          5        SEND_VAL                                                 ~2
   17     6        SEND_VAR                                                 !0
   14     7        DO_ICALL                                         $3      
   17     8        SEND_VAR                                                 $3
   13     9        DO_ICALL                                                 
   19    10      > 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/oUivo
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'mb_strtoupper'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        INIT_FCALL                                               'mb_strtolower'
          6        FETCH_DIM_R                                      ~3      !0, 2
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      $2, $4
         10      > RETURN                                                   ~5
         11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.05 ms | 1001 KiB | 17 Q