On 5 May 2010 12:16, Adam Harvey <ahar...@php.net> wrote: > On 5 May 2010 19:01, Steven Van Poeck <svanpo...@gmail.com> wrote: >> Right. That's what I meant by inconsistent code. The call >> $logs->getSQLLogger()->logSql("...") would function I presume. >> The reason your example code does not is because it is inconsistent. You're >> calling $logs->getSqlLogger() instead of $logs->getSQLLogger() > > Agreed, but not everyone's going to spot that first time, particularly > the sorts of newer programmers we get quite a lot of writing PHP. > Also, the error message you get out the other end is suboptimal, to > say the least. > > I've been holding out on stating my reasoning much beyond my initial > post and vote to try avoiding influencing anyone, but I'm opinionated, > so here goes. :) > > Here's an example of my problem with enforcing case-sensitivity in > general that builds on something Johannes said yesterday on IRC: how > many people use different cases for the gd functions? Taking, say, > imagestring as a simple example and having a quick look at Google Code > Search, the variants people are using there are: > > ImageString: about 3000 results [0] > imagestring: about 4000 results [1] > imageString: 453 results [2] > IMAGESTRING: 1 result [3] > > There are probably other variations in use too, and that's one of the > more simply named functions in gd. > > The above example pretty much sums up why I went for option 1 instead > of 2 in my vote: it's still a BC break, but I honestly thing it's > going to be a much more minor break (remember, it only affects people > in certain Western European locales such as French, Spanish and German > who are _also_ using single-byte encodings — most Linux distros I know > of are shipping with UTF-8 as a default, so they're already > effectively case-sensitive for non-ASCII characters) than changing the > entire language and probably causing issues in a wide variety of > applications. > > If I was designing the language anew, sure, I'd go for > case-sensitivity the whole way, but as things stand, I'm pretty > dubious it would work out. > > Adam > > [0] > http://www.google.com.au/codesearch?as_q=%22ImageString%22&btnG=Search+Code&hl=en&as_lang=php&as_license_restrict=i&as_license=&as_package=&as_filename=&as_case=y > [1] > http://www.google.com.au/codesearch?as_q=imagestring&btnG=Search+Code&hl=en&as_lang=php&as_license_restrict=i&as_license=&as_package=&as_filename=&as_case=y > [2] > http://www.google.com.au/codesearch?as_q=imageString&btnG=Search+Code&hl=en&as_lang=php&as_license_restrict=i&as_license=&as_package=&as_filename=&as_case=y > [3] > http://www.google.com.au/codesearch?as_q=IMAGESTRING&btnG=Search+Code&hl=en&as_lang=php&as_license_restrict=i&as_license=&as_package=&as_filename=&as_case=y > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
_IF_ case sensitivity is going to be incorporated and the BC is too great, is the following an option. 1 - Introduce case sensitivity with an option to allow a fallback to the existing mechanism. 2 - Generate an E_NOTICE or an E_STRICT to inform developers/users of the issue. 3 - Stick with the fallback for a while until it is removed (introduced in 5.x then drop in 7.x). Alternatively, only activate case sensitivity if E_STRICT is set. If a developer is creating E_STRICT code, I doubt that they are sloppy with their case. E_STRICT is documented as "Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code.". Which seems a perfect fit. -- ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php