Quick search:


What is a default

A default is a generic value that is used when a more specific value is not available

A simple example:

class Dog {
function getColor() {
    if (isSet($this->color)) return $this->color;
    return "brown";
    }
}
Here the default color for dogs is "brown".

With default reasoning it is not a value that has a default, but some behavior. This term comes from Artificial Intelligence research. The most common example of default reasoning in object orientation is inheritance: when a class does not define a certain method of its own, a method with the same name of its parent class is used. Thus, the behavior of the child class defaults to the behavior of the parent class.

Default reasoning is used extensively in phpPeanuts: A propertyDescriptor produces default behavior for a property if there is no getter method, the user interfacing framework produces a default page if there is no special page class defined, it uses a default US-style number format if no number format has been defined, etc. etc.