]> granicus.if.org Git - php/commitdiff
Fix of Bug #74383: Wrong reflection on Phar::running
authorMitch Hagstrand <mhagstrand@gmail.com>
Sun, 9 Apr 2017 22:30:35 +0000 (15:30 -0700)
committerJoe Watkins <krakjoe@php.net>
Mon, 10 Apr 2017 05:32:15 +0000 (06:32 +0100)
NEWS
ext/phar/phar_object.c
ext/phar/tests/bug74383.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 049cf66209bc84201127cdccbee0def8e8007f99..10bb6e2b8a197b283baf4c2ed6e1a702f049355c 100644 (file)
--- 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:
index 31d443cd43d0753c08bff3aa065d7d6b61fb43f9..1799268297ada46a14261b7717420830a5e01516 100644 (file)
@@ -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 (file)
index 0000000..366c4fc
--- /dev/null
@@ -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