Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85860 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98360 invoked from network); 18 Apr 2015 14:25:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2015 14:25:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=geolim4@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=geolim4@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.177 as permitted sender) X-PHP-List-Original-Sender: geolim4@gmail.com X-Host-Fingerprint: 209.85.216.177 mail-qc0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:35655] helo=mail-qc0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/91-12030-34962355 for ; Sat, 18 Apr 2015 10:25:08 -0400 Received: by qcbii10 with SMTP id ii10so38125273qcb.2 for ; Sat, 18 Apr 2015 07:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=drHx3Bd39stodjY6NIaRb9Xzy3LZVY+piUlBN72Mlos=; b=BZT2iXhpwMIsSMIn6/gmW57+9DoaKd4kAQL/px6PfsLt6DJVf4+C1pgLw09u17qMCS pd6AfcgXrP3AB6pnL0n/e+Oua25/Km0VMse8VGiAVqoBf1ZxjMLTBsPCjyTTncpUPgzn 8IvSCMX+QPfOzf3X3Ds9yf+vjnKkO0tP7+UZ/20M5acaoHPRbrIFFPJCH3xGChXV9X6r QbRInUtzY204vsIKYk2h7bJAHXqmv7gtAPFdcMYdyhfYy69Oif72pzjAA+RjJBqZvYXe VQFsEn23O04ap9laklWHHiQNo5nQ/xPEMq/dS02MAFo0MHJ6eYGqZLM+UPcdmWI1AWtN JjcA== X-Received: by 10.140.20.150 with SMTP id 22mr9217223qgj.26.1429367105163; Sat, 18 Apr 2015 07:25:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.94.42 with HTTP; Sat, 18 Apr 2015 07:24:34 -0700 (PDT) Date: Sat, 18 Apr 2015 16:24:34 +0200 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=001a11c124bc8e98300514007606 Subject: RFC: spl_autoload_register() should provide kind of entity to load From: geolim4@gmail.com (georges) --001a11c124bc8e98300514007606 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E2=80=8BHi php internals, Currently spl_autoload_register() pass the name of the class entity to the first *Callable* argument=E2=80=8B, but there is now way (as i far i know) = to know what kind of entity we're looking for. -Class ? -Interface ? -Trait? A second argument should be added to the *Callable* function describing what kind of entity we're looking for. Example: In fact i think currently that Autoload is too much "class oriented" as per reading php docs, whereas that php currently allow the autoload of many entities. It can really confuse probies php developers :( *Pros*: - -Avoid multiple else if() for testing an existing file to load the entity. - -As we now know the type of entity to load, it help reduce I/O activity, then reduce timespend. - -Clarify the code: We now what the autoloader will load - -Keep the BC safe *Cons*: - -None Regards, Georges.L --001a11c124bc8e98300514007606--