]> granicus.if.org Git - php/commitdiff
- Add some comment
authorMarcus Boerger <helly@php.net>
Mon, 1 Nov 2004 21:06:42 +0000 (21:06 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 1 Nov 2004 21:06:42 +0000 (21:06 +0000)
ext/standard/array.c

index 7a4af9a8fdbfc654e435ade53ee4e91ce611c068..3a6eeffb1e7e49140777d4dae1df50cfbe7dcd66 100644 (file)
@@ -326,6 +326,7 @@ PHP_FUNCTION(count)
                        break;
                case IS_OBJECT: {
 #if HAVE_SPL
+                       /* it the object implements Countable we call its count() method */
                        zval *retval;
 
                        if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
@@ -335,6 +336,7 @@ PHP_FUNCTION(count)
                                return;
                        }
 #endif
+                       /* if not we return the number of properties (not taking visibility into account) */
                        if (Z_OBJ_HT(*array)->count_elements) {
                                RETVAL_LONG(1);
                                if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value) TSRMLS_CC)) {