3v4l.org

run code in 300+ PHP versions simultaneously
<pre> <?php interface Greetable{ public function sayHello(); public function sayBye(); } interface Happyble{ public function sayHello(); } class Person implements Greetable, Happyble{ //CONCLUSIÓN: # 1. Las clases que implementen una interfaz implementar TODOS los métodos definidos en ellas! # 2. No pueden pasar de public a private de ninguna forma (herencia, interfaces) private $name = "Rowinson Gallego Medina"; public function sayHello(){ echo "Hello, $this->name!\n\n"; } public function sayBye(){} } $a = new Person(); $a->sayHello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tgBSq
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Cpre%3E%0A'
   12     1        DECLARE_CLASS                                            'person'
   24     2        NEW                                              $1      'Person'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   25     5        INIT_METHOD_CALL                                         !0, 'sayHello'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function sayhello

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

End of function saybye

End of class Greetable.

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

End of function sayhello

End of class Happyble.

Class Person:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tgBSq
function name:  sayHello
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ROPE_INIT                                     3  ~2      'Hello%2C+'
          1        FETCH_OBJ_R                                      ~0      'name'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '%21%0A%0A'
          4        ECHO                                                     ~1
   19     5      > RETURN                                                   null

End of function sayhello

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

End of function saybye

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.72 ms | 1395 KiB | 13 Q