Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55570 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90142 invoked from network); 21 Sep 2011 13:57:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2011 13:57:35 -0000 X-Host-Fingerprint: 96.2.18.191 host-191-18-2-96.midco.net Date: Wed, 21 Sep 2011 09:57:35 -0400 Received: from [96.2.18.191] ([96.2.18.191:10569] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/A0-17510-E4DE97E4 for ; Wed, 21 Sep 2011 09:57:35 -0400 Message-ID: <8C.A0.17510.E4DE97E4@pb1.pair.com> To: internals@lists.php.net References: <4E790B82.6090805@akbkhome.com> User-Agent: slrn/pre1.0.0-18 (Linux) X-Posted-By: 96.2.18.191 Subject: Re: is_a() - again - a better fix From: weierophinney@php.net (Matthew Weier O'Phinney) On 2011-09-20, Alan Knowles wrote: > Let's try and close this one. > > https://bugs.php.net/bug.php?id=55475 > > I've just added a patch that adds is_class_of(), which is identical to > is_subclass_of, and has the new feature of supporting strings and using > the autoloader. is_class_of() has a very different semantic meaning (in natural language) than is_subclass_of() -- I know I wouldn't expect the behavior it exhibits by looking at the name. > It then reverts is_a() back to the previous behavior, and clarifies the > documentation. Reverting at this point adds a BC break on top of a BC break. Yes, the original perhaps should not have happened (and likely wouldn't have, if people had actually been testing the RCs...), but I'll argue again: the new behavior is more correct. Reverting at this point is simply going to cause more headaches: "package X works for PHP versions X.Y - 5.3.6, and from 5.3.9 to 5.3.last" -- what a nightmare! > This solves the BC issues, and also solves potential security issues > with existing code accidentally passing $url's to the autoloader, and > gives anyone who needs this new behavior a solution. I'd argue that this fix also highlights the need for autoloaders to test their arguments to see if they are getting something that looks like a class name. > Let's at least try and respect the new release RFC, and our users who > appreciate PHP's efforts over the years to try and maintain BC. (it's > one of it's few advantages these days...) To respect the release RFC, we shouldn't introduce a new BC break (breaking behavior with something already released). -- Matthew Weier O'Phinney Project Lead | matthew@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc