Skip to content

Commit 484b929

Browse files
committed
Fix #70303: Incorrect constructor reflection for ArrayObject
The first parameter of ArrayObject::__construct() is optional. Reflection should reflect this.
1 parent b584b51 commit 484b929

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

ext/spl/spl_array.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,8 +1842,8 @@ SPL_METHOD(Array, unserialize)
18421842

18431843
} /* }}} */
18441844

1845-
/* {{{ arginfo and function tbale */
1846-
ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0)
1845+
/* {{{ arginfo and function table */
1846+
ZEND_BEGIN_ARG_INFO_EX(arginfo_array___construct, 0, 0, 0)
18471847
ZEND_ARG_INFO(0, array)
18481848
ZEND_END_ARG_INFO()
18491849

ext/spl/tests/bug70303.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Bug #70303 (Incorrect constructor reflection for ArrayObject)
3+
--FILE--
4+
<?php
5+
$f = new ReflectionClass('ArrayObject');
6+
$c = $f->getConstructor();
7+
$params = $c->getParameters();
8+
$param = $params[0];
9+
var_dump($param->isOptional());
10+
?>
11+
--EXPECT--
12+
bool(true)

0 commit comments

Comments
 (0)