3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => 1, 'b' => 2 ]; class A { public $a = 1; public $b = 2; } $a = new A(); $t0 = microtime(TRUE); for ($i = 0; $i < 500; ++$i) { $s = $array['a'] . $array['b']; } $t1 = microtime(TRUE); echo ($t1 - $t0) . "seconds\n"; for ($i = 0; $i < 500; ++$i) { $s = $a->a . $a->b; } $t2 = microtime(TRUE); echo ($t2 - $t1) . "seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
Branch analysis from position: 26
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
Branch analysis from position: 10
filename:       /in/L3cGr
function name:  (null)
number of ops:  41
compiled vars:  !0 = $array, !1 = $a, !2 = $t0, !3 = $i, !4 = $s, !5 = $t1, !6 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        NEW                                              $8      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $8
   14     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !2, $11
   15     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->15
   16    10    >   FETCH_DIM_R                                      ~14     !0, 'a'
         11        FETCH_DIM_R                                      ~15     !0, 'b'
         12        CONCAT                                           ~16     ~14, ~15
         13        ASSIGN                                                   !4, ~16
   15    14        PRE_INC                                                  !3
         15    >   IS_SMALLER                                               !3, 500
         16      > JMPNZ                                                    ~19, ->10
   18    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $20     
         20        ASSIGN                                                   !5, $20
   19    21        SUB                                              ~22     !5, !2
         22        CONCAT                                           ~23     ~22, 'seconds%0A'
         23        ECHO                                                     ~23
   21    24        ASSIGN                                                   !3, 0
         25      > JMP                                                      ->31
   22    26    >   FETCH_OBJ_R                                      ~25     !1, 'a'
         27        FETCH_OBJ_R                                      ~26     !1, 'b'
         28        CONCAT                                           ~27     ~25, ~26
         29        ASSIGN                                                   !4, ~27
   21    30        PRE_INC                                                  !3
         31    >   IS_SMALLER                                               !3, 500
         32      > JMPNZ                                                    ~30, ->26
   24    33    >   INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $31     
         36        ASSIGN                                                   !6, $31
   25    37        SUB                                              ~33     !6, !5
         38        CONCAT                                           ~34     ~33, 'seconds%0A'
         39        ECHO                                                     ~34
         40      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.33 ms | 1400 KiB | 15 Q