Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16712 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52426 invoked by uid 1010); 15 Jun 2005 22:26:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 52411 invoked from network); 15 Jun 2005 22:26:23 -0000 Received: from unknown (HELO lerdorf.com) (127.0.0.1) by localhost with SMTP; 15 Jun 2005 22:26:23 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:46178] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id BB/FC-20931-F0BA0B24 for ; Wed, 15 Jun 2005 18:26:23 -0400 Received: from [207.126.233.18] (rasmus2.corp.yahoo.com [207.126.233.18]) (authenticated bits=0) by colo.lerdorf.com (8.13.4/8.13.4/Debian-3) with ESMTP id j5FMQArm012555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 15 Jun 2005 15:26:10 -0700 Message-ID: <42B0AB02.7010803@lerdorf.com> Date: Wed, 15 Jun 2005 15:26:10 -0700 User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rasmus Lerdorf CC: Lukas Smith , Stanislav Malyshev , internals@lists.php.net References: <42B03CF6.9000000@php.net> <42B0A237.9010005@php.net> <42B0A969.6000404@lerdorf.com> In-Reply-To: <42B0A969.6000404@lerdorf.com> X-Enigmail-Version: 0.91.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] forward compatibility "public" in 4.4 From: rasmus@lerdorf.com (Rasmus Lerdorf) Rasmus Lerdorf wrote: > Lukas Smith wrote: > >>Stanislav Malyshev wrote: >> >> >>>I wonder what was the original purpose of PHP5 emitting warning when >>>seeing 'var'? What are you basically saying now is "I want PHP4 code >>>that wouldn't have messages on my class vars if run in PHP5". But I'm >>>sure there was some idea behind these warnings, not? >> >> >>There was a reason. So that people who mark things "var" because there >>was no true PPP available will be notified that they are using >>deprecated syntax. To quote Andi "It was meant to help people find var's >>so that they can be explicit about the access modifiers." >> >>So to me it seems if I have no private/protected, but only public >>properties I would like to be able to preempt a needless warning as I >>migrade to PHP5. >> >>I dont agree however we should make protected and private simply behave >>as var in PHP 4.x as this would indeed just undermine the entire point >>of the E_STRICT warning. > > > Right. To me PHP4 OO code with explicit var declarations are public > declarations, because that is what var means. I find most code I look > at that has something that the developer might want to make private in > PHP5 are not explicitly declared with var. > > Of course, I am not actually seeing this warning right now, so maybe > this has gone away? Or what am I missing? > > error_reporting(E_ALL|E_STRICT); > ini_set('display_errors',1); > > class foo { > var $prop; > function foo($arg) { > $this->_private = $arg; > $this->prop = $this->_private * 10; > } > } > $a = new foo(14); > echo $a->prop; > > I am not seeing an E_STRICT from this. Uh, never mind, I had restarted the Apache. Of course you need this in your php.ini to catch compile-time stuff. -Rasmus