3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $x = 1; function getX() { return $this->x; } function __get($name) { return $this->$name; } } $a = new A(); $t = time(); for ($n = 0; $n < 100000; $n++) { $a->getX(); } echo time - $t(); $t = time(); for ($n = 0; $n < 100000; $n++) { $a->x; } echo time - $t();
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 = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
Branch analysis from position: 23
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/9bpvR
function name:  (null)
number of ops:  34
compiled vars:  !0 = $a, !1 = $t, !2 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   18     3        INIT_FCALL                                               'time'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   19     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->11
   20     8    >   INIT_METHOD_CALL                                         !0, 'getX'
          9        DO_FCALL                                      0          
   19    10        PRE_INC                                                  !2
         11    >   IS_SMALLER                                               !2, 100000
         12      > JMPNZ                                                    ~11, ->8
   22    13    >   FETCH_CONSTANT                                   ~12     'time'
         14        INIT_DYNAMIC_CALL                                        !1
         15        DO_FCALL                                      0  $13     
         16        SUB                                              ~14     ~12, $13
         17        ECHO                                                     ~14
   24    18        INIT_FCALL                                               'time'
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !1, $15
   25    21        ASSIGN                                                   !2, 0
         22      > JMP                                                      ->26
   26    23    >   FETCH_OBJ_R                                      ~18     !0, 'x'
         24        FREE                                                     ~18
   25    25        PRE_INC                                                  !2
         26    >   IS_SMALLER                                               !2, 100000
         27      > JMPNZ                                                    ~20, ->23
   28    28    >   FETCH_CONSTANT                                   ~21     'time'
         29        INIT_DYNAMIC_CALL                                        !1
         30        DO_FCALL                                      0  $22     
         31        SUB                                              ~23     ~21, $22
         32        ECHO                                                     ~23
         33      > RETURN                                                   1

Class A:
Function getx:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9bpvR
function name:  getX
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'x'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getx

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9bpvR
function name:  __get
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function __get

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.55 ms | 1400 KiB | 15 Q