Keeping Code Grounded in a Sea of Variables Class constants are similar to regular constants with the exception that they live inside the class. Class constants cannot be changed, hence the name constant. They’re declared using the const keyword and are allocated in memory once per class and not each time that you instantiate the object; this is what’s meant when you hear that constants live within the class. They resemble static variables in that sense, but static variables can be modified. To access the class constant, you need to use the class name and the scope resolution operator (double colon). Constants do not

Using Class Blueprints to construct real objects PHP has been an Object Oriented Language since PHP 5. It’s mature, powerful, and there should be no reason for anyone to hate on it any longer. In this article, I go over the differences between objects and classes, do a short introduction to object oriented programming concepts, and create a small introductory class showing class properties, methods, and local variables. Classes vs Objects Imagine that you’re constructing a building. Usually the architect, you as a programmer, will develop a blueprint, the class, and from that blueprint, a building will be constructed, the