Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29105 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56650 invoked by uid 1010); 29 Apr 2007 23:04:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56635 invoked from network); 29 Apr 2007 23:04:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2007 23:04:36 -0000 Authentication-Results: pb1.pair.com header.from=el7zndotcom@yahoo.com; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=el7zndotcom@yahoo.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain yahoo.com from 216.252.110.227 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: el7zndotcom@yahoo.com X-Host-Fingerprint: 216.252.110.227 web56303.mail.re3.yahoo.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [216.252.110.227] ([216.252.110.227:21854] helo=web56303.mail.re3.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FD/85-40858-08425364 for ; Sun, 29 Apr 2007 19:04:34 -0400 Received: (qmail 77155 invoked by uid 60001); 29 Apr 2007 23:04:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=LgBFE5t6vps5JBPONw8Lwdb5Bz1kej3N+EXzp7WZBqlmI2GI42NFEaI8nFrgwFmJC3CpHdFBkFKJOivam5LL/DPzSyWKGZB/ZlWbi/ozgxXqEyHzqiog6wPWCjPqiV2JCxQnlSGCjJ+Mer4JuGN6NzCVBDyw1u/ts3/5JiBzIvE=; X-YMail-OSG: _6WfhtkVM1lnbfvZ1LZ4BgCfAPCMuHGE5S465n9wkEfxFecNA_hTh0pT5iuvoClKBDsMJu9SJrTa6jfsykW5ZHxHoW8ej10GNeOXkwWDWr7jcnPaFa73hsBJnFbqdcLQmtO1rMIzN4A53PMsCOfY3W7zaQ-- Received: from [62.215.5.4] by web56303.mail.re3.yahoo.com via HTTP; Sun, 29 Apr 2007 16:04:30 PDT Date: Sun, 29 Apr 2007 16:04:30 -0700 (PDT) To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-72702567-1177887870=:75851" Content-Transfer-Encoding: 8bit Message-ID: <515493.75851.qm@web56303.mail.re3.yahoo.com> Subject: define and objects! From: el7zndotcom@yahoo.com (MaaSTaaR) --0-72702567-1177887870=:75851 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello ... Firstly sorry for my bad English, my friend request from me to send this suggestion for PHP developer. The suggestion is support use constant as object, for example : class HelloWorld { function start() { echo 'Hello World'; } } define('OBJ',new HelloWorld); OBJ->start(); this will be good when we use object inside class, we will not need use global or $this, for example. With normal way : class MainClass { function One() { echo 'One'; } function Two() { echo 'Two'; } } $Main = new MainClass; class AnotherClass { function P() { global $Main; // Note this line $Main->One(); } } With suggested way : class MainClass { function One() { echo 'One'; } function Two() { echo 'Two'; } } define('MAIN',new MainClass); class AnotherClass { function P() { MAIN->One(); // use it directlly without global or $this } } --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. --0-72702567-1177887870=:75851--