3v4l.org

run code in 300+ PHP versions simultaneously
<?php function daysInMonth($month, $year) { $daysBetweenMonths = [0, 31, 59 + ($year%4 === 0), 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; $prev = $daysBetweenMonths[$month - 1]; $current = $daysBetweenMonths[$month]; return $current - $prev; } for ($y = 2000; $y < 2004; $y++) { for ($m = 1; $m < 13; $m++) { echo 'days in '.$m.'/'.$y.' are :'. daysInMonth($m, $y)."\n"; } echo "\n\n"; }
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 = 2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 2
Branch analysis from position: 22
Branch analysis from position: 2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
Branch analysis from position: 4
filename:       /in/Y15AU
function name:  (null)
number of ops:  23
compiled vars:  !0 = $y, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, 2000
          1      > JMP                                                      ->20
   13     2    >   ASSIGN                                                   !1, 1
          3      > JMP                                                      ->16
   14     4    >   CONCAT                                           ~4      'days+in+', !1
          5        CONCAT                                           ~5      ~4, '%2F'
          6        CONCAT                                           ~6      ~5, !0
          7        CONCAT                                           ~7      ~6, '+are+%3A'
          8        INIT_FCALL                                               'daysinmonth'
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $8      
         12        CONCAT                                           ~9      ~7, $8
         13        CONCAT                                           ~10     ~9, '%0A'
         14        ECHO                                                     ~10
   13    15        PRE_INC                                                  !1
         16    >   IS_SMALLER                                               !1, 13
         17      > JMPNZ                                                    ~12, ->4
   17    18    >   ECHO                                                     '%0A%0A'
   12    19        PRE_INC                                                  !0
         20    >   IS_SMALLER                                               !0, 2004
         21      > JMPNZ                                                    ~14, ->2
   18    22    > > RETURN                                                   1

Function daysinmonth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y15AU
function name:  daysInMonth
number of ops:  27
compiled vars:  !0 = $month, !1 = $year, !2 = $daysBetweenMonths, !3 = $prev, !4 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_ARRAY                                       ~5      0
          3        ADD_ARRAY_ELEMENT                                ~5      31
          4        MOD                                              ~6      !1, 4
          5        IS_IDENTICAL                                     ~7      ~6, 0
          6        ADD                                              ~8      59, ~7
          7        ADD_ARRAY_ELEMENT                                ~5      ~8
          8        ADD_ARRAY_ELEMENT                                ~5      90
          9        ADD_ARRAY_ELEMENT                                ~5      120
         10        ADD_ARRAY_ELEMENT                                ~5      151
         11        ADD_ARRAY_ELEMENT                                ~5      181
         12        ADD_ARRAY_ELEMENT                                ~5      212
         13        ADD_ARRAY_ELEMENT                                ~5      243
         14        ADD_ARRAY_ELEMENT                                ~5      273
         15        ADD_ARRAY_ELEMENT                                ~5      304
         16        ADD_ARRAY_ELEMENT                                ~5      334
         17        ADD_ARRAY_ELEMENT                                ~5      365
         18        ASSIGN                                                   !2, ~5
    6    19        SUB                                              ~10     !0, 1
         20        FETCH_DIM_R                                      ~11     !2, ~10
         21        ASSIGN                                                   !3, ~11
    7    22        FETCH_DIM_R                                      ~13     !2, !0
         23        ASSIGN                                                   !4, ~13
    9    24        SUB                                              ~15     !4, !3
         25      > RETURN                                                   ~15
   10    26*     > RETURN                                                   null

End of function daysinmonth

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.43 ms | 1394 KiB | 14 Q