Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16710 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42706 invoked by uid 1010); 15 Jun 2005 22:12:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42691 invoked from network); 15 Jun 2005 22:12:40 -0000 Received: from unknown (HELO hristov.com) (127.0.0.1) by localhost with SMTP; 15 Jun 2005 22:12:40 -0000 X-Host-Fingerprint: 85.92.69.73 iko.gotobg.net Linux 2.4/2.6 Received: from ([85.92.69.73:50026] helo=iko.gotobg.net) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 97/7B-20931-7D7A0B24 for ; Wed, 15 Jun 2005 18:12:39 -0400 Received: from [155.56.26.98] (helo=[155.56.26.98]) by iko.gotobg.net with esmtpa (Exim 4.50) id 1Dig7f-00062w-Kg; Thu, 16 Jun 2005 01:12:35 +0300 Message-ID: <42B0A7B8.7090606@hristov.com> Date: Thu, 16 Jun 2005 00:12:08 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050219 MIME-Version: 1.0 To: Lukas Smith CC: Stanislav Malyshev , internals@lists.php.net References: <42B03CF6.9000000@php.net> <42B0A237.9010005@php.net> In-Reply-To: <42B0A237.9010005@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] forward compatibility "public" in 4.4 From: php@hristov.com (Andrey Hristov) 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. > > regards, > Lukas > I started long ago to prepare code for PHP 5 migration by adding some hint comments /* abstract */ class FooBar { /* public */ var $public; /* protected */ var $protected; /* private */ var $private; /* private */ function __construct(/*PHP5*/$var) {} } When moving to PHP 5 simple search and replace does the job. All places marked with /*PHP5*/& are replaced with empty string - thus unnecessary references in the code are removed. The code base be easily preprocessed and one code base can be used in most cases to be run under 4 and 5. Andrey