Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77134 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12242 invoked from network); 10 Sep 2014 09:20:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2014 09:20:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.47 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.192.47 mail-qg0-f47.google.com Received: from [209.85.192.47] ([209.85.192.47:65237] helo=mail-qg0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/03-24203-2F710145 for ; Wed, 10 Sep 2014 05:20:50 -0400 Received: by mail-qg0-f47.google.com with SMTP id i50so4295797qgf.6 for ; Wed, 10 Sep 2014 02:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=Dz1AHVGkWcLCNglvhUcyzjhVVN/8c1GFSL/k29qvQjY=; b=RPtnG8hGIIMpI9T4rP3P2W7M3++0pS9FZonNoiwswVpKx7lBDNNIID2+SQSbnlQSCv P19HCCDgivJwFtan3E4xnuC1f0gDywRkmebvaMyLSn8mWeWIARXrV0KC+UvQTYiTAvJj flAIV5uJgtvaa5ABGTWR8aL/eXETi7KA8gzHlVdrymbBqwz/bTKN8zLmKXEP+8VHyt25 XmAfE8rFxhPLng05bBzFw8HrHKTBm4wLz+7Tig5RFiUJIq6/OYJ3ddNCwB2tPBUM74QO IuDKRDQ3YMR8XURWGO/3oc2knD5jKSybs09U5wGTVYVKbMV/Rpny8leZXkwAq2QlkDyT TkVg== MIME-Version: 1.0 X-Received: by 10.224.163.138 with SMTP id a10mr44327535qay.72.1410340847769; Wed, 10 Sep 2014 02:20:47 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.141.28.193 with HTTP; Wed, 10 Sep 2014 02:20:47 -0700 (PDT) In-Reply-To: References: Date: Wed, 10 Sep 2014 10:20:47 +0100 X-Google-Sender-Auth: 6dY-x32NY0oLNZU9Z97XRQUzj5k 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: cw@daverandom.com (Chris Wright) On 10 September 2014 06:42, Tjerk Meesters wrote= : > 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? An alternative could be this: --FILE-- isDeprecated()) { $func(); break; } } ?> --EXPECTF-- Deprecated: Function %s() is deprecated in %s on line %d ...although arguably this is testing the error rather than the reflection function. This also assumes that there will always be at least one deprecated function in the standard library, although I doubt this is likely to be an issue any time soon.