3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentence = str_replace("{","", $sentence); $sentence = str_replace("}","", $sentence); $sentence_iter = explode("|", $sentence); $key_upper = "{"; for ($iMatch = 0; iMatch < count($sentence_iter); ++$iMatch) { $key_upper = $key_upper ."|". preg_replace_callback('/(?<=\s|^)[a-z]/', function($match) { return strtoupper($match[0]); }, $sentence_iter[$iMatch]); } $key_upper .= "}"; $key_upper = str_replace("{|", "{", $key_upper); echo $key_upper;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 20
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 20
Branch analysis from position: 35
Branch analysis from position: 20
filename:       /in/1cXXS
function name:  (null)
number of ops:  44
compiled vars:  !0 = $sentence, !1 = $sentence_iter, !2 = $key_upper, !3 = $iMatch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'str_replace'
          1        SEND_VAL                                                 '%7B'
          2        SEND_VAL                                                 ''
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    3     6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '%7D'
          8        SEND_VAL                                                 ''
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !0, $6
    4    12        INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 '%7C'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !1, $8
    6    17        ASSIGN                                                   !2, '%7B'
    7    18        ASSIGN                                                   !3, 0
         19      > JMP                                                      ->31
    9    20    >   CONCAT                                           ~12     !2, '%7C'
         21        INIT_FCALL                                               'preg_replace_callback'
         22        SEND_VAL                                                 '%2F%28%3F%3C%3D%5Cs%7C%5E%29%5Ba-z%5D%2F'
         23        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1cXXS%3A9%240'
   11    24        SEND_VAL                                                 ~13
         25        FETCH_DIM_R                                      ~14     !1, !3
         26        SEND_VAL                                                 ~14
         27        DO_ICALL                                         $15     
         28        CONCAT                                           ~16     ~12, $15
    9    29        ASSIGN                                                   !2, ~16
    7    30        PRE_INC                                                  !3
         31    >   FETCH_CONSTANT                                   ~19     'iMatch'
         32        COUNT                                            ~20     !1
         33        IS_SMALLER                                               ~19, ~20
         34      > JMPNZ                                                    ~21, ->20
   14    35    >   ASSIGN_OP                                     8          !2, '%7D'
   15    36        INIT_FCALL                                               'str_replace'
         37        SEND_VAL                                                 '%7B%7C'
         38        SEND_VAL                                                 '%7B'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                         $23     
         41        ASSIGN                                                   !2, $23
   16    42        ECHO                                                     !2
         43      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F1cXXS%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.93 ms | 1400 KiB | 21 Q