php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54588 Included files should not output shebang
Submitted: 2011-04-21 21:50 UTC Modified: 2013-10-01 10:36 UTC
Votes:13
Avg. Score:3.8 ± 0.9
Reproduced:13 of 13 (100.0%)
Same Version:4 (30.8%)
Same OS:6 (46.2%)
From: djones109 at gmail dot com Assigned:
Status: Duplicate Package: Output Control
PHP Version: 5.3SVN-2011-04-21 (snap) OS: All
Private report: No CVE-ID: None
 [2011-04-21 21:50 UTC] djones109 at gmail dot com
Description:
------------
When writing CLI scripts, one typically adds a shebang to the beginning of the 
script. When the script is executed, the shebang is not outputted.

On occasion, it's useful to include another CLI script. When the file is included, 
the shebang on the included file is outputted, contrary to expected behavior.

Test script:
---------------
file1.php:
#!/usr/bin/php
<?php
echo "Including file2\n";
include 'file2.php';
?>

file2.php:
#!/usr/bin/php
<?php
echo "Inside file2\n";
?>

Expected result:
----------------
Including file2
Inside file2

Actual result:
--------------
Including file2
#!/usr/bin/php
Inside file2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-30 12:13 UTC] mike@php.net
-Status: Open +Status: Duplicate -Type: Bug +Type: Feature/Change Request
 [2013-09-30 12:13 UTC] mike@php.net
See req #31563
 [2013-10-01 10:36 UTC] yohgaki@php.net
I think this request should not be implemented.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 07:01:26 2019 UTC