Hello Greg,

Wednesday, April 20, 2005, 5:11:46 AM, you wrote:

> Hi all,

> I just spent quite a while searching the archives, and can't find any 
> explanation of why this code worked in 5.0.3 but doesn't in 5.0.4:

> <?php
> class blah {
>      protected function __construct(){}
> }
?>>

> Could someone please enlighten me?  I was using this for a singleton 
> pattern, and so it would be nice to know why it is so critical for the 
> engine to be anal retentive here.  It seems to me that it should be up 
> to the programmer to decide how easily the object can be instantiated, 
> unless there is a deeper engine stability issue.

> Thanks,
> Greg


At least it works for 5.0.5-dev:
[EMAIL PROTECTED] /usr/src/php-cvs $ php -r 'class T { protected function 
__construct() {} static function test() { return new T;} } var_dump(T::test());'
make: `sapi/cli/php' is up to date.
object(T)#1 (0) {
}
[EMAIL PROTECTED] /usr/src/php-cvs $ ../PHP_5_0/sapi/cli/php -r 'class T { 
protected function __construct() {} static function test() { return new T;} } 
var_dump(T::test());'
object(T)#1 (0) {
}
[EMAIL PROTECTED] /usr/src/php-cvs $ ../PHP_5_0/sapi/cli/php -v
PHP 5.0.5-dev (cli) (built: Apr  7 2005 17:24:12) (DEBUG)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

but i currently cannot reproduce it with 5.0.4, sorry.

-- 
Best regards,
 Marcus                            mailto:[EMAIL PROTECTED]

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

Reply via email to