-
Notifications
You must be signed in to change notification settings - Fork 860
Expand file tree
/
Copy pathexecution.xml
More file actions
72 lines (70 loc) · 1.85 KB
/
execution.xml
File metadata and controls
72 lines (70 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" encoding="utf-8"?>
<sect1 xml:id="language.operators.execution">
<title>Execution Operators</title>
<titleabbrev>Execution</titleabbrev>
<para>
PHP supports one execution operator: backticks (<literal>``</literal>). Note that
these are not single-quotes! PHP will attempt to execute the
contents of the backticks as a shell command; the output will be
returned (i.e., it won't simply be dumped to output; it can be
assigned to a variable). Use of the backtick operator is identical
to <function>shell_exec</function>.
</para>
<para>
<example>
<title>Backtick Operator</title>
<programlisting role="php" annotations="non-interactive">
<![CDATA[
<?php
$output = `ls -al`;
echo "<pre>$output</pre>";
?>
]]>
</programlisting>
</example>
</para>
<note>
<para>
The backtick operator is disabled when
<function>shell_exec</function> is disabled.
</para>
</note>
<note>
<para>
Unlike some other languages, backticks have no special meaning
within double-quoted strings.
</para>
</note>
<sect2 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.5.0</entry>
<entry>
The backtick operator as an alias for <function>shell_exec</function> has been deprecated.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect2>
<sect2 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link linkend="ref.exec">Program Execution functions</link></member>
<member><function>popen</function></member>
<member><function>proc_open</function></member>
<member><link linkend="features.commandline">Using PHP from the commandline</link></member>
</simplelist>
</para>
</sect2>
</sect1>