The PHP Function Property_Exists
The php function property_exists is a boolean function that verifies the existence of a property in either an object or a class. It returns TRUE when the property exists, FALSE when it does not exist and NULL in case of an error.
PHP supports inheritance of both properties and methods in classes. This is a useful feature as it allows child classes to inherit all the public and protected properties/methods of the parent class without having to duplicate them. This makes code more reusable and reduces the amount of duplication in the codebase.
Private methods/properties are accessed only within the class in which they were declared or defined, this is different from the public keyword which allows properties/methods to be accessible across the entire PHP script being executed. The main difference between private and public is that private methods/properties cannot be inherited by child classes.
The __destruct() method is triggered automatically by PHP when an object is destroyed. This is a great feature as it allows you to clean up any resources that shouldn't be left around after an object has been destroyed.
The __get() magic method allows you to pass an object to another function as if it were a function. This is a great way to pass information between your application's components and allow them to interact with each other. The documentation on the __get() function does not mention that it can also be used to pass properties that have been added to the object at runtime.