|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-09-07 15:42 UTC] cschneid at cschneid dot com
Description:
------------
PHP's shell return code is 1 where 0 is expected when running
php -n t.php; echo $?
I bisected the problem and it seems to work before commit 684ce24eecc5afe7ba767e721c29ef3bb191c43c which is pcre/locale related.
The locale returned by the first setlocale is de_CH.UTF-8 and I'm using openSUSE Tumbleweed 20180829.
Test script:
---------------
<?php
function foo()
{
$oldlocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, $oldlocale);
}
foo();
preg_match('/./', "a");
Expected result:
----------------
Return code 0
Actual result:
--------------
Return code 1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
Thanks for reporting! I can confirm the issue, and also that the regression has been introduced with commit 684ce24[1]. valgrind reports a single memory leak regarding a zend_string[2], but it also reports this leak for earlier commits. However, running with a debug build yields: [Sat Sep 8 13:26:03 2018] Script: '/mnt/c/Users/cmb/php-dev/76850.php' /mnt/c/Users/cmb/php-dev/php-src/Zend/zend_string.h(133) : Freeing 0x00007f5b50c01730 (40 bytes), script=/mnt/c/Users/cmb/php-dev/76850.php === Total 1 memory leaks detected === zend_mm_heap corrupted Segmentation fault (core dumped) Anantol, could you please have a look at this? [1] <http://git.php.net/?p=php-src.git;a=commit;h=684ce24eecc5afe7ba767e721c29ef3bb191c43c> [2] <https://github.com/php/php-src/blob/php-7.3.0beta3/ext/pcre/php_pcre.c#L840>