codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php class Foo { protected function bar() { echo __METHOD__ . "\n"; } } class Baz extends Foo { function qux() { $this->bar(); // Baz extends Foo, so it inherits bar(), but it is not overriding it parent::bar(); } } $baz = new Baz(); $baz->qux();
Private
[
?
]
Run code
Submit