3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'ZpglnRxqenU'; // Expected: 'Z-Pp-Ggg-Llll-Nnnnn-Rrrrrr-Xxxxxxx-Qqqqqqqq-Eeeeeeeee-Nnnnnnnnnn-Uuuuuuuuuuu' var_export( mb_convert_case( preg_replace_callback( '/(?!^)./', function ($m) { static $i = 1; return '-' . str_repeat($m[0], ++$i); }, $input ), MB_CASE_TITLE ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/61vm2
function name:  (null)
number of ops:  15
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ZpglnRxqenU'
    7     1        INIT_FCALL                                               'var_export'
    8     2        INIT_FCALL                                               'mb_convert_case'
    9     3        INIT_FCALL                                               'preg_replace_callback'
   10     4        SEND_VAL                                                 '%2F%28%3F%21%5E%29.%2F'
   11     5        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   14     6        SEND_VAL                                                 ~2
   15     7        SEND_VAR                                                 !0
    9     8        DO_ICALL                                         $3      
   15     9        SEND_VAR                                                 $3
   17    10        SEND_VAL                                                 2
    8    11        DO_ICALL                                         $4      
   17    12        SEND_VAR                                                 $4
    7    13        DO_ICALL                                                 
   19    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/61vm2
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $m, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        BIND_STATIC                                              !1
   13     2        INIT_FCALL                                               'str_repeat'
          3        FETCH_DIM_R                                      ~2      !0, 0
          4        SEND_VAL                                                 ~2
          5        PRE_INC                                          ~3      !1
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        CONCAT                                           ~5      '-', $4
          9      > RETURN                                                   ~5
   14    10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128 ms | 1013 KiB | 17 Q