3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface KeyInterface { public function open(); } class MagnetKey implements KeyInterface { public function open() { print 'open by magnet key:'; $this->slide(); } private function slide() { print 'slide down.'; } } class TurnKey implements KeyInterface { public function open() { print 'open by turn key:'; $this->insert(); $this->turn(); } private function insert() { print 'insert key.'; } private function turn() { print 'turn key.'; } } class Key { public function open() { print 'open door:'; $this->insert(); $this->turn(); } private function insert() { print 'insert key.'; } private function turn() { print 'turn key.'; } } class MagnetKeOld extends Key { public function open() { print 'open by magnet key:'; $this->insert(); $this->slide(); } private function slide() { print 'slide key.'; } } $k = new TurnKey(); $k->open(); $mk = new MagnetKey(); $mk->open(); interface Testable { public function test(); } interface MyCountable { public function count(); } abstract class MyAbstract { public abstract function test(); } class MyClass implements Testable, MyCountable { public function test() { print 'this is test method'; } public function count() { print 'this is count method'; } } $o = new MyClass(); $o->test(); $o->count();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  (null)
number of ops:  21
compiled vars:  !0 = $k, !1 = $mk, !2 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'magnetkey'
   19     1        DECLARE_CLASS                                            'turnkey'
   66     2        NEW                                              $3      'TurnKey'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   67     5        INIT_METHOD_CALL                                         !0, 'open'
          6        DO_FCALL                                      0          
   68     7        NEW                                              $7      'MagnetKey'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   69    10        INIT_METHOD_CALL                                         !1, 'open'
         11        DO_FCALL                                      0          
   83    12        DECLARE_CLASS                                            'myclass'
   93    13        NEW                                              $11     'MyClass'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !2, $11
   94    16        INIT_METHOD_CALL                                         !2, 'test'
         17        DO_FCALL                                      0          
   95    18        INIT_METHOD_CALL                                         !2, 'count'
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

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

End of function open

End of class KeyInterface.

Class MagnetKey:
Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  open
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'open+by+magnet+key%3A'
   11     1        INIT_METHOD_CALL                                         'slide'
          2        DO_FCALL                                      0          
   12     3      > RETURN                                                   null

End of function open

Function slide:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  slide
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'slide+down.'
   16     1      > RETURN                                                   null

End of function slide

End of class MagnetKey.

Class TurnKey:
Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  open
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ECHO                                                     'open+by+turn+key%3A'
   23     1        INIT_METHOD_CALL                                         'insert'
          2        DO_FCALL                                      0          
   24     3        INIT_METHOD_CALL                                         'turn'
          4        DO_FCALL                                      0          
   25     5      > RETURN                                                   null

End of function open

Function insert:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  insert
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   ECHO                                                     'insert+key.'
   29     1      > RETURN                                                   null

End of function insert

Function turn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  turn
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ECHO                                                     'turn+key.'
   33     1      > RETURN                                                   null

End of function turn

End of class TurnKey.

Class Key:
Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  open
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   ECHO                                                     'open+door%3A'
   40     1        INIT_METHOD_CALL                                         'insert'
          2        DO_FCALL                                      0          
   41     3        INIT_METHOD_CALL                                         'turn'
          4        DO_FCALL                                      0          
   42     5      > RETURN                                                   null

End of function open

Function insert:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  insert
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   ECHO                                                     'insert+key.'
   46     1      > RETURN                                                   null

End of function insert

Function turn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  turn
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   ECHO                                                     'turn+key.'
   50     1      > RETURN                                                   null

End of function turn

End of class Key.

Class MagnetKeOld:
Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  open
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   ECHO                                                     'open+by+magnet+key%3A'
   56     1        INIT_METHOD_CALL                                         'insert'
          2        DO_FCALL                                      0          
   57     3        INIT_METHOD_CALL                                         'slide'
          4        DO_FCALL                                      0          
   58     5      > RETURN                                                   null

End of function open

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

End of function slide

Function insert:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  insert
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   ECHO                                                     'insert+key.'
   46     1      > RETURN                                                   null

End of function insert

Function turn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  turn
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   ECHO                                                     'turn+key.'
   50     1      > RETURN                                                   null

End of function turn

End of class MagnetKeOld.

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

End of function test

End of class Testable.

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

End of function count

End of class MyCountable.

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

End of function test

End of class MyAbstract.

Class MyClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   85     0  E >   ECHO                                                     'this+is+test+method'
   86     1      > RETURN                                                   null

End of function test

Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svV96
function name:  count
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   89     0  E >   ECHO                                                     'this+is+count+method'
   90     1      > RETURN                                                   null

End of function count

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.69 ms | 1407 KiB | 13 Q