Timeline for Output the sign
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 17, 2020 at 9:04 | history | edited | CommunityBot |
Commonmark migration
|
|
Dec 22, 2016 at 17:14 | comment | added | Ismael Miguel |
It might be useful to add this, to run PHP without having to create a file: echo '<?=$argv[1]<=>0;' | php -- <number> (works on Debian 8.6).
|
|
Dec 22, 2016 at 17:02 | comment | added | Ismael Miguel |
I figured it out already. I really didn't knew that it worked from a file, using the (implicit) -f parameter.
|
|
Dec 22, 2016 at 17:00 | comment | added | Alex Howansky |
The -r flag is to run a code snippet. This is complete source. Save it to a file and then run php file.php
|
|
Dec 22, 2016 at 16:58 | comment | added | Ismael Miguel |
Running php -r '<?=1' I get PHP Parse error: syntax error, unexpected '<' in Command line code on line 1 . But seems to work fine from a file. I guess you are right.
|
|
Dec 22, 2016 at 16:48 | comment | added | Alex Howansky |
"To use <?=, you need to be inside a webserver (like Apache)," No. The <?= operator works just fine from the command line.
|
|
Dec 22, 2016 at 16:16 | comment | added | Ismael Miguel |
Don't forget to mention that this is a PHP7 answer only. And since you're using <?= , you should use $_GET[n] , which doesn't take any more bytes. To use <?= , you need to be inside a webserver (like Apache), and there you won't have access to $argv . You can try to run <?php var_dump($argv); from a PHP file, acessed through Apache, and it will show NULL .
|
|
Dec 20, 2016 at 16:28 | history | answered | Alex Howansky | CC BY-SA 3.0 |