3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='direction-only'; echo preg_match_callback('/(\w*)-(\w*)/', function($match) { return implode('', array_map($match, function($string) { return ucfirst($string); })); }, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YQZQo
function name:  (null)
number of ops:  9
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'direction-only'
    3     1        INIT_FCALL_BY_NAME                                       'preg_match_callback'
          2        SEND_VAL_EX                                              '%2F%28%5Cw%2A%29-%28%5Cw%2A%29%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYQZQo%3A3%240'
    7     4        SEND_VAL_EX                                              ~2
    3     5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $3      
          7        ECHO                                                     $3
    7     8      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FYQZQo%3A3%240

Function %00%7Bclosure%7D%2Fin%2FYQZQo%3A4%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YQZQo
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'ucfirst'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    6     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYQZQo%3A4%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.31 ms | 1396 KiB | 19 Q