News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Wez Furlong's Blog:
Undefined Behaviour
April 29, 2006 @ 07:59:43

Spurred on by some comments made in a thread on the php internals mailing list, Wez Furlong has posted this new item on his blog to help clear up some of the confusion around some "undefined behaviour" in the PDO libraries.

In this thread on the php internals list, Kevin is asking why the handling of whitespace in certain PDO DSNs is inconsistent. I go on to point out that the manual doesn't say anything about whitespace in DSNs, and that all the documented examples have no whitespace around the DSN parameters.

This is an example of undefined behaviour. The PHP manual doesn't define what happens when you put whitespace in there. That doesn't tell you anything at all about whether you should or should not do that. It might work now, and it might work next week. In 6 months time, when you application is widely deployed and someone changes an apparently unrelated part of their system, it might NOT work and might result in someone getting paged at 3am trying to figure out what the mysterious problem is.

Wez goes on to mention that there are some issues with this in the Solaris manual pages as well, as based on others running into this same sort of problem. The realy key here, though, is how the documenttion is defined. Developers, in his opinion, show always treat situations that aren't expressly defined by the manual as a "situation is undefined" rather than making their own expectations.

0 comments voice your opinion now!
undefined behaviour pdo library documentation solaris undefined behaviour pdo library documentation solaris


blog comments powered by Disqus

Similar Posts

Christopher Kunz's Blog: Building PHP with cURL and libmysqlclient5

Jim Wynia's Blog: WebDAV, PHP and You

Jim Plush's Blog: MyBic Ajax/PHP 0.6.5 Released

Wez Furlong\'s Blog: I\'ve arrived at Forum PHP

Eirik Hoem's Blog: VCL/PHP followup


Community Events





Don't see your event here?
Let us know!


framework community tool security podcast update introduction mvc library laravel language opinion interview series release symfony voicesoftheelephpant package version composer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework