php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13951 function named List() in class cause parse error
Submitted: 2001-11-06 06:10 UTC Modified: 2001-11-06 07:20 UTC
From: shelby at DownloadFAST dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.0.6 OS: FreeBSD 4.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: shelby at DownloadFAST dot com
New email:
PHP Version: OS:

 

 [2001-11-06 06:10 UTC] shelby at DownloadFAST dot com
I get parse error:

Parse error: parse error, expecting `T_STRING'

on line:

function List()

which is the beginning of a function within a class.  If I change the name to any thing else, then parse error goes away:

function Lists()

I don't know what to make of this error.  I even tried removing all the other code in the class, and still got the error.  Only changing the name to any thing but List() seems to fix it.

Is this an erroneous name space collision?  Is List() a reserved function name for class?

Let me know if you can't reproduce, then I'll have to find some time to extract an isolated simple example from my complex code base.

I hope I haven't reported something that will be obvious to me later, but I really think this must be a bug because how could changing the name affect the parsing error of a function declaration.

...excuse me... not too much sleep when I wrote this...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-06 07:20 UTC] jeroen@php.net
list is a language construct, see www.php.net/list (see also the reserved words appendix)

Not a bug
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 22:01:24 2019 UTC