com php-src: Fix #70303: Incorrect constructor reflection for ArrayObject: ext/spl/spl_array.c ext/spl/tests/bug70303.ph pt
| From: | Christoph Michael Becker | Date: | Wed, 19 Aug 2015 14:23:16 +0000 |
| Subject: | com php-src: Fix #70303: Incorrect constructor reflection for ArrayObject: ext/spl/spl_array.c ext/spl/tests/bug70303.ph pt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88688@lists.php.net to get a copy of this message | ||
Commit: 484b92919bd3b06f3eae845bc1a592da58bef64e
Author: Christoph M. Becker <cmb@php.net> Wed, 19 Aug 2015 16:22:04 +0200
Parents: b584b513983319be170f02828bc7c12850b40320
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=484b92919bd3b06f3eae845bc1a592da58bef64e
Log:
Fix #70303: Incorrect constructor reflection for ArrayObject
The first parameter of ArrayObject::__construct() is optional. Reflection
should reflect this.
Bugs:
https://bugs.php.net/70303
Changed paths:
M ext/spl/spl_array.c
A ext/spl/tests/bug70303.phpt
Diff:
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 42490fc..2c65210 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1842,8 +1842,8 @@ outexcept:
} /* }}} */
-/* {{{ arginfo and function tbale */
-ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0)
+/* {{{ arginfo and function table */
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array___construct, 0, 0, 0)
ZEND_ARG_INFO(0, array)
ZEND_END_ARG_INFO()
diff --git a/ext/spl/tests/bug70303.phpt b/ext/spl/tests/bug70303.phpt
new file mode 100644
index 0000000..059c370
--- /dev/null
+++ b/ext/spl/tests/bug70303.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #70303 (Incorrect constructor reflection for ArrayObject)
+--FILE--
+<?php
+$f = new ReflectionClass('ArrayObject');
+$c = $f->getConstructor();
+$params = $c->getParameters();
+$param = $params[0];
+var_dump($param->isOptional());
+?>
+--EXPECT--
+bool(true)