com php-src: Reverted to 5a0da281e5a9fa02db18b4822d8b103c65849fa9 Discussion: http://news.php.net/php.cvs/76836: NEWS ext/standard/array.c
ext/standard/tests/array/bug67064.phpt

From: Date: Sun, 13 Apr 2014 21:01:31 +0000
Subject: com php-src: Reverted to 5a0da281e5a9fa02db18b4822d8b103c65849fa9 Discussion: http://news.php.net/php.cvs/76836: NEWS ext/standard/array.c
ext/standard/tests/array/bug67064.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-76837@lists.php.net to get a copy of this message
Commit:    beda5093b490e80f631f14555bba7216c284a2c3
Author:    Bob Weinand <bobwei9@hotmail.com>         Sun, 13 Apr 2014 23:01:31 +0200
Parents:   f07e37c96dd395305fe81192f2edbc8860e41d5d
Branches:  PHP-5.4

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=beda5093b490e80f631f14555bba7216c284a2c3

Log:
Reverted to 5a0da281e5a9fa02db18b4822d8b103c65849fa9
Discussion: http://news.php.net/php.cvs/76836

Changed paths:
  M  NEWS
  M  ext/standard/array.c
  D  ext/standard/tests/array/bug67064.phpt


Diff:
diff --git a/NEWS b/NEWS
index 3e33c16..2061110 100644
--- a/NEWS
+++ b/NEWS
@@ -8,8 +8,6 @@ PHP                                                                        NEWS
     UNIX sockets). (Mike)
   . Fixed bug #66182 (exit in stream filter produces segfault). (Mike)
   . Fixed bug #66736 (fpassthru broken). (Mike)
-  . Fixed bug #67064  (Countable interface prevents using 2nd parameter
-    ($mode) of count() function). (Bob)
 
 - Embed:
   . Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol)
diff --git a/ext/standard/array.c b/ext/standard/array.c
index f807bb5..c2efca5 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -333,10 +333,7 @@ PHP_FUNCTION(count)
 #ifdef HAVE_SPL
 			/* if not and the object implements Countable we call its count() method */
 			if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array),
spl_ce_Countable TSRMLS_CC)) {
-				zval *mode_zv;
-				MAKE_STD_ZVAL(mode_zv);
-				Z_LVAL_P(mode_zv) = mode;
-				zend_call_method_with_1_params(&array, NULL, NULL, "count", &retval,
mode_zv);
+				zend_call_method_with_0_params(&array, NULL, NULL, "count", &retval);
 				if (retval) {
 					convert_to_long_ex(&retval);
 					RETVAL_LONG(Z_LVAL_P(retval));
diff --git a/ext/standard/tests/array/bug67064.phpt b/ext/standard/tests/array/bug67064.phpt
deleted file mode 100644
index 2818516..0000000
--- a/ext/standard/tests/array/bug67064.phpt
+++ /dev/null
@@ -1,17 +0,0 @@
---TEST--
-Bug #67064 (Countable interface prevents using 2nd parameter ($mode) of count() function)
---FILE--
-<?php
-class Counter implements Countable {
-	public function count($mode = COUNT_NORMAL) {
-		var_dump($mode == COUNT_RECURSIVE);
-		return 1;
-	}
-}
-
-$counter = new Counter;
-var_dump(count($counter, COUNT_RECURSIVE));
-?>
---EXPECTF--
-bool(true)
-int(1)



Thread (1 message)

  • Bob Weinand
« previous php.cvs (#76837) next »