return objects on the fly in php
<p>I know this can be done in javascript like so: </p>

<pre><code>function doSomething(){
    var something, something_else, another_thing;

    // do something with these vars

    return {
        attribute1 : something,
        array1 : [
            something_else,
            another_thing
        ]
    }
}
</code></pre>

<p>can it be done in php?</p>
