3v4l.org

run code in 500+ PHP versions simultaneously
<?php if(!class_exists('DateInterval')) return; $x = DateInterval::createFromDateString('10 minutes'); $y = DateInterval::createFromDateString('30 minutes'); compare($x, $y); print_r($x, true); print_r($y, true); echo "\nAFTER\n"; compare($x, $y); function compare($x, $y) { echo 'x > y: '; var_dump($x > $y); echo 'x < y: '; var_dump($x < $y); echo 'x == y: '; var_dump($x == $y); echo 'x != y: '; var_dump($x != $y); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jLSDU
function name:  (null)
number of ops:  30
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   FRAMELESS_ICALL_1                class_exists        ~2      'DateInterval'
          1        BOOL_NOT                                             ~3      ~2
          2      > JMPZ                                                         ~3, ->4
          3    > > RETURN                                                       null
    4     4    >   INIT_STATIC_METHOD_CALL                                      'DateInterval', 'createFromDateString'
          5        SEND_VAL                                                     '10+minutes'
          6        DO_FCALL                                          0  $4      
          7        ASSIGN                                                       !0, $4
    5     8        INIT_STATIC_METHOD_CALL                                      'DateInterval', 'createFromDateString'
          9        SEND_VAL                                                     '30+minutes'
         10        DO_FCALL                                          0  $6      
         11        ASSIGN                                                       !1, $6
    6    12        INIT_FCALL_BY_NAME                                           'compare'
         13        SEND_VAR_EX                                                  !0
         14        SEND_VAR_EX                                                  !1
         15        DO_FCALL                                          0          
    7    16        INIT_FCALL                                                   'print_r'
         17        SEND_VAR                                                     !0
         18        SEND_VAL                                                     <true>
         19        DO_ICALL                                                     
    8    20        INIT_FCALL                                                   'print_r'
         21        SEND_VAR                                                     !1
         22        SEND_VAL                                                     <true>
         23        DO_ICALL                                                     
    9    24        ECHO                                                         '%0AAFTER%0A'
   10    25        INIT_FCALL_BY_NAME                                           'compare'
         26        SEND_VAR_EX                                                  !0
         27        SEND_VAR_EX                                                  !1
         28        DO_FCALL                                          0          
   21    29      > RETURN                                                       1

Function compare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jLSDU
function name:  compare
number of ops:  23
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   13     2        ECHO                                                         'x+%3E+y%3A+'
   14     3        INIT_FCALL                                                   'var_dump'
          4        IS_SMALLER                                           ~2      !1, !0
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                                     
   15     7        ECHO                                                         'x+%3C+y%3A+'
   16     8        INIT_FCALL                                                   'var_dump'
          9        IS_SMALLER                                           ~4      !0, !1
         10        SEND_VAL                                                     ~4
         11        DO_ICALL                                                     
   17    12        ECHO                                                         'x+%3D%3D+y%3A+'
   18    13        INIT_FCALL                                                   'var_dump'
         14        IS_EQUAL                                             ~6      !0, !1
         15        SEND_VAL                                                     ~6
         16        DO_ICALL                                                     
   19    17        ECHO                                                         'x+%21%3D+y%3A+'
   20    18        INIT_FCALL                                                   'var_dump'
         19        IS_NOT_EQUAL                                         ~8      !0, !1
         20        SEND_VAL                                                     ~8
         21        DO_ICALL                                                     
   21    22      > RETURN                                                       null

End of function compare

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.67 ms | 3034 KiB | 15 Q