3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Time { public function __construct(public int $seconds) {} } define('SECOND', new Time(1)); define('MINUTE', new Time(60)); var_dump(SECOND == new Time(1)); var_dump(SECOND < MINUTE);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rRMNR
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                                   'define'
          1        SEND_VAL                                                     'SECOND'
          2        NEW                                                  $0      'Time'
          3        SEND_VAL_EX                                                  1
          4        DO_FCALL                                          0          
          5        SEND_VAR                                                     $0
          6        DO_ICALL                                                     
    8     7        INIT_FCALL                                                   'define'
          8        SEND_VAL                                                     'MINUTE'
          9        NEW                                                  $3      'Time'
         10        SEND_VAL_EX                                                  60
         11        DO_FCALL                                          0          
         12        SEND_VAR                                                     $3
         13        DO_ICALL                                                     
   10    14        INIT_FCALL                                                   'var_dump'
         15        FETCH_CONSTANT                                       ~6      'SECOND'
         16        NEW                                                  $7      'Time'
         17        SEND_VAL_EX                                                  1
         18        DO_FCALL                                          0          
         19        IS_EQUAL                                             ~9      $7, ~6
         20        SEND_VAL                                                     ~9
         21        DO_ICALL                                                     
   11    22        INIT_FCALL                                                   'var_dump'
         23        FETCH_CONSTANT                                       ~11     'SECOND'
         24        FETCH_CONSTANT                                       ~12     'MINUTE'
         25        IS_SMALLER                                           ~13     ~11, ~12
         26        SEND_VAL                                                     ~13
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Class Time:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rRMNR
function name:  __construct
number of ops:  4
compiled vars:  !0 = $seconds
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'seconds'
          2        OP_DATA                                                      !0
          3      > RETURN                                                       null

End of function __construct

End of class Time.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.47 ms | 1446 KiB | 15 Q