rfc:object-model-improvements

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:object-model-improvements [2011/03/03 14:11] martinscottarfc:object-model-improvements [2011/03/03 14:12] martinscotta
Line 28: Line 28:
     * 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 + <?php 
-namespace Foo { + namespace Foo { 
-class Baz {}  + class Baz {}  
-+
-namespace Test {  + namespace Test {  
-use \Foo\Baz;+ use \Foo\Baz;
  
- interface Marker {} + interface Marker {} 
-class Bar implements Marker {}+ class Bar implements Marker {}
  
-var_dump( Marker::CLASS ); // string "Test\Marker" + var_dump( Marker::CLASS ); // string "Test\Marker" 
-var_dump( Baz::CLASS ); // string "Foo\Baz" + var_dump( Baz::CLASS ); // string "Foo\Baz" 
-var_dump( Bar::CLASS ); // string "Test\Bar" + var_dump( Bar::CLASS ); // string "Test\Bar" 
-}+ }
       </code>       </code>
   - errors into exceptions   - errors into exceptions
Line 48: Line 48:
    * Better stacks dump    * Better stacks dump
       <code php>       <code php>
-try { + try { 
- include $file; // as of today we just die here + include $file; // as of today we just die here 
-} catch(PHPParseException $e) { + } catch(PHPParseException $e) { 
- echo $e->getMessage(); + echo $e->getMessage(); 
- throw new DomainException($e); + throw new DomainException($e); 
-}+ }
       </code>       </code>
  
rfc/object-model-improvements.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1