At PHP we can manage objects and create objects from their classes. One of the first things we can do is create an empty object in PHP.
To create an empty object in PHP we are going to use the stdClass class. The stdClass class is the one that represents an empty object in PHP.
We will simply have to encode the following:
$myobject = new stdClass();
If we dump the content of the object through the console using the function var_dump we can check the structure of the variable and see that, indeed, it is an object.
object(stdClass)#1 (0) { }
Our variable $myobject will already be converted to an empty object at PHP and from this moment on we can assign the properties we want.
We create properties using the assignment operator -> as follows:
$myobject->property = "value";
What use would you find in creating an empty object in PHP?
