#21849 [Ver]: self::constant doesn't work as method's default parameter
| From: | moriyoshi@php.net | Date: | Sun, 09 Feb 2003 15:57:28 +0000 |
| Subject: | #21849 [Ver]: self::constant doesn't work as method's default parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32568@lists.php.net to get a copy of this message | ||
ID: 21849
Updated by: moriyoshi@php.net
Reported By: sebastian@php.net
Status: Verified
Bug Type: Zend Engine 2 problem
Operating System: Windows 2000
PHP Version: 5CVS-2003-01-23 (dev)
New Comment:
Related to bug #18926
Previous Comments:
------------------------------------------------------------------------
[2003-01-23 16:51:05] sebastian@php.net
<?php
class Foo {
const Bar = 'Foobar';
function foobar($foobar = Foo::Bar) {
echo $foobar;
}
}
$o = new Foo;
$o->foobar();
?>
works, but
<?php
class Foo {
const Bar = 'Foobar';
function foobar($foobar = self::Bar) {
echo $foobar;
}
}
$o = new Foo;
$o->foobar();
?>
does not and prints "Fatal error: Undefined class 'self' in c:\test.php
on line 5".
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21849&edit=1