Table of Contents

Request for Comments: Object Model Improvements

Introduction

The purpose of RFCs is to improve the current PHP5 object model.

Why do we need this

Actual PHP5 object model provides the basic for Object Oriented programming but it lacks for support for library or third parties developers.

New Features

Constructors

Magic methods

class / interface

namespace Foo {
	class Baz {} 
}
namespace Test { 
	use \Foo\Baz;
 
	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"
}
 

errors into exceptions

try {
	include $file; // as of today we just die here
} catch(Exception $e) {
	echo $e->getMessage();
	throw new DomainException($e);
}
 

Changelog