3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PHPBench { protected static $start_time = 0; protected static $end_time = 0; public static function start() { return self::$start_time = microtime(true); } public static function end() { return self::$end_time = microtime(true); } public function __destruct() { print "Script executed in: " . (float)$time = self::$start_time - self::$end_time; } } // Loop $Bench = new PHPBench(); $Bench::start(); for($x = 0; $x <= 1000000; $x++) { print $x . '<br/>'; } $Bench::end(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/pW3Ad
function name:  (null)
number of ops:  17
compiled vars:  !0 = $Bench, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'PHPBench'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        FETCH_CLASS                                   0  $5      !0
          4        INIT_STATIC_METHOD_CALL                                  $5, 'start'
          5        DO_FCALL                                      0          
   28     6        ASSIGN                                                   !1, 0
          7      > JMP                                                      ->11
   30     8    >   CONCAT                                           ~8      !1, '%3Cbr%2F%3E'
          9        ECHO                                                     ~8
   28    10        PRE_INC                                                  !1
         11    >   IS_SMALLER_OR_EQUAL                                      !1, 1000000
         12      > JMPNZ                                                    ~10, ->8
   33    13    >   FETCH_CLASS                                   0  $11     !0
         14        INIT_STATIC_METHOD_CALL                                  $11, 'end'
         15        DO_FCALL                                      0          
   36    16      > RETURN                                                   1

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

End of function start

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

End of function end

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pW3Ad
function name:  __destruct
number of ops:  8
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'start_time'
          1        FETCH_STATIC_PROP_R          unknown             ~2      'end_time'
          2        SUB                                              ~3      ~1, ~2
          3        ASSIGN                                           ~4      !0, ~3
          4        CAST                                          5  ~5      ~4
          5        CONCAT                                           ~6      'Script+executed+in%3A+', ~5
          6        ECHO                                                     ~6
   21     7      > RETURN                                                   null

End of function __destruct

End of class PHPBench.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.36 ms | 1400 KiB | 15 Q