Bug #64001 [Fbk]: Slow method invocation for PHP5.5.0 with Development Server

2013-01-18 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=64001edit=1

 ID: 64001
 Updated by: larue...@php.net
 Reported by:lisachenko dot it at gmail dot com
 Summary:Slow method invocation for PHP5.5.0 with Development
 Server
 Status: Feedback
 Type:   Bug
 Package:Performance problem
 Operating System:   Windows 7 x64
 PHP Version:5.5.0alpha3
 Block user comment: N
 Private report: N

 New Comment:

How about change to this:

class TestPerformance {

public function speed()
{
$time  = microtime(true);
$this-nop();
$end   = microtime(true);
echo 'Took ', sprintf(%0.3fms to call method, ($end - $time) * 1e3);
}

protected function nop() {}
}

$instance = new TestPerformance;
$instance-speed();


Previous Comments:

[2013-01-17 10:35:26] lisachenko dot it at gmail dot com

Yeah, detected the issue. 

Configurations were the same for all installations (default configuration), so 
this issue doesn't relate to the output buffering. Just to be sure, I have 
compared output for php -i for all installations, there were only differences 
in REQUEST_TIME, build version and ... presence of loaded php.ini file for 
PHP5.4.10. 

If php.ini file is present (settings are still default) and loaded, then speed 
of method invocation is higher... Amazing ) Without php.ini (but with the same 
default settings) speed is lower for internal development server.

This can be reproduced with PHP5.4.10 too. So this performance bug is more 
general.


[2013-01-17 05:45:40] larue...@php.net

I can not reproduce this, do they (5.4 and 5.5) share the same php.ini 
configure?

I think maybe due to output buffer.


[2013-01-16 07:41:27] lisachenko dot it at gmail dot com

Update PHP version for issue manually (There isn't alpha3 in select).


[2013-01-16 07:38:38] lisachenko dot it at gmail dot com

Description:

I notice, that speed of method invocation for PHP5.5.0alpha3 is significantly 
slower than for PHP5.4 when running the script with internal Development 
Server. However, for CLI-mode PHP5.5.0 is faster than PHP5.4.10, as expected.

To reproduce the issue, please start the development server and execute test 
script in the browser.


Test script:
---
class TestPerformance {

public function speed()
{
$time  = microtime(true);
$this-nop();
echo 'Took ', sprintf(%0.3fms to call method, (microtime(true) - 
$time) * 1e3);
}

protected function nop() {}
}

$instance = new TestPerformance;
$instance-speed();

Expected result:

Expecting that method invocation will take microseconds to finish:
php-5.4.10-Win32-VC9-x86:
  Took 0.005ms to call method
php-5.5.0alpha3-Win32-VC9-x86:
  Took 0.00Xms to call method

Actual result:
--
Method invocation for 5.5.0alpha3 took millisecond to finish:
php-5.4.10-Win32-VC9-x86:
  Took 0.005ms to call method
php-5.5.0alpha3-Win32-VC9-x86:
  Took 1.008ms to call method
php-5.5.0alpha3-nts-Win32-VC9-x86:
  Took 1.000ms to call method






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


Bug #64011 [Opn-Ver]: PHP 5.4 BREAKS get_html_translation_table()

2013-01-18 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=64011edit=1

 ID: 64011
 Updated by: cataphr...@php.net
 Reported by:spam2 at rhsoft dot net
 Summary:PHP 5.4 BREAKS get_html_translation_table()
-Status: Open
+Status: Verified
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.4.10
-Assigned To:
+Assigned To:cataphract
 Block user comment: N
 Private report: N



Previous Comments:

[2013-01-17 15:34:32] spam2 at rhsoft dot net

Description:

the 5.4 return value can not be seriously

hopefully at least Returns the translation table used by 
htmlspecialchars() and htmlentities() is NOT true

however, this breaks dialogs for special chars using
this table and insert the enitity in the HTML code

realize that not every page out there is UTF8 and never will be
_

PHP 5.4:

php -r print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 
'ISO8859-1'));
Array
(
[] = quot;
[] = amp;
['] = #039;
[] = lt;
[] = gt;
)
_

PHP 5.3:

php -r print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 
'ISO8859-1'));
Array
(
[ ] = nbsp;
[¡] = iexcl;
[¢] = cent;
[£] = pound;
[¤] = curren;
[Â¥] = yen;
[¦] = brvbar;
[§] = sect;
[¨] = uml;
[©] = copy;
[ª] = ordf;
[«] = laquo;
[¬] = not;
[­] = shy;
[®] = reg;
[¯] = macr;
[°] = deg;
[±] = plusmn;
[²] = sup2;
[³] = sup3;
[´] = acute;
[µ] = micro;
[¶] = para;
[·] = middot;
[¸] = cedil;
[¹] = sup1;
[º] = ordm;
[»] = raquo;
[¼] = frac14;
[½] = frac12;
[¾] = frac34;
[¿] = iquest;
[À] = Agrave;
[Á] = Aacute;
[Â] = Acirc;
[Ã] = Atilde;
[Ä] = Auml;
[Å] = Aring;
[Æ] = AElig;
[Ç] = Ccedil;
[È] = Egrave;
[É] = Eacute;
[Ê] = Ecirc;
[Ë] = Euml;
[Ì] = Igrave;
[Í] = Iacute;
[Î] = Icirc;
[Ï] = Iuml;
[Ð] = ETH;
[Ñ] = Ntilde;
[Ò] = Ograve;
[Ó] = Oacute;
[Ô] = Ocirc;
[Õ] = Otilde;
[Ö] = Ouml;
[×] = times;
[Ø] = Oslash;
[Ù] = Ugrave;
[Ú] = Uacute;
[Û] = Ucirc;
[Ü] = Uuml;
[Ý] = Yacute;
[Þ] = THORN;
[ß] = szlig;
[à] = agrave;
[á] = aacute;
[â] = acirc;
[ã] = atilde;
[ä] = auml;
[Ã¥] = aring;
[æ] = aelig;
[ç] = ccedil;
[è] = egrave;
[é] = eacute;
[ê] = ecirc;
[ë] = euml;
[ì] = igrave;
[í] = iacute;
[î] = icirc;
[ï] = iuml;
[ð] = eth;
[ñ] = ntilde;
[ò] = ograve;
[ó] = oacute;
[ô] = ocirc;
[õ] = otilde;
[ö] = ouml;
[÷] = divide;
[ø] = oslash;
[ù] = ugrave;
[ú] = uacute;
[û] = ucirc;
[ü] = uuml;
[ý] = yacute;
[þ] = thorn;
[ÿ] = yuml;
[] = amp;
[] = quot;
['] = #039;
[] = lt;
[] = gt;
)


Test script:
---
php -r print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 
'ISO8859-1'));

Expected result:

the full entity table like it worked for many years

Actual result:
--
a crippled array






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


Bug #61551 [Com]: dynamic linker says libnnz11.so not found

2013-01-18 Thread kenji dot uui at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=61551edit=1

 ID: 61551
 Comment by: kenji dot uui at gmail dot com
 Reported by:jm at trash-mail dot com
 Summary:dynamic linker says libnnz11.so not found
 Status: Feedback
 Type:   Bug
 Package:OCI8 related
 Operating System:   linux x64
 PHP Version:Irrelevant
 Assigned To:sixd
 Block user comment: N
 Private report: N

 New Comment:

I got the error when I built php-5.3.20:

/usr/bin/ld: warning: libnnz11.so, needed by 
/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so, not found (try using -rpath 
or -rpath-link)

configure:

'./configure' '--build=x86_64-redhat-linux-gnu' 
'--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' 
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' 
'--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 
'--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' 
'--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' 
'--infodir=/usr/share/info' '--cache-file=../config.cache' 
'--with-libdir=lib64' '--with-config-file-path=/etc' 
'--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' 
'--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' 
'--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' 
'--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' 
'--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' 
'--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' 
'--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' 
'--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' 
'--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--enable-xml' 
'--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--disable-dom' 
'--disable-dba' '--without-unixODBC' '--enable-pdo' '--disable-xmlreader' 
'--disable-xmlwriter' '--without-sqlite3' '--disable-phar' '--disable-fileinfo' 
'--disable-json' '--without-pspell' '--disable-wddx' '--without-curl' 
'--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' 
--with-oci8 --with-pdo-oci=$ORACLE_HOME --with-sqlite3 --enable-sqlite-utf8

Environment:

CentOS 5.2 64bit
oracle-xe-11.2.0-1.0.x86_64.rpm
PHP 5.3.20


Previous Comments:

[2012-03-29 15:05:56] s...@php.net

What operating system and version are you using?
What version of Instant Client are you using?
What is your 'configure' line?


[2012-03-29 09:04:00] jm at trash-mail dot com

Description:

Installed Oracle instantclient from RPM:

/usr/lib/oracle/11.2/client64/lib looks like this:

libclntsh.so
libclntsh.so.11.1
libnnz11.so
libocci.so
libocci.so.11.1
libociei.so
libocijdbc11.so
ojdbc5.jar
ojdbc6.jar
ottclasses.zip
xstreams.jar

configuring and compiling oci8 results in 
# ldd modules/oci8.so
...
libnnz11.so = not found
...

even though libnnz11.so is present in the above listing.

What helps is this:

--- config.m4.old   2012-03-29 10:31:58.0 +0200
+++ config.m4   2012-03-29 10:31:43.0 +0200
@@ -321,6 +321,7 @@

 AC_OCI8IC_VERSION($PHP_OCI8_INSTANT_CLIENT)
 PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
+PHP_ADD_LIBRARY(nnz11, 1, OCI8_SHARED_LIBADD)
 PHP_ADD_LIBPATH($PHP_OCI8_INSTANT_CLIENT, OCI8_SHARED_LIBADD)

 AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[ ])

-- # ldd modules/oci8.so
linux-vdso.so.1 =  (0x7fff9efc5000)
libclntsh.so.11.1 = 
/usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1 (0x7f2b4f24c000)
libnnz11.so = /usr/lib/oracle/11.2/client64/lib/libnnz11.so 
(0x7f2b4ee7f000)
libc.so.6 = /lib64/libc.so.6 (0x7f2b4eaef000)
libdl.so.2 = /lib64/libdl.so.2 (0x7f2b4e8eb000)
libm.so.6 = /lib64/libm.so.6 (0x7f2b4e694000)
libpthread.so.0 = /lib64/libpthread.so.0 (0x7f2b4e477000)
libnsl.so.1 = /lib64/libnsl.so.1 (0x7f2b4e25f000)
libaio.so.1 = /lib64/libaio.so.1 (0x7f2b4e05c000)
/lib64/ld-linux-x86-64.so.2 (0x7f2b51d11000)

\o/







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


Bug #64011 [Ver-Csd]: PHP 5.4 BREAKS get_html_translation_table()

2013-01-18 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=64011edit=1

 ID: 64011
 Updated by: cataphr...@php.net
 Reported by:spam2 at rhsoft dot net
 Summary:PHP 5.4 BREAKS get_html_translation_table()
-Status: Verified
+Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.4.10
 Assigned To:cataphract
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of glo...@nebm.ist.utl.pt
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=77ee200097b592c54fc2f925abcd6db829862d56
Log: Fix bug #64011 (get_html_translation_table())


Previous Comments:

[2013-01-17 15:34:32] spam2 at rhsoft dot net

Description:

the 5.4 return value can not be seriously

hopefully at least Returns the translation table used by 
htmlspecialchars() and htmlentities() is NOT true

however, this breaks dialogs for special chars using
this table and insert the enitity in the HTML code

realize that not every page out there is UTF8 and never will be
_

PHP 5.4:

php -r print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 
'ISO8859-1'));
Array
(
[] = quot;
[] = amp;
['] = #039;
[] = lt;
[] = gt;
)
_

PHP 5.3:

php -r print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 
'ISO8859-1'));
Array
(
[ ] = nbsp;
[¡] = iexcl;
[¢] = cent;
[£] = pound;
[¤] = curren;
[Â¥] = yen;
[¦] = brvbar;
[§] = sect;
[¨] = uml;
[©] = copy;
[ª] = ordf;
[«] = laquo;
[¬] = not;
[­] = shy;
[®] = reg;
[¯] = macr;
[°] = deg;
[±] = plusmn;
[²] = sup2;
[³] = sup3;
[´] = acute;
[µ] = micro;
[¶] = para;
[·] = middot;
[¸] = cedil;
[¹] = sup1;
[º] = ordm;
[»] = raquo;
[¼] = frac14;
[½] = frac12;
[¾] = frac34;
[¿] = iquest;
[À] = Agrave;
[Á] = Aacute;
[Â] = Acirc;
[Ã] = Atilde;
[Ä] = Auml;
[Å] = Aring;
[Æ] = AElig;
[Ç] = Ccedil;
[È] = Egrave;
[É] = Eacute;
[Ê] = Ecirc;
[Ë] = Euml;
[Ì] = Igrave;
[Í] = Iacute;
[Î] = Icirc;
[Ï] = Iuml;
[Ð] = ETH;
[Ñ] = Ntilde;
[Ò] = Ograve;
[Ó] = Oacute;
[Ô] = Ocirc;
[Õ] = Otilde;
[Ö] = Ouml;
[×] = times;
[Ø] = Oslash;
[Ù] = Ugrave;
[Ú] = Uacute;
[Û] = Ucirc;
[Ü] = Uuml;
[Ý] = Yacute;
[Þ] = THORN;
[ß] = szlig;
[à] = agrave;
[á] = aacute;
[â] = acirc;
[ã] = atilde;
[ä] = auml;
[Ã¥] = aring;
[æ] = aelig;
[ç] = ccedil;
[è] = egrave;
[é] = eacute;
[ê] = ecirc;
[ë] = euml;
[ì] = igrave;
[í] = iacute;
[î] = icirc;
[ï] = iuml;
[ð] = eth;
[ñ] = ntilde;
[ò] = ograve;
[ó] = oacute;
[ô] = ocirc;
[õ] = otilde;
[ö] = ouml;
[÷] = divide;
[ø] = oslash;
[ù] = ugrave;
[ú] = uacute;
[û] = ucirc;
[ü] = uuml;
[ý] = yacute;
[þ] = thorn;
[ÿ] = yuml;
[] = amp;
[] = quot;
['] = #039;
[] = lt;
[] = gt;
)


Test script:
---
php -r print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 
'ISO8859-1'));

Expected result:

the full entity table like it worked for many years

Actual result:
--
a crippled array






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


[PHP-BUG] Bug #64016 [NEW]: file_get_contents does not fill up $http_response_header via HEAD method

2013-01-18 Thread anil at saog dot net
From: anil at saog dot net
Operating system: Centos 6.2
PHP version:  5.4.11
Package:  *URL Functions
Bug Type: Bug
Bug description:file_get_contents does not fill up $http_response_header via 
HEAD method

Description:

PHP is compiled with option --with-curlwrappers. Whenever a HEAD request
issued with file_get_contents, $http_response_header is not filled-up
but upon calling get_headers(), variable $http_response_header
auto-magically filled up.

Test script:
---
$url = 'http://www.google.com';
$ctx = stream_context_create();

stream_context_set_option($ctx, array('http' = array('method' =
'HEAD','timeout' = 60)));

$res = file_get_contents($url, false, $ctx);
var_dump($http_response_header); // NULL
get_headers($url);
var_dump($http_response_header); // filled up correctly

Expected result:

$http_response_header filled-up correctly

Actual result:
--
$http_response_header is always NULL

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



[PHP-BUG] Bug #64017 [NEW]: php_libxml_initialize overwrites global entity loader

2013-01-18 Thread piotrek dot pokora at gmail dot com
From: piotrek dot pokora at gmail dot com
Operating system: Linux/Debian
PHP version:  5.4.11
Package:  CGI/CLI related
Bug Type: Bug
Bug description:php_libxml_initialize overwrites global entity loader

Description:

php_libxml_initialize function in ext/libxml sets global entity loader via
xmlSetExternalEntityLoader(_php_libxml_pre_ext_ent_loader). This affects
any library which is loaded implicitly during loading phase and triggers
segmentation fault.

Gdb output:

Program received signal SIGSEGV, Segmentation fault.
_zend_hash_index_update_or_next_insert (ht=0xd1b910, h=0, pData=value
optimized out, nDataSize=16, pDest=0x0, flag=1)
at /app/php-5.4.8/Zend/zend_hash.c:385
385 /app/php-5.4.8/Zend/zend_hash.c: No such file or directory.
in /app/php-5.4.8/Zend/zend_hash.c
(gdb) bt
#0  _zend_hash_index_update_or_next_insert (ht=0xd1b910, h=0, pData=value
optimized out, nDataSize=16, pDest=0x0, flag=1)
at /app/php-5.4.8/Zend/zend_hash.c:385
#1  0x0068f600 in zend_list_insert (ptr=value optimized out,
type=value optimized out) at /app/php-5.4.8/Zend/zend_list.c:46
#2  0x0068f61e in zend_register_resource (rsrc_result=0x0,
rsrc_pointer=0x77fad2c8, rsrc_type=-134556984)
at /app/php-5.4.8/Zend/zend_list.c:98
#3  0x006392d6 in php_stream_context_alloc () at
/app/php-5.4.8/main/streams/streams.c:2199
#4  0x00455035 in php_libxml_streams_IO_open_wrapper
(filename=0xea1990 /app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, 
mode=0xa71434 rb, read_only=1) at
/app/php-5.4.8/ext/libxml/libxml.c:334
#5  0x0045509f in php_libxml_streams_IO_open_read_wrapper
(URI=0x77fad2c8 0\320\372\367\377\177, enc=XML_CHAR_ENCODING_NONE)
at /app/php-5.4.8/ext/libxml/libxml.c:345
#6  php_libxml_input_buffer_create_filename (URI=0x77fad2c8
0\320\372\367\377\177, enc=XML_CHAR_ENCODING_NONE)
at /app/php-5.4.8/ext/libxml/libxml.c:386
#7  0x76dc7d8d in xmlNewInputFromFile () from
/usr/lib/libxml2.so.2
#8  0x0045681b in _php_libxml_pre_ext_ent_loader (URL=0xea1990
/app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, ID=0x0, 
context=0xe9e0b0) at /app/php-5.4.8/ext/libxml/libxml.c:694
#9  0x76e8d59b in xmlSAX2ResolveEntity () from
/usr/lib/libxml2.so.2
#10 0x76de35a5 in xmlSAXParseDTD () from /usr/lib/libxml2.so.2
#11 0x75687307 in gda_init () at gda-init.c:198
#12 0x7610c249 in midgard_init () at src/midgard.c:138
#13 0x7639cb61 in zm_startup_midgard2 (type=1, module_number=28) at
/app/midgard-php5-10.05.7/midgard.c:324

Steps from #11 to #8 clearly shows that php's hook is wrong in this case.
It doesn't happen with PHP 5.3, where global hook is not set.


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



[PHP-BUG] Bug #64018 [NEW]: missing elements from the result set when using foreach with referencing $value

2013-01-18 Thread potyo dot ada at gmail dot com
From: potyo dot ada at gmail dot com
Operating system: Ubuntu 12.10
PHP version:  Irrelevant
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:missing elements from the result set when using foreach with 
referencing $value

Description:

If we try to change the array elements in one foreach loop using referenced

$value, and in a second foreach loop remove some elements from the array,
then 
the resulting array misses some element, some elements are duplicated, or
simply 
nothing is removed, depending on that, which element we want to remove from
the 
array in the second loop.

Test script:
---
$a=array(array('a'='11', 'aa'='22'), array('a'='33', 'aa'='44'),
array('a'='55', 'aa'='66'));
foreach ($a as $v) // if we use $k=$v here
{
$v['c']='99'; // and $a[$k]['c']='99' here, then it produces the 
expected
result
}
foreach ($a as $k=$v)
{
if ($v['aa']=='22')
{
unset($a[$k]); // 
}
}
print_r($a);


Expected result:

Array
(
[1] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

[2] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

)

Actual result:
--
Array
(
[1] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

[2] = Array
(
[a] = 55
[aa] = 66
[c] = 99
)

)


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



Bug #64018 [Opn]: missing elements from the result set when using foreach with referencing $value

2013-01-18 Thread potyo dot ada at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64018edit=1

 ID: 64018
 User updated by:potyo dot ada at gmail dot com
 Reported by:potyo dot ada at gmail dot com
 Summary:missing elements from the result set when using
 foreach with referencing $value
 Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Ubuntu 12.10
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Tested using 5.3.5 and 5.4.10 versions


Previous Comments:

[2013-01-18 11:40:40] potyo dot ada at gmail dot com

Description:

If we try to change the array elements in one foreach loop using referenced 
$value, and in a second foreach loop remove some elements from the array, then 
the resulting array misses some element, some elements are duplicated, or 
simply 
nothing is removed, depending on that, which element we want to remove from the 
array in the second loop.

Test script:
---
$a=array(array('a'='11', 'aa'='22'), array('a'='33', 'aa'='44'), 
array('a'='55', 'aa'='66'));
foreach ($a as $v) // if we use $k=$v here
{
$v['c']='99'; // and $a[$k]['c']='99' here, then it produces the 
expected result
}
foreach ($a as $k=$v)
{
if ($v['aa']=='22')
{
unset($a[$k]); // 
}
}
print_r($a);


Expected result:

Array
(
[1] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

[2] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

)

Actual result:
--
Array
(
[1] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

[2] = Array
(
[a] = 55
[aa] = 66
[c] = 99
)

)







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


Bug #64017 [Opn]: php_libxml_initialize overwrites global entity loader

2013-01-18 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=64017edit=1

 ID: 64017
 Updated by: cataphr...@php.net
 Reported by:piotrek dot pokora at gmail dot com
 Summary:php_libxml_initialize overwrites global entity
 loader
 Status: Open
 Type:   Bug
 Package:CGI/CLI related
 Operating System:   Linux/Debian
 PHP Version:5.4.11
 Block user comment: N
 Private report: N

 New Comment:

I don't think that's the problem. Your frame #8:

#8  0x0045681b in _php_libxml_pre_ext_ent_loader (URL=0xea1990 
/app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, ID=0x0, 
context=0xe9e0b0) at /app/php-5.4.8/ext/libxml/libxml.c:694

indicates PHP is using the original entity loader:

694return _php_libxml_default_entity_loader(URL, ID, context);

precisely because PHP refuses to use the custom entity loader except if all the 
modules have gone though module AND request init. 
_php_libxml_default_entity_loader is set here:

730PHP_LIBXML_API void php_libxml_initialize(void)
731{
732if (!_php_libxml_initialized) {
733/* we should be the only one's to ever init!! */
734xmlInitParser();
735
736_php_libxml_default_entity_loader = xmlGetExternalEntityLoader();
737xmlSetExternalEntityLoader(_php_libxml_pre_ext_ent_loader);

So my guess is the problem is elsewhere. Namely, this commit:

https://github.com/php/php-src/commit/d8bddb966563

xmlParserInputBufferCreateFilenameDefault() is now called on module init and 
not on request init in some SAPIs. Other modules that use libxml but happen to 
run minit after the libxml PHP module may have some trouble as 
php_libxml_input_buffer_create_filename() may not be ready to be executed yet.


Previous Comments:

[2013-01-18 11:28:20] piotrek dot pokora at gmail dot com

Description:

php_libxml_initialize function in ext/libxml sets global entity loader via 
xmlSetExternalEntityLoader(_php_libxml_pre_ext_ent_loader). This affects any 
library which is loaded implicitly during loading phase and triggers 
segmentation fault.

Gdb output:

Program received signal SIGSEGV, Segmentation fault.
_zend_hash_index_update_or_next_insert (ht=0xd1b910, h=0, pData=value 
optimized out, nDataSize=16, pDest=0x0, flag=1)
at /app/php-5.4.8/Zend/zend_hash.c:385
385 /app/php-5.4.8/Zend/zend_hash.c: No such file or directory.
in /app/php-5.4.8/Zend/zend_hash.c
(gdb) bt
#0  _zend_hash_index_update_or_next_insert (ht=0xd1b910, h=0, pData=value 
optimized out, nDataSize=16, pDest=0x0, flag=1)
at /app/php-5.4.8/Zend/zend_hash.c:385
#1  0x0068f600 in zend_list_insert (ptr=value optimized out, 
type=value optimized out) at /app/php-5.4.8/Zend/zend_list.c:46
#2  0x0068f61e in zend_register_resource (rsrc_result=0x0, 
rsrc_pointer=0x77fad2c8, rsrc_type=-134556984)
at /app/php-5.4.8/Zend/zend_list.c:98
#3  0x006392d6 in php_stream_context_alloc () at 
/app/php-5.4.8/main/streams/streams.c:2199
#4  0x00455035 in php_libxml_streams_IO_open_wrapper (filename=0xea1990 
/app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, 
mode=0xa71434 rb, read_only=1) at /app/php-5.4.8/ext/libxml/libxml.c:334
#5  0x0045509f in php_libxml_streams_IO_open_read_wrapper 
(URI=0x77fad2c8 0\320\372\367\377\177, enc=XML_CHAR_ENCODING_NONE)
at /app/php-5.4.8/ext/libxml/libxml.c:345
#6  php_libxml_input_buffer_create_filename (URI=0x77fad2c8 
0\320\372\367\377\177, enc=XML_CHAR_ENCODING_NONE)
at /app/php-5.4.8/ext/libxml/libxml.c:386
#7  0x76dc7d8d in xmlNewInputFromFile () from /usr/lib/libxml2.so.2
#8  0x0045681b in _php_libxml_pre_ext_ent_loader (URL=0xea1990 
/app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, ID=0x0, 
context=0xe9e0b0) at /app/php-5.4.8/ext/libxml/libxml.c:694
#9  0x76e8d59b in xmlSAX2ResolveEntity () from /usr/lib/libxml2.so.2
#10 0x76de35a5 in xmlSAXParseDTD () from /usr/lib/libxml2.so.2
#11 0x75687307 in gda_init () at gda-init.c:198
#12 0x7610c249 in midgard_init () at src/midgard.c:138
#13 0x7639cb61 in zm_startup_midgard2 (type=1, module_number=28) at 
/app/midgard-php5-10.05.7/midgard.c:324

Steps from #11 to #8 clearly shows that php's hook is wrong in this case.
It doesn't happen with PHP 5.3, where global hook is not set.







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


Bug #64017 [Opn-Fbk]: php_libxml_initialize overwrites global entity loader

2013-01-18 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=64017edit=1

 ID: 64017
 Updated by: cataphr...@php.net
 Reported by:piotrek dot pokora at gmail dot com
 Summary:php_libxml_initialize overwrites global entity
 loader
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:CGI/CLI related
 Operating System:   Linux/Debian
 PHP Version:5.4.11
 Block user comment: N
 Private report: N

 New Comment:

Can you patch the code so that _php_libxml_per_request_initialization is always 
1 and see if that solves the problem?


Previous Comments:

[2013-01-18 11:56:30] cataphr...@php.net

I don't think that's the problem. Your frame #8:

#8  0x0045681b in _php_libxml_pre_ext_ent_loader (URL=0xea1990 
/app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, ID=0x0, 
context=0xe9e0b0) at /app/php-5.4.8/ext/libxml/libxml.c:694

indicates PHP is using the original entity loader:

694return _php_libxml_default_entity_loader(URL, ID, context);

precisely because PHP refuses to use the custom entity loader except if all the 
modules have gone though module AND request init. 
_php_libxml_default_entity_loader is set here:

730PHP_LIBXML_API void php_libxml_initialize(void)
731{
732if (!_php_libxml_initialized) {
733/* we should be the only one's to ever init!! */
734xmlInitParser();
735
736_php_libxml_default_entity_loader = xmlGetExternalEntityLoader();
737xmlSetExternalEntityLoader(_php_libxml_pre_ext_ent_loader);

So my guess is the problem is elsewhere. Namely, this commit:

https://github.com/php/php-src/commit/d8bddb966563

xmlParserInputBufferCreateFilenameDefault() is now called on module init and 
not on request init in some SAPIs. Other modules that use libxml but happen to 
run minit after the libxml PHP module may have some trouble as 
php_libxml_input_buffer_create_filename() may not be ready to be executed yet.


[2013-01-18 11:28:20] piotrek dot pokora at gmail dot com

Description:

php_libxml_initialize function in ext/libxml sets global entity loader via 
xmlSetExternalEntityLoader(_php_libxml_pre_ext_ent_loader). This affects any 
library which is loaded implicitly during loading phase and triggers 
segmentation fault.

Gdb output:

Program received signal SIGSEGV, Segmentation fault.
_zend_hash_index_update_or_next_insert (ht=0xd1b910, h=0, pData=value 
optimized out, nDataSize=16, pDest=0x0, flag=1)
at /app/php-5.4.8/Zend/zend_hash.c:385
385 /app/php-5.4.8/Zend/zend_hash.c: No such file or directory.
in /app/php-5.4.8/Zend/zend_hash.c
(gdb) bt
#0  _zend_hash_index_update_or_next_insert (ht=0xd1b910, h=0, pData=value 
optimized out, nDataSize=16, pDest=0x0, flag=1)
at /app/php-5.4.8/Zend/zend_hash.c:385
#1  0x0068f600 in zend_list_insert (ptr=value optimized out, 
type=value optimized out) at /app/php-5.4.8/Zend/zend_list.c:46
#2  0x0068f61e in zend_register_resource (rsrc_result=0x0, 
rsrc_pointer=0x77fad2c8, rsrc_type=-134556984)
at /app/php-5.4.8/Zend/zend_list.c:98
#3  0x006392d6 in php_stream_context_alloc () at 
/app/php-5.4.8/main/streams/streams.c:2199
#4  0x00455035 in php_libxml_streams_IO_open_wrapper (filename=0xea1990 
/app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, 
mode=0xa71434 rb, read_only=1) at /app/php-5.4.8/ext/libxml/libxml.c:334
#5  0x0045509f in php_libxml_streams_IO_open_read_wrapper 
(URI=0x77fad2c8 0\320\372\367\377\177, enc=XML_CHAR_ENCODING_NONE)
at /app/php-5.4.8/ext/libxml/libxml.c:345
#6  php_libxml_input_buffer_create_filename (URI=0x77fad2c8 
0\320\372\367\377\177, enc=XML_CHAR_ENCODING_NONE)
at /app/php-5.4.8/ext/libxml/libxml.c:386
#7  0x76dc7d8d in xmlNewInputFromFile () from /usr/lib/libxml2.so.2
#8  0x0045681b in _php_libxml_pre_ext_ent_loader (URL=0xea1990 
/app/libgda/share/libgda-4.0/dtd/libgda-array.dtd, ID=0x0, 
context=0xe9e0b0) at /app/php-5.4.8/ext/libxml/libxml.c:694
#9  0x76e8d59b in xmlSAX2ResolveEntity () from /usr/lib/libxml2.so.2
#10 0x76de35a5 in xmlSAXParseDTD () from /usr/lib/libxml2.so.2
#11 0x75687307 in gda_init () at gda-init.c:198
#12 0x7610c249 in midgard_init () at src/midgard.c:138
#13 0x7639cb61 in zm_startup_midgard2 (type=1, module_number=28) at 
/app/midgard-php5-10.05.7/midgard.c:324

Steps from #11 to #8 clearly shows that php's hook is wrong in this case.
It doesn't happen with PHP 5.3, where global hook is not set.







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


Bug #64018 [Opn-Nab]: missing elements from the result set when using foreach with referencing $value

2013-01-18 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=64018edit=1

 ID: 64018
 Updated by: cataphr...@php.net
 Reported by:potyo dot ada at gmail dot com
 Summary:missing elements from the result set when using
 foreach with referencing $value
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Ubuntu 12.10
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Not a bug; when the second loop starts $v is still a reference to the last $a 
element and you're writing to that reference.


Previous Comments:

[2013-01-18 11:41:39] potyo dot ada at gmail dot com

Tested using 5.3.5 and 5.4.10 versions


[2013-01-18 11:40:40] potyo dot ada at gmail dot com

Description:

If we try to change the array elements in one foreach loop using referenced 
$value, and in a second foreach loop remove some elements from the array, then 
the resulting array misses some element, some elements are duplicated, or 
simply 
nothing is removed, depending on that, which element we want to remove from the 
array in the second loop.

Test script:
---
$a=array(array('a'='11', 'aa'='22'), array('a'='33', 'aa'='44'), 
array('a'='55', 'aa'='66'));
foreach ($a as $v) // if we use $k=$v here
{
$v['c']='99'; // and $a[$k]['c']='99' here, then it produces the 
expected result
}
foreach ($a as $k=$v)
{
if ($v['aa']=='22')
{
unset($a[$k]); // 
}
}
print_r($a);


Expected result:

Array
(
[1] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

[2] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

)

Actual result:
--
Array
(
[1] = Array
(
[a] = 33
[aa] = 44
[c] = 99
)

[2] = Array
(
[a] = 55
[aa] = 66
[c] = 99
)

)







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


Bug #64009 [Fbk-Nab]: fsockopen function not work on chrooted ubuntu linux os on android device.

2013-01-18 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=64009edit=1

 ID: 64009
 Updated by: cataphr...@php.net
 Reported by:anilsoneji at gmail dot com
 Summary:fsockopen function not work on chrooted ubuntu linux
 os on android device.
-Status: Feedback
+Status: Not a bug
 Type:   Bug
 Package:Sockets related
 Operating System:   chrooted ubuntu on android
 PHP Version:5.3.20
 Block user comment: N
 Private report: N

 New Comment:

.


Previous Comments:

[2013-01-18 06:08:24] anilsoneji at gmail dot com

Problem has been solved.

include users mysql and apache (www-data) in group 3003 (aid_inet)


[2013-01-18 00:48:15] ahar...@php.net

I have a similar setup on my own tablet, so I can have a go at replicating this 
over the weekend, but to ask the obvious question first: are you sure there's a 
socket server listening on the loopback interface on port 5038? What happens if 
you telnet 127.0.0.1 5038 from the shell?


[2013-01-17 11:56:25] anilsoneji at gmail dot com

Description:

fsockopen function not work on chrooted ubuntu linux os on android device.

Test script:
---
?php
$socket = fsockopen(127.0.0.1,5038, $errno, $errstr, 1);
fputs($socket, Action: Login\r\n); 
fputs($socket, UserName: admin\r\n); 
fputs($socket, Secret: devindia\r\n\r\n); 
fputs($socket, Action: Command\r\n);
fputs($socket, Command: reload\r\n\r\n); 
fputs($socket, Action: Logoff\r\n\r\n);
while (!feof($socket)) 
{ 
fgets($socket,200);
echo $value[$count].'br';  
} 
fclose($socket);

?

Actual result:
--
2013-01-17 15:52:20: (mod_fastcgi.c.2701) FastCGI-stderr: PHP Warning:  
fsockopen(): unable to connect to 127.0.0.1:5038 (Unknown error) in 
/var/www/test.php on line 2






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


Bug #64001 [Com]: Slow method invocation for PHP5.5.0 with Development Server

2013-01-18 Thread lisachenko dot it at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64001edit=1

 ID: 64001
 Comment by: lisachenko dot it at gmail dot com
 Reported by:lisachenko dot it at gmail dot com
 Summary:Slow method invocation for PHP5.5.0 with Development
 Server
 Status: Feedback
 Type:   Bug
 Package:Performance problem
 Operating System:   Windows 7 x64
 PHP Version:5.5.0alpha3
 Block user comment: N
 Private report: N

 New Comment:

Rewriting the source code in that way fixes the issue and execution time is 
about 4us. But how presence of php.ini with default settings can be related 
with the speed of method invocation for my case?

Can you reproduce it with my code and my php.ini http://pastebin.com/zDNvzuvg ? 
Here is the difference for php -i for loaded/unloaded php.ini 
http://pastebin.com/BrxBaTJ0 Speed of execution for my previous code block is 
not equal (5us and 1ms)


Previous Comments:

[2013-01-18 09:18:47] larue...@php.net

How about change to this:

class TestPerformance {

public function speed()
{
$time  = microtime(true);
$this-nop();
$end   = microtime(true);
echo 'Took ', sprintf(%0.3fms to call method, ($end - $time) * 1e3);
}

protected function nop() {}
}

$instance = new TestPerformance;
$instance-speed();


[2013-01-17 10:35:26] lisachenko dot it at gmail dot com

Yeah, detected the issue. 

Configurations were the same for all installations (default configuration), so 
this issue doesn't relate to the output buffering. Just to be sure, I have 
compared output for php -i for all installations, there were only differences 
in REQUEST_TIME, build version and ... presence of loaded php.ini file for 
PHP5.4.10. 

If php.ini file is present (settings are still default) and loaded, then speed 
of method invocation is higher... Amazing ) Without php.ini (but with the same 
default settings) speed is lower for internal development server.

This can be reproduced with PHP5.4.10 too. So this performance bug is more 
general.


[2013-01-17 05:45:40] larue...@php.net

I can not reproduce this, do they (5.4 and 5.5) share the same php.ini 
configure?

I think maybe due to output buffer.


[2013-01-16 07:41:27] lisachenko dot it at gmail dot com

Update PHP version for issue manually (There isn't alpha3 in select).


[2013-01-16 07:38:38] lisachenko dot it at gmail dot com

Description:

I notice, that speed of method invocation for PHP5.5.0alpha3 is significantly 
slower than for PHP5.4 when running the script with internal Development 
Server. However, for CLI-mode PHP5.5.0 is faster than PHP5.4.10, as expected.

To reproduce the issue, please start the development server and execute test 
script in the browser.


Test script:
---
class TestPerformance {

public function speed()
{
$time  = microtime(true);
$this-nop();
echo 'Took ', sprintf(%0.3fms to call method, (microtime(true) - 
$time) * 1e3);
}

protected function nop() {}
}

$instance = new TestPerformance;
$instance-speed();

Expected result:

Expecting that method invocation will take microseconds to finish:
php-5.4.10-Win32-VC9-x86:
  Took 0.005ms to call method
php-5.5.0alpha3-Win32-VC9-x86:
  Took 0.00Xms to call method

Actual result:
--
Method invocation for 5.5.0alpha3 took millisecond to finish:
php-5.4.10-Win32-VC9-x86:
  Took 0.005ms to call method
php-5.5.0alpha3-Win32-VC9-x86:
  Took 1.008ms to call method
php-5.5.0alpha3-nts-Win32-VC9-x86:
  Took 1.000ms to call method






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


Bug #63258 [Com]: seg fault with PDO and dblib using DBSETOPT(H-link, DBQUOTEDIDENT, 1);

2013-01-18 Thread f dot marquis at of2m dot fr
Edit report at https://bugs.php.net/bug.php?id=63258edit=1

 ID: 63258
 Comment by: f dot marquis at of2m dot fr
 Reported by:paul dot visco at roswellpark dot org
 Summary:seg fault with PDO and dblib using DBSETOPT(H-link,
 DBQUOTEDIDENT, 1);
 Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   centos 5.8
 PHP Version:5.4.7
 Assigned To:ssufficool
 Block user comment: N
 Private report: N

 New Comment:

this patch seems to cause an error :
#63638 Cannot connect to SQL Server 2008 with PDO dblib


Previous Comments:

[2012-10-12 02:39:42] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=0c0b5a3543f37dc3dfe7fa55629f2749c0b05294
Log: Fixed bug #63258 (seg fault with PDO and dblib using DBSETOPT(H-gt;link, 
DBQUOTEDIDENT, 1))


[2012-10-12 02:38:28] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=0c0b5a3543f37dc3dfe7fa55629f2749c0b05294
Log: Fixed bug #63258 (seg fault with PDO and dblib using DBSETOPT(H-gt;link, 
DBQUOTEDIDENT, 1))


[2012-10-11 16:21:34] ssuffic...@php.net

The patch looks legit. I'm not sure why I used 1 instead of null for the 
parameter value. I have not posted patches since the source was moved to git. 
Please merge this change for me if possible.


[2012-10-11 10:23:57] larue...@php.net

ssufficool, do you have time to look into this?

seems you intentionally change the NULL to 1 in https://github.com/php/php-
src/commit/36b8c4cb

thanks


[2012-10-11 10:22:26] larue...@php.net

according to MSDN, the fix should be:

diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 77832f9..baf1dcc 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -315,7 +315,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
DBSETOPT(H-link, DBTEXTSIZE, 2147483647);
 
/* allow double quoted indentifiers */
-   DBSETOPT(H-link, DBQUOTEDIDENT, 1);
+   DBSETOPT(H-link, DBQUOTEDIDENT, NULL);
 

see: http://msdn.microsoft.com/en-us/library/aa937147(v=sql.80).aspx


Note  When you use DBQUOTEDIDENT, you must set param to NULL.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=63258


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


Bug #44780 [Com]: some time zone offsets not recognized by timezone_name_from_abbr

2013-01-18 Thread ivo dot tijan at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=44780edit=1

 ID: 44780
 Comment by: ivo dot tijan at gmail dot com
 Reported by:shawn dot parker at alttech dot com
 Summary:some time zone offsets not recognized by
 timezone_name_from_abbr
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   *
 PHP Version:5CVS-2008-08-14
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

?php $timezoneName = timezone_name_from_abbr(, 28800, false); ?

Fatal error: Uncaught exception 'Exception' with message 
'DateTimeZone::__construct() [a 
href='datetimezone.--construct'datetimezone.--construct/a]: Unknown or bad 
timezone ()' in C:\ ... \test.php:46 Stack trace: #0 C:\ ... \test.php(46): 
DateTimeZone-__construct('') #1 {main} thrown in C:\ ... \test.php on line 46

I am using PHP 5.3.6 MSVC9 (Visual C++ 2008).

It is January 2013 and this bug is still around, even though 23 out of 24 
current votes reproduced the bug!!


Previous Comments:

[2011-05-30 23:51:34] theogaden at gmail dot com

I have the exact same problem and I found this bug entry thanks to someone at 
stackoverflow. Here was my original question: 
http://stackoverflow.com/questions/6180892/why-does-timezone-name-from-abbr-
return-an-empty-string

Test Code
--
$offset = -10; //UM10
echo timezone_name_from_abbr('', $offset * 3600, true); //empty string

Expected Result
--
Pacific/Honolulu

Actual result:
--
false

I am using PHP 5.3.0.


[2009-05-08 18:23:40] mfburdett at gmail dot com

I was able to resolve this by changing the fallbackmap from hours to minutes 
(the bug is apparently due to some issue with float vs. integer).  Also, this 
patch adds Caracas and Shanghai time (there are likely other missing time 
zones, however) and uses the new spelling for Calcutta (Kolkata).

Index: ext/date/lib/fallbackmap.h
===
RCS file: /repository/php-src/ext/date/lib/fallbackmap.h,v
retrieving revision 1.3
diff -u -p -r1.3 fallbackmap.h
--- ext/date/lib/fallbackmap.h  15 Oct 2005 18:14:40 -  1.3
+++ ext/date/lib/fallbackmap.h  8 May 2009 18:18:32 -
@@ -1,40 +1,42 @@
-   { sst,   0,  -11,  Pacific/Apia },
-   { hst,   0,  -10,  Pacific/Honolulu },
-   { akst,  0,   -9,  America/Anchorage },
-   { akdt,  1,   -8,  America/Anchorage },
-   { pst,   0,   -8,  America/Los_Angeles },
-   { pdt,   1,   -7,  America/Los_Angeles },
-   { mst,   0,   -7,  America/Denver },
-   { mdt,   1,   -6,  America/Denver },
-   { cst,   0,   -6,  America/Chicago },
-   { cdt,   1,   -5,  America/Chicago },
-   { est,   0,   -5,  America/New_York },
-   { edt,   1,   -4,  America/New_York },
-   { ast,   0,   -4,  America/Halifax },
-   { adt,   1,   -3,  America/Halifax },
-   { brt,   0,   -3,  America/Sao_Paulo },
-   { brst,  1,   -2,  America/Sao_Paulo },
-   { azost, 0,   -1,  Atlantic/Azores },
-   { azodt, 1,0,  Atlantic/Azores },
-   { gmt,   0,0,  Europe/London },
-   { bst,   1,1,  Europe/London },
-   { cet,   0,1,  Europe/Paris },
-   { cest,  1,2,  Europe/Paris },
-   { eet,   0,2,  Europe/Helsinki },
-   { eest,  1,3,  Europe/Helsinki },
-   { msk,   0,3,  Europe/Moscow },
-   { msd,   1,4,  Europe/Moscow },
-   { gst,   0,4,  Asia/Dubai },
-   { pkt,   0,5,  Asia/Karachi },
-   { ist,   0,  5.5,  Asia/Calcutta },
-   { npt,   0, 5.75,  Asia/Katmandu },
-   { yekt,  1,6,  Asia/Yekaterinburg },
-   { novst, 1,7,  Asia/Novosibirsk },
-   { krat,  0,7,  Asia/Krasnoyarsk },
-   { krast, 1,8,  Asia/Krasnoyarsk },
-   { jst,   0,9,  Asia/Tokyo },
-   { est,   0,   10,  Australia/Melbourne },
-   { cst,   1, 10.5,  Australia/Adelaide },
-   { est,   1,   11,  Australia/Melbourne },
-   { nzst,  0,   12,  Pacific/Auckland },
-   { nzdt,  1,   13,  Pacific/Auckland },
+   { sst,   0, -660, Pacific/Apia },
+   { hst,   0, -600, Pacific/Honolulu },
+   { akst,  0, -540, America/Anchorage },
+   { akdt,  1, -480, America/Anchorage },
+   { pst,   0, -480, America/Los_Angeles },
+   { pdt,   1, -420, America/Los_Angeles },
+   { mst,   0, -420, America/Denver },
+   { mdt,   1, -360, America/Denver },
+   { cst,   0, -360, America/Chicago },
+   { cdt,   1, -300, America/Chicago },
+   { est,   0, -300, America/New_York },
+   { vet,   0, -270, America/Caracas },
+   { edt,   1, -240, America/New_York },
+   { ast,   0, -240, 

Bug #64001 [Fbk-Nab]: Slow method invocation for PHP5.5.0 with Development Server

2013-01-18 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=64001edit=1

 ID: 64001
 Updated by: larue...@php.net
 Reported by:lisachenko dot it at gmail dot com
 Summary:Slow method invocation for PHP5.5.0 with Development
 Server
-Status: Feedback
+Status: Not a bug
 Type:   Bug
 Package:Performance problem
 Operating System:   Windows 7 x64
 PHP Version:5.5.0alpha3
 Block user comment: N
 Private report: N

 New Comment:

as I said, due to output buffer


Previous Comments:

[2013-01-18 12:24:01] lisachenko dot it at gmail dot com

Rewriting the source code in that way fixes the issue and execution time is 
about 4us. But how presence of php.ini with default settings can be related 
with the speed of method invocation for my case?

Can you reproduce it with my code and my php.ini http://pastebin.com/zDNvzuvg ? 
Here is the difference for php -i for loaded/unloaded php.ini 
http://pastebin.com/BrxBaTJ0 Speed of execution for my previous code block is 
not equal (5us and 1ms)


[2013-01-18 09:18:47] larue...@php.net

How about change to this:

class TestPerformance {

public function speed()
{
$time  = microtime(true);
$this-nop();
$end   = microtime(true);
echo 'Took ', sprintf(%0.3fms to call method, ($end - $time) * 1e3);
}

protected function nop() {}
}

$instance = new TestPerformance;
$instance-speed();


[2013-01-17 10:35:26] lisachenko dot it at gmail dot com

Yeah, detected the issue. 

Configurations were the same for all installations (default configuration), so 
this issue doesn't relate to the output buffering. Just to be sure, I have 
compared output for php -i for all installations, there were only differences 
in REQUEST_TIME, build version and ... presence of loaded php.ini file for 
PHP5.4.10. 

If php.ini file is present (settings are still default) and loaded, then speed 
of method invocation is higher... Amazing ) Without php.ini (but with the same 
default settings) speed is lower for internal development server.

This can be reproduced with PHP5.4.10 too. So this performance bug is more 
general.


[2013-01-17 05:45:40] larue...@php.net

I can not reproduce this, do they (5.4 and 5.5) share the same php.ini 
configure?

I think maybe due to output buffer.


[2013-01-16 07:41:27] lisachenko dot it at gmail dot com

Update PHP version for issue manually (There isn't alpha3 in select).




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=64001


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


[PHP-BUG] Bug #64023 [NEW]: Overloading __toString() in SplFileInfo has no effect

2013-01-18 Thread php at lightning dot hu
From: php at lightning dot hu
Operating system: Linux
PHP version:  Irrelevant
Package:  SPL related
Bug Type: Bug
Bug description:Overloading __toString() in SplFileInfo has no effect

Description:

When I overload the __toString() magic method in the SplFileInfo class or
in one 
of it's derivatives it does not work if I concatenate the object with a
string.
See the example for a simple demonstration.

Test script:
---
class A extends \SplFileInfo
{
public function __toString() {return ' -expected- ';}
}

$a = new A('/');

// Works
echo $a, $a-__toString(), $a-__toString() . '';

// Does not work - outputs parent::__toString()
echo $a . '';

Expected result:

-expected-  -expected-  -expected- /


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



[PHP-BUG] Req #64024 [NEW]: ftp_dir_exists()

2013-01-18 Thread wowkise at gmail dot com
From: wowkise at gmail dot com
Operating system: Linux
PHP version:  Irrelevant
Package:  FTP related
Bug Type: Feature/Change Request
Bug description:ftp_dir_exists()

Description:

I think PHP needs proper way to check if the FTP directory exists, right
now there is no correct way to do it other then using ftp_chdir/is_dir and
check the results which produce E_WARNING if the directory doesn't exists.

there is also is_dir() function which require that you re-authenticate just
to check if the directory exists and if you have to check multiple
directories you have to re-authenticate each time.

i hacked this function in test script just to bypass the E_WARNING 

Test script:
---
function dir_exists2($conn, $dir) {
$orginal = $dir;
if ( !$conn )
return false;

if ( substr($dir, -1) === '/' )
$dir = substr($dir, 0, strlen($dir)-1);

$dir= substr($dir, 0, strlen($dir)-strlen(strrchr($dir,'/')));

$res  = ftp_nlist($conn, '-dF '. $dir);
if ( isset($res) AND is_array($res) ) {
foreach ($res as $key = $value) {
if ($value === $orginal)
return true;
}
}
return false;
}

Expected result:

true if directory exists and false if it does not exists.


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



Bug #63870 [Opn-Csd]: apache is generating the more core files and going to maintanance mode

2013-01-18 Thread skatta at ftc dot gov
Edit report at https://bugs.php.net/bug.php?id=63870edit=1

 ID: 63870
 User updated by:skatta at ftc dot gov
 Reported by:skatta at ftc dot gov
 Summary:apache is generating the more core files and going
 to maintanance mode
-Status: Open
+Status: Closed
 Type:   Bug
 Package:Apache2 related
 Operating System:   solaris 10 x86
 PHP Version:5.3.20
 Block user comment: N
 Private report: N

 New Comment:

Hi John,

I am waiting for to get an response from my PHP developers.
At present,We were using temp solution for to stop/start the httpd server.
So,temply,I am closing this issue.
Please let me know,If You have any questions or concerns.
Thanks,
Srinivas


Previous Comments:

[2013-01-04 18:39:42] skatta at ftc dot gov

John,

Thanks for the information.

I am waiting for to get core alert from these web servers by setup the cron job.
Right now,I do not know exact cause for Why apache was generating the core 
files for php web pages.I am working with other unix admin and sent information 
to my php developers.

I will let you know the information,When I get reply or advice from my people 
for to do the more debugging on this problem.

Please let me know,If You have any questions or concerns.

Thanks,
Srinivas


[2012-12-29 12:37:02] johan...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


[2012-12-28 20:53:18] skatta at ftc dot gov

Description:

skatta@hq1-webdmz-s3 $ php -version
PHP 5.3.18 (cli) (built: Nov 20 2012 15:33:10)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
skatta@hq1-webdmz-s3 $

skatta@hq1-webdmz-s3 $ /usr/local/apache/bin/httpd -v
Server version: Apache/2.2.23 (Unix)
Server built:   Nov 13 2012 12:53:00

root@hq1-webdmz-s3 # uname -a
SunOS hq1-webdmz-s3.ftc.gov 5.10 Generic_147441-24 i86pc i386 i86pc
root@hq1-webdmz-s3 #


Hi,
Seems,httpd was going to maintanace mode after generation of lot of core files 
to /var/core.

Here is the one of the core file info by running the pstack cmd.
Please advice us how I can fix this problem.

Thanks,
Srinivas
ska...@ftc.gov

--
root@hq1-webdmz-s3 # pstack 
core_hq1-webdmz-s3.ftc.gov_httpd_800_800_1356721913_15496
core 'core_hq1-webdmz-s3.ftc.gov_httpd_800_800_1356721913_15496' of 15496:  
/usr/local/apache/bin/httpd -k start
 ec835356  (86c14b0, 8046cd0, 8046cb0, 8046cb4, 8046cb8, 8666204)
 fd377559 php_iconv_string (83697d4, 2c, 8046cf0, 8046cf4, 86a39c4) + a1
 fd37a4a4 php_if_iconv (3, 8679370, 0, 0, 1, 86463a4) + a0
 fd507a26 zend_do_fcall_common_helper_SPEC (8047790, 8368e5c, 8046e28, 
fd8c03e0, 86c4ecc, 1007790) + 92e
 fd506b79 execute  (86463dc, 0, 2, 83685ac, 8046e5c, 8046e64) + 195
 fd4e6781 zend_execute_scripts (8, 0, 3, 0, 8047790, 0) + 129
 fd49745f php_execute_script (8047790, 84d2490, 9c, fd56998d, 1, 0) + 1df
 fd569bec php_handler (84f8ba8, 25, 84f8e88, 84fa320) + 270
 080834ce ap_run_handler (84f8ba8, 3b, 8047a78, 8083839, 11e1a300, 0) + 2e
 080838a3 ap_invoke_handler (84f8ba8, 0, 8047aa8, 80779b2) + af
 080b09fd ap_process_request (84f8ba8, 4, 84f8ba8, 84f8ba8) + 18d
 080ae3b5 ap_process_http_connection (84ce758, 8115b58, 8047b08, 80891a9) + f1
 08088eca ap_run_process_connection (84ce758, 84ce4c0, 8047b88, 80cc24f, 
fea63c40, 0) + 2e
 080cc29e child_main (10, 80cbe00, 1, 0) + 406
 080cc476 make_child (fd8c0e80, fd84224f, 0, 4a, fd84248d, fd85b3fc) + d2
 080ccfcf ap_mpm_run (8116fb0, 815b0c0, 811f9a0, 811f9a0) + ac3
 0807312f main (3, 8047d9c, 8047dac) + 71f
 0807260c _start   (3, 8047e48, 8047e64, 8047e67, 0, 8047e6d) + 60
--








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


[PHP-BUG] Bug #64027 [NEW]: ForEach fails to add new key/value pairs

2013-01-18 Thread mfuhrman at enetarch dot net
From: mfuhrman at enetarch dot net
Operating system: Linux svm0907pdv 2.6.18-308.8.2.
PHP version:  5.3Git-2013-01-18 (snap)
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:ForEach fails to add new key/value pairs

Description:

using PHP Version 5.3.3, Build Date Jun 25 2012 04:51:11

In testing updating nested arrays, I'm finding the that the results of an
array 
is not updated, since the variable used to point to that portion of the
array 
seems to be a copy of the data and not a direct reference to the data.

Below is an array of arrays.

In the for loop, $sub points to $aryJunk's elements .. 0 .. 4
respectively.

When $sub has a new key value pair added, ex. munch = junk, this value
only 
exists as long as $sub exists in the for loop. Outside that loop, the key
value 
pair are lost.

It is my understanding that this key value pair should not be lost.  Or, at

least I cannot find an example that says definitively one way or the
other.

Please test to see if this issue still exists in the latest version of PHP,
and 
determine the next steps to resolution.

Michael J. Fuhrman
mfuhr...@enetarch.net
skype ENetArch


Test script:
---
$aryJunk = Array 
(
0 = array(),
1 = array(),
2 = array(),
3 = array(),
4 = array(),
);

// fails

foreach ($aryJunk AS $sub)
$sub [munch] = junk;

print_r ($aryJunk);

// works

for ($t=0; $t  count ($aryJunk); $t++)
$aryJunk[$t] [munch] = junk;

print_r ($aryJunk);


Expected result:

Array ( [0] = Array ( [munch] = junk ) [1] = Array ( [munch] = junk )
[2] = 
Array ( [munch] = junk ) [3] = Array ( [munch] = junk ) [4] = Array (
[munch] 
= junk ) )

Actual result:
--
Array ( [0] = Array ( ) [1] = Array ( ) [2] = Array ( ) [3] = Array ( )
[4] = 
Array ( ) )

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



Req #53950 [Com]: Add a way to configure where libxml searches for Catalog Files

2013-01-18 Thread hanskrentel at yahoo dot de
Edit report at https://bugs.php.net/bug.php?id=53950edit=1

 ID: 53950
 Comment by: hanskrentel at yahoo dot de
 Reported by:gordon at onlinehome dot de
 Summary:Add a way to configure where libxml searches for
 Catalog Files
 Status: Assigned
 Type:   Feature/Change Request
 Package:*XML functions
 Operating System:   any
 PHP Version:Irrelevant
 Assigned To:rrichards
 Block user comment: N
 Private report: N

 New Comment:

setenv(XML_CATALOG_FILES=/path/to/catalog.xml);

should normally work (depending which dialect that as) if it's set before PHP 
starts and loads the extension and the path to the catalog XML file does not 
contain any spaces (which has a special meaning).

See as well:

http://www.cafeconleche.org/books/effectivexml/chapters/47.html
http://www.chlab.ch/blog/archives/php/soap/cache-soap-envelope-schema-schema-
validation
http://wp.me/pLEEp-nlj

To change things at runtime, make use of libxml_set_external_entity_loader and 
implement a catalog parser your own. You then can use catalogs as you wish at 
runtime.


Previous Comments:

[2011-12-06 17:34:01] Marko dot Voss at fiz-Karlsruhe dot de

 The user can change the default catalog behaviour by redirecting queries to 
 its own set of catalogs. This can be done by setting the XML_CATALOG_FILES 
 environment variable to a list of catalogs, an empty one should deactivate 
 loading the default /etc/xml/catalog default catalog.

If I understand this right, you can use this code to set your own catalog:

setenv(XML_CATALOG_FILES=/path/to/catalog.xml);

I tried that, because I have to use xml catalog somehow, without overwriting 
the http stream wrapper, which is a non-threadsafe way to do this. However, the 
catalog.xml I specified using setenv seems not to be used by libxml2.


[2011-02-08 19:27:00] rricha...@php.net

Assign to self as I asked him to open this


[2011-02-08 19:18:43] cataphr...@php.net

 This, by itself, makes it inviable to write a PHP function that allows
 replacing the default catalog unless some (probably expensive, since a
 catalog file must be read) on request startup/shutdown is used.

The unless part doesn't actually make sense in the multi-threading versions of 
PHP.


[2011-02-08 19:14:49] cataphr...@php.net

I know very little of libxml2, but as far as I infer from 
http://xmlsoft.org/catalog.html and from the code in catalog.c, there is no way 
to specify a global catalog in a thread-local manner. This, by itself, makes it 
inviable to write a PHP function that allows replacing the default catalog 
unless some (probably expensive, since a catalog file must be read) on request 
startup/shutdown is used.

libxml2 supports per-document catalogs, but from what I see, your document must 
contain an oasis-xml-catalog processing instruction, like this:

?xml version=1.0?
?oasis-xml-catalog catalog=http://example.com/catalog.xml;?
!DOCTYPE doc PUBLIC -//Example//DTD Document V1.0//EN
 http://www.example.com/schema/doc.dtd;

There is another alternative, which is using an external entity loader (see 
http://xmlsoft.org/html/libxml-parser.html#xmlSetExternalEntityLoader ), but 
this is less convenient, though probably we could also expose some functions to 
deal with catalogs for use in the user-supplied callback.

I could implement this, but I'm hopping someone else with more libxml2 
knowledge could tell if my analysis is correct.


[2011-02-07 17:16:37] gordon at onlinehome dot de

Description:

Libxml can use catalog files to provide a local cache mechanism allowing to 
load the entities associated to public identifiers or remote resources. There 
is currently no way to configure the catalog file path from PHP. Configuring 
the path in libxml itself seems possible:

 The user can change the default catalog behaviour by redirecting queries to 
 its own set of catalogs. This can be done by setting the XML_CATALOG_FILES 
 environment variable to a list of catalogs, an empty one should deactivate 
 loading the default /etc/xml/catalog default catalog.

It would be nice if PHP's libxml extension would provide a way to set the path 
somehow. This could be helpful when validating documents with remote System 
Identifiers, like any HTML DTD. Or simply to bundle files with an application.

Related Resources:

- http://xmlsoft.org/catalog.html
- http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic
- http://bugs.php.net/48080
- http://bugs.php.net/32426




Bug #63462 [Asn-Csd]: Magic methods called twice for unset protected properties

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

 ID: 63462
 Updated by: s...@php.net
 Reported by:ocramius at gmail dot com
 Summary:Magic methods called twice for unset protected
 properties
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Irrelevant
 PHP Version:5.4.8
 Assigned To:dmitry
 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=33b104c778c5c0e5446671397aaddd66efa4a7bc
Log: fix bug #63462 (Magic methods called twice for unset protected properties)


Previous Comments:

[2013-01-14 08:18:11] s...@php.net

https://github.com/php/php-src/pull/258 should fix it (will be applied soon if 
no 
problem is found).


[2012-11-08 07:34:06] larue...@php.net

similar to #55731


[2012-11-08 05:47:23] ocramius at gmail dot com

I've added the failing test case as a PR at 
https://github.com/php/php-src/pull/229


[2012-11-08 05:40:59] ocramius at gmail dot com

Description:

When un-setting a private or protected property of an object, magic methods get 
called twice when that property is accessed.

Test script:
---
https://gist.github.com/4037010
(will provide PR with the test later)

Expected result:

Each of the magic methods presented in the test script should be called only 
once per checked property. 

Actual result:
--
Each of the magic methods are called twice for private or protected properties 
that were unset.






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


Bug #55731 [Nab-Csd]: __get after __unset

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

 ID: 55731
 Updated by: s...@php.net
 Reported by:421034509 at qq dot com
 Summary:__get after __unset
-Status: Not a bug
+Status: Closed
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   windows xp
 PHP Version:5.3.8
-Assigned To:
+Assigned To:stas
 Block user comment: N
 Private report: N

 New Comment:

The fix for this bug has been committed.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

fix for bug #63462 should also fix this one.


Previous Comments:

[2012-11-08 08:13:17] ocramius at gmail dot com

I got pointed here after filing #63462 ( https://bugs.php.net/bug.php?id=63462 
).

Shouldn't the `getter_guard` be disabled for \0Example\0p1: (laurence's 
example) when already in the context of `__get` (and similar logic for all the 
other magic methods)? 

I have absolutely no understanding of PHP internals about this, but I wouldn't 
expect the magic getter to work again for the same property when we already 
know it was the requested one.

This is actually a (quite problematic) bug for me since it denies any action on 
unset properties, which is a feature I need when working with proxies.

If I understand this correctly, at 
https://github.com/php/php-src/blob/6ba376f552238de643a665d355fd5e59c40315b5/Zend/zend_object_handlers.c#L559-572
 the guard is used. I don't understand why `guard-in_set` isn't checked the 
second time though. Does `zend_get_property_guard` retrieve a different item 
for different `property_info`?


[2011-09-22 03:36:35] 421034509 at qq dot com

Thank you!I got it!


[2011-09-22 01:28:25] larue...@php.net

No, if the property is private, and the getter is called out of call 
entry(means 
access a private property out of scope), zend vm will return NULL,  but 
zend_read_property will assume as a public property name, since PHP is a 
flexible language.


[2011-09-22 01:18:53] 421034509 at qq dot com

When get_property_info successed in the Example class,
if the private property is defined but be unsetted,zend vm return a property 
info with name \0Example\0propertyname,
but if the property is undefined(or defined but not be unsetted),zend vm return 
a property info with name propertyname.
Is that true?


[2011-09-22 01:17:55] larue...@php.net

because there is no '\0Example\0p3' in property_info of  Example class entry




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=55731


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


Bug #64027 [Com]: ForEach fails to add new key/value pairs

2013-01-18 Thread matthew dot vince at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64027edit=1

 ID: 64027
 Comment by: matthew dot vince at gmail dot com
 Reported by:mfuhrman at enetarch dot net
 Summary:ForEach fails to add new key/value pairs
 Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Linux svm0907pdv 2.6.18-308.8.2.
 PHP Version:5.3Git-2013-01-18 (snap)
 Block user comment: N
 Private report: N

 New Comment:

This is expected behavior. To modify values using a foreach loop, you need to 
assign by reference, as explained in the foreach documentation:

foreach ($aryJunk AS $sub)
$sub [munch] = junk;


http://php.net/manual/en/control-structures.foreach.php


Previous Comments:

[2013-01-18 20:13:51] mfuhrman at enetarch dot net

Description:

using PHP Version 5.3.3, Build Date Jun 25 2012 04:51:11

In testing updating nested arrays, I'm finding the that the results of an array 
is not updated, since the variable used to point to that portion of the array 
seems to be a copy of the data and not a direct reference to the data.

Below is an array of arrays.

In the for loop, $sub points to $aryJunk's elements .. 0 .. 4 respectively.

When $sub has a new key value pair added, ex. munch = junk, this value 
only 
exists as long as $sub exists in the for loop. Outside that loop, the key value 
pair are lost.

It is my understanding that this key value pair should not be lost.  Or, at 
least I cannot find an example that says definitively one way or the other.

Please test to see if this issue still exists in the latest version of PHP, and 
determine the next steps to resolution.

Michael J. Fuhrman
mfuhr...@enetarch.net
skype ENetArch


Test script:
---
$aryJunk = Array 
(
0 = array(),
1 = array(),
2 = array(),
3 = array(),
4 = array(),
);

// fails

foreach ($aryJunk AS $sub)
$sub [munch] = junk;

print_r ($aryJunk);

// works

for ($t=0; $t  count ($aryJunk); $t++)
$aryJunk[$t] [munch] = junk;

print_r ($aryJunk);


Expected result:

Array ( [0] = Array ( [munch] = junk ) [1] = Array ( [munch] = junk ) [2] 
= 
Array ( [munch] = junk ) [3] = Array ( [munch] = junk ) [4] = Array ( 
[munch] 
= junk ) )

Actual result:
--
Array ( [0] = Array ( ) [1] = Array ( ) [2] = Array ( ) [3] = Array ( ) [4] 
= 
Array ( ) )






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


[PHP-BUG] Bug #64028 [NEW]: include_path starting with . doesn't actually start the search in current dir

2013-01-18 Thread mike at kristopeit dot com
From: mike at kristopeit dot com
Operating system: CentOS
PHP version:  5.3.21
Package:  Dynamic loading
Bug Type: Bug
Bug description:include_path starting with . doesn't actually start the 
search in current dir

Description:

i have code that runs via the command line... the php include path is set
to 
.:/some/dir

that code does an
include(file.php); 
for a file that is in the same directory.  that file is included
correctly.

then in file.php i have
include(another_file.php); 
for another file in the same directory... but there is also a file at 
/some/dir/another_file.php...

using a backtrace log i see that the /some/dir/another_file.php is being
included 
instead of the file in the current directory.

i changed the include(another_file.php); to be
include(./another_file.php);, 
and now everything works.

this is a pretty obvious bug. 



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



[PHP-BUG] Bug #64029 [NEW]: segfault on libphp5.so

2013-01-18 Thread jmdoren at ok dot cl
From: jmdoren at ok dot cl
Operating system: 
PHP version:  5.4.11
Package:  Unknown/Other Function
Bug Type: Bug
Bug description:segfault on libphp5.so

Description:

segfault on libphp5.so
Jan 18 18:34:43 db2 kernel: httpd[20339]: segfault at 71 ip
7f00043b28ac sp 
7efff47f2700 error 4 in libphp5.so[7f0003f99000+912000]
Jan 18 18:35:35 db2 kernel: httpd[21958]: segfault at 18 ip
7f0004378d45 sp 
7efff33f0620 error 4 in libphp5.so[7f0003f99000+912000]

the php was compiled like this:
'./configure' '--disable-phar' '--with-mysqli=mysqlnd' '--with-mysql'
'--with-
apxs2=/usr/local/apache2/bin/apxs' '--with-config-file-path=/etc'
'--enable-
calendar' '--disable-simplexml' '--enable-libxml' '--with-curl' '--enable-
mbstring' '--with-gd' '--with-jpeg-dir=/usr/lib64/' '--with-t1lib'
'--enable-gd-
native-ttf' '--with-freetype-dir=/usr/local' '--with-zlib'

it also runs with eAccelerator v1.0-dev, Copyright (c) 2004-2012
eAccelerator, 
by eAccelerator




Test script:
---
Don't know, I use mysqli and cUrl but may be another lib


Actual result:
--
Jan 18 18:34:43 db2 kernel: httpd[20339]: segfault at 71 ip
7f00043b28ac sp 
7efff47f2700 error 4 in libphp5.so[7f0003f99000+912000]
Jan 18 18:35:35 db2 kernel: httpd[21958]: segfault at 18 ip
7f0004378d45 sp 
7efff33f0620 error 4 in libphp5.so[7f0003f99000+912000]

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



Req #52523 [Com]: mcrypt_create_iv not reliable on win: Could not gather sufficient random data

2013-01-18 Thread mah at everybody dot org
Edit report at https://bugs.php.net/bug.php?id=52523edit=1

 ID: 52523
 Comment by: mah at everybody dot org
 Reported by:php-bugs at thequod dot de
 Summary:mcrypt_create_iv not reliable on win: Could not
 gather sufficient random data
 Status: Closed
 Type:   Feature/Change Request
 Package:mcrypt related
 Operating System:   win32
 PHP Version:5.3.3
 Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

Just came across this while trying to install the latest MediaWiki on a host 
with PHP 5.3.5 phpinfo() reports has a system string of Windows NT A1-WHW-B69 
6.0 build 6002 (Windows Server 2008 Web Server Edition Service Pack 2) i586 
and a build date of Jan 5 2011 20:33:43.

Since this was on a hosted account, I didn't have the opportunity to upgrade 
PHP and I couldn't find a way to test for the bug without causing a fatal 
error.  If I had been able to do that, I would have added code to MediaWiki to 
test for the bug.

I was able to work-around the bug by modifying the installer source so that 
MCRYPT_RAND was used instead of MCRYPT_DEV_URANDOM.  For a package like 
MediaWiki, though, this is less than ideal.


Previous Comments:

[2011-06-14 11:17:03] paj...@php.net

There is no difference between the two on Windows. Both called the same 
function.

How do you get the error? Which windows version do you use?


[2011-06-14 10:28:23] s...@php.net

I'm still experiencing issues with 5.3.6. Calling the method with both  
MCRYPT_DEV_RANDOM and MCRYPT_DEV_URANDOM results in the fatal error. IMO the 
first should block, and the second should just return non-crypto-safe data, but 
it should return *something*, and ideally do it fast.


[2010-08-09 10:14:52] paj...@php.net

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.




[2010-08-09 10:14:16] paj...@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=302024
Log: - #52523, fix logic (0 is perfectly valid as part of the data, bin data)


[2010-08-03 18:11:15] paj...@php.net

@derick
urandom is not crypto safe (to be more precised).

@thequod
About the patch in typo3, this code is wrong. They use urandom on non windows 
platform, then try alternatives on windows only.

Problem is that they first try COM (very slow), then try with mcrypt_create_iv 
and overwrite COM output (regardless if it worked well or not). MCrypt also 
always exists on windows with 5.3+, no need to test it (statically compiled). 
The openssl code won't be used either (never reached this condition).

However even if the openssl code was used, its logic is wrong. It considers  
non strong (not crypto safe) output as invalid. But urandom is not crypto safe 
anyway. They should test for the openssl function in the 1st place then use 
fopen('urandom') and finally mcrypt and other options. Much better/cleaner.

About your last comment, that fits in the explanation I gave earlier. Nothing 
new.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=52523


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


Bug #63258 [Csd]: seg fault with PDO and dblib using DBSETOPT(H-link, DBQUOTEDIDENT, 1);

2013-01-18 Thread ssufficool
Edit report at https://bugs.php.net/bug.php?id=63258edit=1

 ID: 63258
 Updated by: ssuffic...@php.net
 Reported by:paul dot visco at roswellpark dot org
 Summary:seg fault with PDO and dblib using DBSETOPT(H-link,
 DBQUOTEDIDENT, 1);
 Status: Closed
 Type:   Bug
 Package:PDO related
 Operating System:   centos 5.8
 PHP Version:5.4.7
 Assigned To:ssufficool
 Block user comment: N
 Private report: N

 New Comment:

Are you compiling against FreeTDS or Sybase libs? It looks like the segfault is 
in the DB LIB, not PHP. FreeTDS is passing a null pointer (or something 
invalid) 
to the libc strlen() function.

To further debug this issue, FreeTDS will need to be recompiled with debug 
symbols intact, php recompiled and the segfault back trace reproduced. This 
will 
give better insight to the code generating the error.


Previous Comments:

[2013-01-18 13:03:08] f dot marquis at of2m dot fr

this patch seems to cause an error :
#63638 Cannot connect to SQL Server 2008 with PDO dblib


[2012-10-12 02:39:42] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=0c0b5a3543f37dc3dfe7fa55629f2749c0b05294
Log: Fixed bug #63258 (seg fault with PDO and dblib using DBSETOPT(H-gt;link, 
DBQUOTEDIDENT, 1))


[2012-10-12 02:38:28] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=0c0b5a3543f37dc3dfe7fa55629f2749c0b05294
Log: Fixed bug #63258 (seg fault with PDO and dblib using DBSETOPT(H-gt;link, 
DBQUOTEDIDENT, 1))


[2012-10-11 16:21:34] ssuffic...@php.net

The patch looks legit. I'm not sure why I used 1 instead of null for the 
parameter value. I have not posted patches since the source was moved to git. 
Please merge this change for me if possible.


[2012-10-11 10:23:57] larue...@php.net

ssufficool, do you have time to look into this?

seems you intentionally change the NULL to 1 in https://github.com/php/php-
src/commit/36b8c4cb

thanks




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=63258


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


Bug #63638 [Com]: Cannot connect to SQL Server 2008 with PDO dblib

2013-01-18 Thread ssuffic...@php.net
Edit report at https://bugs.php.net/bug.php?id=63638edit=1

 ID: 63638
 Comment by: ssuffic...@php.net
 Reported by:pmeunier at cybergeneration dot com
 Summary:Cannot connect to SQL Server 2008 with PDO dblib
 Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   Linux Slackware 13
 PHP Version:5.4.9
 Block user comment: N
 Private report: N

 New Comment:

Looks like a Microsoft DBLIB versus FreeTDS issue. MS DBLIB requires the 
parameter to be NULL (per MSDN, possibly incorrect docs) while FreeTDS does not 
like the NULL parameter, thus I guess why I used 1 originally.

The patch from 1 to NULL should be reverted.


Previous Comments:

[2012-12-07 16:37:58] wdmeldon at gmail dot com

I've tested this in SQL Server 2012, 2008 and 2005 with similar results.  The 
warnings do not always manifest however.  I've noticed returning output will 
prevent the warning as will calling other functions, but it's a crap shoot. 

The connection seems to be fine and the data returned is as well, so more 
annoying 
than anything else.

Running Ubuntu Server 12.04 with PHP 5.4.9.


[2012-12-05 16:49:09] f dot marquis at of2m dot fr

same problem here, but only from time to time (not all connections are failing 
like with pmeunier)

seems related to #63258


[2012-11-28 21:43:00] pmeunier at cybergeneration dot com

We made a compare between the /ext/pdo_dblib/ php 5.4.7 and php 5.4.9 and found 
only one file was changed. Line 318 in dblib_driver.c went from :

// In PHP 5.4.7
DBSETOPT(H-link, DBQUOTEDIDENT, 1);

To :

// In PHP 5.4.9
DBSETOPT(H-link, DBQUOTEDIDENT, NULL);

For fun, we tried to revert to passing 1 for the last parameter... and guess 
what ? It worked. Since we don't actually understand what this function makes, 
and why the parameter was changed, we don't find this solution very clean, 
unless it is eventually confirmed by a PHP developper.


[2012-11-28 21:09:02] pmeunier at cybergeneration dot com

Description:

We are relying on PDO_DBLIB to connect to our SQL Server 2008 Server in PHP, 
hosted on a Linux platform. We were running PHP 5.4.7 and everything was fine. 
When we upgraded to 5.4.9, all connections to SQL Server were failing with the 
following error : Warning: PDO::__construct(): Called dbsetopt with parameter 3 
NULL (severity 11). We tried with different logins to be sure that it was not a 
permission issue, but the bug also occurs when trying to log with 'sa'.

Test script:
---
$connection = new PDO('dblib:host=myServerHost;dbname=MyDatabase', 'username', 
'pass');

Expected result:

We expect no warnings to be thrown and connection to SQL Server to work

Actual result:
--
A warning is thrown : Warning: PDO::__construct(): Called dbsetopt with 
parameter 
3 NULL (severity 11)






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