3v4l.org

run code in 300+ PHP versions simultaneously
<?php function remove_shout($_text,$_max_caps=3) { return preg_replace_callback('/[A-Z]{$_max_caps,}/',function($matches) { var_dump($matches); exit(); return strtolower($matches[0]); },$_text); } $input = "This is so AWESOME COOL!"; echo remove_shout($input);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ofrEq
function name:  (null)
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'This+is+so+AWESOME+COOL%21'
   13     1        INIT_FCALL                                               'remove_shout'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function remove_shout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ofrEq
function name:  remove_shout
number of ops:  10
compiled vars:  !0 = $_text, !1 = $_max_caps
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      3
    5     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%2F%5BA-Z%5D%7B%24_max_caps%2C%7D%2F'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FofrEq%3A5%240'
    8     5        SEND_VAL                                                 ~2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
    9     9*     > RETURN                                                   null

End of function remove_shout

Function %00%7Bclosure%7D%2Fin%2FofrEq%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/ofrEq
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > EXIT                                                     
    7     5*       INIT_FCALL                                               'strtolower'
          6*       FETCH_DIM_R                                      ~2      !0, 0
          7*       SEND_VAL                                                 ~2
          8*       DO_ICALL                                         $3      
          9*       RETURN                                                   $3
    8    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FofrEq%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.11 ms | 1398 KiB | 20 Q