]> granicus.if.org Git - php/commitdiff
Fix php 8.0's opcache flags for pathinfo()
authorTyson Andre <tysonandre775@hotmail.com>
Sun, 9 Jun 2019 20:55:56 +0000 (16:55 -0400)
committerJoe Watkins <krakjoe@php.net>
Tue, 11 Jun 2019 07:09:50 +0000 (09:09 +0200)
See https://php.net/pathinfo

This fixes a bug introduced in the cleanup for commit
0d79c70cf3c10f60a2e8fbfd68903d8716b7b43c

`pathinfo($str, PATHINFO_EXTENSION)` will always return a string
(if there is no extension, the function returns the empty string)

ext/opcache/Optimizer/zend_func_info.c
ext/standard/string.c

index 55a6aa1727924b65a01d941d3b7dc23fd844cc43..1485c0a73bdd4d5c284b98a181991aff9971b632 100644 (file)
@@ -194,7 +194,7 @@ static const func_info_t func_infos[] = {
        FN("nl2br",                        MAY_BE_STRING),
        F1("basename",                     MAY_BE_STRING),
        F1("dirname",                      MAY_BE_NULL | MAY_BE_STRING),
-       F1("pathinfo",                     MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
+       F1("pathinfo",                     MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
        F1("stripslashes",                 MAY_BE_STRING),
        F1("stripcslashes",                MAY_BE_STRING),
        F1("strstr",                       MAY_BE_FALSE | MAY_BE_STRING),
index 8fb256970d2f1ab18c1b5fb5e89394ef65c5e249..5c56bb4f62a86f30a234714ab282b3200f4a97a0 100644 (file)
@@ -1666,7 +1666,7 @@ PHP_FUNCTION(dirname)
 }
 /* }}} */
 
-/* {{{ proto array pathinfo(string path[, int options])
+/* {{{ proto array|string pathinfo(string path[, int options])
    Returns information about a certain string */
 PHP_FUNCTION(pathinfo)
 {