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

Michael Kimsal's Blog:
Bizarre PHP behaviour
Feb 16, 2006 @ 20:40:59

In a new post on his blog today, Michael Kimsal looks at an abnormality that he's disocvered with constants in PHP.

Chalk this up as par for the course in the world of PHP, but it doesn't behave as documented. I noticed today that @ work someone is creating database connections, then define()ing the result into a constant. I presumed this was failing silently and because we were generally connecting to only one database (or so I thought initially) that it was simply using the last open connection and still working.

This does *not* throw an error, but does in fact work. Even going back to PHP 4.3.2 (earliest I've checked). This flies in the face of my understanding of constants for years - well, since 1998 (perhaps earlier) or so.

the issue - that a resource can be assigned to a constant - seems to contradict what's listed in the manual, and he asks later if there are others out there that have seen this same issue...

tagged: bizarre behavior assign resource to constant bizarre behavior assign resource to constant

Link:

Michael Kimsal's Blog:
Bizarre PHP behaviour
Feb 16, 2006 @ 20:40:59

In a new post on his blog today, Michael Kimsal looks at an abnormality that he's disocvered with constants in PHP.

Chalk this up as par for the course in the world of PHP, but it doesn't behave as documented. I noticed today that @ work someone is creating database connections, then define()ing the result into a constant. I presumed this was failing silently and because we were generally connecting to only one database (or so I thought initially) that it was simply using the last open connection and still working.

This does *not* throw an error, but does in fact work. Even going back to PHP 4.3.2 (earliest I've checked). This flies in the face of my understanding of constants for years - well, since 1998 (perhaps earlier) or so.

the issue - that a resource can be assigned to a constant - seems to contradict what's listed in the manual, and he asks later if there are others out there that have seen this same issue...

tagged: bizarre behavior assign resource to constant bizarre behavior assign resource to constant

Link:

PHPEverywhere:
PHP 5.1 - The Bazaar Is Sometimes Bizarre
Nov 28, 2005 @ 11:50:01

John Lim looks at the release of PHP 5.1 with a bit more skeptical eye in his latest blog post today.

Well PHP 5.1.0 is out. This is a monumental piece of work, and congratulations to the PHP 5 internals team for all the hard work. However it feels rushed through the door. Apparently there are compatibility problems (with typecasting when parameter passing, the prototype date class, and possibly other stuff.) Wait for the patches.

He also mentions some of the turmoil that's been going on on the PHP internals mailing list lately, especially pre-5.1 release...

tagged: 5.1 bazaar bizarre internals mailing list 5.1 bazaar bizarre internals mailing list

Link:

PHPEverywhere:
PHP 5.1 - The Bazaar Is Sometimes Bizarre
Nov 28, 2005 @ 11:50:01

John Lim looks at the release of PHP 5.1 with a bit more skeptical eye in his latest blog post today.

Well PHP 5.1.0 is out. This is a monumental piece of work, and congratulations to the PHP 5 internals team for all the hard work. However it feels rushed through the door. Apparently there are compatibility problems (with typecasting when parameter passing, the prototype date class, and possibly other stuff.) Wait for the patches.

He also mentions some of the turmoil that's been going on on the PHP internals mailing list lately, especially pre-5.1 release...

tagged: 5.1 bazaar bizarre internals mailing list 5.1 bazaar bizarre internals mailing list

Link:


Trending Topics: