Or logs full of this:
PHP Notice: Undefined index: alpha PHP Notice: Undefined index: bravo PHP Notice: Undefined index: delta
"In computer programming, a scope is the context
within a computer program in which an identifier is in effect, and can be
resolved to an entity – when the entity is visible."
http://en.wikipedia.org/wiki/Scope_(computer_science)
See also: Variable Scope in the PHP manual
Conclusion: We need a level of scope beyond the global namespace and individual function scope.
Objects!
"Encapsulation is used to refer to one of two related but distinct notions, and sometimes to the combination thereof:
A language mechanism for restricting access to some of the object's components.
A language construct that facilitates the bundling of data with the methods (or other functions) operating on that data."
http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)
See also: The Basics in the PHP manual
"Each person is three people in one: the person everyone sees, the person only close family and friends see, and the person only they see."
(Most likely paraphrased) Chinese proverb
See also: Visibility in the PHP manual
See also: Constants in the PHP manual
"Inheritance is a way to establish is-a relationships between objects."
http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)
parent::getTotal()
calls this method defined in this class.
See also: Object Inheritance in the PHP manual
"The primary usage of polymorphism... is the
ability of objects belonging to different types to respond to method, field, or
property calls of the same name, each one according to an appropriate
type-specific behavior."
http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming
See also: Type Hinting in the PHP manual
"Abstraction is the process by which data and programs are defined with a representation similar in form to its meaning (semantics), while hiding away the implementation details... a concept or idea not associated with any specific instance."
See also: Class Abstraction in the PHP manual
"Design by contract... is an approach for designing software. It prescribes that software designers should define formal, precise and verifiable interface specifications for software components... These specifications are referred to as 'contracts,' in accordance with a conceptual metaphor with the conditions and obligations of business contracts."
See also: Object Interfaces in the PHP manual
See also: ArrayAccess in the PHP manual
See also: Iterator in the PHP manual
"Don't Repeat Yourself (DRY) is a principle of software development aimed at reducing repetition of information of all kinds... is stated as 'Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.'"
"Multiple inheritance is a feature... in which a class can inherit... features from more than one superclass. It is distinct from single inheritance, where a class may only inherit from one particular superclass."
http://en.wikipedia.org/wiki/Multiple_inheritance
"A mixin is a class which contains a combination of methods from other classes... not by inheritance... Mixins encourage code reuse and avoid well-known pathologies associated with multiple inheritance.
http://en.wikipedia.org/wiki/Mixin
"Traits are a mechanism for code reuse... by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies... and avoids the typical problems associated with multiple inheritance and mixins.
http://www.php.net/manual/en/language.oop5.traits.php
"Don't over-complicate this: traits are compiler-assisted copy-and-paste."
Rasmus Lerdorf, almost definitely paraphrased
See also: Traits in the PHP manual and the horizontal reuse RFC
"Object composition... is a way to combine simple objects or data types into more complex ones."
http://en.wikipedia.org/wiki/Object_composition
"Composition over inheritance... is a technique by which classes may achieve polymorphic behavior and code reuse by containing [instances of] other classes that implement the desired functionality instead of through inheritance.
More on this DIC implementation at pimple.sensiolabs.org
Example lifted from the PSR-0 standard
Check out this blog post on autoloading strategies
Use a script like this one to generate the classmap during your build process
See also: Comparing Objects
See also: Object Cloning and Objects and references in the PHP manual
See also: Object Serialization in the PHP manual
See also: Exceptions
"Do not meddle in the affairs of dragons for you are crunchy and taste good with ketchup"
"Magic" has the same connotation as "interesting" in the Chinese proverb.
Use these sparingly, intentionally, and with great hesitation.
See also: Magic Methods in the PHP manual
Please rate my talk!
Also, check out the joind.in mobile apps!