rfc:callableconstructors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:callableconstructors [2016/02/25 14:04] danackrfc:callableconstructors [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: Callable Constructors ====== ====== PHP RFC: Callable Constructors ======
-  * Version: 0.9+  * Version: 1.0
   * Date: 2016-02-25   * Date: 2016-02-25
   * Author: Dan Ackroyd, Danack@php.net   * Author: Dan Ackroyd, Danack@php.net
-  * Status: Draft+  * Status: Under Discussion
   * First Published at: https://wiki.php.net/rfc/callableconstructors   * First Published at: https://wiki.php.net/rfc/callableconstructors
  
Line 146: Line 146:
  
 class A { class A {
-    public function %%__%%construct() {+    public function __construct() {
         return "Why would you even do this.";         return "Why would you even do this.";
     }     }
          
     public function foo() {     public function foo() {
-        $fn = [self::class, '%%__%%construct'];+        $fn = [self::class, '__construct'];
         // Calling directly as a callable like:         // Calling directly as a callable like:
         // $result = $fn();         // $result = $fn();
         // Correctly fails with the error message:         // Correctly fails with the error message:
-        // Error: Non-static method A::%%__%%construct() cannot be called statically+        // Error: Non-static method A::__construct() cannot be called statically
                  
         // However calling with 'call user function', is erroneously allowed.         // However calling with 'call user function', is erroneously allowed.
rfc/callableconstructors.1456409047.txt.gz · Last modified: 2017/09/22 13:28 (external edit)