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

From: Date: Mon, 14 Apr 2014 12:21:15 +0000
Subject: Req #38121 [Opn->Nab]: class is considered not defined before it is declared
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185240@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=38121&edit=1 ID: 38121 Updated by: dm@php.net Reported by: public at grik dot net Summary: class is considered not defined before it is declared -Status: Open +Status: Not a bug Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: * PHP Version: 5.1.4 Block user comment: N Private report: N New Comment: nikic@php.net said: "interfaces are implemented at runtime" Previous Comments: ------------------------------------------------------------------------ [2006-07-17 09:00:41] public at grik dot net 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? ------------------------------------------------------------------------ [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 https://bugs.php.net/bug.php?id=38121&edit=1

« previous php.bugs (#185240) next »