3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface intf{ public function setVar($a); public function getVar(); } class A implements intf{ private $A; public function setVar($a){ $this->A=$a; } public function getVar(){ return $this->A; } } class B extends Abs{ private $B; public function setVar($a){ $this->B=$a; } public function getVar(){ return $this->B; } } abstract class Abs{ abstract public function setVar($a); abstract public function getVar(); public function getDouble($a){ return $a*2; } } $A=new A(); $B=new B(); $A->setVar(2); echo ' Class A: '.$A->getVar(); $B->setVar(4); echo ' Class B: '.$B->getVar(); echo ' Class B Double: '.$B->getDouble($B->getVar()); echo ' Class A Double: '.$B->getDouble($A->getVar());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  (null)
number of ops:  37
compiled vars:  !0 = $A, !1 = $B
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'a'
   17     1        DECLARE_CLASS                                            'b', 'abs'
   36     2        NEW                                              $2      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   37     5        NEW                                              $5      'B'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   38     8        INIT_METHOD_CALL                                         !0, 'setVar'
          9        SEND_VAL_EX                                              2
         10        DO_FCALL                                      0          
   39    11        INIT_METHOD_CALL                                         !0, 'getVar'
         12        DO_FCALL                                      0  $9      
         13        CONCAT                                           ~10     '+Class+A%3A+', $9
         14        ECHO                                                     ~10
   40    15        INIT_METHOD_CALL                                         !1, 'setVar'
         16        SEND_VAL_EX                                              4
         17        DO_FCALL                                      0          
   42    18        INIT_METHOD_CALL                                         !1, 'getVar'
         19        DO_FCALL                                      0  $12     
         20        CONCAT                                           ~13     '+Class+B%3A+', $12
         21        ECHO                                                     ~13
   44    22        INIT_METHOD_CALL                                         !1, 'getDouble'
         23        INIT_METHOD_CALL                                         !1, 'getVar'
         24        DO_FCALL                                      0  $14     
         25        SEND_VAR_NO_REF_EX                                       $14
         26        DO_FCALL                                      0  $15     
         27        CONCAT                                           ~16     '+Class+B+Double%3A+', $15
         28        ECHO                                                     ~16
   46    29        INIT_METHOD_CALL                                         !1, 'getDouble'
         30        INIT_METHOD_CALL                                         !0, 'getVar'
         31        DO_FCALL                                      0  $17     
         32        SEND_VAR_NO_REF_EX                                       $17
         33        DO_FCALL                                      0  $18     
         34        CONCAT                                           ~19     '+Class+A+Double%3A+', $18
         35        ECHO                                                     ~19
         36      > RETURN                                                   1

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

End of function setvar

Function getvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  getVar
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function getvar

End of class intf.

Class A:
Function setvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  setVar
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ASSIGN_OBJ                                               'A'
          2        OP_DATA                                                  !0
   11     3      > RETURN                                                   null

End of function setvar

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

End of function getvar

End of class A.

Class B:
Function setvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  setVar
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ASSIGN_OBJ                                               'B'
          2        OP_DATA                                                  !0
   22     3      > RETURN                                                   null

End of function setvar

Function getvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  getVar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'B'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function getvar

End of class B.

Class Abs:
Function setvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  setVar
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function setvar

Function getvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  getVar
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E > > RETURN                                                   null

End of function getvar

Function getdouble:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jlZB7
function name:  getDouble
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   33     1        MUL                                              ~1      !0, 2
          2      > RETURN                                                   ~1
   34     3*     > RETURN                                                   null

End of function getdouble

End of class Abs.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.64 ms | 1403 KiB | 13 Q