Quantcast
Channel: PHP | Canned Atropine!!
Viewing all articles
Browse latest Browse all 33

Abstract properties in PHP

$
0
0

What are abstract properties? There are abstract methods but the notion of an abstract property seems a bit ridiculous. Why so, you might ask! Well, the thing is, methods are declared & defined (not necessarily at same time). So you can declare a method without actually defining it (ie., no body, no set of commands which it will execute) and the same can be defined at a later stage. But there is no such thing as defining a property of a class; properties are always declared as containers of data which reserve a space in memory on class initialization.


Viewing all articles
Browse latest Browse all 33

Trending Articles