3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "british telecom (uk) limited"; $result = preg_replace_callback('/\([a-z]+\)/i', function($matches) { return strtoupper($matches[0]); }, ucwords($string)); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TbU0A
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'british+telecom+%28uk%29+limited'
    4     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%5C%28%5Ba-z%5D%2B%5C%29%2Fi'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTbU0A%3A4%240'
    7     4        SEND_VAL                                                 ~3
          5        INIT_FCALL                                               'ucwords'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
    4    10        ASSIGN                                                   !1, $5
    8    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FTbU0A%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.01 ms | 1395 KiB | 21 Q