note 96581 deleted from function.passthru by danbrown
| From: | danbrown@php.net | Date: | Fri, 05 Mar 2010 23:27:35 +0000 |
| Subject: | note 96581 deleted from function.passthru by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166723@lists.php.net to get a copy of this message | ||
Note Submitter: anthony
----
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.