Re: Re: constant() - php5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Barnett wrote:
Actually, thanks for pointing out this function to me because I never even knew that it existed. You learn something new every day.

I have to admit that a warning seems a little unusual given that an undefined variable would result in only an E_NOTICE. Especially since the default behavior for an undefined constant (anywhere except for this function) is an E_NOTICE. Seems like you may have found a bug to report.

<?php

/* Causes E_WARNING */
echo constant(UNDEFINED_CONSTANT);

The above is wrong, use:
echo constant('UNDEFINED_CONSTANT');

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux