3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "NEW APPLE IPHONE X 64GB CVX-Dk46"; $arr = explode(" ", $str); foreach($arr as &$word){ //var_dump(preg_match("/\d/", $word)); if(!preg_match("/\d/", $word)){ $word = ucwords(strtolower($word)); } } echo implode(" ", $arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/qccG9
function name:  (null)
number of ops:  29
compiled vars:  !0 = $str, !1 = $arr, !2 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'NEW+APPLE+IPHONE+X+64GB+CVX-Dk46'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    7     6      > FE_RESET_RW                                      $6      !1, ->22
          7    > > FE_FETCH_RW                                              $6, !2, ->22
    9     8    >   INIT_FCALL                                               'preg_match'
          9        SEND_VAL                                                 '%2F%5Cd%2F'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $7      
         12        BOOL_NOT                                         ~8      $7
         13      > JMPZ                                                     ~8, ->21
   10    14    >   INIT_FCALL                                               'ucwords'
         15        INIT_FCALL                                               'strtolower'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !2, $10
    7    21    > > JMP                                                      ->7
         22    >   FE_FREE                                                  $6
   14    23        INIT_FCALL                                               'implode'
         24        SEND_VAL                                                 '+'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $12     
         27        ECHO                                                     $12
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.95 ms | 1010 KiB | 18 Q