Posted by Andy Hassall on 11/15/10 11:22
On Tue, 26 Jul 2005 14:43:36 -0600, "Michael G" <mike-g@montana.com> wrote:
>>> function create($className) {
>>> return new $className;
>>> }
>>>
>>> Not sure if it's a better solution though.
>>>
>>
>> That's not a bad idea. It would eliminate the need for an array of
>> strings.
>
>Just a note, some languages would not allow that. That makes me a bit
>uncomfortable. They would require an explicit open/closed paran at a
>minimum.
But you're not writing in other languages, you're writing in PHP where it's
valid syntax, so where's the problem?
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
[Back to original message]
|