3v4l.org

run code in 300+ PHP versions simultaneously
<?php $k = 201435; $str = strval($k); $year = intval(substr($str,0,4)); $month = intval(substr($str,4)); while($month>12){ $month = $month-12; $year++; } var_dump($month, $year);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 17
Branch analysis from position: 22
Branch analysis from position: 17
filename:       /in/03AJX
function name:  (null)
number of ops:  27
compiled vars:  !0 = $k, !1 = $str, !2 = $year, !3 = $month
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 201435
    4     1        CAST                                          6  ~5      !0
          2        ASSIGN                                                   !1, ~5
    5     3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 4
          7        DO_ICALL                                         $7      
          8        CAST                                          4  ~8      $7
          9        ASSIGN                                                   !2, ~8
    6    10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 4
         13        DO_ICALL                                         $10     
         14        CAST                                          4  ~11     $10
         15        ASSIGN                                                   !3, ~11
    7    16      > JMP                                                      ->20
    8    17    >   SUB                                              ~13     !3, 12
         18        ASSIGN                                                   !3, ~13
    9    19        PRE_INC                                                  !2
    7    20    >   IS_SMALLER                                               12, !3
         21      > JMPNZ                                                    ~16, ->17
   12    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !3
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.29 ms | 1395 KiB | 17 Q