Reply to Re: factory pattern in php

Your name:

Reply:


Posted by Andy Hassall on 11/15/98 11:22

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.

--
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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация