|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-05-09 03:52 UTC] derick@php.net
[2001-05-09 05:02 UTC] hholzgra@php.net
[2003-08-11 16:21 UTC] destes at ix dot netcom dot com
[2010-11-24 13:53 UTC] jani@php.net
-Summary: class functions & PHP core
functions inconsistently clash ;)
+Summary: Allow using list, new, etc. as
class method names
-Package: Feature/Change Request
+Package: Scripting Engine problem
-Operating System: Linux
+Operating System: *
-PHP Version: 4.0.4pl1
+PHP Version: *
[2012-06-05 22:59 UTC] nikic@php.net
[2012-06-05 22:59 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
Okay.. this has been bugging me for a while.. consider the following: class test { function mail () { print ("Bah\n"); } function fopen () { print ("Bah\n"); } function new () { print ("Bah\n"); } function list () { print ("Bah\n"); } } $temp = new test; $temp->mail(); etc, etc.. This will generate a parse error (expecting `T_STRING') until the new() and list() functions are removed from the class. mail() and fopen() will work. Now.. my question is why the inconsistency? Is there some super-secret reasoning behind not letting me name my classes' objects the same as only a few predefined functions? I'm lazy.. you guys took all the good function names.. why must you tease me with them?!