LonghornPHP 2026

Voting

: min(two, nine)?
(Example: nine)

The Note You're Voting On

php-note-2003-june-18 at ryandesign dot com
23 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