3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'aaAAąAŚĆżź'; echo preg_replace_callback( '/(\p{Lu})|(\p{Ll})/u', function($m) { return $m[1] ? mb_strtolower($m[1]) : mb_strtoupper($m[2]); }, $string );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rNICr
function name:  (null)
number of ops:  9
compiled vars:  !0 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'aaAA%C4%85A%C5%9A%C4%86%C5%BC%C5%BA'
    4     1        INIT_FCALL                                                   'preg_replace_callback'
    5     2        SEND_VAL                                                     '%2F%28%5Cp%7BLu%7D%29%7C%28%5Cp%7BLl%7D%29%2Fu'
    6     3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   10     4        SEND_VAL                                                     ~2
   11     5        SEND_VAR                                                     !0
    4     6        DO_ICALL                                             $3      
   11     7        ECHO                                                         $3
   12     8      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rNICr
function name:  {closure:/in/rNICr:6}
number of ops:  16
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        FETCH_DIM_R                                          ~1      !0, 1
          2      > JMPZ                                                         ~1, ->9
    8     3    >   INIT_FCALL                                                   'mb_strtolower'
          4        FETCH_DIM_R                                          ~2      !0, 1
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                             $3      
          7        QM_ASSIGN                                            ~4      $3
          8      > JMP                                                          ->14
    9     9    >   INIT_FCALL                                                   'mb_strtoupper'
         10        FETCH_DIM_R                                          ~5      !0, 2
         11        SEND_VAL                                                     ~5
         12        DO_ICALL                                             $6      
         13        QM_ASSIGN                                            ~4      $6
         14    > > RETURN                                                       ~4
   10    15*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.24 ms | 1991 KiB | 16 Q