3v4l.org

run code in 300+ PHP versions simultaneously
<?php $kod = '830.03.02.00.00.00'; $parts = explode('.', $kod); for($i=count($parts) - 1; $i >= 0; $i--) if ($parts[$i] != '00') break; $kod = implode('.', array_slice($parts, 0, $i + 1)); echo $kod;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
Branch analysis from position: 10
filename:       /in/YDSFa
function name:  (null)
number of ops:  30
compiled vars:  !0 = $kod, !1 = $parts, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '830.03.02.00.00.00'
    3     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    4     6        COUNT                                            ~6      !1
          7        SUB                                              ~7      ~6, 1
          8        ASSIGN                                                   !2, ~7
          9      > JMP                                                      ->15
    5    10    >   FETCH_DIM_R                                      ~9      !1, !2
         11        IS_NOT_EQUAL                                             ~9, '00'
         12      > JMPZ                                                     ~10, ->14
    6    13    > > JMP                                                      ->17
    4    14    >   PRE_DEC                                                  !2
         15    >   IS_SMALLER_OR_EQUAL                                      0, !2
         16      > JMPNZ                                                    ~12, ->10
    7    17    >   INIT_FCALL                                               'implode'
         18        SEND_VAL                                                 '.'
         19        INIT_FCALL                                               'array_slice'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 0
         22        ADD                                              ~13     !2, 1
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                         $14     
         25        SEND_VAR                                                 $14
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !0, $15
    8    28        ECHO                                                     !0
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
292.37 ms | 1396 KiB | 20 Q