3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_leap_year(int $year) :bool { return $year % 4 == 0 and ($year % 100 != 0 or $year % 400 == 0); } $year = 2016; var_dump(is_leap_year($year) === date('L', $year)); # true $year = 2018; var_dump(is_leap_year($year) === date('L', $year)); # false
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ja8IY
function name:  (null)
number of ops:  25
compiled vars:  !0 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 2016
    8     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'is_leap_year'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'L'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        IS_IDENTICAL                                     ~4      $2, $3
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                                 
   10    12        ASSIGN                                                   !0, 2018
   11    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'is_leap_year'
         15        SEND_VAR                                                 !0
         16        DO_FCALL                                      0  $7      
         17        INIT_FCALL                                               'date'
         18        SEND_VAL                                                 'L'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $8      
         21        IS_IDENTICAL                                     ~9      $7, $8
         22        SEND_VAL                                                 ~9
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function is_leap_year:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 11
filename:       /in/ja8IY
function name:  is_leap_year
number of ops:  15
compiled vars:  !0 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        MOD                                              ~1      !0, 4
          2        IS_EQUAL                                         ~2      ~1, 0
          3      > JMPZ_EX                                          ~2      ~2, ->11
          4    >   MOD                                              ~3      !0, 100
          5        IS_NOT_EQUAL                                     ~4      ~3, 0
          6      > JMPNZ_EX                                         ~4      ~4, ->10
          7    >   MOD                                              ~5      !0, 400
          8        IS_EQUAL                                         ~6      ~5, 0
          9        BOOL                                             ~4      ~6
         10    >   BOOL                                             ~2      ~4
         11    >   VERIFY_RETURN_TYPE                                       ~2
         12      > RETURN                                                   ~2
    5    13*       VERIFY_RETURN_TYPE                                       
         14*     > RETURN                                                   null

End of function is_leap_year

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.75 ms | 1403 KiB | 19 Q