|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2385 using $variables as default value in a function doen't work
Submitted: 1999-09-26 14:36 UTC Modified: 1999-09-27 01:09 UTC
From: webmaster at retroplay dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 2 OS: Linux Slackware 4.0, Kernel 2.12
Private report: No CVE-ID: None
 [1999-09-26 14:36 UTC] webmaster at retroplay dot com
PHP reports a "parser error" in a function (at the very start of it) when I specified a default value and it is another variable (not null).
For example
#function UltimiGiorni($tabella,$foo="no",$quanti="$voci_per_pagina")
doens't work (parser error)
function UltimiGiorni($tabella,$foo="no",$quanti=0)
is OK.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-27 01:09 UTC] cslawi at cvs dot php dot net
This isn't a bug; it just doesn't work that way. For one thing, should the 
default be the value as evaluated when the function is parsed, or it's 

For more information, see the manual:

For ways around this, see:

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 02:01:24 2019 UTC