rfc:callableconstructors

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:callableconstructors [2016/02/25 16:45]
danack Under Discussion
rfc:callableconstructors [2017/09/22 13:28] (current)
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 (external edit)