3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public function _($foo) { return $foo; } } class T extends Base { public function __invoke($foo) { return $this->_($foo); } } $mem = memory_get_usage(); $timestamp = microtime(true); $t = new T(); for ($i = 0; $i < 1000; $i++) { $t($i); } $timestampAfter = microtime(true); $memDiff = memory_get_usage() - $mem; $timeDiff = $timestampAfter-$timestamp; var_dump($memDiff, $timeDiff);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
Branch analysis from position: 12
filename:       /in/ePZ0o
function name:  (null)
number of ops:  33
compiled vars:  !0 = $mem, !1 = $timestamp, !2 = $t, !3 = $i, !4 = $timestampAfter, !5 = $memDiff, !6 = $timeDiff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $7      
          2        ASSIGN                                                   !0, $7
   19     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !1, $9
   21     7        NEW                                              $11     'T'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $11
   23    10        ASSIGN                                                   !3, 0
         11      > JMP                                                      ->16
   24    12    >   INIT_DYNAMIC_CALL                                        !2
         13        SEND_VAR_EX                                              !3
         14        DO_FCALL                                      0          
   23    15        PRE_INC                                                  !3
         16    >   IS_SMALLER                                               !3, 1000
         17      > JMPNZ                                                    ~17, ->12
   27    18    >   INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $18     
         21        ASSIGN                                                   !4, $18
   29    22        INIT_FCALL                                               'memory_get_usage'
         23        DO_ICALL                                         $20     
         24        SUB                                              ~21     $20, !0
         25        ASSIGN                                                   !5, ~21
   30    26        SUB                                              ~23     !4, !1
         27        ASSIGN                                                   !6, ~23
   32    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !5
         30        SEND_VAR                                                 !6
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Class Base:
Function _:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ePZ0o
function name:  _
number of ops:  3
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1      > RETURN                                                   !0
    8     2*     > RETURN                                                   null

End of function _

End of class Base.

Class T:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ePZ0o
function name:  __invoke
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         '_'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   15     5*     > RETURN                                                   null

End of function __invoke

Function _:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ePZ0o
function name:  _
number of ops:  3
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1      > RETURN                                                   !0
    8     2*     > RETURN                                                   null

End of function _

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.21 ms | 1400 KiB | 19 Q