#33273 [Opn]: Use of certain kanji characters make PHP crash

From: Date: Wed, 08 Jun 2005 14:21:25 +0000
Subject: #33273 [Opn]: Use of certain kanji characters make PHP crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80059@lists.php.net to get a copy of this message
ID: 33273 User updated by: lars dot jensen at careercross dot com Reported By: lars dot jensen at careercross dot com Status: Open Bug Type: Arrays related Operating System: FreeBSD 5.3 PHP Version: 5.0.3 New Comment: This was a very stripped down version, if I exchange the kanji with say "abc", it works fine. It also works with other kanji sequences, katakana, hiragana ect. These two samples is the only two out of about 75 causing problems Previous Comments: ------------------------------------------------------------------------ [2005-06-08 16:20:07] derick@php.net Nicholas, that is bullshit. You can have trailing comma's in arrays - just like in C. And Unicode is also not added in PHP 5 or PHp 5.1. Please refrain from commenting if you're not 100% sure about things. ------------------------------------------------------------------------ [2005-06-08 16:17:56] nick dot telford at ntlworld dot com If that source is causing that error it's not because of the kanji sequences. You've got an extra comma (,) at the end of your array() statement. Your code: $foo = array ( 'One Text' => 'some kanji', 'Another Text' => 'more kanji', ); The last comma, should not be present, as PHP expects another argument to follow it. Simply remove it: $foo = array ( 'One Text' => 'some kanji', 'Another Text' => 'more kanji' ); On a related note, if you wish to code using non-western character sets, full Unicode support is being added into PHP5 (most likely, the next major release after 5.1 will have it). This should be of great use to you when it's released. Nicholas Telford ------------------------------------------------------------------------ [2005-06-08 10:47:09] lars dot jensen at careercross dot com Description: ------------ Certain Kanji direct in source seems to be a problem - wanted to use a small array for some simple language changes between english / japanese, but with these given kanji's it fail. Viewing the Kanji's as ascii, they both hold " in it, but closing the array strings using ', it shouldnt affect the strings. Example provided at http://www.ebenkyo.com/bug.php / Lars Reproduce code: --------------- As the code holds kanji characters, use this page to see the source. Please ensure to see the page using shift_jis encoding http://www.ebenkyo.com/bug_source.php Expected result: ---------------- The array not to fail with given Kanji's. Most Kanji sequences seem to work. Actual result: -------------- Parse error: parse error, unexpected T_STRING, expecting ')' in /usr/local/www/www.ebenkyo.com/bug.php on line 4 or similar ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33273&edit=1

« previous php.bugs (#80059) next »