Object-Oriented Programming in PHP
Learn all about modern object-oriented programming in PHP in this course. You'll learn from simple object manipulation to advanced language structures.
In this course, we'll go into the whys and hows of object-oriented programming. We'll list the advantages of OOP's and get familiar with working with it.
Written by David Capka
In this lesson, we'll go over how OOP works and create our first object-oriented application in PHP.
Written by David Capka
In this lesson, we'll add attributes to our objects and introduce you to the 3 main magic methods: constructor, destructor, and toString.
Written by David Capka
Solved programmer tasks in PHP on classes, attributes, methods, and constructors. Tasks are ordered by difficulty. Solutions available for download.
Written by David Capka
Lesson 4
Encapsulation in PHP
In this lesson, we'll explain the principle of encapsulation in PHP, add private attributes to our class, and program a sleeping mechanism for our humans.
Written by David Capka
In this lesson, we're going to create our very first object-oriented component in PHP - an Image gallery.
Written by David Capka
After this lesson, you'll understand how PHP handles reference data types (objects) and how they differ from the primitive ones.
Written by David Capka
Solved programmer tasks in PHP on topics encapsulation, files and folders, references. Tasks are ordered by difficulty. Solutions available for download.
Written by David Capka
Lesson 7
Inheritance in PHP
In this lesson, you'll learn how inheritance works in PHP. We'll call a parent constructor, introduce you to the protected modifier and extend our objects.
Written by David Capka
In the lesson, we'll go even deeper into object-oriented programming. We'll go over polymorphism, method overriding, final attributes, and autoloader.
Written by David Capka
Solved programmer tasks in PHP on inheritance and polymorphism. Tasks are ordered by difficulty. Solutions are available for download.
Written by David Capka
Lesson 9
Static class members in PHP
In object-oriented lesson, we'll introduce you to static class members in PHP, which are an important part of most applications.
Written by David Capka
In this object-oriented programming lesson, we'll continue working with static class members in PHP, and learn to declare constants.
Written by David Capka
In this lesson, we'll wrap up with static members in PHP. We'll go over static registers, database wrappers and consider when to use static members.
Written by David Capka
Solved programmer tasks in PHP on static class members and constants. Tasks are ordered by difficulty. Solutions are available for download.
Written by David Capka
In the lesson, we'll program an object-oriented hit counter in PHP using the PDO database driver and static database wrapper.
Written by David Capka
In the lesson, we'll finish up with our PHP hit counter using the PDO database driver and static database wrapper.
Written by David Capka
Solved programmer tasks in PHP on databases and PDO. Tasks are ordered by difficulty. Solutions are available for download.
Written by David Capka
Lesson 14
Interfaces in PHP
In this object-oriented programming lesson, we'll teach you how to use interfaces and the instanceof operator.
Written by David Capka
In this lesson, we'll keep going with interfaces as well as introduce you to abstract classes. You'll learn to implement and delegate interfaces.
Written by David Capka
In this lesson, we'll put our knowledge of OOP in PHP to the test by using interfaces to create a guestbook and modular captchas.
Written by David Capka
Lesson 17
Guestbook in PHP - continuation
In this lesson, we're going to finish our PHP guestbook and change it's captcha implementation to image-based responses using our modular interface.
Written by David Capka
Lesson 18
Exceptions in PHP
In this tutorial, we're going to cover what exceptions are in OOP. We'll show you how try-catch blocks work and how exceptions make PHP apps more readable.
Written by David Capka
Lesson 19
Exceptions in PHP pt. 2
In tutorial, we'll explain the relationship between exceptions and OOP design, the types of built-in PHP exceptions, and how to react to exceptions.
Written by David Capka
In this tutorial we're going to create our own exceptions, we'll explain propagation of exceptions and finally block.
Written by David Capka
In the tutorial, we're going to finish our contact e-mail form in PHP using OOP using exceptions to handle user errors and finish up with exceptions.
Written by David Capka
Solved programmer tasks in PHP on interfaces, abstract classes, and exceptions. Tasks are ordered by difficulty. Solutions are available for download.
Written by David Capka
Lesson 22
Magic methods in PHP pt. 2
In this tutorial about object-oriented programming in PHP, we're going to go over some more magic methods. Mainly, about getters and setters.
Written by David Capka
Lesson 23
Date and Time in PHP using OOP
In this tutorial, we're going work with date and time in an object-oriented way using the DateTime and DateInterval PHP classes. We'll also format dates.
Written by David Capka
Solved programmer tasks in PHP on date, time and magic methods. Tasks are ordered by difficulty. Solutions are available for download.
Written by David Capka
Lesson 24
ArrayAccess and cloning in PHP
In this tutorial, we're going to treat objects like arrays by implementing the ArrayAccess interface. We'll also teach you how to clone objects.
Written by David Capka
Lesson 25
Namespaces in PHP
In this tutorial, we're going to teach you how to use namespaces to make big projects more readable. We'll show you importing, aliases, and autoloading.
Written by David Capka
Lesson 26
TypeHinting and documentation in PHP
In the final tutorial, we're going to show you how to automatically check data types using TypeHinting, and learn how to document projects properly.
Written by David Capka
Solved programmer tasks in PHP on cloning, namespaces and documentation. Tasks are ordered by difficulty. Solutions are available for download.
Written by David Capka