Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77130 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96598 invoked from network); 10 Sep 2014 05:59:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2014 05:59:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.171 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 209.85.212.171 mail-wi0-f171.google.com Received: from [209.85.212.171] ([209.85.212.171:58790] helo=mail-wi0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/F0-24203-EA8EF045 for ; Wed, 10 Sep 2014 01:59:11 -0400 Received: by mail-wi0-f171.google.com with SMTP id hi2so5601677wib.10 for ; Tue, 09 Sep 2014 22:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=441HDBCWNqRdF9SgwLD54xkWzB6DCBgXZkMIj0raacI=; b=BqWXCyY/unO1DlGuyPpLTMw3ZD9e3DXySmH8sezs2aL6enJ//CsGAwkSCsso/PjMOR yOed1DyoQEx3cuqOMfHZTlBjy9G7daMjs4ah2Pb8DCKbxvjgSLdySbMIAFowG4U1AtUB DjO/kUKqmlUcSN5zJzKkV8sIvugHVsypRdu/MAiYXQLyRnARJFp33gpFQygW59DZL+Ba nG3GOJJRB/Nc2bqy9MD2eymRQYULmO2EC6llyYf+HR4Oa7aLkQEG22oAR7kXGHt33YBg ZAo342cWw7wIc9NuOCgEJ8ET6VvlbrD5+oX400EFmCc81Uib8o1xA4dCoOTLM2/IYbPe zpbg== MIME-Version: 1.0 X-Received: by 10.180.90.6 with SMTP id bs6mr35048284wib.47.1410328747438; Tue, 09 Sep 2014 22:59:07 -0700 (PDT) Received: by 10.194.42.137 with HTTP; Tue, 9 Sep 2014 22:59:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 10 Sep 2014 09:59:07 +0400 Message-ID: To: Tjerk Meesters Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Deprecated functions From: lisachenko.it@gmail.com (Alexander Lisachenko) Hi! Maybe it will be better to do this in another way: introduce an RFC to add 'deprecated' keyword into the syntax like 'final' or 'protected'. There are many frameworks that want to deprecate some methods or classes. Currently it's only possible via "@deprecated" tag in the phpDoc-block, but this tag doesn't influence on method invocation, so no warnings are generated. Symfony uses trigger_error($message, E_USER_DEPRECATED) explicitly in deprecated methods to trigger this warning (see https://github.com/symfony/symfony/pull/6180), but this is not a transparent solution. This can be look like this: class Test { deprecated protected $someProperty; deprecated public function foo() {} public function bar() {} } deprecated class OldStuff {} deprecated function someOldFunction() {} This RFC will give more control over 'deprecated' functionality and can be easily tested. Thoughts? 2014-09-10 9:42 GMT+04:00 Tjerk Meesters : > Hi, > > When I was fixing test cases on my `kill-ereg` branch I noticed a Reflect= ion test case for `ReflectionFunction::isDeprecated()`. > > The problem with such a test case is that you=E2=80=99d be chasing deprec= ated functions to tests against as we move along; this is the current list = of deprecated functions as taken from a typical 5.4 installation: > > Since 4.1.0: call_user_method, call_user_method_array > Since 4.3.7: mysql_list_tables, mysql_listtables > Since 5.3 : ereg, ereg_replace, eregi, eregi_replace, split, spliti, sql= _regcase, mysql_db_query, magic_quotes_runtime, set_magic_quotes_runtime, s= et_socket_blocking > Since 5.4 : mysql_list_dbs > > The above are, as far as I=E2=80=99m concerned, all potential candidates = for removal in PHP 7, so in order to reliably test a deprecated function I = would suggest introducing a hidden function with this signature: > > void __deprecated__() { } > > And mark that function as eternally deprecated using the ZEND_ACC_DEPRECA= TED flag. > > Thoughts?