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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: djones109 at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC