3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = "IPC_IPCamera_13_7_24_9_57_45.jpg"; $newName = ""; $parts = explode("_", $name); for ($i = 0; $i < count($parts); $i++) { $part = $parts[$i]; if (strlen($part) == 1) { $part = "0" . $part . "_"; } $newName .= $part; } echo $name . "\n"; echo $newName;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
Branch analysis from position: 9
Branch analysis from position: 17
filename:       /in/ZD7mF
function name:  (null)
number of ops:  26
compiled vars:  !0 = $name, !1 = $newName, !2 = $parts, !3 = $i, !4 = $part
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'IPC_IPCamera_13_7_24_9_57_45.jpg'
    4     1        ASSIGN                                                   !1, ''
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '_'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    8     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->19
    9     9    >   FETCH_DIM_R                                      ~10     !2, !3
         10        ASSIGN                                                   !4, ~10
   11    11        STRLEN                                           ~12     !4
         12        IS_EQUAL                                                 ~12, 1
         13      > JMPZ                                                     ~13, ->17
   12    14    >   CONCAT                                           ~14     '0', !4
         15        CONCAT                                           ~15     ~14, '_'
         16        ASSIGN                                                   !4, ~15
   15    17    >   ASSIGN_OP                                     8          !1, !4
    8    18        PRE_INC                                                  !3
         19    >   COUNT                                            ~19     !2
         20        IS_SMALLER                                               !3, ~19
         21      > JMPNZ                                                    ~20, ->9
   19    22    >   CONCAT                                           ~21     !0, '%0A'
         23        ECHO                                                     ~21
   20    24        ECHO                                                     !1
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.66 ms | 1395 KiB | 15 Q