3v4l.org

run code in 500+ PHP versions simultaneously
<?php $yearwithdecimal = "1.2"; $months = 0; if($yearwithdecimal){ $parts = explode('.', $yearwithdecimal); $months = $parts[0]*12 + $parts[1] ?? 0; } echo $months;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/VhOfV
function name:  (null)
number of ops:  17
compiled vars:  !0 = $yearwithdecimal, !1 = $months, !2 = $parts
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1.2'
    4     1        ASSIGN                                                       !1, 0
    5     2      > JMPZ                                                         !0, ->15
    6     3    >   INIT_FCALL                                                   'explode'
          4        SEND_VAL                                                     '.'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $5      
          7        ASSIGN                                                       !2, $5
    7     8        FETCH_DIM_R                                          ~7      !2, 0
          9        MUL                                                  ~8      ~7, 12
         10        FETCH_DIM_R                                          ~9      !2, 1
         11        ADD                                                  ~10     ~8, ~9
         12        COALESCE                                             ~11     ~10
         13        QM_ASSIGN                                            ~11     0
         14        ASSIGN                                                       !1, ~11
    9    15    >   ECHO                                                         !1
   10    16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.24 ms | 1705 KiB | 14 Q