3v4l.org

run code in 300+ PHP versions simultaneously
<?php $type = "REUSABLE_DOCUMENT_CREATED"; $method = preg_replace_callback( '/_(.?)/', function ($m) { return strtoupper($m[1]); }, strtolower( $type ) ).'_Event'; echo $method;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n6ocN
function name:  (null)
number of ops:  14
compiled vars:  !0 = $type, !1 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'REUSABLE_DOCUMENT_CREATED'
    4     1        INIT_FCALL                                               'preg_replace_callback'
    5     2        SEND_VAL                                                 '%2F_%28.%3F%29%2F'
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fn6ocN%3A6%240'
    8     4        SEND_VAL                                                 ~3
    9     5        INIT_FCALL                                               'strtolower'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
   10    10        CONCAT                                           ~6      $5, '_Event'
    4    11        ASSIGN                                                   !1, ~6
   12    12        ECHO                                                     !1
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fn6ocN%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n6ocN
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'strtoupper'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
    8     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fn6ocN%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.7 ms | 1395 KiB | 19 Q