cvs: ZendEngine2(PHP_5_0) / zend_builtin_functions.c
| From: | Andi Gutmans | Date: | Tue, 26 Oct 2004 23:25:34 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_0) / zend_builtin_functions.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3109@lists.php.net to get a copy of this message | ||
andi Tue Oct 26 19:25:34 2004 EDT
Modified files: (Branch: PHP_5_0)
/ZendEngine2 zend_builtin_functions.c
Log:
- MFH
http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.239.2.11&r2=1.239.2.12&ty=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.239.2.11
ZendEngine2/zend_builtin_functions.c:1.239.2.12
--- ZendEngine2/zend_builtin_functions.c:1.239.2.11 Tue Oct 12 18:22:06 2004
+++ ZendEngine2/zend_builtin_functions.c Tue Oct 26 19:25:34 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.239.2.11 2004/10/12 22:22:06 helly Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.239.2.12 2004/10/26 23:25:34 andi Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -603,12 +603,21 @@
ZEND_WRONG_PARAM_COUNT();
}
- if (Z_TYPE_PP(obj) != IS_OBJECT) {
+ if (only_subclass && Z_TYPE_PP(obj) == IS_STRING) {
+ zend_class_entry **the_ce;
+ if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &the_ce TSRMLS_CC) == FAILURE) {
+ zend_error(E_WARNING, "Unknown class passed as parameter");
+ RETURN_FALSE;
+ }
+ instance_ce = *the_ce;
+ } else if (Z_TYPE_PP(obj) != IS_OBJECT) {
RETURN_FALSE;
+ } else {
+ instance_ce = NULL;
}
/* TBI!! new object handlers */
- if (!HAS_CLASS_ENTRY(**obj)) {
+ if (Z_TYPE_PP(obj) == IS_OBJECT && !HAS_CLASS_ENTRY(**obj)) {
RETURN_FALSE;
}
@@ -618,7 +627,11 @@
retval = 0;
} else {
if (only_subclass) {
- instance_ce = Z_OBJCE_PP(obj)->parent;
+ if (!instance_ce) {
+ instance_ce = Z_OBJCE_PP(obj)->parent;
+ } else {
+ instance_ce = instance_ce->parent;
+ }
} else {
instance_ce = Z_OBJCE_PP(obj);
}