ConFoo Montreal 2026: Call for Papers

Voting

: one plus two?
(Example: nine)

The Note You're Voting On

php-note-2003-june-18 at ryandesign dot com
22 years ago
Xavier's example is rather complicated, and his task would be much more simply accomplished by using classes. Define a base class to do the basic functions open, dump, and close, and create extension classes to override whatever behavior.

class foo {
function open() {
// Default functionality for open()
}
function dump() {
// Default functionality for dump()
}
function close() {
// Default functionality for close()
}
}

class bar extends foo {
function open() {
// Override functionality of open()
}
// dump() and close() remain as in class foo
}

<< Back to user notes page

To Top