Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91321 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7746 invoked from network); 19 Feb 2016 13:09:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2016 13:09:48 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:42230] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/F6-44579-A1417C65 for ; Fri, 19 Feb 2016 08:09:48 -0500 Received: from [127.0.0.1] (unknown [82.240.16.115]) (Authenticated sender: flaupretre@free.fr) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 9C1B14B0173; Fri, 19 Feb 2016 14:06:42 +0100 (CET) To: Nikita Popov , PHP internals References: Message-ID: <56C71411.7020508@php.net> Date: Fri, 19 Feb 2016 14:09:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 160219-0, 19/02/2016), Outbound message X-Antivirus-Status: Clean Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 7.1 From: francois@php.net (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) Hi, Le 18/02/2016 13:41, Nikita Popov a écrit : > > This RFC is incomplete -- I'm posting it now so people can suggest other > things that should be deprecated. I expect it to grow over time and don't > plan to vote on it in the immediate future. May I suggest to remove the second argument of spl_autoload() ? spl_autoload() is typically called from the PHP core only, and the core never sets this argument. File extensions to consider are set using spl_autoload_extensions(). So, the 2nd argument of spl_autoload() is useless and probably never used anywhere. The problem with this argument is that it creates an annoying issue when thinking about a way to extend autoloading to other symbol types (namely functions and constants). The easiest way to extend autoloading to other types is to add an optional second argument to autoloaders. For a perfect BC, the core would call an autoloader for non-class symbols only if the function accepts 2 arguments. This way, we can achieve full backwards and forward compatibility with existing autoloaders. The pre-requisite is that currently existing autoloaders take only one arg, hence my suggestion to remove the second argument of spl_autoload() (spl_autoload() will remain a class-only autoloader). Regards François