reference/filesystem/functions/is-executable.xml
8d8cd43bfcd67415f3d548b7209c5b1a63d88fd1
...
...
@@ -37,33 +37,14 @@
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

44
-
<refsect1 role="changelog">
45
-
&reftitle.changelog;
46
-
<para>
47
-
<informaltable>
48
-
<tgroup cols="2">
49
-
<thead>
50
-
<row>
51
-
<entry>&Version;</entry>
52
-
<entry>&Description;</entry>
53
-
</row>
54
-
</thead>
55
-
<tbody>
56
-
<row>
57
-
<entry>5.0.0</entry>
58
-
<entry>
59
-
<function>is_executable</function> became available with
60
-
<productname>Windows</productname>
61
-
</entry>
62
-
</row>
63
-
</tbody>
64
-
</tgroup>
65
-
</informaltable>
66
-
</para>
45
+
<refsect1 role="errors">
46
+
&reftitle.errors;
47
+
&fs.emits.warning.on.failure;
67
48
</refsect1>
68
49

69
50
<refsect1 role="examples">
...
...
@@ -90,15 +71,21 @@ if (is_executable($file)) {
90
71
</para>
91
72
</refsect1>
92
73

93
-
<refsect1 role="errors">
94
-
&reftitle.errors;
95
-
&fs.emits.warning.on.failure;
96
-
</refsect1>
97
-

98
74
<refsect1 role="notes">
99
75
&reftitle.notes;
100
76
&note.clearstatcache;
101
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>
102
89
</refsect1>
103
90

104
91
<refsect1 role="seealso">
105
92