3v4l.org

run code in 300+ PHP versions simultaneously
<?php $parcel = "32.1"; $supparcel = ""; $arr = explode('.',$parcel); if (count($arr) > 1){ $supparcel = $arr[1]; } if ($supparcel != ""){ echo $arr[0] . '-' . $subparcel; } else { echo $arr[0]; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/X0EQ2
function name:  (null)
number of ops:  22
compiled vars:  !0 = $parcel, !1 = $supparcel, !2 = $arr, !3 = $subparcel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '32.1'
    3     1        ASSIGN                                                   !1, ''
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '.'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    5     7        COUNT                                            ~8      !2
          8        IS_SMALLER                                               1, ~8
          9      > JMPZ                                                     ~9, ->12
    6    10    >   FETCH_DIM_R                                      ~10     !2, 1
         11        ASSIGN                                                   !1, ~10
    8    12    >   IS_NOT_EQUAL                                             !1, ''
         13      > JMPZ                                                     ~12, ->19
    9    14    >   FETCH_DIM_R                                      ~13     !2, 0
         15        CONCAT                                           ~14     ~13, '-'
         16        CONCAT                                           ~15     ~14, !3
         17        ECHO                                                     ~15
         18      > JMP                                                      ->21
   12    19    >   FETCH_DIM_R                                      ~16     !2, 0
         20        ECHO                                                     ~16
   14    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.77 ms | 1387 KiB | 15 Q