3v4l.org

run code in 300+ PHP versions simultaneously
<?php $years = [ -25000, 0, 9999, 10000, 25000, ]; foreach ($years as $year) { $dt1 = date_create_from_format('d/m/Y', "22/09/$year"); $dt2 = new \DateTime(); $dt2->setDate($year, 9, 22); var_dump($year, $dt1, $dt2); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 25
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/QHitu
function name:  (null)
number of ops:  27
compiled vars:  !0 = $years, !1 = $year, !2 = $dt1, !3 = $dt2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1      > FE_RESET_R                                       $5      !0, ->25
          2    > > FE_FETCH_R                                               $5, !1, ->25
   11     3    >   INIT_FCALL                                               'date_create_from_format'
          4        SEND_VAL                                                 'd%2Fm%2FY'
          5        NOP                                                      
          6        FAST_CONCAT                                      ~6      '22%2F09%2F', !1
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
   12    10        NEW                                              $9      'DateTime'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !3, $9
   13    13        INIT_METHOD_CALL                                         !3, 'setDate'
         14        SEND_VAR_EX                                              !1
         15        SEND_VAL_EX                                              9
         16        SEND_VAL_EX                                              22
         17        DO_FCALL                                      0          
   14    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !1
         20        SEND_VAR                                                 !2
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
   15    23        ECHO                                                     '%0A'
   10    24      > JMP                                                      ->2
         25    >   FE_FREE                                                  $5
   16    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.92 ms | 1003 KiB | 15 Q