Edit report at https://bugs.php.net/bug.php?id=70125&edit=1
ID: 70125
Updated by: yohgaki@php.net
Reported by: tuxy at vmail dot me
Summary: PHP Shebang
Status: Open
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: Arch Linux
PHP Version: 5.6.11
Block user comment: N
Private report: N
New Comment:
@tuxy
We cannot remove email. Please use mail address that you wouldn't mind next time.
Anyway, what you are proposing breaks compatibility. "PHP executes script in embedded mode
always"
-------------
#!/use/bin/php
Hello! Current date is <?php echo date('Y/m/d'); ?> !
-------------
This script is perfectly valid with current PHP. We need some RFC that "allows to start PHP
with non-embedded mode" as I mentioned earlier. e.g.
-------------
#!/use/bin/php -X
// Non-embedded mode, so this code is syntax error.
Hello! Current date is <?php echo date('Y/m/d'); ?> !
-------------
Previous Comments:
------------------------------------------------------------------------
[2015-07-30 06:06:12] tuxy at vmail dot me
@ cmb@php.net, It may make sense to you but no one else. Most other languages have proper shebang in
them. Why not have the same for PHP when script is intented to only be executed and used in
shell/terminal. Remember I'm talking about the shebang for CLI scripts and NOT web.
@ yohgaki@php.net, None of this related to this shebang post.
-- Off Subject --
Please remove my email from this posts, or at least leave only "tuxy" and not full name!!
------------------------------------------------------------------------
[2015-07-30 05:49:53] yohgaki@php.net
There are a few RFCs related to this topic.
https://wiki.php.net/rfc/phpphttps://wiki.php.net/rfc/nophptagshttps://wiki.php.net/rfc/script_only_include
There may be others.
------------------------------------------------------------------------
[2015-07-29 00:27:18] cmb@php.net
To me it doesn't make sense to introduce a special syntax for
scripts starting with a shebang line. Either there'll be the
possibility to have PHP code only files, or not. Actually, I'm
fine with the latter, as that also can make sense for CLI scripts.
------------------------------------------------------------------------
[2015-07-24 07:47:18] tuxy at vmail dot me
Description:
------------
Feature request to remove the need to use "<?php" when using shebang
"#!/usr/bin/php"
Note this is only for terminal php scripts anyway, there is no need to use "<?php" with
that.
Test script:
---------------
Example, this is how its done now:
#!/usr/bin/php
<?php
//code
Request to have this instead:
#!/usr/bin/php
//code
Expected result:
----------------
n/a
Actual result:
--------------
n/a
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70125&edit=1