php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67681 declare(encoding='UTF-8') causes "Warning: Unexpected character in input"
Submitted: 2014-07-25 00:27 UTC Modified: 2014-07-25 05:08 UTC
Votes:4
Avg. Score:3.0 ± 1.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: dqneoo at gmail dot com Assigned:
Status: Verified Package: Scripting Engine problem
PHP Version: PHP5.4,5.5,5.6,5.7dev OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dqneoo at gmail dot com
New email:
PHP Version: OS:

 

 [2014-07-25 00:27 UTC] dqneoo at gmail dot com
Description:
------------
declare(encoding='UTF-8'); causes Warning under the environment of 
zend.multibyte=On and mbstring.internal_encoding="EUC_JP"


Test script:
---------------
a.php
-----
<?php
declare(encoding='UTF-8');
// あああ
-----

$ ./configure --enable-mbstring --enable-debug
$ make
$ ./sapi/cli/php -d zend.multibyte=On -d mbstring.internal_encoding="EUC_JP"  a.php


Expected result:
----------------
No warnings

Actual result:
--------------
Warning: Unexpected character in input:  ' in /home/vagrant/src/php-src/a.php on line 4

Warning: Unexpected character in input:  ' in /home/vagrant/src/php-src/a.php on line 4

Warning: Unexpected character in input:  ' in /home/vagrant/src/php-src/a.php on line 4

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-25 00:29 UTC] dqneoo at gmail dot com
-PHP Version: master-Git-2014-07-24 (Git) +PHP Version: PHP5.4,5.5,5.6,5.7dev
 [2014-07-25 00:29 UTC] dqneoo at gmail dot com
specify php version
 [2014-07-25 05:08 UTC] yohgaki@php.net
-Status: Open +Status: Verified
 [2014-07-25 05:08 UTC] yohgaki@php.net
When zend.multibyte became runtime option, it was messed up. Related to zend multibyte XFAIL tests in mbstring.
 [2017-06-18 11:58 UTC] qdinar at gmail dot com
i have same problem with php 5.5.34.

but problem appears at last line of script, and i had not ending "?>" . when i put it, warning disappeared.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 14:02:33 2024 UTC