Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55911 invoked from network); 18 Nov 2014 23:11:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2014 23:11:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.171 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.171 mail-ob0-f171.google.com Received: from [209.85.214.171] ([209.85.214.171:43351] helo=mail-ob0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/39-06737-712DB645 for ; Tue, 18 Nov 2014 18:11:20 -0500 Received: by mail-ob0-f171.google.com with SMTP id uz6so1487416obc.16 for ; Tue, 18 Nov 2014 15:11:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=dbLJYR55qD+Fq05zw28RYbjRldPJhzicKWow9OWa2Mk=; b=CDl+uW6Gyx81Y2cTfxie3eAm9bv8q4aGgZ+MnqOi9QxL+Z54xCkg2JjXQbGTDHKQbj 3Vcv8DeD8M4zuJ0T7D12ck+S63idqwxH9SItjDPecnRMdTSr/h4s7ChyloTO6bMTwt7J 3tYO5AYbRXPATgpqCwvJjNFGfpq+e+YPhJRHnNvVZltO8wIjbPn+PBcEzIxJzY5jRW4L 56g6THLjmYI+JmaXq5U/NI5UNzs+9EVLQUfbA1fn1MczslFKHdVY07FZiGYCRkzNUM0G xSwcC4MhKTbwdFGKE2g5eDk8fNBGBD9SgzUgaDfYmuS+pfu/KRXciU2bYmIRa3eMSaAL 7qDA== MIME-Version: 1.0 X-Received: by 10.202.79.142 with SMTP id d136mr1981051oib.71.1416352277463; Tue, 18 Nov 2014 15:11:17 -0800 (PST) Sender: morrison.levi@gmail.com Received: by 10.76.89.237 with HTTP; Tue, 18 Nov 2014 15:11:17 -0800 (PST) Date: Tue, 18 Nov 2014 16:11:17 -0700 X-Google-Sender-Auth: KXHrWzgsBnBhzsqY7OIveL7iKuY Message-ID: To: internals Content-Type: text/plain; charset=UTF-8 Subject: [RFC] Remove PHP 4 Constructors From: levim@php.net (Levi Morrison) Dear Internals, I am proposing an RFC[1] to remove PHP 4 constructors in PHP 7. If accepted, methods with the same name as their defining class will no longer be recognized as constructors. As noted in the RFC, there are already many situations where we do not recognize these methods as constructors, such as in namespaces and traits and when `function __construct` is also present. Andrea Faulds has kindly written a utility that identifies when a PHP 4 constructor is defined[2]. It does not automatically change the code for liability reasons. The utility PHPMD[3] can also detect this but has a false positive when `__construct` is also defined. Cheers, Levi Morrison [1]: https://wiki.php.net/rfc/remove_php4_constructors [2]: https://github.com/TazeTSchnitzel/PHP4_Constructor_Finder [3]: http://phpmd.org/rules/naming.html#constructorwithnameasenclosingclass