reference/filesystem/functions/is-executable.xml
8d8cd43bfcd67415f3d548b7209c5b1a63d88fd1
...
...
@@ -37,10 +37,16 @@
37
37
&reftitle.returnvalues;
38
38
<para>
39
39
Returns &true; if the filename exists and is executable, or &false; on
40
-
error.
40
+
error. On POSIX systems, a file is executable if the executable bit of the
41
+
file permissions is set. For Windows, see the note below.
41
42
</para>
42
43
</refsect1>
43
44

45
+
<refsect1 role="errors">
46
+
&reftitle.errors;
47
+
&fs.emits.warning.on.failure;
48
+
</refsect1>
49
+

44
50
<refsect1 role="examples">
45
51
&reftitle.examples;
46
52
<para>
...
...
@@ -65,15 +71,21 @@ if (is_executable($file)) {
65
71
</para>
66
72
</refsect1>
67
73

68
-
<refsect1 role="errors">
69
-
&reftitle.errors;
70
-
&fs.emits.warning.on.failure;
71
-
</refsect1>
72
-

73
74
<refsect1 role="notes">
74
75
&reftitle.notes;
75
76
&note.clearstatcache;
76
77
&tip.fopen-wrapper.stat;
78
+
<note>
79
+
<simpara>
80
+
On Windows, a file is considered executable, if it is a properly executable
81
+
file as reported by the Win API <literal>GetBinaryType()</literal>; for BC
82
+
reasons, files with a <filename>.bat</filename> or <filename>.cmd</filename>
83
+
extension are also considered executable. Prior to PHP 7.4.0, any non-empty
84
+
file with a <filename>.exe</filename> or <filename>.com</filename> extension
85
+
was considered executable. Note that <envar>PATHEXT</envar> is irrelevant
86
+
for <function>is_executable</function>.
87
+
</simpara>
88
+
</note>
77
89
</refsect1>
78
90

79
91
<refsect1 role="seealso">
80
92