3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "luke"; echo preg_replace_callback('~^(?![eiux])[a-z]~', function($m) { return ucfirst($m[0]); }, $str); $str = "egg"; echo "\n" . preg_replace_callback('~^(?![eiux])[a-z]~', function($m) { return ucfirst($m[0]); }, $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q9lMW
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'luke'
    4     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%7E%5E%28%3F%21%5Beiux%5D%29%5Ba-z%5D%7E'
          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     8        ASSIGN                                                   !0, 'egg'
    9     9        INIT_FCALL                                               'preg_replace_callback'
         10        SEND_VAL                                                 '%7E%5E%28%3F%21%5Beiux%5D%29%5Ba-z%5D%7E'
         11        DECLARE_LAMBDA_FUNCTION                          ~5      [1]
   11    12        SEND_VAL                                                 ~5
         13        SEND_VAR                                                 !0
    9    14        DO_ICALL                                         $6      
   11    15        CONCAT                                           ~7      '%0A', $6
         16        ECHO                                                     ~7
         17      > 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/q9lMW
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'ucfirst'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
    6     6*     > RETURN                                                   null

End of Dynamic Function 0

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

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.49 ms | 1439 KiB | 15 Q