Static Properties & Methods In Object Oriented PHP - Full PHP 8 Tutorial

Your video will begin in 10
73 Views
Published
In the first section of the course, you learned about variable scopes & static variables. In this lesson, you will learn about static properties & methods of the class with some use cases including singleton & factory design patterns. There are few differences between static properties & non-static properties, one is that static properties are associated & belong to the class itself & not to any particular object, while non-static properties are associated & belong to the object. So when you create an object, that object gets fresh values for the non-static properties. Another difference is that you need to use the dollar sign when accessing static properties, unlike regular properties where you don't use the dollar sign to access non-static properties.

SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
Category
Program With Gio
Tags
advanced php course, learn php the right way, object oriented php
Be the first to comment