Constant Bite

Written by Harald Ponce de Leon on May 18, 2006

It looks like we have to use another compatibility function due to inconsistencies between PHP versions.

For PHP versions below 4.3.5, defined() returns an integer (1 or 0), whereas from 4.3.5 onwards it returns a boolean (true or false).

This makes it impossible for us to use the following:

if (defined('CONSTANT') === true) {
...
}

A note has been added to the PHP documentation page to warn others of this inconsistency.

Relevant bug report:

http://bugs.php.net/bug.php?id=27443

Leave a Comment

You must be logged in to post a comment.


Trademark Policy | Copyright Policy | Sitemap

Copyright © 2000-2008 osCommerce. All rights reserved.
Webmaster: Harald Ponce de Leon (Impressum)