Hi!

> If constructors had always been callable in PHP, this would be a
> standard thing to do and not controversial imo. It's only due to
> reasons lost in the mists of time, that object instantiation can only
> be invoked via 'new' that it's not possible currently, and so needs an
> RFC to change.

Constructors have always been callable in PHP and still are. They are
functions like any other. What you need is a factory method, not a
constructor - constructor is called to initialize object, not create it.
But you can create factory methods at will, you just don't have to call
it __construct.

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to