3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('date.timezone', 'GMT'); // Sun, 06 Nov 1994 08:49:37 GMT $date = gmmktime(8, 49, 37, 11, 6, 1994); function compare_date_format($date, $constant, $string) { $constant_date = date((defined($constant)) ? constant($constant) : '', $date); $string_date = date($string, $date); var_dump($constant, $constant_date, $string_date, $constant_date === $string_date); } compare_date_format($date, 'DATE_RFC822', 'D, j M y H:i:s O'); compare_date_format($date, 'DATE_RFC850', 'l, d-M-y H:i:s T'); compare_date_format($date, 'DATE_RFC1036', 'D, d M y H:i:s O'); compare_date_format($date, 'DATE_RFC1123', 'D, d M Y H:i:s O'); compare_date_format($date, 'DATE_RFC2109', 'D, d-M-y H:i:s T'); compare_date_format($date, 'DATE_COOKIE', 'D, d-M-Y H:i:s T'); compare_date_format($date, 'DATE_RFC2616', 'D, d M Y H:i:s \G\M\T'); //compare_date_format($date, 'DATE_RFC2965', ''); compare_date_format($date, 'DATE_RFC2822', 'D, j M Y H:i:s O'); compare_date_format($date, 'DATE_RFC5322', 'D, j M Y H:i:s O'); compare_date_format($date, 'DATE_RFC6265', 'D, d M Y H:i:s \G\M\T'); compare_date_format($date, 'DATE_RFC7231', 'D, d M Y H:i:s \G\M\T');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3pbah
function name:  (null)
number of ops:  69
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'date.timezone'
          2        SEND_VAL                                                 'GMT'
          3        DO_ICALL                                                 
    6     4        INIT_FCALL                                               'gmmktime'
          5        SEND_VAL                                                 8
          6        SEND_VAL                                                 49
          7        SEND_VAL                                                 37
          8        SEND_VAL                                                 11
          9        SEND_VAL                                                 6
         10        SEND_VAL                                                 1994
         11        DO_ICALL                                         $2      
         12        ASSIGN                                                   !0, $2
   15    13        INIT_FCALL                                               'compare_date_format'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 'DATE_RFC822'
         16        SEND_VAL                                                 'D%2C+j+M+y+H%3Ai%3As+O'
         17        DO_FCALL                                      0          
   16    18        INIT_FCALL                                               'compare_date_format'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 'DATE_RFC850'
         21        SEND_VAL                                                 'l%2C+d-M-y+H%3Ai%3As+T'
         22        DO_FCALL                                      0          
   17    23        INIT_FCALL                                               'compare_date_format'
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 'DATE_RFC1036'
         26        SEND_VAL                                                 'D%2C+d+M+y+H%3Ai%3As+O'
         27        DO_FCALL                                      0          
   18    28        INIT_FCALL                                               'compare_date_format'
         29        SEND_VAR                                                 !0
         30        SEND_VAL                                                 'DATE_RFC1123'
         31        SEND_VAL                                                 'D%2C+d+M+Y+H%3Ai%3As+O'
         32        DO_FCALL                                      0          
   19    33        INIT_FCALL                                               'compare_date_format'
         34        SEND_VAR                                                 !0
         35        SEND_VAL                                                 'DATE_RFC2109'
         36        SEND_VAL                                                 'D%2C+d-M-y+H%3Ai%3As+T'
         37        DO_FCALL                                      0          
   20    38        INIT_FCALL                                               'compare_date_format'
         39        SEND_VAR                                                 !0
         40        SEND_VAL                                                 'DATE_COOKIE'
         41        SEND_VAL                                                 'D%2C+d-M-Y+H%3Ai%3As+T'
         42        DO_FCALL                                      0          
   21    43        INIT_FCALL                                               'compare_date_format'
         44        SEND_VAR                                                 !0
         45        SEND_VAL                                                 'DATE_RFC2616'
         46        SEND_VAL                                                 'D%2C+d+M+Y+H%3Ai%3As+%5CG%5CM%5CT'
         47        DO_FCALL                                      0          
   23    48        INIT_FCALL                                               'compare_date_format'
         49        SEND_VAR                                                 !0
         50        SEND_VAL                                                 'DATE_RFC2822'
         51        SEND_VAL                                                 'D%2C+j+M+Y+H%3Ai%3As+O'
         52        DO_FCALL                                      0          
   24    53        INIT_FCALL                                               'compare_date_format'
         54        SEND_VAR                                                 !0
         55        SEND_VAL                                                 'DATE_RFC5322'
         56        SEND_VAL                                                 'D%2C+j+M+Y+H%3Ai%3As+O'
         57        DO_FCALL                                      0          
   25    58        INIT_FCALL                                               'compare_date_format'
         59        SEND_VAR                                                 !0
         60        SEND_VAL                                                 'DATE_RFC6265'
         61        SEND_VAL                                                 'D%2C+d+M+Y+H%3Ai%3As+%5CG%5CM%5CT'
         62        DO_FCALL                                      0          
   26    63        INIT_FCALL                                               'compare_date_format'
         64        SEND_VAR                                                 !0
         65        SEND_VAL                                                 'DATE_RFC7231'
         66        SEND_VAL                                                 'D%2C+d+M+Y+H%3Ai%3As+%5CG%5CM%5CT'
         67        DO_FCALL                                      0          
         68      > RETURN                                                   1

Function compare_date_format:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3pbah
function name:  compare_date_format
number of ops:  31
compiled vars:  !0 = $date, !1 = $constant, !2 = $string, !3 = $constant_date, !4 = $string_date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        INIT_FCALL                                               'date'
          4        INIT_FCALL                                               'defined'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->13
          8    >   INIT_FCALL                                               'constant'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        QM_ASSIGN                                        ~7      $6
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~7      ''
         14    >   SEND_VAL                                                 ~7
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !3, $8
   10    18        INIT_FCALL                                               'date'
         19        SEND_VAR                                                 !2
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $10     
         22        ASSIGN                                                   !4, $10
   12    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !1
         25        SEND_VAR                                                 !3
         26        SEND_VAR                                                 !4
         27        IS_IDENTICAL                                     ~12     !3, !4
         28        SEND_VAL                                                 ~12
         29        DO_ICALL                                                 
   13    30      > RETURN                                                   null

End of function compare_date_format

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.79 ms | 1014 KiB | 30 Q