note 96581 added to function.passthru
| From: | anthony at osu1 dot php dot net | Date: | Fri, 05 Mar 2010 23:17:47 +0000 |
| Subject: | note 96581 added to function.passthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166722@lists.php.net to get a copy of this message | ||
to jo:
You may or may not be right about passthru going through shell, but your example doesn't prove
your point (at least not how you have stated it).
If you use single quotes, PHP treats everything inside as a string, so variables aren't treated
as variables, but as part of the string. So if you have:
passthru('echo $PATH');
it is the exact same thing as writing
echo $PATH
at a command line.
if you have:
$PATH = "I love beans!";
passthru("echo $PATH");
This would be the same as writing
echo I love beans
at the command line (not sure if php quote wraps it or not).
Variables only get treated as variable when used in strings when you double-quote the entire string.
----
Server IP: 208.69.120.55
Probable Submitter: 128.83.176.162
----
Manual Page -- http://www.php.net/manual/en/function.passthru.php
Edit -- https://master.php.net/note/edit/96581
Del: integrated -- https://master.php.net/note/delete/96581/integrated
Del: useless -- https://master.php.net/note/delete/96581/useless
Del: bad code -- https://master.php.net/note/delete/96581/bad+code
Del: spam -- https://master.php.net/note/delete/96581/spam
Del: non-english -- https://master.php.net/note/delete/96581/non-english
Del: in docs -- https://master.php.net/note/delete/96581/in+docs
Del: other reasons-- https://master.php.net/note/delete/96581
Reject -- https://master.php.net/note/reject/96581
Search -- https://master.php.net/manage/user-notes.php