3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldValue = 'new_name_spacing'; $newValue = preg_replace_callback( '/(_[a-z])/', function ($match) { return substr($match, 1, strlen($match)); }, $oldValue ); echo $newValue;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GI59E
function name:  (null)
number of ops:  10
compiled vars:  !0 = $oldValue, !1 = $newValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'new_name_spacing'
    6     1        INIT_FCALL                                               'preg_replace_callback'
    7     2        SEND_VAL                                                 '%2F%28_%5Ba-z%5D%29%2F'
    8     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGI59E%3A8%240'
   10     4        SEND_VAL                                                 ~3
   11     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
    6     7        ASSIGN                                                   !1, $4
   14     8        ECHO                                                     !1
          9      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FGI59E%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.61 ms | 1395 KiB | 17 Q