rfc:callableconstructors

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
rfc:callableconstructors [2016/02/25 16:45] – Under Discussion danackrfc:callableconstructors [2016/02/25 22:19] – DokuWiki tags danack
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.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1