#38121 [Bgs->Opn]: class is considered not defined before it is declared

From: Date: Mon, 17 Jul 2006 09:00:42 +0000
Subject: #38121 [Bgs->Opn]: class is considered not defined before it is declared
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99523@lists.php.net to get a copy of this message
ID: 38121 User updated by: public at grik dot net Reported By: public at grik dot net -Status: Bogus +Status: Open -Bug Type: SPL related +Bug Type: Feature/Change Request Operating System: * PHP Version: 5.1.4 New Comment: Thank you! "It's not a bug - it's a feature" :-) Actually, it is a documentation issue and I'll comment it. May I convert it to a feature request? Previous Comments: ------------------------------------------------------------------------ [2006-07-17 07:57:27] tony2001@php.net It doesn't depend on SPL, that happens with all interfaces and it's expected. ------------------------------------------------------------------------ [2006-07-17 07:05:19] helly@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . ------------------------------------------------------------------------ [2006-07-17 01:36:33] public at grik dot net Description: ------------ I am not sure already what is it related to, but it's getting interesting :) The engine does not recognise the class that implements the ArrayAccess interface as declared in the code written before the class declaration is placed. Reproduce code: --------------- <?php var_dump(class_exists('validatorCheck')); class validatorCheck implements ArrayAccess { function offsetGet($key){} function offsetSet($key, $value) {} function offsetUnset($key) {} function offsetExists($offset) {} //class end } var_dump(class_exists('validatorCheck')); ?> Expected result: ---------------- bool(true) bool(true) Actual result: -------------- bool(false) bool(true) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38121&edit=1

« previous php.bugs (#99523) next »