com php-src: Fix of Bug #74383: Wrong reflection on Phar::running: NEWS ext/phar/phar_object.c ext/phar/tests/bug74383 .phpt

[email protected] (Joe Watkins)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    d9a05807d26be80e0821be52f9ac60a35c52d004
Author:    Mitch Hagstrand <[email protected]>         Sun, 9 Apr 2017 15:30:35 -0700
Committer: Joe Watkins <[email protected]>      Mon, 10 Apr 2017 06:32:15 +0100
Parents:   9c7cb2cdcde92691f1f833546eb1382acf788e2c
Branches:  PHP-7.0

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

Log:
Fix of Bug #74383: Wrong reflection on Phar::running

Bugs:
https://bugs.php.net/74383

Changed paths:
  M  NEWS
  M  ext/phar/phar_object.c
  A  ext/phar/tests/bug74383.phpt


Diff:
diff --git a/NEWS b/NEWS
index 049cf66..10bb6e2 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,9 @@ PHP                                                                        NEWS
   . Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
     seconds). (Moritz Fain)
 
+- phar:
+  . Fixed bug #74383 phar method parameters reflection correction. (mhagstrand)
+
 13 Apr 2017 PHP 7.0.18
 
 - Core:
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 31d443c..1799268 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -5191,7 +5191,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_webPhar, 0, 0, 0)
 ZEND_END_ARG_INFO()
 
 PHAR_ARG_INFO
-ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_running, 0, 0, 1)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_running, 0, 0, 0)
 	ZEND_ARG_INFO(0, retphar)
 ZEND_END_ARG_INFO()
 
diff --git a/ext/phar/tests/bug74383.phpt b/ext/phar/tests/bug74383.phpt
new file mode 100644
index 0000000..366c4fc
--- /dev/null
+++ b/ext/phar/tests/bug74383.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Phar: bug #74383: Wrong reflection on Phar::running
+--SKIPIF--
+<?php if (!extension_loaded("phar") || !extension_loaded('reflection')) die("skip"); ?>
+--FILE--
+<?php
+$rc = new ReflectionClass(Phar::class);
+$rm = $rc->getMethod("running");
+echo $rm->getNumberOfParameters();
+echo PHP_EOL;
+echo $rm->getNumberOfRequiredParameters();
+echo PHP_EOL;
+echo (int) $rm->getParameters()[0]->isOptional();
+
+?>
+
+--EXPECT--
+1
+0
+1
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.