note 68176 deleted from language.oop5.interfaces by felipe

From: Date: Tue, 11 Dec 2007 01:04:36 +0000
Subject: note 68176 deleted from language.oop5.interfaces by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133350@lists.php.net to get a copy of this message
Note Submitter: Grigori Kochanov ---- The engine does not recognise the class that implements an interface as declared in the code written before the class declaration is placed. This means that you can't place the declaration of a classes that implements an interfaces in the code beneath the creation of an instance. Tony2001 said this is an expected behaviour of Zend engine. Back to PHP 3 ;-) <?php var_dump(class_exists('validatorCheck')); //you don't write $obj = new validatorCheck() here class validatorCheck implements ArrayAccess { function offsetGet($key){} function offsetSet($key, $value) {} function offsetUnset($key) {} function offsetExists($offset) {} //class end } var_dump(class_exists('validatorCheck')); //an instance can be created only here ?> Result: bool(false) bool(true)

« previous php.notes (#133350) next »