3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '123_abc____def'; var_dump( preg_replace( '/\_+[a-zA-Z]{1}/e', '_' . strtoupper('\\1'), $s) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rdcOB
function name:  (null)
number of ops:  14
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '123_abc____def'
    5     1        INIT_FCALL                                               'var_dump'
    6     2        INIT_FCALL                                               'preg_replace'
    7     3        SEND_VAL                                                 '%2F%5C_%2B%5Ba-zA-Z%5D%7B1%7D%2Fe'
    8     4        INIT_FCALL                                               'strtoupper'
          5        SEND_VAL                                                 '%5C1'
          6        DO_ICALL                                         $2      
          7        CONCAT                                           ~3      '_', $2
          8        SEND_VAL                                                 ~3
    9     9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
   10    13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.15 ms | 1394 KiB | 19 Q