3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function test() { if (method_exists($this, 'init')) { $this->init(); } } } $a = new a; $s = microtime(true); for ($i = 0; $i<10000; $i++) { $a->test(); } var_dump(microtime(true) - $s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
Branch analysis from position: 9
filename:       /in/tLq9O
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $s, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $3      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   19     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
   20     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->12
   22     9    >   INIT_METHOD_CALL                                         !0, 'test'
         10        DO_FCALL                                      0          
   20    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 10000
         13      > JMPNZ                                                    ~11, ->9
   25    14    >   INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $12     
         18        SUB                                              ~13     $12, !1
         19        SEND_VAL                                                 ~13
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class a:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/tLq9O
function name:  test
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'method_exists'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        SEND_VAL                                                 'init'
          4        DO_ICALL                                         $1      
          5      > JMPZ                                                     $1, ->8
    9     6    >   INIT_METHOD_CALL                                         'init'
          7        DO_FCALL                                      0          
   11     8    > > RETURN                                                   null

End of function test

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.67 ms | 1396 KiB | 19 Q