Re: [PHP] Unexpected behaviour from define()

2010-06-25 Thread Richard Quadling
On 24 June 2010 22:41, James Long p...@umpquanet.com wrote: ?php error_reporting(-1); ini_set('display_errors', 1); define( 'LOG_NORMAL', 0 ); define( 'LOG_WARNING', 1 ); define( 'LOG_ERROR', 2 ); echo 'LOG_NORMAL ' . LOG_NORMAL . \n; echo 'LOG_WARNING ' . LOG_WARNING . \n; echo 'LOG_ERROR

Re: [PHP] Unexpected behaviour from define()

2010-06-25 Thread James Long
Thank you very much! Once I realized the source of the problem, I was dismayed that one could declare a constant and have the interpreter absolutely ignore it without warning. I already had error_reporting to E_ALL in php.ini, so was unaware of what else I could do. Didn't think to look for

[PHP] Unexpected behaviour from define()

2010-06-24 Thread James Long
Perhaps I am missing something basic here. Why does the LOG_WARNING constant take on a value of 4, when it is defined with a value of 1? Thank you! Jim $ cat bug.php ? define( 'LOG_NORMAL', 0 ); define( 'LOG_WARNING', 1 ); define( 'LOG_ERROR', 2 ); echo 'LOG_NORMAL ' . LOG_NORMAL . \n;

Re: [PHP] Unexpected behaviour from define()

2010-06-24 Thread Tim Schofield
On 24/06/10 22:41, James Long wrote: Perhaps I am missing something basic here. Why does the LOG_WARNING constant take on a value of 4, when it is defined with a value of 1? Thank you! Jim $ cat bug.php ? define( 'LOG_NORMAL', 0 ); define( 'LOG_WARNING', 1 ); define( 'LOG_ERROR', 2 );

Re: [PHP] Unexpected behaviour from define()

2010-06-24 Thread Ashley Sheridan
On Thu, 2010-06-24 at 23:02 +0100, Tim Schofield wrote: On 24/06/10 22:41, James Long wrote: Perhaps I am missing something basic here. Why does the LOG_WARNING constant take on a value of 4, when it is defined with a value of 1? Thank you! Jim $ cat bug.php ? define(

Re: [PHP] Unexpected behaviour from define()

2010-06-24 Thread Tim Schofield
On 24/06/10 23:08, Ashley Sheridan wrote: On Thu, 2010-06-24 at 23:02 +0100, Tim Schofield wrote: Very strange, as ? define( 'LOG_NORMAL', 0 ); define( 'LOG_WARNiNG', 1 ); define( 'LOG_ERROR', 2 ); echo 'LOG_NORMAL ' . LOG_NORMAL .\n; echo 'LOG_WARNiNG ' . LOG_WARNiNG .\n; echo