3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Get an interval between 1st January and 14th January $diff1 = (new DateTimeImmutable('2019-01-01'))->diff(new DateTimeImmutable('2019-01-14')); // Get another interval, but this time an extra day on the end $diff2 = (new DateTimeImmutable('2019-01-01'))->diff(new DateTimeImmutable('2019-01-15')); // Check if the first interval is shorter than the second var_dump($diff1 < $diff2); // Oh, that's weird... // Let's peek inside the two intervals var_export($diff1, true); var_export($diff2, true); // Now let's check again var_dump($diff1 < $diff2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O8Okj
function name:  (null)
number of ops:  37
compiled vars:  !0 = $diff1, !1 = $diff2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $2      'DateTimeImmutable'
          1        SEND_VAL_EX                                              '2019-01-01'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $2, 'diff'
          4        NEW                                              $4      'DateTimeImmutable'
          5        SEND_VAL_EX                                              '2019-01-14'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !0, $6
    7    10        NEW                                              $8      'DateTimeImmutable'
         11        SEND_VAL_EX                                              '2019-01-01'
         12        DO_FCALL                                      0          
         13        INIT_METHOD_CALL                                         $8, 'diff'
         14        NEW                                              $10     'DateTimeImmutable'
         15        SEND_VAL_EX                                              '2019-01-15'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $10
         18        DO_FCALL                                      0  $12     
         19        ASSIGN                                                   !1, $12
   10    20        INIT_FCALL                                               'var_dump'
         21        IS_SMALLER                                       ~14     !0, !1
         22        SEND_VAL                                                 ~14
         23        DO_ICALL                                                 
   14    24        INIT_FCALL                                               'var_export'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                                 
   15    28        INIT_FCALL                                               'var_export'
         29        SEND_VAR                                                 !1
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                                 
   18    32        INIT_FCALL                                               'var_dump'
         33        IS_SMALLER                                       ~18     !0, !1
         34        SEND_VAL                                                 ~18
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.1 ms | 1000 KiB | 15 Q