cvs: php-src /ext/standard array.c
| From: | Andrei Zmievski | Date: | Sat, 05 Mar 2005 00:45:48 +0000 |
| Subject: | cvs: php-src /ext/standard array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-30718@lists.php.net to get a copy of this message | ||
andrei Fri Mar 4 19:45:48 2005 EDT
Modified files:
/php-src/ext/standard array.c
Log:
Check that object can actually return a class entry. I need this for a
class-entry-less helper objects that should not be present in the class
table.
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.291&r2=1.292&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.291 php-src/ext/standard/array.c:1.292
--- php-src/ext/standard/array.c:1.291 Fri Feb 18 08:37:23 2005
+++ php-src/ext/standard/array.c Fri Mar 4 19:45:47 2005
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.291 2005/02/18 13:37:23 derick Exp $ */
+/* $Id: array.c,v 1.292 2005/03/05 00:45:47 andrei Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -323,7 +323,7 @@
/* it the object implements Countable we call its count() method */
zval *retval;
- if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
+ if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array),
spl_ce_Countable TSRMLS_CC)) {
zend_call_method_with_0_params(&array, NULL, NULL, "count", &retval);
RETVAL_LONG(Z_LVAL_P(retval));
zval_ptr_dtor(&retval);
@@ -331,7 +331,7 @@
}
#endif
/* if not we return the number of properties (not taking visibility into account) */
- if (Z_OBJ_HT(*array)->count_elements) {
+ if (Z_OBJ_HT_P(array)->count_elements) {
RETVAL_LONG(1);
if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value)
TSRMLS_CC)) {
return;