Posted by Michael Fesser on 01/31/07 20:01
..oO(crater)
>A question naturally arises from this. Is there a way to do the
>following?...
>
>[code]
>$link1 = new htmlElement("a")->setAttribute("name", "value");
>
> or
>
>($link1 = new htmlElement("a"))->setAttribute("name", "value");
>[/code]
>
>It's not an issue. I'm just curious.
Nope. PHP's syntax doesn't allow that. You could write a function that
creates and returns the new object, something like
$link = createHtmlElement('a')->setAttribute(...);
Micha
[Back to original message]
|