[ phpeclipse-Bugs-1151909 ] Paser fails for functions containing function call defaults
"SourceForge.net" <[email protected]> Fri, 30 Mar 2007 18:51:44 -0700
| Newsgroups | gmane.comp.ide.eclipse.phpeclipse.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1151909, was opened at 2005-02-25 13:18
Message generated for change (Comment added) made by scorphus
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1151909&group_id=57621
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: PHP Parser
Group: None
>Status: Deleted
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Paser fails for functions containing function call defaults
Initial Comment:
The internal PHP parser does recognise variables who's
default is the result of a function call as valid
syntax. PHP itself executes these fine
In the example below PHPEclipse thinks that "time()" is
an error.
<?php
function PrintBabyBorn($strName,$uxtDateBorn = time())
{
echo("$strName was born on ".date('d/m/Y')."\n");
}
?>
My PHPEclipse core version is 1.1.2
----------------------------------------------------------------------
>Comment By: Pablo Aguiar (scorphus)
Date: 2007-03-30 22:51
Message:
Logged In: YES
user_id=987242
Originator: NO
There may be very few (or only one) functions one can use when assigning a
function's default parameters (I know of array(), but maybe there are a few
others, but that's another story) and it does not include time(). So, this
is not a bug and is now deleted.
I think that the way the PHP parser works for array definition allows it
to be used on default parameters.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2005-04-27 13:47
Message:
Logged In: NO
If I'm running the above script with:
c:\xampp\php\php -l -f
I get a parser error with PHP version 5.0.2:
"syntax error, unexpected '(', expecting ')'.... on line 3"
So I don't think this is a bug.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2005-02-25 13:52
Message:
Logged In: NO
Sorry, for "Paser" read Parser.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1151909&group_id=57621
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV