3v4l.org

run code in 300+ PHP versions simultaneously
<?php class time { const second = 1000; const minute = 60000; const hour = 3600000; const day = 86400000; const week = 604800000; const month = 18144000000; static public function now() { return microtime(true); } static public function since ($time) { return microtime(true)-$time; } } $start = time::now(); sleep(2 * time::second); echo time::since($start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lSTQl
function name:  (null)
number of ops:  11
compiled vars:  !0 = $start
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'time', 'now'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   26     3        INIT_FCALL                                               'sleep'
          4        SEND_VAL                                                 2000
          5        DO_ICALL                                                 
   28     6        INIT_STATIC_METHOD_CALL                                  'time', 'since'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $4      
          9        ECHO                                                     $4
         10      > RETURN                                                   1

Class time:
Function now:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lSTQl
function name:  now
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $0      
          3      > RETURN                                                   $0
   15     4*     > RETURN                                                   null

End of function now

Function since:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lSTQl
function name:  since
number of ops:  7
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $1      
          4        SUB                                              ~2      $1, !0
          5      > RETURN                                                   ~2
   20     6*     > RETURN                                                   null

End of function since

End of class time.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.75 ms | 1396 KiB | 17 Q