|
Posted by Michael G on 11/15/86 11:22
"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:g0dde11uu4j8d9jrgdh1onv5vt8dj8raf3@4ax.com...
> On Tue, 26 Jul 2005 16:03:28 -0600, "Michael G" <mike-g@montana.com>
> wrote:
>
>>> But you're not writing in other languages, you're writing in PHP where
>>> it's
>>> valid syntax, so where's the problem?
>>
>>Between my ears!!
>>
>>Just because the php interpreter doesn't barf doesn't necessarliy mean
>>that
>>it is defined behavior. I have ran across this before with different
>>implementations of compilers, undefined behavior that is.
>
> It's valid in Perl, and PHP's roots are in Perl :-)
>
> The Objects page in the manual has an example of creating an object with
> just:
>
> $cart = new Cart;
>
> ... no parens.
>
> The definition of new (T_NEW) in Zend/zend_language_parser.y:425 (in PHP
> 4.4.0's source) looks to me like it accepts a variable - so "new
> $className" is
> fine.
ok. thanks. but if you start trying to add parameters using concatenation
then the interpreter doesn't like that.
for example:
new $a."(".$paren.")" //this does not work
Mike
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
[Back to original message]
|