From: random at sinfusion dot com
Operating system: Windows 2000
PHP version: 5.0.0b4 (beta4)
PHP Bug Type: Scripting Engine problem
Bug description: Class constants don't work as class function parameter defaults
Description:
------------
Constants declared within a class are not recognized as such when used as
function parameter default values for functions within the class.
Reproduce code:
---------------
class TestConstants
{
const CONST_1 = 1;
function test ($param = CONST_1)
{
echo $param;
}
}
$test = new TestConstants();
$test->test();
Expected result:
----------------
1
Actual result:
--------------
Notice: Use of undefined constant CONST_1 - assumed 'CONST_1' in
f:\dev\Web\pervercity.com\test\testconstants.class.php on line 8
CONST_1
--
Edit bug report at http://bugs.php.net/?id=27523&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27523&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27523&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27523&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27523&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27523&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27523&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27523&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27523&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27523&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27523&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27523&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27523&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27523&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27523&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27523&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27523&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27523&r=float