ID: 50464 Updated by: fel...@php.net Reported By: marco dot weber at uni-trier dot de -Status: Open +Status: Closed Bug Type: *General Issues Operating System: ANY PHP Version: 5.3.1 -Assigned To: +Assigned To: felipe New Comment:
This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2009-12-13 15:18:59] s...@php.net Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=292078 Log: - Fixed bug #50464 (declare encoding doesn't work with) # The bug (BC) only happens in this branch. ------------------------------------------------------------------------ [2009-12-13 01:00:00] marco dot weber at uni-trier dot de http://lists.typo3.org/pipermail/flow3-general/2009-December/000042.html ------------------------------------------------------------------------ [2009-12-13 00:31:11] marco dot weber at uni-trier dot de Description: ------------ When using the the declare encoding statement in your php script, you will get an fatal error, when you try to include a subscript with a defined encoding. This only happens with php5.3.x version that was compiled with '--enable-zend-multibyte' When i'm using a php5.3.x version WITHOUT '--enable-zend-multibyte', there is no fatal error. And everything works as expected. Reproduce code: --------------- i used a php5.3.1 with '--enable-zend-multibyte' just try to call the index.php binary index.php file: <?php declare(encoding='UTF-8'); namespace marcotest; require_once('sub.inc.php'); ?> sub.inc.php file: <?php declare(encoding='UTF-8'); namespace marcotest; echo "TEST"; //phpinfo(); ?> Expected result: ---------------- NO FATAL ERROR... ( Same result as WITHOUT '--enable-zend-multibyte' ) Actual result: -------------- Fatal error: Encoding declaration pragma must be the very first statement in the script in /home/mweber/public_html/sub.inc.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50464&edit=1