3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $prop; public function change() { $prop=2; } public function output() { echo $prop; } } class b { public function change() { $this->prop=2; } public function output() { echo $this->prop; echo get_class($this); } } $objA=new a(); $objB=new b(); $objA->change(); $objA->output(); $objB->change(); $objB->output();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EIuEv
function name:  (null)
number of ops:  15
compiled vars:  !0 = $objA, !1 = $objB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $2      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   33     3        NEW                                              $5      'b'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   35     6        INIT_METHOD_CALL                                         !0, 'change'
          7        DO_FCALL                                      0          
   36     8        INIT_METHOD_CALL                                         !0, 'output'
          9        DO_FCALL                                      0          
   38    10        INIT_METHOD_CALL                                         !1, 'change'
         11        DO_FCALL                                      0          
   39    12        INIT_METHOD_CALL                                         !1, 'output'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Class a:
Function change:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EIuEv
function name:  change
number of ops:  2
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 2
    9     1      > RETURN                                                   null

End of function change

Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EIuEv
function name:  output
number of ops:  2
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     !0
   14     1      > RETURN                                                   null

End of function output

End of class a.

Class b:
Function change:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EIuEv
function name:  change
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN_OBJ                                               'prop'
          1        OP_DATA                                                  2
   22     2      > RETURN                                                   null

End of function change

Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EIuEv
function name:  output
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   FETCH_OBJ_R                                      ~0      'prop'
          1        ECHO                                                     ~0
   27     2        FETCH_THIS                                       ~1      
          3        GET_CLASS                                        ~2      ~1
          4        ECHO                                                     ~2
   28     5      > RETURN                                                   null

End of function output

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.58 ms | 1390 KiB | 13 Q