3v4l.org

run code in 300+ PHP versions simultaneously
<?php function starttime() { return microtime(true); } function duration($starttime) { $endtime = microtime(true); return number_format($endtime - $starttime, 10); } $starttime = starttime(); $arr = array(); echo duration($starttime) . PHP_EOL; $starttime2 = starttime(); $arr2 = []; echo duration($starttime2) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VOEQT
function name:  (null)
number of ops:  19
compiled vars:  !0 = $starttime, !1 = $arr, !2 = $starttime2, !3 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'starttime'
          1        DO_FCALL                                      0  $4      
          2        ASSIGN                                                   !0, $4
   14     3        ASSIGN                                                   !1, <array>
   15     4        INIT_FCALL                                               'duration'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $7      
          7        CONCAT                                           ~8      $7, '%0A'
          8        ECHO                                                     ~8
   18     9        INIT_FCALL                                               'starttime'
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !2, $9
   19    12        ASSIGN                                                   !3, <array>
   20    13        INIT_FCALL                                               'duration'
         14        SEND_VAR                                                 !2
         15        DO_FCALL                                      0  $12     
         16        CONCAT                                           ~13     $12, '%0A'
         17        ECHO                                                     ~13
         18      > RETURN                                                   1

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

End of function starttime

Function duration:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VOEQT
function name:  duration
number of ops:  12
compiled vars:  !0 = $starttime, !1 = $endtime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
    9     5        INIT_FCALL                                               'number_format'
          6        SUB                                              ~4      !1, !0
          7        SEND_VAL                                                 ~4
          8        SEND_VAL                                                 10
          9        DO_ICALL                                         $5      
         10      > RETURN                                                   $5
   10    11*     > RETURN                                                   null

End of function duration

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.6 ms | 1403 KiB | 21 Q