Bug #65358 [Dup->Asn]: php can't handle 8.3 names of files which have long names with unicode in them

2013-08-18 Thread pajoye
Edit report at https://bugs.php.net/bug.php?id=65358&edit=1

 ID: 65358
 Updated by: paj...@php.net
 Reported by:rsk82 at live dot com
 Summary:php can't handle 8.3 names of files which have long
 names with unicode in them
-Status: Duplicate
+Status: Assigned
 Type:   Bug
 Package:Filesystem function related
 Operating System:   Windows XP
 PHP Version:5.4.17
-Assigned To:
+Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

This is not a duplicate bug of the unicode paths support.

The problem here, in this exact (maybe other encoding could be affected but 
same 
cause then) issue, is that the CRT call FindFirstFileW instead of 
FindFirstFileA, 
despite that _UNICODE is defined.

Patch on its way.


Previous Comments:

[2013-07-30 17:13:15] rsk82 at live dot com

Yes, but there are different things to add support for full fledged unicode 
names on windows and support only for shortened 8.3 dos paths that have no 
unicode chars in them. I thought that such names would by completely 
transparent to php like they are for 16 apps. This is not exact duplicate.


[2013-07-30 16:48:43] a...@php.net

This the general issue with non 7-bit encoded filenames, so duplicate of bug 
#64699, see also bug #61315.


[2013-07-30 11:12:52] rsk82 at live dot com

Functions affected are not only fopen, but all, no matter if writing or reading 
the file.

And I think it is and issue in all of the php versions in windows not only 5.4.


[2013-07-30 11:09:49] rsk82 at live dot com

Description:

I don't know if this is expected. I know that php can't handle international 
file names in Windows but shortened paths have no Unicode characters in them so 
I do not see any reason that php should have any problem with that.

These paths are perfectly visible to 16bit win311 apps and such files are 
editable by those programs, of course them cannot see the correct name of the 
file but this doesn't count any problem with accessing their content. And if 
that I think php should have similar behavior here.

Maybe the php's filesystem functions are trying to "do better" and translate 
such path to it's normal mode and subsequently are confused about what they 
have done.

Test script:
---
CreateTextFile("c:\\Ελλάδα.txt");
$ShortPath = $FS->GetFile("c:\\Ελλάδα.txt")->ShortPath;
echo $ShortPath;
$handle = fopen($ShortPath, 'w');
?>

Expected result:

The script should run without any errors.

Actual result:
--
Warning: fopen(C:\BFEE~1.TXT): failed to open stream: Invalid argument in 
C:\test.php on line 6






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65358&edit=1


[PHP-BUG] Bug #65475 [NEW]: wrong session cookie is generated on session.use_strict_mode

2013-08-18 Thread php at tokumaru dot org
From: php at tokumaru dot org
Operating system: Ubuntu
PHP version:  5.5.2
Package:  Session related
Bug Type: Bug
Bug description:wrong session cookie is generated on session.use_strict_mode

Description:

In the case of session.use_strict_mode = On, a wrong session cookie is
generated.

Test script:
---
https://bugs.php.net/bug.php?id=65475&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65475&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65475&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=65475&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=65475&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=65475&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65475&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=65475&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=65475&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=65475&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=65475&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65475&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65475&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=65475&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65475&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=65475&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=65475&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=65475&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65475&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65475&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65475&r=mysqlcfg



Bug #65460 [Asn]: PHP 5.4.18 fails to compile with Apache 2.4.6

2013-08-18 Thread stas
Edit report at https://bugs.php.net/bug.php?id=65460&edit=1

 ID: 65460
 Updated by: s...@php.net
 Reported by:stu at coe dot uky dot edu
 Summary:PHP 5.4.18 fails to compile with Apache 2.4.6
 Status: Assigned
 Type:   Bug
 Package:Compile Failure
 Operating System:   Slackware64 14.0
 PHP Version:5.4.18
 Assigned To:stas
 Block user comment: N
 Private report: N

 New Comment:

5.4 compiles fine for me on CentOS 6.3 and on Mac. Apache is older there but I 
don't think this should have any consequence for zendparse.


Previous Comments:

[2013-08-18 19:11:35] m...@php.net

Looks like something was wrongly or not completely merged into 5.4?


[2013-08-18 02:16:58] giamteckchoon at gmail dot com

I overcome this error by following the steps outline in 
https://bugs.php.net/bug.php?id=64503 (note you need to install bison):

1. Apply the patch at 
https://bugs.php.net/patch-display.php?bug_id=64503&patch=bison_build_2.patch&revision=latest

2. rm -f Zend/zend_{language,ini}_parser.[ch]

3. Regenerate Zend/zend_language_parser.c etc.
./genfiles

4. Compile as usual.

Tested in SL6.4/CentOS6.4.

Hope this helps!


[2013-08-16 16:59:25] ben dot harper at rackspace dot com

I am running into this same error on RHEL 5 with Apache 2.2.3 and RHEL 6 with 
2.2.15.  Same config on both but slightly different error:

%configure \
--cache-file=../config.cache \
--with-libdir=%{_lib} \
--with-config-file-path=%{_sysconfdir} \
--with-config-file-scan-dir=%{_sysconfdir}/php.d \
--disable-debug \
--with-pic \
--disable-rpath \
--without-pear \
--with-bz2 \
--with-exec-dir=%{_bindir} \
--with-freetype-dir=%{_prefix} \
--with-png-dir=%{_prefix} \
--with-xpm-dir=%{_prefix} \
--enable-gd-native-ttf \
--with-t1lib=%{_prefix} \
--without-gdbm \
--with-gettext \
--with-gmp \
--with-iconv \
--with-jpeg-dir=%{_prefix} \
--with-openssl \
--with-pcre-regex \
--with-zlib \
--with-layout=GNU \
--enable-exif \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--with-kerberos \
--enable-ucd-snmp-hack \
--enable-shmop \
--enable-calendar \
--with-libxml-dir=%{_prefix} \
--enable-xml \
--with-system-tzdata \
--with-mhash \

Error in RHEL 5:

In file included from /builddir/build/BUILD/php-
5.4.18/ext/standard/basic_functions.c:48:
/builddir/build/BUILD/php-5.4.18/Zend/zend_language_parser.h:327: error: 
conflicting types for 'zendparse'
/builddir/build/BUILD/php-5.4.18/Zend/zend_globals_macros.h:35: error: previous 
declaration of 'zendparse' was here
/bin/sh /builddir/build/BUILD/php-5.4.18/build-ztscli/libtool --silent --
preserve-dup-deps --mode=compile /builddir/build/BUILD/php-5.4.18/build-
ztscli/meta_ccld  -Iext/standard/ -I/builddir/build/BUILD/php-
5.4.18/ext/standard/ -DPHP_ATOM_INC -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/include -I/builddir/build/BUILD/php-5.4.18/build-ztscli/main -
I/builddir/build/BUILD/php-5.4.18 -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/date/lib -I/builddir/build/BUILD/php-5.4.18/ext/date/lib -
I/builddir/build/BUILD/php-5.4.18/ext/ereg/regex -I/usr/include/libxml2 -
I/usr/kerberos/include -I/usr/include/enchant -I/usr/include/freetype2 -
I/usr/include/imap -I/usr/lib/firebird/include -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl/mbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl/mbfl -I/usr/include/pspell -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/TSRM -I/builddir/build/BUILD/php-
5.4.18/build-ztscli/Zend -I/builddir/build/BUILD/php-5.4.18/main -
I/builddir/build/BUILD/php-5.4.18/Zend -I/builddir/build/BUILD/php-5.4.18/TSRM -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/  -D_REENTRANT  -I/usr/include -
O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-
tables -fno-strict-aliasing -Wno-pointer-sign -fvisibility=hidden -pthread 
-DZTS  
-c /builddir/build/BUILD/php-5.4.18/ext/standard/filestat.c -o 
ext/standard/filestat.lo 
make: *** [ext/standard/basic_functions.lo] Error 1
make: *** Waiting for unfinished jobs
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c: In function 
'php_arra

Bug #65470 [Opn->Csd]: Segmentation fault in zend_error() with --enable-dtrace

2013-08-18 Thread stas
Edit report at https://bugs.php.net/bug.php?id=65470&edit=1

 ID: 65470
 Updated by: s...@php.net
 Reported by:s...@php.net
 Summary:Segmentation fault in zend_error() with
 --enable-dtrace
-Status: Open
+Status: Closed
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Linux
 PHP Version:5.4Git-2013-08-18 (Git)
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of stas
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=14f5732096575f3c4ff0438e6650238370cb465c
Log: Fix bug #65470 Segmentation fault in zend_error() with --enable-dtrace


Previous Comments:

[2013-08-18 06:02:12] s...@php.net

The patch tested OK and can be applied to PHP 5.4, 5.5 and master.  This 
requires 
zend karma, which I don't have.


[2013-08-18 05:05:12] s...@php.net

The following patch has been added/updated:

Patch Name: bug65470
Revision:   1376802312
URL:
https://bugs.php.net/patch-display.php?bug=65470&patch=bug65470&revision=1376802312


[2013-08-18 04:41:33] s...@php.net

I'm currently testing a patch.


[2013-08-18 04:40:25] s...@php.net

Description:

A segmentation fault can occur in zend_error() with --enable-dtrace.
The zend_vspprintf() call in the DTRACE_ERROR_ENABLED() block leaves
args undefined:

  "If ap is passed to a function that uses va_arg(ap,type) then the
  value of ap is undefined after the return of that function."

When args is used again later in zend_error(), a seg fault can occur.

Test script:
---
As root:
---
# dtrace -Z -s error.d 
dtrace: script 'error.d' matched 0 probes
CPU IDFUNCTION:NAME
  0  6 zend_error:error PHP error



As a normal user:

$ php error.php 
Segmentation fault (core dumped)


Where error.d is:

php*:::error { printf("PHP error\n"); }

and error.php is:










-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65470&edit=1


Bug #65362 [Com]: strcmp null return missing from docs.

2013-08-18 Thread atli dot jonsson at ymail dot com
Edit report at https://bugs.php.net/bug.php?id=65362&edit=1

 ID: 65362
 Comment by: atli dot jonsson at ymail dot com
 Reported by:atli dot jonsson at ymail dot com
 Summary:strcmp null return missing from docs.
 Status: Not a bug
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.5.1
 Block user comment: N
 Private report: N

 New Comment:

Yes, I realize this is common behaviour, and not as such a bug in PHP. 
That is why I originally categorized this as a documentation bug. 

The problem isn't PHP's behaviour, it's that the documentation on the 
functions I mentioned is misleading about the return type. There is no 
mention of the possibility of a null return, and while you may get away
with not mentioning this fact for most functions, in the case of these
particular functions, it can easily lead to unpredictable and hard to
find bugs.


Previous Comments:

[2013-08-18 20:32:25] johan...@php.net

This is common PHP behavior and documented in a note here: 
http://php.net/functions.internal


[2013-08-18 07:54:39] yohg...@php.net

Other functions such as strlen()/strncmp()/etc return null. 
I'm not sure the best behavior, but E_NOTICE/E_WARNING for invalid parameters 
are 
preferred.


[2013-08-18 07:50:51] yohg...@php.net

I changed bug type since this is in Zend/zend_builtin_functions.c.

Shouldn't it raise error for arrays? Currently, it simply returned.

/* {{{ proto int strcmp(string str1, string str2)
   Binary safe string comparison */
ZEND_FUNCTION(strcmp)
{
char *s1, *s2;
int s1_len, s2_len;
   
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1_len, 
&s2, &s2_len) == FAILURE) {
return;
}

RETURN_LONG(zend_binary_strcmp(s1, s1_len, s2, s2_len));
}
/* }}} */


[2013-07-30 23:36:30] atli dot jonsson at ymail dot com

Description:

strcmp, strncmp, strcasecmp and strncasecmp will all return NULL when either 
string parameter is of a type that is invalid for string conversions, like 
Arrays, 
Objects and Resources.

However, the docs make no mention of this fact. (Aside from a comment.) As the 
0 
value returned for equal strings, and NULL returned for invalid comparisons, 
are 
equal when compared in a non-strict manner, this can lead to unexpected 
behaviour.

There is a warning issued, but without clarification the above is still in no 
way 
obvious. 

Test script:
---
https://bugs.php.net/bug.php?id=65362&edit=1


Bug #65225 [Opn->Csd]: PHP_BINARY incorrectly set

2013-08-18 Thread stas
Edit report at https://bugs.php.net/bug.php?id=65225&edit=1

 ID: 65225
 Updated by: s...@php.net
 Reported by:patrickalla...@php.net
 Summary:PHP_BINARY incorrectly set
-Status: Open
+Status: Closed
 Type:   Bug
 Package:PHP options/info functions
 PHP Version:5.4.17
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of stas
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=0154db1c5fcfd0c4030a0aefb2861dc8386b4a1c
Log: new for fix #65225


Previous Comments:

[2013-07-09 13:02:36] patrickalla...@php.net

Description:

PHP_BINARY is initialized thanks to php_binary_init() without checking that 
candidate is a regular file.

I'm going to send a pull request that fixes it.

Test script:
---
$ sudo mkdir /usr/local/bin/php
$ php -r 'echo PHP_BINARY, "\n";';


Expected result:

/usr/lib64/php5.4/bin/php


Actual result:
--
/usr/local/bin/php






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65225&edit=1


Bug #65362 [Opn->Nab]: strcmp null return missing from docs.

2013-08-18 Thread johannes
Edit report at https://bugs.php.net/bug.php?id=65362&edit=1

 ID: 65362
 Updated by: johan...@php.net
 Reported by:atli dot jonsson at ymail dot com
 Summary:strcmp null return missing from docs.
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.5.1
 Block user comment: N
 Private report: N

 New Comment:

This is common PHP behavior and documented in a note here: 
http://php.net/functions.internal


Previous Comments:

[2013-08-18 07:54:39] yohg...@php.net

Other functions such as strlen()/strncmp()/etc return null. 
I'm not sure the best behavior, but E_NOTICE/E_WARNING for invalid parameters 
are 
preferred.


[2013-08-18 07:50:51] yohg...@php.net

I changed bug type since this is in Zend/zend_builtin_functions.c.

Shouldn't it raise error for arrays? Currently, it simply returned.

/* {{{ proto int strcmp(string str1, string str2)
   Binary safe string comparison */
ZEND_FUNCTION(strcmp)
{
char *s1, *s2;
int s1_len, s2_len;
   
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1_len, 
&s2, &s2_len) == FAILURE) {
return;
}

RETURN_LONG(zend_binary_strcmp(s1, s1_len, s2, s2_len));
}
/* }}} */


[2013-07-30 23:36:30] atli dot jonsson at ymail dot com

Description:

strcmp, strncmp, strcasecmp and strncasecmp will all return NULL when either 
string parameter is of a type that is invalid for string conversions, like 
Arrays, 
Objects and Resources.

However, the docs make no mention of this fact. (Aside from a comment.) As the 
0 
value returned for equal strings, and NULL returned for invalid comparisons, 
are 
equal when compared in a non-strict manner, this can lead to unexpected 
behaviour.

There is a warning issued, but without clarification the above is still in no 
way 
obvious. 

Test script:
---
https://bugs.php.net/bug.php?id=65362&edit=1


Bug #65460 [Opn]: PHP 5.4.18 fails to compile with Apache 2.4.6

2013-08-18 Thread mike
Edit report at https://bugs.php.net/bug.php?id=65460&edit=1

 ID: 65460
 Updated by: m...@php.net
 Reported by:stu at coe dot uky dot edu
 Summary:PHP 5.4.18 fails to compile with Apache 2.4.6
 Status: Open
 Type:   Bug
 Package:Compile Failure
 Operating System:   Slackware64 14.0
 PHP Version:5.4.18
-Assigned To:
+Assigned To:stas
 Block user comment: N
 Private report: N

 New Comment:

Looks like something was wrongly or not completely merged into 5.4?


Previous Comments:

[2013-08-18 02:16:58] giamteckchoon at gmail dot com

I overcome this error by following the steps outline in 
https://bugs.php.net/bug.php?id=64503 (note you need to install bison):

1. Apply the patch at 
https://bugs.php.net/patch-display.php?bug_id=64503&patch=bison_build_2.patch&revision=latest

2. rm -f Zend/zend_{language,ini}_parser.[ch]

3. Regenerate Zend/zend_language_parser.c etc.
./genfiles

4. Compile as usual.

Tested in SL6.4/CentOS6.4.

Hope this helps!


[2013-08-16 16:59:25] ben dot harper at rackspace dot com

I am running into this same error on RHEL 5 with Apache 2.2.3 and RHEL 6 with 
2.2.15.  Same config on both but slightly different error:

%configure \
--cache-file=../config.cache \
--with-libdir=%{_lib} \
--with-config-file-path=%{_sysconfdir} \
--with-config-file-scan-dir=%{_sysconfdir}/php.d \
--disable-debug \
--with-pic \
--disable-rpath \
--without-pear \
--with-bz2 \
--with-exec-dir=%{_bindir} \
--with-freetype-dir=%{_prefix} \
--with-png-dir=%{_prefix} \
--with-xpm-dir=%{_prefix} \
--enable-gd-native-ttf \
--with-t1lib=%{_prefix} \
--without-gdbm \
--with-gettext \
--with-gmp \
--with-iconv \
--with-jpeg-dir=%{_prefix} \
--with-openssl \
--with-pcre-regex \
--with-zlib \
--with-layout=GNU \
--enable-exif \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--with-kerberos \
--enable-ucd-snmp-hack \
--enable-shmop \
--enable-calendar \
--with-libxml-dir=%{_prefix} \
--enable-xml \
--with-system-tzdata \
--with-mhash \

Error in RHEL 5:

In file included from /builddir/build/BUILD/php-
5.4.18/ext/standard/basic_functions.c:48:
/builddir/build/BUILD/php-5.4.18/Zend/zend_language_parser.h:327: error: 
conflicting types for 'zendparse'
/builddir/build/BUILD/php-5.4.18/Zend/zend_globals_macros.h:35: error: previous 
declaration of 'zendparse' was here
/bin/sh /builddir/build/BUILD/php-5.4.18/build-ztscli/libtool --silent --
preserve-dup-deps --mode=compile /builddir/build/BUILD/php-5.4.18/build-
ztscli/meta_ccld  -Iext/standard/ -I/builddir/build/BUILD/php-
5.4.18/ext/standard/ -DPHP_ATOM_INC -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/include -I/builddir/build/BUILD/php-5.4.18/build-ztscli/main -
I/builddir/build/BUILD/php-5.4.18 -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/date/lib -I/builddir/build/BUILD/php-5.4.18/ext/date/lib -
I/builddir/build/BUILD/php-5.4.18/ext/ereg/regex -I/usr/include/libxml2 -
I/usr/kerberos/include -I/usr/include/enchant -I/usr/include/freetype2 -
I/usr/include/imap -I/usr/lib/firebird/include -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl/mbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl/mbfl -I/usr/include/pspell -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/TSRM -I/builddir/build/BUILD/php-
5.4.18/build-ztscli/Zend -I/builddir/build/BUILD/php-5.4.18/main -
I/builddir/build/BUILD/php-5.4.18/Zend -I/builddir/build/BUILD/php-5.4.18/TSRM -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/  -D_REENTRANT  -I/usr/include -
O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-
tables -fno-strict-aliasing -Wno-pointer-sign -fvisibility=hidden -pthread 
-DZTS  
-c /builddir/build/BUILD/php-5.4.18/ext/standard/filestat.c -o 
ext/standard/filestat.lo 
make: *** [ext/standard/basic_functions.lo] Error 1
make: *** Waiting for unfinished jobs
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c: In function 
'php_array_diff':
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3418: warning: 
'fci_key_cache' may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3417: warning: 'fci_key' 
may be used un

Bug #65362 [Opn]: strcmp null return missing from docs.

2013-08-18 Thread yohgaki
Edit report at https://bugs.php.net/bug.php?id=65362&edit=1

 ID: 65362
 Updated by: yohg...@php.net
 Reported by:atli dot jonsson at ymail dot com
 Summary:strcmp null return missing from docs.
 Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.5.1
 Block user comment: N
 Private report: N

 New Comment:

Other functions such as strlen()/strncmp()/etc return null. 
I'm not sure the best behavior, but E_NOTICE/E_WARNING for invalid parameters 
are 
preferred.


Previous Comments:

[2013-08-18 07:50:51] yohg...@php.net

I changed bug type since this is in Zend/zend_builtin_functions.c.

Shouldn't it raise error for arrays? Currently, it simply returned.

/* {{{ proto int strcmp(string str1, string str2)
   Binary safe string comparison */
ZEND_FUNCTION(strcmp)
{
char *s1, *s2;
int s1_len, s2_len;
   
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1_len, 
&s2, &s2_len) == FAILURE) {
return;
}

RETURN_LONG(zend_binary_strcmp(s1, s1_len, s2, s2_len));
}
/* }}} */


[2013-07-30 23:36:30] atli dot jonsson at ymail dot com

Description:

strcmp, strncmp, strcasecmp and strncasecmp will all return NULL when either 
string parameter is of a type that is invalid for string conversions, like 
Arrays, 
Objects and Resources.

However, the docs make no mention of this fact. (Aside from a comment.) As the 
0 
value returned for equal strings, and NULL returned for invalid comparisons, 
are 
equal when compared in a non-strict manner, this can lead to unexpected 
behaviour.

There is a warning issued, but without clarification the above is still in no 
way 
obvious. 

Test script:
---
https://bugs.php.net/bug.php?id=65362&edit=1


Doc->Bug #65362 [Opn]: strcmp null return missing from docs.

2013-08-18 Thread yohgaki
Edit report at https://bugs.php.net/bug.php?id=65362&edit=1

 ID: 65362
 Updated by: yohg...@php.net
 Reported by:atli dot jonsson at ymail dot com
 Summary:strcmp null return missing from docs.
 Status: Open
-Type:   Documentation Problem
+Type:   Bug
-Package:Documentation problem
+Package:Scripting Engine problem
 PHP Version:5.5.1
 Block user comment: N
 Private report: N

 New Comment:

I changed bug type since this is in Zend/zend_builtin_functions.c.

Shouldn't it raise error for arrays? Currently, it simply returned.

/* {{{ proto int strcmp(string str1, string str2)
   Binary safe string comparison */
ZEND_FUNCTION(strcmp)
{
char *s1, *s2;
int s1_len, s2_len;
   
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &s1, &s1_len, 
&s2, &s2_len) == FAILURE) {
return;
}

RETURN_LONG(zend_binary_strcmp(s1, s1_len, s2, s2_len));
}
/* }}} */


Previous Comments:

[2013-07-30 23:36:30] atli dot jonsson at ymail dot com

Description:

strcmp, strncmp, strcasecmp and strncasecmp will all return NULL when either 
string parameter is of a type that is invalid for string conversions, like 
Arrays, 
Objects and Resources.

However, the docs make no mention of this fact. (Aside from a comment.) As the 
0 
value returned for equal strings, and NULL returned for invalid comparisons, 
are 
equal when compared in a non-strict manner, this can lead to unexpected 
behaviour.

There is a warning issued, but without clarification the above is still in no 
way 
obvious. 

Test script:
---
https://bugs.php.net/bug.php?id=65362&edit=1


Bug #65384 [Asn]: pg_last_notice test failures

2013-08-18 Thread yohgaki
Edit report at https://bugs.php.net/bug.php?id=65384&edit=1

 ID: 65384
 Updated by: yohg...@php.net
 Reported by:ni...@php.net
 Summary:pg_last_notice test failures
 Status: Assigned
 Type:   Bug
 Package:PostgreSQL related
 PHP Version:5.5.2RC1
 Assigned To:yohgaki
 Block user comment: N
 Private report: N

 New Comment:

> Could it just be that they configured client_min_messages=WARNING?

Users can set it as SQL command.

SET client_min_messages TO WARNING;

It may be the reason why this test fails. I'll try to change message level to 
NOTICE to see if it helps. I'm not sure how NOTIFY command is handled by 
PostgreSQL, so it might not be related, though.

There is request that stores all notice during session. I'll work on this 
request later. If pgsql module keep all of them, it may consume all available 
memory. Therefore, configuration for max number of notices recorded will be 
added. It may help to find out what is going on.


Previous Comments:

[2013-08-09 20:35:53] m...@php.net

Could it just be that they configured client_min_messages=WARNING?


[2013-08-05 01:18:45] yohg...@php.net

I cannot reproduce on my Fedora19 and PHP 5.5 branch

[yohgaki@dev PHP-5.5]$ rpm -q postgresql
postgresql-9.2.4-1.fc19.x86_64

Anyone know what the PostgreSQL version on Travis CI?


[2013-08-03 15:04:51] ni...@php.net

Description:

The following pg_last_notice related tests currently fail on Travis CI:

PostgreSQL notice function [ext/pgsql/tests/09notice.phpt]
Bug #32223 (weird behaviour of pg_last_notice) 
[ext/pgsql/tests/80_bug32223.phpt]
Bug #32223 (weird behaviour of pg_last_notice using define) 
[ext/pgsql/tests/80_bug32223b.phpt]

The diffs are:

09notice.phpt:

001+ Cannot find notice message in hash
002+ bool(false)
003+ 
001- Notice: pg_query(): %s already a transaction in progress in %s on line %d
002- %s already a transaction in progress

80_bug32223.phpt:

005+ bool(false)
005- string(14) "NOTICE:  1"

80_bug32223b.phpt:

005+ bool(false)
005- string(14) "NOTICE:  1"







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65384&edit=1