rfc:object-model-improvements

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:object-model-improvements [2011/02/25 22:46]
martinscotta
rfc:object-model-improvements [2017/09/22 13:28] (current)
Line 17: Line 17:
  
 ==== New Features ==== ==== New Features ====
-  - Constructors+=== Constructors ​===
     * Provide a default empty constructor (if applicable)     * Provide a default empty constructor (if applicable)
     * Remove the inheritance     * Remove the inheritance
     * Disallow directly calls to them     * Disallow directly calls to them
     * Ensure constructor call on parent classes     * Ensure constructor call on parent classes
-  - Magic methods:+=== Magic methods ​===
     * disallow directly call from outer context?     * disallow directly call from outer context?
     * markers interfaces     * markers interfaces
-  - class / interface+=== class / interface ​===
     * provide a magic constant with the fully qualified class name     * provide a magic constant with the fully qualified class name
-<code php> +      ​<code php> 
-<?php+namespace Foo { 
 + class Baz {}  
 +}
 namespace Test {  namespace Test { 
- class Bar {} + use \Foo\Baz; 
- var_dump( Bar::CLASS ); // string "​Test\Bar"​+ 
 + interface Marker {} 
 + class Bar implements Marker ​{} 
 + 
 + var_dump( Marker::​CLASS ); // string "​Test\Marker"​ 
 + var_dump( Baz::CLASS ); // string "​Foo\Baz"​ 
 + var_dump( Bar::CLASS ); // string "​Test\Bar"​ 
 +
 +      </​code>​ 
 +=== errors into exceptions === 
 +   * Improve PHP Exception class 
 +   * Remove errors/​warnings,​ throw an Exceptions instead 
 +   * Better stacks dump 
 +      <code php> 
 +try { 
 + include $file; // as of today we just die here 
 +} catch(Exception $e) { 
 + echo $e->​getMessage();​ 
 + throw new DomainException($e);​
 } }
-</​code>​+      ​</​code>​
  
 ===== Changelog ===== ===== Changelog =====
rfc/object-model-improvements.1298673998.txt.gz · Last modified: 2017/09/22 13:28 (external edit)