|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-07-11 06:26 UTC] warnar at boekkooi dot net
Description:
------------
Have a script that calls `Locale::getDisplayRegion` with the first argument being NULL.
Some system information about my system:
Packages installed from ppa:ondrej/php5:
php-apc install
php5 install
php5-apcu install
php5-cli install
php5-common install
php5-curl install
php5-intl install
php5-json install
php5-mcrypt install
php5-mysql install
php5-readline install
php5-xdebug install
Version (php -v):
PHP 5.5.14-2+deb.sury.org~precise+1 (cli) (built: Jul 2 2014 12:07:02)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
Intl information (from php -v):
intl
Internationalization support => enabled
version => 1.1.0
ICU version => 52.1
ICU Data version => 52.1
Directive => Local Value => Master Value
intl.default_locale => no value => no value
intl.error_level => 0 => 0
intl.use_exceptions => 0 => 0
Test script:
---------------
<?php
Locale::getDisplayRegion(null, "en_US");
Expected result:
----------------
A catch-able exception or NULL
Actual result:
--------------
Segmentation fault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Looks like this is the result of a bad merge. In 5.4, 5.5 etc. main branches, line 509 of ext/intl/locale/locale_methods.c looks like this: loc_name = intl_locale_get_default(TSRMLS_C); However, in 5.5.14 branch it looks like this: loc_name = INTL_G(default_locale); And this is incorrect. This was done in commit a6b7fdeb2d68c33758cca1fbb03dc0b2b1f4e107, which is merged from 5.4, but in 5.4 the default locale can not be null, while in 5.5 and above it can. So the merge was incorrect there. However, in 5.5.15 branch it seems to be back to normal, so once 5.5.15 is release it will be fine. You can also use 5.5.15 RC1 or any recent stapshot, it should be OK too.