#21849 [Ver->Csd]: self::constant doesn't work as method's default parameter

From: Date: Mon, 10 Feb 2003 09:46:10 +0000
Subject: #21849 [Ver->Csd]: self::constant doesn't work as method's default parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32632@lists.php.net to get a copy of this message
ID: 21849 Updated by: zeev@php.net Reported By: sebastian@php.net -Status: Verified +Status: Closed Bug Type: Zend Engine 2 problem Operating System: Windows 2000 PHP Version: 5CVS-2003-01-23 (dev) Previous Comments: ------------------------------------------------------------------------ [2003-02-09 09:57:27] moriyoshi@php.net Related to bug #18926 ------------------------------------------------------------------------ [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

« previous php.bugs (#32632) next »