I have created a class in a php file in the following way:
class thingy {
...
var $property;
...
}
Once the class is created (in a separate file which I’m including) I do the following:
$mything = new thingy();
$mything->$property = 5;
(this is an example with modified var and property names, but it’s the same code except those names, and the fact that I’m only showing one property here.)
I get the following output when displaying the page, and it’s not loading anymore (the header and footer are not showing, just a weird output).
I get something like this whenever I load the page:
‹$A Ã0ï}…^ÐÐKÁøè+t‘ †D²ŠéïÓÓ³›ŠÃ’©ä7Àîêi)yØID¨Vîø²ø‚¹û Mà–ö ]†c$³Þ‚g"Õh*•>q<í°9 *p6á)¾ÖuVéÿÿÿ»-¶†
When I remove the line where I’m trying to set a property, my page loads alright. I’m stuck.
You don’t need the second ‘$’. That is trying to set a variable whose name is the value of $property.