Edit report at https://bugs.php.net/bug.php?id=80936&edit=1
ID: 80936
User updated by: samsanchez at qq dot com
Reported by: samsanchez at qq dot com
Summary: php.exe -f test.php doesn't work
Status: Open
Type: Bug
Package: JIT
Operating System: Windows 10
PHP Version: 8.0.3
Block user comment: N
Private report: N
New Comment:
I attach a file with unicode bom. to reproduce this bug:
1) download the patch file 'rename_this_file_extension.txt'
2) open it by any kindof txt editor. add <?php to the 1st line
3) rename it to test.php
4) command line to exec: php.exe -f tes.php
5) output here it's
<?php
echo 'hello php8';
=====================
what i expect to get are
1) fatal error exception raise
2) or show me 'hello php8'
Previous Comments:
------------------------------------------------------------------------
[2021-04-06 14:31:12] samsanchez at qq dot com
The following patch has been added/updated:
Patch Name: rename_this_file_extension.txt
Revision: 1617719472
URL: https://bugs.php.net/patch-display.php?bug=80936&patch=rename_this_file_extension.txt&revision=1617719472
------------------------------------------------------------------------
[2021-04-05 15:29:54] cmb@php.net
I cannot reproduce, neither with JIT enabled nor disabled.
------------------------------------------------------------------------
[2021-04-05 08:51:18] samsanchez at qq dot com
I find the problem is because the encode of test.php is UTF-8 With BOM!
changing the encode to UTF-8 without BOM make it work as expect.
however i think the php cli should raise me an error instead of output the whole source to me.
------------------------------------------------------------------------
[2021-04-05 08:39:44] samsanchez at qq dot com
change the package to JIT
------------------------------------------------------------------------
[2021-04-05 08:33:39] samsanchez at qq dot com
Description:
------------
E:\Develop\php8>php -f test.php
<?php
echo 'hello php8';
Test script:
---------------
<?php
echo 'hello php8';
Expected result:
----------------
hello php8
Actual result:
--------------
<?php
echo 'hello php8';
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80936&edit=1