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,}/',create_function('$matches','return strtolower($matches[0]);'),$_text); } $input = "This is so AWESOME!"; echo remove_shout($input);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zm2Ff
function name:  (null)
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'This+is+so+AWESOME%21'
   10     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/Zm2Ff
function name:  remove_shout
number of ops:  13
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        INIT_FCALL_BY_NAME                                       'create_function'
          5        SEND_VAL_EX                                              '%24matches'
          6        SEND_VAL_EX                                              'return+strtolower%28%24matches%5B0%5D%29%3B'
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11      > RETURN                                                   $3
    6    12*     > RETURN                                                   null

End of function remove_shout

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.22 ms | 1401 KiB | 16 Q