Membership
Main Menu
Forum Boards
Stats
- 20 tutorials
- 74,815 members
- 734,935 forum posts
- 13 blog posts
Tutorials
OO PHP Part 1: OOP in Full Effect
Views: 43566
Introduction
On the old site, I started a series of tutorials named "PHP Application Design". I planned for at least three parts, and while I did publish the first two and wrote at least half of part three, I found myself out of time to make it to the finish.
Still dedicated to writing reusable and extensible PHP code and spreading the knowledge, this is a restart of the series, renamed as simply "OO PHP". So:
Welcome to part one of the "OO PHP" series.
This article is an overview of what PHP has to offer with respect to OOP, with examples on how to use these concepts.
If you have wanted to grasp OOP, but haven't come around to learning it, this article is for you. If you've read some "Hello World" in OOP tutorial, gotten familiar with OOP syntax but are interested in learning more, this article is for you too.
A couple of things have changed in this tutorial. First off, PHP 4 examples and references have been stripped. PHP 4 is dead, let’s look to the future. In that same frame of mind, this tutorial now has some brief coverage of namespaces and late static binding, introduced in PHP 5.3. Finally, the last chapter from the original has been stripped, or rather moved to a future part of the series.
Index
1. The Very Basics
1.1 A tiny bit of theory
1.2 Hold on, read this disclaimer first
1.3 Absolute basic syntax
2 Defining how objects should behave
2.1 Classes
2.2 Inheritance
2.3 Constructors
2.4 Scope Resolution Operator
2.5 Abstract Classes
3 Beyond the Absolute Basics
3.1 Object Handles
3.2 Interfaces
3.3 Autoload
3.4 Destructors
3.5 Visibility
3.6 Class Constants
3.7 Type Hinting
3.8 Exceptions
3.9 The Final Keyword
3.10 More Magic Methods
3.10.1 Object Overloading
3.10.2 Object cloning
3.10.3 Serialization
3.10.4 Other
3.11 Object Iteration
4. Hot off The Press Features
4.1 Namespaces
4.2 Late static binding
In conclusion
