Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26789 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10951 invoked by uid 1010); 4 Dec 2006 14:23:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10936 invoked from network); 4 Dec 2006 14:23:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2006 14:23:10 -0000 Authentication-Results: pb1.pair.com header.from=urbanose@gmail.com; sender-id=pass; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=urbanose@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.187 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: urbanose@gmail.com X-Host-Fingerprint: 64.233.182.187 nf-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.182.187] ([64.233.182.187:18166] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/32-29296-B2F24754 for ; Mon, 04 Dec 2006 09:23:10 -0500 Received: by nf-out-0910.google.com with SMTP id l35so4764398nfa for ; Mon, 04 Dec 2006 06:22:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=kp46lfcL3OjIee/Y15TaINVctOys9ficGdE1XaaU+4O8wk/kvwCJ645oc6Mq3oOnZVn7Gf3310ewThI7yYWP6mOfiIEy/WhCA+nqtfYNjhH4P4WLdUEZ4yoFLGr1XTEBnv2I4mM3DChxlMRrMFg6CGqNKLcs3FVGryVifGxtXko= Received: by 10.48.220.15 with SMTP id s15mr20642543nfg.1165242152327; Mon, 04 Dec 2006 06:22:32 -0800 (PST) Received: from ?10.0.0.250? ( [82.66.216.107]) by mx.google.com with ESMTP id d2sm48888204nfe.2006.12.04.06.22.31; Mon, 04 Dec 2006 06:22:32 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-ID: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: internals@lists.php.net Date: Mon, 4 Dec 2006 15:22:15 +0100 X-Mailer: Apple Mail (2.752.3) Subject: Making a method called "list" or other "language constructs" names. From: urbanose@gmail.com (Urbanose) Hello there :] I wanted to build a method called "list". The problem is that once I do that, I get a "PHP Parse error: syntax error, unexpected T_LIST, expecting T_STRING" error, because it's a "language construct". Here's the code that leads me to this error : list(); ?> So I made it working with a "__call" magic method, like this : list(); ?> And it works. So there's my question : why can't we make methods with the same name as those used by "language constructs" ? I don't see the point. Even less if you can make it work with the __call magic method. Does someone have an explanation ? Is there a way to make this possible for future versions of PHP, so that the classes namespace is really independent ? Don't tell me to use another name. Writting code like : $books->list('all'); or : class Books extends Controller { function list () { # Instructions to list all books } } makes things so much easier to read and self explanatory than putting, for example, a "_" in front of it (_list). Thanks :] Urbanose