Defining class variables with a space
<p>I'm trying to make a class which has object names with a space in between. Just so I can access them like this:</p>

<pre><code>$object-&gt;{'Var name with spaces'};
</code></pre>

<p>I've read <a href="http://stackoverflow.com/questions/6649410/mysql-php-return-object-value-with-space-in-key">this topic over here</a> and now know how to access those variables, but I'm not sure how to create a class with these variables. I've tried something like this, but I can't get it to work:
</p>

<pre><code>class Hotel
{
    public ${'Var name with spaces'} = 'Some value'; // Fails
}
</code></pre>

<p>How would I go and create variables in a class definition containing spaces?</p>
