]> granicus.if.org Git - php/commitdiff
Mark $time argument of touch() as UNKNOWN as well
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 9 Apr 2020 14:50:46 +0000 (16:50 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 9 Apr 2020 14:54:42 +0000 (16:54 +0200)
For some reason I thought that passing 0 is same as current time,
but that's not the case.

ext/standard/basic_functions.stub.php
ext/standard/basic_functions_arginfo.h

index 067797111c0479bab5b330b58aa4de09528ab464..f63a5dbae6f668193330f4c66d5f28365f1196aa 100755 (executable)
@@ -942,7 +942,7 @@ function lchgrp(string $filename, $group): bool {}
 function chmod(string $filename, int $mode): bool {}
 
 #if HAVE_UTIME
-function touch(string $filename, int $time = 0, int $atime = UNKNOWN): bool {}
+function touch(string $filename, int $time = UNKNOWN, int $atime = UNKNOWN): bool {}
 #endif
 
 function clearstatcache(bool $clear_realpath_cache = false, string $filename = ""): void {}
index 8fb731f912ebf7050ee495500f86ffea8da2fb66..f5ff383d24a943f2c15e4dae016a0e49dec9fa93 100755 (executable)
@@ -1442,7 +1442,7 @@ ZEND_END_ARG_INFO()
 #if HAVE_UTIME
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_touch, 0, 1, _IS_BOOL, 0)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0")
+       ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, atime, IS_LONG, 0)
 ZEND_END_ARG_INFO()
 #endif