com php-src: Add test for bug (count on symbol table): ext/standard/tests/array/count_symbol_table.phpt
| From: | Xinchen Hui | Date: | Mon, 23 Nov 2015 14:21:30 +0000 |
| Subject: | com php-src: Add test for bug (count on symbol table): ext/standard/tests/array/count_symbol_table.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89972@lists.php.net to get a copy of this message | ||
Commit: 801e46d8c0a869d60e0af9aa0909d6df2cfc7958
Author: Xinchen Hui <laruence@gmail.com> Mon, 23 Nov 2015 06:21:30 -0800
Parents: 6313e16a0472d42a2056364b1aacd7798d500b75
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=801e46d8c0a869d60e0af9aa0909d6df2cfc7958
Log:
Add test for bug (count on symbol table)
I should have do this ....
Changed paths:
A ext/standard/tests/array/count_symbol_table.phpt
Diff:
diff --git a/ext/standard/tests/array/count_symbol_table.phpt
b/ext/standard/tests/array/count_symbol_table.phpt
new file mode 100644
index 0000000..b7e0a2e
--- /dev/null
+++ b/ext/standard/tests/array/count_symbol_table.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Test count() function : count on symbol table
+--FILE--
+<?php
+
+$c1 = 0;
+$c2 = 0;
+$a = 1;
+$b = 1;
+$c1 = count($GLOBALS);
+unset($a);
+unset($GLOBALS["b"]);
+$c2 = count($GLOBALS);
+
+var_dump($c1 - $c2);
+$c = 1;
+$c1 = count($GLOBALS);
+var_dump($c1 - $c2);
+?>
+--EXPECT--
+int(2)
+int(1)