Skip to content

Commit fcc6da3

Browse files
committed
Mark $time argument of touch() as UNKNOWN as well
For some reason I thought that passing 0 is same as current time, but that's not the case.
1 parent c10f30f commit fcc6da3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ function lchgrp(string $filename, $group): bool {}
942942
function chmod(string $filename, int $mode): bool {}
943943

944944
#if HAVE_UTIME
945-
function touch(string $filename, int $time = 0, int $atime = UNKNOWN): bool {}
945+
function touch(string $filename, int $time = UNKNOWN, int $atime = UNKNOWN): bool {}
946946
#endif
947947

948948
function clearstatcache(bool $clear_realpath_cache = false, string $filename = ""): void {}

ext/standard/basic_functions_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ ZEND_END_ARG_INFO()
14421442
#if HAVE_UTIME
14431443
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_touch, 0, 1, _IS_BOOL, 0)
14441444
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
1445-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0")
1445+
ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0)
14461446
ZEND_ARG_TYPE_INFO(0, atime, IS_LONG, 0)
14471447
ZEND_END_ARG_INFO()
14481448
#endif

0 commit comments

Comments
 (0)