Bug #13315 Updated: problem with function definitions

From: Date: Sat, 15 Sep 2001 09:28:14 +0000
Subject: Bug #13315 Updated: problem with function definitions
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-65997@lists.php.net to get a copy of this message
ID: 13315 Updated by: mfischer Reported By: php@altemachtige.reageerttochniet.nl Old Status: Open Status: Bogus Bug Type: *General Issues Operating System: WIN98/APACHE1.3.19 PHP Version: 4.0.4pl1 New Comment: Shouldn't. Default values must be constant expressions. Not a bug, bogusified. - Markus Previous Comments: ------------------------------------------------------------------------ [2001-09-15 05:11:56] php@altemachtige.reageerttochniet.nl <?php $foo = 'foo'; function showvar( $bar = $foo ) { //global $foo //doesn't work either echo $bar; } showvar(); showvar('bar'); ?> gives me a parse error on line 3:( also: <?php $foo = 'foo'; function returnvar() { global $foo; return $foo; } function whatisvar( $bar = returnvar() ) { echo $bar; } ?> gives me this: Parse error: parse error, expecting `')'' in c:/path/to/script/test.php on line 9 Should work, shouldn't it? ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13315&edit=1

« previous php.dev (#65997) next »