3v4l.org

run code in 300+ 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 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jLSDU
function name:  (null)
number of ops:  32
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'class_exists'
          1        SEND_VAL                                                 'DateInterval'
          2        DO_ICALL                                         $2      
          3        BOOL_NOT                                         ~3      $2
          4      > JMPZ                                                     ~3, ->6
          5    > > RETURN                                                   null
    4     6    >   INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
          7        SEND_VAL                                                 '10+minutes'
          8        DO_FCALL                                      0  $4      
          9        ASSIGN                                                   !0, $4
    5    10        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         11        SEND_VAL                                                 '30+minutes'
         12        DO_FCALL                                      0  $6      
         13        ASSIGN                                                   !1, $6
    6    14        INIT_FCALL_BY_NAME                                       'compare'
         15        SEND_VAR_EX                                              !0
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
    7    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                                 
    8    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !1
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                                 
    9    26        ECHO                                                     '%0AAFTER%0A'
   10    27        INIT_FCALL_BY_NAME                                       'compare'
         28        SEND_VAR_EX                                              !0
         29        SEND_VAR_EX                                              !1
         30        DO_FCALL                                      0          
   21    31      > 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.0.0


preferences:
163.21 ms | 1400 KiB | 19 Q