From 8d8cd43bfcd67415f3d548b7209c5b1a63d88fd1 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 8 Nov 2021 15:04:41 +0100 Subject: [PATCH] Fix #41062: is_executable only looks at basic executables --- reference/filesystem/functions/is-executable.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reference/filesystem/functions/is-executable.xml b/reference/filesystem/functions/is-executable.xml index 75c6518567..8eda8f9b23 100644 --- a/reference/filesystem/functions/is-executable.xml +++ b/reference/filesystem/functions/is-executable.xml @@ -37,7 +37,8 @@ &reftitle.returnvalues; Returns &true; if the filename exists and is executable, or &false; on - error. + error. On POSIX systems, a file is executable if the executable bit of the + file permissions is set. For Windows, see the note below. @@ -74,6 +75,17 @@ if (is_executable($file)) { &reftitle.notes; ¬e.clearstatcache; &tip.fopen-wrapper.stat; + + + On Windows, a file is considered executable, if it is a properly executable + file as reported by the Win API GetBinaryType(); for BC + reasons, files with a .bat or .cmd + extension are also considered executable. Prior to PHP 7.4.0, any non-empty + file with a .exe or .com extension + was considered executable. Note that PATHEXT is irrelevant + for is_executable. + +