3v4l.org

run code in 500+ PHP versions simultaneously
<?php $geo = 'New york, Ny columbia, sc charleston washington, DC BISMARCK, ND'; $geo = explode(PHP_EOL, $geo); foreach ($geo as $str) { // chop $str = explode(',', $str); // fix echo (!empty($str[0]) ? ucwords(strtolower(trim($str[0]))) : null). (!empty($str[1]) ? ', '.strtoupper(trim($str[1])) : null).PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 43
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 43
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 26
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
Branch analysis from position: 38
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/ojl2M
function name:  (null)
number of ops:  45
compiled vars:  !0 = $geo, !1 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'New+york%2C+Ny%0Acolumbia%2C+sc%0Acharleston%0Awashington%2C+DC%0ABISMARCK%2C+ND'
    7     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '%0A'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $3      
          5        ASSIGN                                                       !0, $3
    9     6      > FE_RESET_R                                           $5      !0, ->43
          7    > > FE_FETCH_R                                                   $5, !1, ->43
   12     8    >   INIT_FCALL                                                   'explode'
          9        SEND_VAL                                                     '%2C'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                             $6      
         12        ASSIGN                                                       !1, $6
   16    13        ISSET_ISEMPTY_DIM_OBJ                             1  ~8      !1, 0
         14        BOOL_NOT                                             ~9      ~8
         15      > JMPZ                                                         ~9, ->26
         16    >   INIT_FCALL                                                   'ucwords'
         17        INIT_FCALL                                                   'strtolower'
         18        FETCH_DIM_R                                          ~10     !1, 0
         19        FRAMELESS_ICALL_1                trim                ~11     ~10
         20        SEND_VAL                                                     ~11
         21        DO_ICALL                                             $12     
         22        SEND_VAR                                                     $12
         23        DO_ICALL                                             $13     
         24        QM_ASSIGN                                            ~14     $13
         25      > JMP                                                          ->27
         26    >   QM_ASSIGN                                            ~14     null
   17    27    >   ISSET_ISEMPTY_DIM_OBJ                             1  ~15     !1, 1
         28        BOOL_NOT                                             ~16     ~15
         29      > JMPZ                                                         ~16, ->38
         30    >   INIT_FCALL                                                   'strtoupper'
         31        FETCH_DIM_R                                          ~17     !1, 1
         32        FRAMELESS_ICALL_1                trim                ~18     ~17
         33        SEND_VAL                                                     ~18
         34        DO_ICALL                                             $19     
         35        CONCAT                                               ~20     '%2C+', $19
         36        QM_ASSIGN                                            ~21     ~20
         37      > JMP                                                          ->39
         38    >   QM_ASSIGN                                            ~21     null
         39    >   CONCAT                                               ~22     ~14, ~21
         40        CONCAT                                               ~23     ~22, '%0A'
         41        ECHO                                                         ~23
    9    42      > JMP                                                          ->7
         43    >   FE_FREE                                                      $5
   18    44      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.56 ms | 2567 KiB | 17 Q