3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function foo() { $start = microtime(true); for ($i=0; $i<1e5; $i++) { $a=get_called_class(); } $end = microtime(true); echo "Took: ", ($end-$start)*1e3, " ms"; $start = microtime(true); for ($i=0; $i<1e5; $i++) { $a=static::class; } $end = microtime(true); echo "Took: ", ($end-$start)*1e3, " ms"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QMW1q
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   1

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 26
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 26
Branch analysis from position: 31
Branch analysis from position: 26
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/QMW1q
function name:  foo
number of ops:  41
compiled vars:  !0 = $start, !1 = $i, !2 = $a, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    6     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->9
          6    >   GET_CALLED_CLASS                                 ~7      
          7        ASSIGN                                                   !2, ~7
          8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 100000
         10      > JMPNZ                                                    ~10, ->6
    7    11    >   INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !3, $11
    8    15        ECHO                                                     'Took%3A+'
         16        SUB                                              ~13     !3, !0
         17        MUL                                              ~14     ~13, 1000
         18        ECHO                                                     ~14
         19        ECHO                                                     '+ms'
    9    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $15     
         23        ASSIGN                                                   !0, $15
   10    24        ASSIGN                                                   !1, 0
         25      > JMP                                                      ->29
         26    >   FETCH_CLASS_NAME                                 ~18     
         27        ASSIGN                                                   !2, ~18
         28        PRE_INC                                                  !1
         29    >   IS_SMALLER                                               !1, 100000
         30      > JMPNZ                                                    ~21, ->26
   11    31    >   INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $22     
         34        ASSIGN                                                   !3, $22
   12    35        ECHO                                                     'Took%3A+'
         36        SUB                                              ~24     !3, !0
         37        MUL                                              ~25     ~24, 1000
         38        ECHO                                                     ~25
         39        ECHO                                                     '+ms'
   13    40      > RETURN                                                   null

End of function foo

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.05 ms | 1400 KiB | 15 Q