Re: PHP 5.3.8 Released!

From: Date: Thu, 25 Aug 2011 04:58:05 +0000
Subject: Re: PHP 5.3.8 Released!
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
For the record, I'd like to point out I do need the new behaviour.
In 5.3.6 you need reflection to check if a class implements an interface.
You also need to check is_subclass_of AND compare the lowercased classes.
All that is about 5 times slower than is_a in 5.3.8.

Probably it should be class_is_a() instead of altering is_a() behaviour,
but the need to match class names against each other is pretty much real.

Sincerely yours, Aleksandr.

On Aug 25, 2011, at 05:51, [email protected] wrote:

> I'm not sure it's possible to get agreement on if this is a bug or not, you might see
> a bug, I just see this as a pointless change for consistency that pretty much nobody will ever need
> or use.
> 
> I think I'll leave it as
> a) no bug was ever reported on the previous behaviour.
> 
> b) intended "design" of is_subclass_of  was originally to return false on non-object
> - andrei (1999)
> http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=17245&r2=17272
> <http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=17245&r2=17272>
> 
> c) is_a() was introduced by sebastian (2002) and kept this intended behaviour
> http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=67102&r2=69234
> <http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=67102&r2=69234>
> 
> d) when andrey (2004) proposed the change to accepts strings on  is_subclass_of, he
> deliberately maintained the existing behaviour for is_a()
> http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=170604&r2=171349
> <http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=170604&r2=171349>
> 
> e) is_a() has a valid use case , and is currently reasonably commonly used.
> 
> d) the new behaviour is an uncommon use case, and can be done very easily in other ways.
> 
> 
> BTW. we could really do with a searchable archive of php.dev + internals... - It's pretty
> difficult to find out if this was ever discussed before..
> 
> Regards
> Alan



Thread (54 messages)

« previous php.internals (#54914) next »