#46398 [Opn-Bgs]: highlight_string() removes backslashes

2008-10-27 Thread scottmac
 ID:   46398
 Updated by:   [EMAIL PROTECTED]
 Reported By:  fromphp dot nethash69 at vano dot org
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Windows XP Pro
 PHP Version:  5.2.6
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

// is a comment not \\ which is an escape character.


Previous Comments:


[2008-10-27 00:32:47] fromphp dot nethash69 at vano dot org

Description:

function highlight_string() removes backslashes

Reproduce code:
---
?php
$text = '?php
$blah = 1;
\\this is a comment line with two backslashes at the beginning and one
at the end:\
$blah = 2;
?';
highlight_string($text);
?

Expected result:

Expected output in the browser:

?php
$blah = 1;
\\this is a comment line with two backslashes at the beginning and one
at the end:\
$blah = 2;
?

Actual result:
--
Actual output in the browser:

?php 
$blah = 1; 
this is a comment line with two backslashes at the beginning and one at
the end: 
$blah = 2; 
? 





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



#45062 [Com]: thttpd problem displaying .html pages when patched with php on 64 bits OS

2008-10-27 Thread j dot orfeuil at courantmultimedia dot fr
 ID:   45062
 Comment by:   j dot orfeuil at courantmultimedia dot fr
 Reported By:  j dot orfeuil at courantmultimedia dot fr
 Status:   Feedback
 Bug Type: Other web server
 Operating System: debian 4.0 x86_64
 PHP Version:  5.2.6
 New Comment:

First of all thx for the answer :)
Of course i've heard about other light web servers thx but the fact is
we already have a whole system running on thttpd.
We actually just need to move our system on a new hardware plateform
(actually on many VPS on a new hardware plateform) and a new OS based on
64bits debian system. For obvious bug reasons and testing time, we just
wanted to clone the web part as it is bugless (or at least with small
ones :p)
Changing webserver would be an idea and it would probably work but we
wanted to understand why there was a problem with specific 64 bits OS...
(as we believe it is related to patching thttpd sources with php...) and
of course, as i said before, for bug reason...

On the other hand i don't know if thttpd is still maintained and it
would be recommended to change for an active project but the version we
have is stable and if the bug comes from php, we would have no reason to
change.

Well, hoping you can understand our needs and why we're still looking
for a lead through php bugs, maybe you could help us :)

Regards
Joseph


Previous Comments:


[2008-10-25 13:15:28] [EMAIL PROTECTED]

Does someone actually maintain thttpd anymore? Have you ever heard of 
lighttpd and FastCGI..? 




[2008-07-01 08:50:35] j dot orfeuil at courantmultimedia dot fr

Hi,

Does anyone have any idea on my problem?

I still encouter it and don't know where it comes from (php or
thttpd).
looks like someone else found the same problem...

Thank you for your help :)



[2008-05-26 18:25:29] dinmansam at hotmail dot com

Hi guys,

I have the same problem to compile for 64 bits target ?

Can anybody provide me a source code of thttpd+php or send me a patch?

Thanks.



[2008-05-22 07:23:43] j dot orfeuil at courantmultimedia dot fr

thttpd v2.21b



[2008-05-21 22:04:57] j dot orfeuil at courantmultimedia dot fr

Summary edited (64 bits precision)



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
http://bugs.php.net/45062

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



#45062 [Fbk-Opn]: thttpd problem displaying .html pages when patched with php on 64 bits OS

2008-10-27 Thread j dot orfeuil at courantmultimedia dot fr
 ID:   45062
 User updated by:  j dot orfeuil at courantmultimedia dot fr
 Reported By:  j dot orfeuil at courantmultimedia dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: Other web server
 Operating System: debian 4.0 x86_64
 PHP Version:  5.2.6
 New Comment:

Updated


Previous Comments:


[2008-10-27 08:44:05] j dot orfeuil at courantmultimedia dot fr

First of all thx for the answer :)
Of course i've heard about other light web servers thx but the fact is
we already have a whole system running on thttpd.
We actually just need to move our system on a new hardware plateform
(actually on many VPS on a new hardware plateform) and a new OS based on
64bits debian system. For obvious bug reasons and testing time, we just
wanted to clone the web part as it is bugless (or at least with small
ones :p)
Changing webserver would be an idea and it would probably work but we
wanted to understand why there was a problem with specific 64 bits OS...
(as we believe it is related to patching thttpd sources with php...) and
of course, as i said before, for bug reason...

On the other hand i don't know if thttpd is still maintained and it
would be recommended to change for an active project but the version we
have is stable and if the bug comes from php, we would have no reason to
change.

Well, hoping you can understand our needs and why we're still looking
for a lead through php bugs, maybe you could help us :)

Regards
Joseph



[2008-10-25 13:15:28] [EMAIL PROTECTED]

Does someone actually maintain thttpd anymore? Have you ever heard of 
lighttpd and FastCGI..? 




[2008-07-01 08:50:35] j dot orfeuil at courantmultimedia dot fr

Hi,

Does anyone have any idea on my problem?

I still encouter it and don't know where it comes from (php or
thttpd).
looks like someone else found the same problem...

Thank you for your help :)



[2008-05-26 18:25:29] dinmansam at hotmail dot com

Hi guys,

I have the same problem to compile for 64 bits target ?

Can anybody provide me a source code of thttpd+php or send me a patch?

Thanks.



[2008-05-22 07:23:43] j dot orfeuil at courantmultimedia dot fr

thttpd v2.21b



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
http://bugs.php.net/45062

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



#46399 [Opn-Fbk]: cgi 'leaks' shell_exec output to webserver

2008-10-27 Thread lbarnaud
 ID:   46399
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stefan at konink dot de
-Status:   Open
+Status:   Feedback
 Bug Type: CGI related
 Operating System: Linux 2.6.27
 PHP Version:  5.2.6
 New Comment:

Could you please try the following and report what happens ?

?php
file_put_contents(php://stderr, php stderr\n);
echo php stdout\n;
?


Previous Comments:


[2008-10-27 01:17:47] stefan at konink dot de

Description:

When a php-cgi issues an shell_exec that outputs code that is expected
to be stored in the variable before it. The output is in fact leaked
back over the fcgi connection, which will issue a 500.

I'm using the Cherokee webserver.

Reproduce code:
---
$debug = shell_exec('/usr/bin/nohup /usr/bin/inkscape -z
--file='.$svgfile.' --export-width='.$width.'
--export-height='.$height.' --export-png='.$pngfile);


The work around seems to be to add:

.' 21 1/dev/null'

Expected result:

Output to be stored in $debug.

Actual result:
--
Outputted over the fcgi line:

 2f75 7372 2f62 696e 2f6e 6f68 7570 3a20 /usr/bin/nohup:.
 handler_fcgi.c:83: Parsing error: unknown version






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



#46394 [Opn-Bgs]: Sessions multipe tabs or instances of a web browser

2008-10-27 Thread lbarnaud
 ID:   46394
 Updated by:   [EMAIL PROTECTED]
 Reported By:  master_chriso at yahoo dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Windows Vista
 PHP Version:  5.2.6
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

One of the possible solutions is to change the session save path
(ini_set(session.save_path, ...)).


Previous Comments:


[2008-10-26 15:51:51] mater_chriso at yahoo dot com

but when i open the two simultaneusly on different web browsers they
use different sessions as expected.

Is it possible for php to detect and create a separate session for each
tab/instance of the web browser?



[2008-10-26 15:39:10] master_chriso at yahoo dot com

Description:

I'm developing 2 different php programs simultaneously both using php
session. I notice that both are sharing and overriding the same session
variables. The worst thing happens is when I close one of the app, it
will destroy the contents for the other app.

Is there a way to keep php from sharing the session on multiple tabs or
instances of the same web browser?







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



#46380 [Fbk]: incorrect reference counting in =new.

2008-10-27 Thread dmitry
 ID:   46380
 Updated by:   [EMAIL PROTECTED]
 Reported By:  marek dot miska at netart dot pl
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: linux
 PHP Version:  5.2.6
 Assigned To:  dmitry
 New Comment:

I don't see any memory errors on this script with PHP_5_2 too.


Previous Comments:


[2008-10-24 15:41:41] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Actually your script does not crash with latest CVS snapshot of PHP_5_2
branch.



[2008-10-24 15:40:14] [EMAIL PROTECTED]

Dmitry, can you check this out please?



[2008-10-24 13:40:24] marek dot miska at netart dot pl

Description:

Incorrect reference counting in:
ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
refcount is decremented twice.

(In short: ZEND_RETURNS_FUNCTION for new is missing).

It's fixed in 5.3.0alpha1 with ZEND_RETURNS_NEW.
But it will be nice to have it also in stable version.

Reproduce code:
---
?
class A{
function A() {
global $g;
$g[0] = $g[1] = $this;
}

function __destruct() { }
}

$g = array();

for($i=0; $i1000; ++$i)
{
$a = new A;
}
?

Expected result:

Exit without any errors.

Actual result:
--
Segmentation fault





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



#46400 [NEW]: Floating number output problem

2008-10-27 Thread David dot Rolli at bl dot ch
From: David dot Rolli at bl dot ch
Operating system: Windows XP Pro, SP2
PHP version:  5.2.6
PHP Bug Type: Unknown/Other Function
Bug description:  Floating number output problem

Description:

I want to outpu my floating number with 13 digits but not in scientific
notation - this just doesn't work with certain numbers (see code).

Reproduce code:
---
?php
  ini_set(precision, 14);

  $a = 123456789012;
  $b = 123456789012.0;
  $c = 12345678901203;
  $d = 1234567890123.0;
  
  $e = 1225099800;
  $f = 122509980;
  $h = 122509981;

  echo('$a: ' . $a. BR);   // -  123456789012
  echo('$b: ' . $b. BR);   // -  123456789012
  echo('$c: ' . $c. BR);   // -  1234567890123
  echo('$d: ' . $d. BR);   // -  1234567890123
  echo('$e: ' . $e. BR);   // -  1225099800
  echo('$f: ' . $f. BR);   // -  1.2250998E+12  !!!
  echo('$h: ' . $h. BR);   // -  122509981  !!!
?

Expected result:

123456789012
123456789012
1234567890123
1234567890123
1225099800
122509980
122509981

Actual result:
--
123456789012
123456789012
1234567890123
1234567890123
1225099800
12250998E+12
122509981

-- 
Edit bug report at http://bugs.php.net/?id=46400edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46400r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46400r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46400r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46400r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46400r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46400r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=46400r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=46400r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=46400r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=46400r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=46400r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=46400r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=46400r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46400r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=46400r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=46400r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=46400r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=46400r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=46400r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=46400r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=46400r=mysqlcfg



#46386 [Opn]: Digest authentication with SOAP module fails against MSSQL SOAP services

2008-10-27 Thread lordelph at gmail dot com
 ID:   46386
 User updated by:  lordelph at gmail dot com
 Reported By:  lordelph at gmail dot com
 Status:   Open
 Bug Type: SOAP related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

Here's a patch which can be applied in /ext/soap to fix the php_http.c
file for this issue

http://files.dixo.net/php_bug_46386.patch

It simply ensures the request header containing the authorization
response uses the same algorithm value as contained in the server's
response.


Previous Comments:


[2008-10-25 17:04:21] lordelph at gmail dot com

The problem occurs because the Authorization header returned by the
SOAP module does not include the algorithm=MD5-sess value, even though
the server has specified this algorithm and the module has obeyed by
applying a second hashing round to the HA1 value.

The fix is simply to add an algorithm=xyz value to the Authorization.


I have verified that this fix works by writng a PHP-based simulation of
what the C source code is doing. When the Authorize header is fixed, it
works normally. This demonstration is here:
http://pastebin.com/f7996ccbe

You can see around lne 507 of ext/soap/php_http.c the code applies the
extra hashing step required for MD5-sess, but further down, around line
606, it should be adding the algorithm=foo value to the Authorization
response header.

Because it fails to do this, MS SQL server fails to authenticate the
request.



[2008-10-25 16:54:01] lordelph at gmail dot com

Description:

Using the SoapClient class to talk to SOAP services provided by MSSQL
server configured with Digest authorization fails if the server
specifies that the MD5-sess algorithm be used

Reproduce code:
---
// reproduction requires an MSSQL server configured with 
// SOAP services and protected with Digest authorization
// Prior to testing, verify the Digest support by making a
// a request with a third party tool like cURL

$options=array(
'trace'  = 1,  
'authentication' = SOAP_AUTHENTICATION_DIGEST,
'login'= $user, 
'password'=$pass
);

$client = new SoapClient($wsdlfile, $options);  

$client-Foo(); 

Expected result:

Expect SOAP call 'Foo' to succeed

Actual result:
--
SoapFault exception is thrown with the message Unauthorized

$client-__getLastRequestHeaders() returns

POST /ept/cv HTTP/1.1
Host: 168.143.179.36
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.6-1ubuntu4
Content-Type: text/xml; charset=utf-8
SOAPAction: ASP.EPT.CVListTerms
Content-Length: 393
Authorization: Digest username=admin8, realm=Digest,
nonce=987675a1c136c901ec4171a06bd402000eb60bf1fd307a9faf41324273b0872d8b56905071490005,
uri=/ept/cv, qop=auth, nc=0001, cnonce=4942e49e,
response=3ee12e732e2e04a50c23ffd910164cb8



$client-__getLastResponseHeaders() returns this:

HTTP/1.1 401 Unauthorized
Content-Length: 0
WWW-Authenticate: Digest
qop=auth,algorithm=MD5-sess,nonce=857594a1c136c90161f301be706f9f1e5a4146c3d7a1bf3b63a6b8b14dea6b3afcc195ff8d1fce37,charset=utf-8,realm=Digest
Server: Microsoft-SQL/9.0 Microsoft-HTTPAPI/1.0
Date: Sat, 25 Oct 2008 16:49:21 GMT
Connection: close






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



#44182 [Fbk-Opn]: extract($a, EXTR_REFS) can fail to split copy-on-write references

2008-10-27 Thread robin_fernandes at uk dot ibm dot com
 ID:   44182
 User updated by:  robin_fernandes at uk dot ibm dot com
 Reported By:  robin_fernandes at uk dot ibm dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Arrays related
 Operating System: *
 PHP Version:  5.2CVS-2008-02-20 (snap)
 New Comment:

Changing status back to Open now that an alternative URL has been 
provided.


Previous Comments:


[2008-10-25 13:52:02] robin_fernandes at uk dot ibm dot com

The patch URL? Seems OK to me, perhaps it was temporarily broken.

In any case, here's another one: 
http://soal.org/php/extract.patch.txt



[2008-10-25 13:25:36] [EMAIL PROTECTED]

That url does not work..



[2008-02-20 09:29:24] robin_fernandes at uk dot ibm dot com

I think the problem is that extract() can set the is_ref flag on zvals
without splitting them (i.e. zvals which have more than 1 copy-on-write
references can get their is_ref flag set).

From array.c:
...
} else {
  if (Z_REFCOUNT_P(var_array)  1 || *entry ==
EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
  } else {
Z_SET_ISREF_PP(entry);  // -- causes damage if entry has COW
references!
  }
...

I believe that the only reliable way to fix this would be to make
extract() take its array argument as PREFER_REF.

This way, we can safely split array elements away from their
copy-on-write references, and still end up with a zval that belongs to
the original array.

I'm attaching a patch which implements this and fixes this bug, as well
as bug http://bugs.php.net/44181.

Disclaimer:
- I am not an internals expert. I might have disregarded some
scenarios. Feedback welcome!
- Patch tested on Windows XP 32bit only.

Patch against php6.0-200802191530 snap (includes test cases):
http://pastebin.ca/910172



[2008-02-20 09:26:54] robin_fernandes at uk dot ibm dot com

Description:

extract($a, EXTR_REFS) does not always respect copy-on-write reference
logic.

In the testcase below, $nonRef is initially a copy-on-write reference
to an element of $a. After the call to extract, it has become a real
reference to an element of $a.

This is reproducible on 5.2, 5.3 and 6.0 snaps.

Reproduce code:
---
?php
$a = array('foo' = 'original.foo');

$nonref = $a['foo'];
$ref = $a;

extract($a, EXTR_REFS);
$a['foo'] = 'changed.foo';

var_dump($nonref); //expecting original.foo
?


Expected result:

string(12) original.foo

Actual result:
--
string(11) changed.foo





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



#46399 [Fbk-Opn]: cgi 'leaks' shell_exec output to webserver

2008-10-27 Thread stefan at konink dot de
 ID:   46399
 User updated by:  stefan at konink dot de
 Reported By:  stefan at konink dot de
-Status:   Feedback
+Status:   Open
 Bug Type: CGI related
 Operating System: Linux 2.6.27
 PHP Version:  5.2.6
 New Comment:

Warning: file_put_contents(php://stderr) [function.file-put-contents]:
failed to open stream: Bad file descriptor in
/opt/cherokee/var/www/bugs.php on line 2
php stdout 

The author of the webserver has asked me to also file a bug there.


Previous Comments:


[2008-10-27 10:16:56] [EMAIL PROTECTED]

Could you please try the following and report what happens ?

?php
file_put_contents(php://stderr, php stderr\n);
echo php stdout\n;
?



[2008-10-27 01:17:47] stefan at konink dot de

Description:

When a php-cgi issues an shell_exec that outputs code that is expected
to be stored in the variable before it. The output is in fact leaked
back over the fcgi connection, which will issue a 500.

I'm using the Cherokee webserver.

Reproduce code:
---
$debug = shell_exec('/usr/bin/nohup /usr/bin/inkscape -z
--file='.$svgfile.' --export-width='.$width.'
--export-height='.$height.' --export-png='.$pngfile);


The work around seems to be to add:

.' 21 1/dev/null'

Expected result:

Output to be stored in $debug.

Actual result:
--
Outputted over the fcgi line:

 2f75 7372 2f62 696e 2f6e 6f68 7570 3a20 /usr/bin/nohup:.
 handler_fcgi.c:83: Parsing error: unknown version






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



#46400 [Opn-Bgs]: Floating number output problem

2008-10-27 Thread jani
 ID:   46400
 Updated by:   [EMAIL PROTECTED]
 Reported By:  David dot Rolli at bl dot ch
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Windows XP Pro, SP2
 PHP Version:  5.2.6
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

PLEASE, search the bug database before you submit a bug report. This
has actually been fixed already, IIRC.


Previous Comments:


[2008-10-27 10:55:19] David dot Rolli at bl dot ch

Description:

I want to outpu my floating number with 13 digits but not in scientific
notation - this just doesn't work with certain numbers (see code).

Reproduce code:
---
?php
  ini_set(precision, 14);

  $a = 123456789012;
  $b = 123456789012.0;
  $c = 12345678901203;
  $d = 1234567890123.0;
  
  $e = 1225099800;
  $f = 122509980;
  $h = 122509981;

  echo('$a: ' . $a. BR);   // -  123456789012
  echo('$b: ' . $b. BR);   // -  123456789012
  echo('$c: ' . $c. BR);   // -  1234567890123
  echo('$d: ' . $d. BR);   // -  1234567890123
  echo('$e: ' . $e. BR);   // -  1225099800
  echo('$f: ' . $f. BR);   // -  1.2250998E+12  !!!
  echo('$h: ' . $h. BR);   // -  122509981  !!!
?

Expected result:

123456789012
123456789012
1234567890123
1234567890123
1225099800
122509980
122509981

Actual result:
--
123456789012
123456789012
1234567890123
1234567890123
1225099800
12250998E+12
122509981





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



#46399 [Opn-Bgs]: cgi 'leaks' shell_exec output to webserver

2008-10-27 Thread jani
 ID:   46399
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stefan at konink dot de
-Status:   Open
+Status:   Bogus
 Bug Type: CGI related
 Operating System: Linux 2.6.27
 PHP Version:  5.2.6
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Please read the manual about CGI (and FastCGI) ini options. There is no
bug here.


Previous Comments:


[2008-10-27 11:33:07] stefan at konink dot de

Warning: file_put_contents(php://stderr) [function.file-put-contents]:
failed to open stream: Bad file descriptor in
/opt/cherokee/var/www/bugs.php on line 2
php stdout 

The author of the webserver has asked me to also file a bug there.



[2008-10-27 10:16:56] [EMAIL PROTECTED]

Could you please try the following and report what happens ?

?php
file_put_contents(php://stderr, php stderr\n);
echo php stdout\n;
?



[2008-10-27 01:17:47] stefan at konink dot de

Description:

When a php-cgi issues an shell_exec that outputs code that is expected
to be stored in the variable before it. The output is in fact leaked
back over the fcgi connection, which will issue a 500.

I'm using the Cherokee webserver.

Reproduce code:
---
$debug = shell_exec('/usr/bin/nohup /usr/bin/inkscape -z
--file='.$svgfile.' --export-width='.$width.'
--export-height='.$height.' --export-png='.$pngfile);


The work around seems to be to add:

.' 21 1/dev/null'

Expected result:

Output to be stored in $debug.

Actual result:
--
Outputted over the fcgi line:

 2f75 7372 2f62 696e 2f6e 6f68 7570 3a20 /usr/bin/nohup:.
 handler_fcgi.c:83: Parsing error: unknown version






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



#36947 [Opn-Tbd]: PHP HTTP stream wrapper does not treat all 2xx status codes as successful

2008-10-27 Thread bjori
 ID:   36947
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Jared dot Williams1 at ntlworld dot com
-Status:   Open
+Status:   To be documented
 Bug Type: Feature/Change Request
 Operating System: Win2000
 PHP Version:  5.1.3RC2
 New Comment:

Fixed in PHP5.3, but I don't think it has been documented properly
yet.
See: http://php.markmail.org/message/5rockhlt6hj7tzrb


Previous Comments:


[2006-04-02 13:39:17] Jared dot Williams1 at ntlworld dot com

Was raised on php internals ~year ago..

http://marc.theaimsgroup.com/?l=php-devm=111383344601864w=2

http://marc.theaimsgroup.com/?l=php-devm=111384113712112w=2

http://marc.theaimsgroup.com/?l=php-devm=111384249807034w=2



[2006-04-02 13:27:06] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to Open.

Thank you for your interest in PHP.






[2006-04-02 13:20:04] Jared dot Williams1 at ntlworld dot com

Description:

PHP HTTP stream wrapper does not treat all http 2xx status codes as
successful, making it impossible to use with WebDAV.







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



#46257 [Asn-Csd]: Compile fails when building against versions before MySql 4.1.1

2008-10-27 Thread andrey
 ID:   46257
 Updated by:   [EMAIL PROTECTED]
 Reported By:  binarycleric at gmail dot com
-Status:   Assigned
+Status:   Closed
 Bug Type: MySQL related
 Operating System: CentOS 5.2
 PHP Version:  5.3.0alpha2
 Assigned To:  andrey
 New Comment:

This bug has been fixed in CVS.

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.

Fix will be in alpha3. Thank you for testing!


Previous Comments:


[2008-10-24 16:22:12] [EMAIL PROTECTED]

Andrey, seems like this broke the build:

revision 1.260
date: 2008/07/15 13:12:27;  author: andrey;  state: Exp;  lines: +23
-4
Sync with bzr





[2008-10-08 19:27:22] binarycleric at gmail dot com

Description:

When trying to compile PHP 5.3 Alpha2 against MySQL 4.0.21 the build
would fail because a number of DEFINES and functions were not available
in that version.

A diff of my (semi-hack) fix is included.

Reproduce code:
---
--- php-5.3.0alpha2/ext/mysql/php_mysql.c   2008-08-06 15:25:03.0
-0400
+++ php-5.3.0alpha2-PATCHED/ext/mysql/php_mysql.c   2008-10-08
14:40:40.0 -0400
@@ -130,10 +130,23 @@
 static MYSQLND_QCACHE  *mysql_mysqlnd_qcache;
 #endif
 
+
+#ifndef CLIENT_MULTI_STATEMENTS
+# define CLIENT_MULTI_STATEMENTS 0
+#endif
+
+#ifndef MYSQL_OPTION_MULTI_STATEMENTS_OFF
+# define MYSQL_OPTION_MULTI_STATEMENTS_OFF 0
+#endif
+
+#if MYSQL_VERSION_ID = 40101
 #define MYSQL_DISABLE_MQ if (mysql-multi_query) { \
mysql_set_server_option(mysql-conn,
MYSQL_OPTION_MULTI_STATEMENTS_OFF); \
mysql-multi_query = 0; \
 } 
+#else
+#define MYSQL_DISABLE_MQ
+#endif
 
 /* {{{ mysql_functions[]
  */






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



#42594 [Opn-Fbk]: fopen doesn't work with ocfs2 cdsl (ocfs2 == Oracle Cluster Filesystem 2)

2008-10-27 Thread jani
 ID:   42594
 Updated by:   [EMAIL PROTECTED]
 Reported By:  i dot dastolfo at smart dot it
-Status:   Open
+Status:   Feedback
 Bug Type: OCI8 related
 Operating System: Linux
 PHP Version:  5.2.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2007-09-12 07:10:58] i dot dastolfo at smart dot it

Additional elements that could help in debugging:
CDSL link are special soft links.
Issuing a stat on this files you obtain this:

File: `test' - `.cluster/hostname/{hostname}/test'

Should it be that the php filesystem related functions misinterpret
this link, that should be followed by a syscall to the VFS?



[2007-09-07 22:28:33] i dot dastolfo at smart dot it

Description:

The fopen function (and maybe other filesystem related functions) can't
handle CDSL files/directories.
CDSL stands for context dependent symbolic link and it's a feature of
Oracle Cluster FileSystem 2 (OCFS2).
While fopen works fine with regular files and directory inside an OCFS2
 filesystem, gives failed to open stream: No such file or directory
for  CDSL files. 

Reproduce code:
---
make a OCFS2 filesystem (you can setup it even with 1 node).
Create a regular file (touch test)
Transform it in a cdsl file (ocfs2cdsl -t hostname -c test)
fopen(test,w); = Warning: fopen(test) [function.fopen]: failed to
open stream: No such file or directory in ...






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



#43314 [Opn-Fbk]: iconv_mime_encode(), broken Q scheme

2008-10-27 Thread jani
 ID:   43314
 Updated by:   [EMAIL PROTECTED]
 Reported By:  wiela at centras dot lt
-Status:   Open
+Status:   Feedback
 Bug Type: ICONV related
 Operating System: Windows XP HE
 PHP Version:  5.2.5
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2008-02-01 14:10:33] d_kelsey at uk dot ibm dot com

I encountered a similar problem with another utf-8 string, and although
this may not be the best way to fix it, this change provides a
workaround.

in iconv.c (line 1281 in php5.2.5) the line
out_size -= ((nbytes_required - (char_cnt - 2)) + 1) / (3 - 1);

should be changed to
out_size -= ((nbytes_required - (char_cnt - 2)) + 1) / 3;

It looks like the code attempts to determine how many characters would
fit into output buffer when converted (given that it has gone over the
limit), but it assumes that on average each character uses 2 bytes (ie
an even mixture of encoded and printable characters). A lot of strings
will be greater than this and out_size will be set to a very large
positive number (as it subtracts a larger number from out_size and being
unsigned will result in a large positive number).
The workaround is to take the worst case scenario and assume all
characters generated 3 bytes (ie all encoded).



[2007-11-16 16:23:17] wiela at centras dot lt

Description:

iconv_mime_encode(),'Q' encoding scheme isn't reliable and 
sometimes (for particular character and/or string length combination?)
returns: Notice: iconv_mime_encode(): Unknown error (7) in ...
*without any result*. 

This also applies to earlier php versions (tested with php 5.2.1).



Reproduce code:
---
$preferences = array(
input-charset = UTF-8,
output-charset = UTF-8,
line-length = 76,
line-break-chars = \n,
scheme = Q
);

// $str1 results error, it's utf-8 string, its base64_encode() is: 
//'xIXEjcSZxJfEr8WhxbPFviDEr8SZxI3FocWzxJnEr8SFIMSNxJnFs8SFxaHFs8Wr'
$str1 = #261;#269;#281;#279;#303;š#371;ž
#303;#281;#269;š#371;#281;#303;#261;
#269;#281;#371;#261;š#371;#363;; 

// $str2 doesn't result error, although it's only one character
// shorter. It's utf-8 string, its base64_encode() is: 
//'xIXEjcSZxJfEr8WhxbPFviDEr8SZxI3FocWzxJnEr8SFIMSNxJnFs8SFxaHFsw=='
$str2 = #261;#269;#281;#279;#303;š#371;ž
#303;#281;#269;š#371;#281;#303;#261;
#269;#281;#371;#261;š#371;;

echo iconv_mime_encode(Subject, $str1, $preferences);
echo iconv_mime_encode(Subject, $str2, $preferences);


Expected result:

Well, at least any (*some*) result is expected, without any 
errors and warnings. 

For $str1 is expected:
Subject: =?UTF-8?Q?=C4=85=C4=8D=C4=99=C4=97=C4=AF=C5=A1=C5=B3?=
 =?UTF-8?Q?=C5=BE=20=C4=AF=C4=99=C4=8D=C5=A1=C5=B3=C4=99=C4=AF?=
 =?UTF-8?Q?=C4=85=20=C4=8D=C4=99=C5=B3=C4=85=C5=A1=C5=B3=C5=AB?=

For $str2 is expected:
Subject: =?UTF-8?Q?=C4=85=C4=8D=C4=99=C4=97=C4=AF=C5=A1=C5=B3?=
 =?UTF-8?Q?=C5=BE=20=C4=AF=C4=99=C4=8D=C5=A1=C5=B3=C4=99=C4=AF?=
 =?UTF-8?Q?=C4=85=20=C4=8D=C4=99=C5=B3=C4=85=C5=A1=C5=B3?=

Actual result:
--
For $str1: 
FALSE with Notice: iconv_mime_encode(): Unknown error (7) in ...


For $str2:
Subject: =?UTF-8?Q?=C4=85=C4=8D=C4=99=C4=97=C4=AF=C5=A1=C5=B3?=
 =?UTF-8?Q?=C5=BE=20=C4=AF=C4=99=C4=8D=C5=A1=C5=B3=C4=99=C4=AF?=
 =?UTF-8?Q?=C4=85=20=C4=8D=C4=99=C5=B3=C4=85=C5=A1=C5=B3?=





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



#43468 [Opn-Fbk]: Curl doesn't handle php://memory stream

2008-10-27 Thread jani
 ID:   43468
 Updated by:   [EMAIL PROTECTED]
 Reported By:  peter at petersmit dot eu
-Status:   Open
+Status:   Feedback
 Bug Type: cURL related
 Operating System: Ubuntu Linux Gutsy Gibbon
 PHP Version:  5.2.5
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

If it still does not work, please provide the full configure line you
have used.


Previous Comments:


[2008-02-13 22:16:29] quickshiftin at gmail dot com

i have discovered that this does work, partially, for some urls.
im not sure what is preventing this from working on all urls, but even
for ones where it does work, the entire result is not placed in the
buffer.
here is a modification of peters code, which illustrates 2 urls that
work partially, one is the google translate 'api', the other is
php.net.

?php
#$c = curl_init(http://example.com;);
#$c =
curl_init(http://google.com/translate_t?langpair=en%7Cfrtext=newspaper;);
$c = curl_init(http://php.net;);
$st = fopen('php://memory', 'r');

curl_setopt($c, CURLOPT_FILE, $st);
curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686;
en-US; rv:1.8.1.11) Gecko/20080115 Firefox/2.0.0.11');

if(!curl_exec($c)) die (error: .curl_error($c));
curl_close($c);


rewind($st);
/*
$str =  fgets($st);
var_dump($str);
*/
echo stream_get_contents($st);
#echo
Content|.htmlspecialchars(stream_get_contents($st)).|/Content;
fclose($st);
?



[2007-12-01 10:00:25] peter at petersmit dot eu

Description:

If you use a php://memory stream in combination with curl, nothing is
written to the stream.

A filestream works fine.

Reproduce code:
---
?php

$c = curl_init(http://example.com;);
$st = fopen(php://memory, r+);

curl_setopt($c, CURLOPT_FILE, $st);

if(!curl_exec($c)) die (error: .curl_error($c));

rewind($st);
echo
Content|.htmlspecialchars(stream_get_contents($st)).|/Content;
fclose($st);

?

Expected result:

Content|The content of example.org|/Content

Actual result:
--
Content||/Content





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



#43510 [Opn-Fbk]: stream_get_meta_data() does not return same mode as used in fopen

2008-10-27 Thread jani
 ID:   43510
 Updated by:   [EMAIL PROTECTED]
 Reported By:  dz at bitxtender dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Streams related
 Operating System: *
 PHP Version:  5.2.5


Previous Comments:


[2008-10-26 23:41:58] dz at bitxtender dot com

Thanks Jani. Will try ASAP.



[2008-10-26 23:34:03] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2007-12-06 17:37:54] dz at bitxtender dot com

The simple reason why this must work is because one might want to 
serialize an object with a file pointer, and that can only be done by 
grabbing the meta data on sleep, and restoring the stream on wakeup.

But fopen() on an HTTP resource with r+ of course gives a warning that

the stream does not support writing!

I stumbled across this when someone pointed out that in Agavi, it's not

possible to cache a response that is streaming content from an HTTP 
resource. Check 
http://trac.agavi.org/browser/branches/0.11/src/response/AgaviResponse.c
lass.php?rev=2205#L55 for some real-life code that relies on this ;)

Also, it never hurts to have things working 100% properly ;)



[2007-12-06 17:26:52] [EMAIL PROTECTED]

Reopening after discussions. David, please explain the reasoning



[2007-12-06 13:50:09] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Why should the exact mode matter?



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
http://bugs.php.net/43510

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



#43899 [Opn-Asn]: Problem in displaying right to left connected languages (like persian, arabic)

2008-10-27 Thread jani
 ID:   43899
 Updated by:   [EMAIL PROTECTED]
 Reported By:  mohamnag at gmail dot com
-Status:   Open
+Status:   Assigned
 Bug Type: GD related
 Operating System: Ubuntu Gusty
 PHP Version:  5.2.5
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

Assigned to the GD maintainer.


Previous Comments:


[2008-01-20 12:28:29] mohamnag at gmail dot com

Description:

There is an issue displaying Persian characters in GD generated
images.
In persian, characters are arranged right to left (I mean first char is
the most right hand arranged one). In addition characters are connected.
For example while #1740; and #1705; are being written when separated,
they should be written #1740;#1705; when connected. So not only they
should be arranged right to left but also the shape of characters change
during connections.
However displaying text using GD don't arrange persian characters right
to left nor connects them correctly.
Some persian developers have made a php function which corrects the
problem here: http://persiangd.berlios.de/doku.php
but I think it should be solved globally in the original lib.


Reproduce code:
---
header(Content-type: image/png);
//uncomment to correct issue:
//include(fagd.php);

$text=#1740;#1705;;

$im = imagecreate(800, 40);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);

//uncomment to correct issue:
//$text = fagd($string,'fa');

$font = dirname(__FILE__).'/tahoma.ttf';

// Add the text
imagettftext($im, 20, 0, 20, 25, $black, $font,$text);

imagepng($im);
imagedestroy($im);


Expected result:

this is an image displaying the correct output resulting from passing
the text to imagettftext(), after being parsed using the fagd() function
(provided by persian developers to correct the issue):
http://khone.ir/test/t2.png

Actual result:
--
this is an image displaying the problematic view resulting from direct
input of persian text to imagettftext():
http://khone.ir/test/t1.png





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



#43934 [Opn-Bgs]: uncaught exception for wrong parameter type in mysql_fetch_object

2008-10-27 Thread jani
 ID:   43934
 Updated by:   [EMAIL PROTECTED]
 Reported By:  josmessa at uk dot ibm dot com
-Status:   Open
+Status:   Bogus
 Bug Type: MySQL related
 Operating System: Windows XP
 PHP Version:  5.2CVS-2008-01-25 (snap)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:


[2008-03-07 19:53:17] [EMAIL PROTECTED]

The comments on code justify such behavior:

/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The 
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/



[2008-01-25 11:43:06] josmessa at uk dot ibm dot com

Description:

If an argument that is not an array or null is passed as the $params
(also called $ctor_params in source code) argument in mysql_fetch_object
then the below uncaught exception is returned instead of a normal
warning. 
The reproduced code below is similar to that of a test case from 5.3,
although by the time that what I have described above was tested no more
rows were in $res so bool(false) was being returned and so this problem
may also be in 5.3

Reproduce code:
---
?php
//select database and table...

$res = mysql_query('SELECT col1 FROM test');

class mysql_fetch_object_test {
public $a = null;
public $b = null;
public function __construct($a, $b) {
$this-a = $a;
$this-b = $b;
}
public function toString() {
var_dump($this);
}
}
var_dump(mysql_fetch_object($res, 'mysql_fetch_object_test', 'not
array'));
?

Actual result:
--
Fatal error: Uncaught exception 'Exception' with message 'Parameter
ctor_params must be an array' in ...\mysql_fetch_object.php:25
Stack trace:
#0 ...\mysql_fetch_object.php(25): mysql_fetch_object(Resource id #5,
'mysql_fetch_obj...', 'not array')
#1 {main}
  thrown in ...\mysql_fetch_object.php on line 25






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



#44182 [Opn-Fbk]: extract($a, EXTR_REFS) can fail to split copy-on-write references

2008-10-27 Thread jani
 ID:   44182
 Updated by:   [EMAIL PROTECTED]
 Reported By:  robin_fernandes at uk dot ibm dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Arrays related
 Operating System: *
 PHP Version:  5.2CVS-2008-02-20 (snap)
 New Comment:

Does this bug exist in HEAD, PHP_5_3 and PHP_5_2 branches? And in
today's versions of them?


Previous Comments:


[2008-10-25 13:52:02] robin_fernandes at uk dot ibm dot com

The patch URL? Seems OK to me, perhaps it was temporarily broken.

In any case, here's another one: 
http://soal.org/php/extract.patch.txt



[2008-10-25 13:25:36] [EMAIL PROTECTED]

That url does not work..



[2008-02-20 09:29:24] robin_fernandes at uk dot ibm dot com

I think the problem is that extract() can set the is_ref flag on zvals
without splitting them (i.e. zvals which have more than 1 copy-on-write
references can get their is_ref flag set).

From array.c:
...
} else {
  if (Z_REFCOUNT_P(var_array)  1 || *entry ==
EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
  } else {
Z_SET_ISREF_PP(entry);  // -- causes damage if entry has COW
references!
  }
...

I believe that the only reliable way to fix this would be to make
extract() take its array argument as PREFER_REF.

This way, we can safely split array elements away from their
copy-on-write references, and still end up with a zval that belongs to
the original array.

I'm attaching a patch which implements this and fixes this bug, as well
as bug http://bugs.php.net/44181.

Disclaimer:
- I am not an internals expert. I might have disregarded some
scenarios. Feedback welcome!
- Patch tested on Windows XP 32bit only.

Patch against php6.0-200802191530 snap (includes test cases):
http://pastebin.ca/910172



[2008-02-20 09:26:54] robin_fernandes at uk dot ibm dot com

Description:

extract($a, EXTR_REFS) does not always respect copy-on-write reference
logic.

In the testcase below, $nonRef is initially a copy-on-write reference
to an element of $a. After the call to extract, it has become a real
reference to an element of $a.

This is reproducible on 5.2, 5.3 and 6.0 snaps.

Reproduce code:
---
?php
$a = array('foo' = 'original.foo');

$nonref = $a['foo'];
$ref = $a;

extract($a, EXTR_REFS);
$a['foo'] = 'changed.foo';

var_dump($nonref); //expecting original.foo
?


Expected result:

string(12) original.foo

Actual result:
--
string(11) changed.foo





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



#45973 [Fbk-Opn]: Setting include_path with non-defined ${include_path} crashes

2008-10-27 Thread olivier dot berger at it-sudparis dot eu
 ID:   45973
 User updated by:  olivier dot berger at it-sudparis dot eu
 Reported By:  olivier dot berger at it-sudparis dot eu
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: Debian lenny
 PHP Version:  5.2.6
 New Comment:

Hi.

Sorry, but I'm afraid I won't have time to test that at the moment.

Should be testable by anyone interested still.

Best regards,


Previous Comments:


[2008-10-26 19:23:51] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2008-09-02 13:00:01] olivier dot berger at it-sudparis dot eu

Description:

If include_path wasn't set already, setting it to some concatenation of
${include_path} causes a segfault.

Seems different from #37002, AFAICT

More details in Debian bug :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497453

Reproduce code:
---
For instance, if /etc/php5/apache2/php.ini doesn't contain any
include_path definition, like is by default in Debian :
 ; UNIX: /path1:/path2
 ;include_path = .:/usr/share/php

then setting the following in for instance /etc/php5/conf.d/zend.ini :
 [Zend]
 include_path = ${include_path}
:/usr/share/php/libzend-framework-php

leads to segmentation fault.


Expected result:

I guess referencing variables no yet explicitely set, but having
default values should return their default value.

Uncommenting the default include_path in /etc/php5/apache2/php.ini
allows it to work.


Actual result:
--
Apache segmentation fault





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



#44182 [Fbk-Opn]: extract($a, EXTR_REFS) can fail to split copy-on-write references

2008-10-27 Thread robin_fernandes at uk dot ibm dot com
 ID:   44182
 User updated by:  robin_fernandes at uk dot ibm dot com
 Reported By:  robin_fernandes at uk dot ibm dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Arrays related
 Operating System: *
 PHP Version:  5.2CVS-2008-02-20 (snap)
 New Comment:

Confirmed this bug (and bug 44181) still present on:
PHP 5.2.7RC3-dev (cli) (built: Oct 27 2008 11:40:07) 
PHP 5.3.0alpha3-dev (cli) (built: Oct 27 2008 14:06:30) 
PHP 6.0.0-dev (cli) (built: Oct 27 2008 12:39:36)


Previous Comments:


[2008-10-27 13:01:24] [EMAIL PROTECTED]

Does this bug exist in HEAD, PHP_5_3 and PHP_5_2 branches? And in
today's versions of them?



[2008-10-25 13:52:02] robin_fernandes at uk dot ibm dot com

The patch URL? Seems OK to me, perhaps it was temporarily broken.

In any case, here's another one: 
http://soal.org/php/extract.patch.txt



[2008-10-25 13:25:36] [EMAIL PROTECTED]

That url does not work..



[2008-02-20 09:29:24] robin_fernandes at uk dot ibm dot com

I think the problem is that extract() can set the is_ref flag on zvals
without splitting them (i.e. zvals which have more than 1 copy-on-write
references can get their is_ref flag set).

From array.c:
...
} else {
  if (Z_REFCOUNT_P(var_array)  1 || *entry ==
EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
  } else {
Z_SET_ISREF_PP(entry);  // -- causes damage if entry has COW
references!
  }
...

I believe that the only reliable way to fix this would be to make
extract() take its array argument as PREFER_REF.

This way, we can safely split array elements away from their
copy-on-write references, and still end up with a zval that belongs to
the original array.

I'm attaching a patch which implements this and fixes this bug, as well
as bug http://bugs.php.net/44181.

Disclaimer:
- I am not an internals expert. I might have disregarded some
scenarios. Feedback welcome!
- Patch tested on Windows XP 32bit only.

Patch against php6.0-200802191530 snap (includes test cases):
http://pastebin.ca/910172



[2008-02-20 09:26:54] robin_fernandes at uk dot ibm dot com

Description:

extract($a, EXTR_REFS) does not always respect copy-on-write reference
logic.

In the testcase below, $nonRef is initially a copy-on-write reference
to an element of $a. After the call to extract, it has become a real
reference to an element of $a.

This is reproducible on 5.2, 5.3 and 6.0 snaps.

Reproduce code:
---
?php
$a = array('foo' = 'original.foo');

$nonref = $a['foo'];
$ref = $a;

extract($a, EXTR_REFS);
$a['foo'] = 'changed.foo';

var_dump($nonref); //expecting original.foo
?


Expected result:

string(12) original.foo

Actual result:
--
string(11) changed.foo





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



#46400 [Bgs]: Floating number output problem

2008-10-27 Thread David dot Rolli at bl dot ch
 ID:   46400
 User updated by:  David dot Rolli at bl dot ch
 Reported By:  David dot Rolli at bl dot ch
 Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Windows XP Pro, SP2
 PHP Version:  5.2.6
 New Comment:

Would be nice if you could tell me which bug report seems to point out
this same problem (I didn't find it) and which version of PHP has this
fix ! PLEASE


Previous Comments:


[2008-10-27 11:47:39] [EMAIL PROTECTED]

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

PLEASE, search the bug database before you submit a bug report. This
has actually been fixed already, IIRC.



[2008-10-27 10:55:19] David dot Rolli at bl dot ch

Description:

I want to outpu my floating number with 13 digits but not in scientific
notation - this just doesn't work with certain numbers (see code).

Reproduce code:
---
?php
  ini_set(precision, 14);

  $a = 123456789012;
  $b = 123456789012.0;
  $c = 12345678901203;
  $d = 1234567890123.0;
  
  $e = 1225099800;
  $f = 122509980;
  $h = 122509981;

  echo('$a: ' . $a. BR);   // -  123456789012
  echo('$b: ' . $b. BR);   // -  123456789012
  echo('$c: ' . $c. BR);   // -  1234567890123
  echo('$d: ' . $d. BR);   // -  1234567890123
  echo('$e: ' . $e. BR);   // -  1225099800
  echo('$f: ' . $f. BR);   // -  1.2250998E+12  !!!
  echo('$h: ' . $h. BR);   // -  122509981  !!!
?

Expected result:

123456789012
123456789012
1234567890123
1234567890123
1225099800
122509980
122509981

Actual result:
--
123456789012
123456789012
1234567890123
1234567890123
1225099800
12250998E+12
122509981





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



#44462 [Opn-Fbk]: Can't compile embed sapi on OSX

2008-10-27 Thread jani
 ID:   44462
 Updated by:   [EMAIL PROTECTED]
 Reported By:  graham+php at nexopia dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Compile Failure
 Operating System: OSX
 PHP Version:  5.2CVS-2008-03-18
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2008-04-25 17:56:46] cthompson at nexopia dot com

I just sent the following to the php-install mailing list for
feedback.

Modify php-5.2.5/Zend/zend_ini_scanner.c:

--- /Users/cthompson/php-5.2.5.clean/Zend/zend_ini_scanner.c   
2007-11-08 09:36:37.0 -0600
+++ ./zend_ini_scanner.c2008-04-25 10:16:27.0 -0600
@@ -478,7 +478,7 @@
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+//char *yytext;
 #define INITIAL 0
 /*

+--+


Modify php-5.2.5/Zend/zend_language_scanner.c:
--- /Users/cthompson/php-5.2.5.clean/Zend/zend_language_scanner.c
2007-11-08 09:36:37.0 -0600
+++ ./zend_language_scanner.c2008-04-25 10:17:15.0 -0600
@@ -3009,7 +3009,7 @@
 #define yymore() (yy_more_flag = 1)
 #define YY_MORE_ADJ yy_more_len
 #define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+//char *yytext;
 #define INITIAL 0

 /*


This REMOVES the definition of yytext.  I think this is okay because
the various defines in those files actually end up using the yy_text in
zend_global.h, at least as far as I can see.

Certainly, this allows PHP to compile but I am not at all sure if this
is going to cause other problems.  Could someone please give me some
feedback?


Additionally, I believe php-5.2.5/sapi/cli/config.m4 should be modified
to compile using libtool on OS X:
--- /Users/cthompson/php-5.2.5.clean/sapi/cli/config.m42007-07-11
17:20:36.0 -0600
+++ ./config.m42008-04-25 11:51:57.0 -0600
@@ -17,7 +17,7 @@
 BUILD_CLI=echo '\#! .'  php.sym  echo php.sym  nm -BCpg
\`echo \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) | sed
's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \T\) ||
(\$\$2 == \D\) || (\$\$2 == \B\))  (substr(\$\$3,1,1) != \.\)) {
print \$\$3 } }' | sort -u  php.sym  \$(LIBTOOL) --mode=link \$(CC)
-export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym
\$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
 ;;
   *darwin*)
-BUILD_CLI=\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS)
\$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
+BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) \$(CFLAGS_CLEAN)
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
 ;;
   *netware*)
 BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic
\$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS)
\$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS)
-Lnetware -lphp5lib -o \$(SAPI_CLI_PATH)


Of course, the shipping version of PHP 5.2.5 would then also need the
php-5.2.5/configure file changing, though presumably this is
autogenerated from the fragments:
--- /Users/cthompson/php-5.2.5.clean/configure2007-11-08
09:36:28.0 -0600
+++ ./configure2008-04-25 11:27:46.0 -0600
@@ -9180,7 +9180,7 @@
 BUILD_CLI=echo '\#! .'  php.sym  echo php.sym  nm -BCpg
\`echo \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) | sed
's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \T\) ||
(\$\$2 == \D\) || (\$\$2 == \B\))  (substr(\$\$3,1,1) != \.\)) {
print \$\$3 } }' | sort -u  php.sym  \$(LIBTOOL) --mode=link \$(CC)
-export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym
\$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
 ;;
   *darwin*)
-BUILD_CLI=\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS)
\$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
+BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) \$(CFLAGS_CLEAN)
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
 ;;
   *netware*)
 BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic
\$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS)
\$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) 

#46401 [Opn-Bgs]: String concatenation with class attribute

2008-10-27 Thread jani
 ID:   46401
 Updated by:   [EMAIL PROTECTED]
 Reported By:  victor at equillon dot ro
-Status:   Open
+Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

I suggest you turn on full error_reporting on your development
machine:

# php -derror_reporting=E_ALL -n t.php

Notice: Trying to get property of non-object in /home/jani/t.php on
line 18

And then read about constructors and classnames..


Previous Comments:


[2008-10-27 13:17:20] victor at equillon dot ro

Description:

When concatenating a string with an attribute of a class, the attribute
is considered to be void or something. It doesn't always run like that.

It can be fixed by doing this:

echo Monster .($this-monsters[0]-name). hit something;

Reproduce code:
---
class Monster {
   public $name;
}

class test {
   private $monsters; 
   
   public function init() {
  for ($i=0; $i100; $i++) {
 $this-monsters[$i] = new Monster();
 $this-monsters[$i]-name = test;
  }
   }

   public function test() {
  echo Monster .$this-monsters[0]-name. hit something;
   }
}

$abc = new test();
$abc-init();
$abc-test();

Expected result:

Monster test hit something

Actual result:
--
Monster hit something





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



#42666 [Opn-Fbk]: virtual() crashes when there is some error in script using it

2008-10-27 Thread jani
 ID:   42666
 Updated by:   [EMAIL PROTECTED]
 Reported By:  per dot jessen at enidan dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Apache2 related
 Operating System: Linux
 PHP Version:  5.2.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2007-10-26 18:47:23] s dot clover at gmail dot com

Similar issue running PHP 5.2.4 as a module with Apache 2.2.6 on a Win
XP box. Three files:

---

test.php:
?php
virtual ('/test.html');
echo $bad;?

test.html:
!--#include virtual=test2.php --

test2.php:
?php

?

---
This is running with display_errors=On. It also segfaults, but in
different ways, with display_errors=Off, or depending on the exact
amount of bytes/calls in various files will simply print out a notice
with a corrupted linenumber.

It looks like the issue is that the php-within-php virtual nesting
somehow corrupts php's ability to tell the difference between
uninitialized/unset variables and valid ones, leading to memory access
exceptions of various sorts.



[2007-10-23 10:41:13] per dot jessen at enidan dot com

Sure. 

problem.phtlm.en:

?php
virtual(problem-include.phtml.en);
klop
?

problem-include.phtml.en:

?php
?



[2007-10-23 09:45:27] [EMAIL PROTECTED]

So you should be able to now provide the reproducing script here
instead of the tar package?



[2007-10-23 06:19:35] per dot jessen at enidan dot com

Sorry, forgot to mention that - yes, I've removed the XSL calls, and
added a plain syntax error. The segfault still happens.



[2007-10-22 19:24:10] [EMAIL PROTECTED]

And does the problem occur without XSL (by causing some other error) ?
(I can't check the tar package right now)



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
http://bugs.php.net/42666

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



#42568 [Opn-Fbk]: Compile fails when using --with-gmp option in MacOSX

2008-10-27 Thread jani
 ID:   42568
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jerry at scene-naturally dot dyndns dot org
-Status:   Open
+Status:   Feedback
 Bug Type: GNU MP related
 Operating System: MacOSX 10.4.10
 PHP Version:  5.2.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2007-11-05 19:12:04] [EMAIL PROTECTED]

I'm afraid I don't know what to do with this - I don't have OS X
readily available and OS linkage is quite exotic so I couldn't figure it
out using other systems...



[2007-09-13 10:18:12] [EMAIL PROTECTED]

Assigned to the ext/gmp maintainer.



[2007-09-11 15:55:51] jerry at scene-naturally dot dyndns dot org

This is from the gmp folks:


Well, I can only wish you luck since there is really nothing I can do
about this.  You need to dig in PHP to debug this.

You need to provide me with a test case that violates the documented
GMP behavior, then I will fix the error.


Therein is a problem, when gmp is build according to the developer's 
instructions, using it when building PHP is the only place things 
break, which does not violate the docs for gmp.



[2007-09-11 12:32:27] [EMAIL PROTECTED]

I have no idea how to fix this in PHP. And to me it seems more like a
bug in either the tools in OSX used to compile/link and/or in libgmp. It
works fine on Linux. :) Can you try and find out what the libgmp folks
think might be wrong with PHP build system which might cause this kind
of error? (I have no MacOSX machine to test anything so..)



[2007-09-07 16:15:36] jerry at scene-naturally dot dyndns dot org

I had a chance to try the following;

GMP build via:

./configure \
--prefix=/usr/local \
--enable-cxx \
--disable-shared \
ABI=mode32


PHP configure:

./configure \
--with-gmp=/usr/local \
--disable-shared

as requested, but running make for this configuration still crashes 
with the error

/usr/bin/ld: /usr/local/lib/libgmp.a(popcount.o) has local relocation 
entries in non-writable section (__TEXT,__text)



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
http://bugs.php.net/42568

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



#42832 [Opn-Asn]: scandir() fails unless user has permissions in the parent directory

2008-10-27 Thread jani
 ID:   42832
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jmboyd at bluebottle dot com
-Status:   Open
+Status:   Assigned
 Bug Type: Directory function related
 Operating System: Windows 2000
-PHP Version:  5.2CVS-2007-10-03
+PHP Version:  5.2CVS-2008-08-25
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

Assigned to the windows port maintainer.


Previous Comments:


[2008-08-25 14:56:47] jmboyd at bluebottle dot com

Hey, I did provide feedback!  Lousy robot.

Just tried it again with the latest 5.3.0alpha2-dev build stamped Mon,
25 Aug 2008 10:05:33 -0400, same result.  I can post the output if
needed, but it's exactly the same as the 18 Aug 5:54pm UTC comment
above.



[2008-08-18 17:54:24] jmboyd at bluebottle dot com

Same result with the snapshot (from Mon, 18 Aug 2008 14:03:00 -0400):

C:\parentdir\subdir\php53dev\php -r foreach(scandir('.') as $f)
{echo($f); }

Warning: scandir(.): failed to open dir: Bad file descriptor in Command
line code on line 1

Warning: scandir(): (errno 9): Bad file descriptor in Command line code
on line 1

Warning: Invalid argument supplied for foreach() in Command line code
on line 1



[2007-10-04 01:59:28] jmboyd at bluebottle dot com

Same result with the snapshot (from 03 Oct 2007 20:09:47):

C:\parentdir\subdir\php525dev\php -r foreach(scandir('.') as $f) {
echo($f); }

Warning: scandir(.): failed to open dir: Bad file descriptor in Command
line code on line 1

Warning: scandir(): (errno 9): Bad file descriptor in Command line code
on line 1

Warning: Invalid argument supplied for foreach() in Command line code
on line 1



[2007-10-02 17:57:35] jmboyd at bluebottle dot com

Description:

A user must have permissions for a directory's parent in order to scan
it with scandir.  If the user does not have permissions (for instance,
user has Full Control over the subdir but is not in the parent's ACL
at all), php fails with a failed to open dir: Bad file descriptor
error followed by a (errno 9): Bad file descriptor error.

Based on the quick test in the Actual results box below, this bug
seems to have arrived between 5.2.1 and 5.2.2.  No php.ini is in use in
any of the tests.

Reproduce code:
---
Any use of scandir will work, here's a quick one to do from the command
line, after cding to the subdir:

php -r foreach(scandir('.') as $f) { echo($f); }

Expected result:

The subdirectory's filenames (all run together):

...file1.txtfile2.txtfile3.txt

Actual result:
--
C:\cd \parentdir
Access is denied.

C:\cd \parentdir\subdir

C:\parentdir\subdirdir /B
file1.txt
file2.txt
file3.txt

C:\parentdir\subdir\php521\php -r foreach(scandir('.') as $f) {
echo($f); }
...file1.txtfile2.txtfile3.txt
C:\parentdir\subdir\php522\php -r foreach(scandir('.') as $f) {
echo($f); }

Warning: scandir(.): failed to open dir: Bad file descriptor in Command
line code on line 1

Warning: scandir(): (errno 9): Bad file descriptor in Command line code
on line 1

Warning: Invalid argument supplied for foreach() in Command line code
on line 1

C:\parentdir\subdir\php524\php -r foreach(scandir('.') as $f) {
echo($f); }

Warning: scandir(.): failed to open dir: Bad file descriptor in Command
line code on line 1

Warning: scandir(): (errno 9): Bad file descriptor in Command line code
on line 1

Warning: Invalid argument supplied for foreach() in Command line code
on line 1





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



#44938 [Opn-Ctl]: gettext functions crash with long strings

2008-10-27 Thread jani
 ID:   44938
 Updated by:   [EMAIL PROTECTED]
 Reported By:  hoffie at gentoo dot org
-Status:   Open
+Status:   Critical
 Bug Type: Gettext related
 Operating System: Linux
 PHP Version:  5.2.6


Previous Comments:


[2008-05-07 20:34:37] hoffie at gentoo dot org

Description:

Has this ever been addressed? 5.2.6 still crashes.

http://www.securityfocus.com/archive/1/483648/30/0/threaded

Reproduce code:
---
$ php -r 'dgettext(str_repeat(A,8476509),hi);'

(See $URL for more examples)

Expected result:

No crash...

Actual result:
--
Segmentation fault





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



#45005 [Opn-Bgs]: pg_insert causes segmentation fault at end of program execution

2008-10-27 Thread jani
 ID:   45005
 Updated by:   [EMAIL PROTECTED]
 Reported By:  deusmax at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: PostgreSQL related
 Operating System: ubuntu linux gutsy
 PHP Version:  5.2CVS-2008-05-15 (CVS)
 New Comment:

See above.


Previous Comments:


[2008-07-30 19:54:59] bugs dot php dot net at zetafleet dot com

This is a duplicate of Bug #40926.



[2008-05-15 12:28:33] deusmax at gmail dot com

Here is a backtrace:

(gdb) bt
#0  0xb6412ea0 in ?? ()
#1  0xb7870705 in CRYPTO_lock () from
/usr/lib/i686/cmov/libcrypto.so.0.9.8
#2  0xb78dc5ad in ?? () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#3  0x0009 in ?? ()
#4  0x0001 in ?? ()
#5  0xb79562bb in ?? () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#6  0x0161 in ?? ()
#7  0xb79669b8 in ?? () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#8  0x085df8b8 in ?? ()
#9  0xbfdaa978 in ?? ()
#10 0xb78a in ERR_free_strings ()
   from /usr/lib/i686/cmov/libcrypto.so.0.9.8
Backtrace stopped: frame did not save the PC
(gdb)

My php5 binary doesn't have debug symbols enabled, it seems.
Anyway, I ran the code again from within the debuger and got this
output:

bash%gdb /usr/bin/php5 

This GDB was configured as i486-linux-gnu...
(no debugging symbols found)
Using host libthread_db library
/lib/tls/i686/cmov/libthread_db.so.1.
(gdb) run /home/dias/tmp/test.php
Starting program: /usr/bin/php5 /home/dias/tmp/test.php
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
---Type return to continue, or q return to quit---
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1215936848 (LWP 29629)]
Error while reading shared library symbols:
Cannot find new threads: generic error
Inserting array... Done
Closed

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215936848 (LWP 29629)]
0xb644fea0 in ?? ()
(gdb) bt
#0  0xb644fea0 in ?? ()
#1  0xb78ad705 in CRYPTO_lock () from
/usr/lib/i686/cmov/libcrypto.so.0.9.8
#2  0xb79195ad in ?? () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#3  0x0009 in ?? ()
#4  0x0001 in ?? ()
#5  0xb79932bb in ?? () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#6  0x0161 in ?? ()
#7  0xb79a39b8 in ?? () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#8  0x085df8b8 in ?? ()
#9  0xbf837c08 in ?? ()
#10 0xb791adda in ERR_free_strings ()
   from /usr/lib/i686/cmov/libcrypto.so.0.9.8
Backtrace stopped: frame did not save the PC
(gdb)



[2008-05-15 11:53:44] deusmax at gmail dot com

Description:

when using pg_insert(),everything works, but when the program
terminates it reports a Segmentation fault.

Data are properly inserted into table,
db connection closed ok. too.

create a small table

create table test (regn text, mtow numeric(6,2), tonbl timestamp(0)
with time zone);

Actually, just using pg_convert() on the array causes the same
segmentation fault to be reported. Without even trying to insert the
data.

Reproduce code:
---
Use some data
$data = array('regn' = 'defi', 
  'mtow' =  23.2,
  'tonbl' = '2008-05-15T16:15:16+00');

insert using:
$db = pg_connect(dbname=foo);
$res = pg_insert($db, 'test', $data);
pg_close($db);







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



#46401 [NEW]: String concatenation with class attribute

2008-10-27 Thread victor at equillon dot ro
From: victor at equillon dot ro
Operating system: Linux
PHP version:  5.2.6
PHP Bug Type: Class/Object related
Bug description:  String concatenation with class attribute

Description:

When concatenating a string with an attribute of a class, the attribute is
considered to be void or something. It doesn't always run like that.

It can be fixed by doing this:

echo Monster .($this-monsters[0]-name). hit something;

Reproduce code:
---
class Monster {
   public $name;
}

class test {
   private $monsters; 
   
   public function init() {
  for ($i=0; $i100; $i++) {
 $this-monsters[$i] = new Monster();
 $this-monsters[$i]-name = test;
  }
   }

   public function test() {
  echo Monster .$this-monsters[0]-name. hit something;
   }
}

$abc = new test();
$abc-init();
$abc-test();

Expected result:

Monster test hit something

Actual result:
--
Monster hit something

-- 
Edit bug report at http://bugs.php.net/?id=46401edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46401r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46401r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46401r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46401r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46401r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46401r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=46401r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=46401r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=46401r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=46401r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=46401r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=46401r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=46401r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46401r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=46401r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=46401r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=46401r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=46401r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=46401r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=46401r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=46401r=mysqlcfg



#45068 [Opn-Bgs]: Large integer immediates are read incorrectly

2008-10-27 Thread jani
 ID:   45068
 Updated by:   [EMAIL PROTECTED]
 Reported By:  philipm at sybase dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Compile Failure
 Operating System: Linux (32-bit only)
 PHP Version:  5.2.6
 New Comment:

Cross compiling is not supported.


Previous Comments:


[2008-05-26 16:00:16] philipm at sybase dot com

This 32-bit PHP executable was built on a 64-bit Red Hat Linux machine.
 In order to build as 32-bit I set CFLAGS=-m32 then run configure.

Larger numbers (even those that require a 64-bit data type) also end up
coming out as INT_MAX.  Note that even if SIZEOF_LONG is being set
incorrectly, it does seem strange that everything is coming out as
INT_MAX.  If the high-order bits were getting lost, I would expect to
see the low-order bits coming out...but in this case I'm only seeing
this number that is completely unrelated to the input value.

It may be that the configure script is messing up SIZEOF_LONG, as you
mentioned.  This is, I suppose, technically cross-compiling since the
host machine is 64-bit and I'm compiling for 32-bit.  I can't find the
note in the configure script that you mentioned, however.

I did a grep for SIZEOF_LONG and got this:
main/php_config.h ...
#define SIZEOF_LONG 8
include/php/main/php_config.h ...
#define SIZEOF_LONG 8

Soindeed, the configure script does seem to have gotten confused.



[2008-05-25 14:41:14] [EMAIL PROTECTED]

This would seem to be caused by SIZEOF_LONG not being defined correctly
(e.g. 8 when it should be 4 on 32-bit)... I'm the one who made the
changes in 5.2.1 so most of the overhead to check for integer overflow
could be eliminated, etc. It didn't cause any tests to fail, and this is
the first issue I've heard. Also, I would expect numeric strings to fail
in the same way: '30' + 0 ?

Is the result the same if you use an 11-digit number? Any more details
about your Linux system, in case there's something unique, might help
the Linux experts (not me) figure something else out. I'm not sure what
sets SIZEOF_LONG. Oh wait, I was just looking at the configure
script, and noticed bits about cross compiling where SIZEOF_LONG is
defined -- do you know, is that something that applies in your
configuration?



[2008-05-22 19:34:15] philipm at sybase dot com

Description:

Entering a large integer immediate (i.e. bigger than INT_MAX) will
result in INT_MAX being used.  The issue is that these numbers cannot be
treated as integers in the zval, but for some reason the parser is
attempting to do so.  However, the various operators convert the large
number to a float, so they work okay.

For example, entering:

30 gives 2147483647
30 + 1 gives 2147483648
30.0 + 1 gives 31

This issue was introduced in PHP 5.2.1 and has not been addressed as of
5.2.6.  5.2.0 and earlier worked as expected.  It also appears to work
properly on Windows.

Reproduce code:
---
# the output should be the same as the input
print 30 . \n;

# these two should be the same
print 30 + 1 . \n;
print 30.0 + 1 .\n;


Expected result:

30
31
31


Actual result:
--
2147483647
2147483648
31





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



#45062 [Opn]: thttpd problem displaying .html pages when patched with php on 64 bits OS

2008-10-27 Thread jani
 ID:   45062
 Updated by:   [EMAIL PROTECTED]
 Reported By:  j dot orfeuil at courantmultimedia dot fr
 Status:   Open
 Bug Type: Other web server
 Operating System: debian 4.0 x86_64
 PHP Version:  5.2.6
 New Comment:

I doubt anyone has updated the thttpd patch required so I doubt it will
ever work in 64bit systems.


Previous Comments:


[2008-10-27 08:44:05] j dot orfeuil at courantmultimedia dot fr

First of all thx for the answer :)
Of course i've heard about other light web servers thx but the fact is
we already have a whole system running on thttpd.
We actually just need to move our system on a new hardware plateform
(actually on many VPS on a new hardware plateform) and a new OS based on
64bits debian system. For obvious bug reasons and testing time, we just
wanted to clone the web part as it is bugless (or at least with small
ones :p)
Changing webserver would be an idea and it would probably work but we
wanted to understand why there was a problem with specific 64 bits OS...
(as we believe it is related to patching thttpd sources with php...) and
of course, as i said before, for bug reason...

On the other hand i don't know if thttpd is still maintained and it
would be recommended to change for an active project but the version we
have is stable and if the bug comes from php, we would have no reason to
change.

Well, hoping you can understand our needs and why we're still looking
for a lead through php bugs, maybe you could help us :)

Regards
Joseph



[2008-10-25 13:15:28] [EMAIL PROTECTED]

Does someone actually maintain thttpd anymore? Have you ever heard of 
lighttpd and FastCGI..? 




[2008-05-22 07:23:43] j dot orfeuil at courantmultimedia dot fr

thttpd v2.21b



[2008-05-21 22:03:05] j dot orfeuil at courantmultimedia dot fr

Description:

thttpd problem displaying .html pages when patched with php :

gcc 4.1 or gcc 3.3
In all cases, thttpd and php compile well.

Compiling thttpd alone = .html files display correctly
Compiling php with thttpd (--with-thttpd option) and then thttpd =
.php files display correctly but .html file cause thttpd server to
crash.

This behaviour doesn't occur on an 32bits systems but only on my 64
bits debian OS.

My guess is patchning thttpd sources with php when compiling causes
types problems (maybe buffer lenght problems) with 64bits OS.

Reproduce code:
---
Compilation options :

php first :

./configure --with-thttpd=thttpd_source_dir
make
make install

thttpd then :

./configure
make

Expected result:

Both html and php files display correctly

Actual result:
--
Only php files display correctly. Html files causes thttpd to crash





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



#46165 [Opn-Asn]: strcoll() does not work with UTF-8 strings on Windows

2008-10-27 Thread jani
 ID:   46165
 Updated by:   [EMAIL PROTECTED]
 Reported By:  gehrig at ishd dot de
-Status:   Open
+Status:   Assigned
 Bug Type: Strings related
-Operating System: Windows XP
+Operating System: win32 only
 PHP Version:  5.2.6
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

As a windows only bug assigned to the windows port maintainer.


Previous Comments:


[2008-09-24 07:31:52] gehrig at ishd dot de

Description:

The strcoll() function for sorting comparing strings in a locale-aware
manner does not seem to work with UTF-8 encoded strings despite using
the correct Windows locale with UTF-8 codepage (65001). strcoll() always
returns 2147483647 which makes array sorting of such strings more or
less random (for example).
Running the same snippet with Windows-1252 (ISO-8859-1) encoded strings
or on a Linux machine does in fact work as expected.

Please note: for running the following reproduce code, the PHP file
must be UTF-8 encoded!

Reproduce code:
---
?php
function traceStrColl($a, $b) {
$outValue=strcoll($a, $b);
echo $a $b $outValue\r\n;
return $outValue;
}

$locale=(defined('PHP_OS')  stristr(PHP_OS, 'win')) ?
'German_Germany.65001' : 'de_DE.utf8';

$string=ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜabcdefghijklmnopqrstuvwxyzäöüß;
$array=array();
for ($i=0; $imb_strlen($string, 'UTF-8'); $i++) {
$array[]=mb_substr($string, $i, 1, 'UTF-8');
}
$oldLocale=setlocale(LC_COLLATE, 0);
var_dump(setlocale(LC_COLLATE, $locale));
usort($array, 'traceStrColl');
setlocale(LC_COLLATE, $oldLocale);
var_dump($array);

Expected result:

string(20) German_Germany.65001
a B -1
[...]
array(59) {
  [0]=
  string(1) a
  [1]=
  string(1) A
  [2]=
  string(2) ä
  [3]=
  string(2) Ä
  [4]=
  string(1) b
  [5]=
  string(1) B
  [6]=
  string(1) c
  [7]=
  string(1) C
  [8]=
  string(1) d
  [9]=
  string(1) D
  [10]=
  string(1) e
  [11]=
  string(1) E
  [12]=
  string(1) f
  [13]=
  string(1) F
  [14]=
  string(1) g
  [15]=
  string(1) G
  [16]=
  string(1) h
  [17]=
  string(1) H
  [18]=
  string(1) i
  [19]=
  string(1) I
  [20]=
  string(1) j
  [21]=
  string(1) J
  [22]=
  string(1) k
  [23]=
  string(1) K
  [24]=
  string(1) l
  [25]=
  string(1) L
  [26]=
  string(1) m
  [27]=
  string(1) M
  [28]=
  string(1) n
  [29]=
  string(1) N
  [30]=
  string(1) o
  [31]=
  string(1) O
  [32]=
  string(2) ö
  [33]=
  string(2) Ö
  [34]=
  string(1) p
  [35]=
  string(1) P
  [36]=
  string(1) q
  [37]=
  string(1) Q
  [38]=
  string(1) r
  [39]=
  string(1) R
  [40]=
  string(1) s
  [41]=
  string(1) S
  [42]=
  string(2) ß
  [43]=
  string(1) t
  [44]=
  string(1) T
  [45]=
  string(1) u
  [46]=
  string(1) U
  [47]=
  string(2) ü
  [48]=
  string(2) Ü
  [49]=
  string(1) v
  [50]=
  string(1) V
  [51]=
  string(1) w
  [52]=
  string(1) W
  [53]=
  string(1) x
  [54]=
  string(1) X
  [55]=
  string(1) y
  [56]=
  string(1) Y
  [57]=
  string(1) z
  [58]=
  string(1) Z
}

Actual result:
--
string(20) German_Germany.65001
a B 2147483647
[...]
array(59) {
  [0]=
  string(1) c
  [1]=
  string(1) B
  [2]=
  string(1) s
  [3]=
  string(1) C
  [4]=
  string(1) k
  [5]=
  string(1) D
  [6]=
  string(2) ä
  [7]=
  string(1) E
  [8]=
  string(1) g
  [9]=
  string(1) F
  [10]=
  string(1) o
  [11]=
  string(1) G
  [12]=
  string(1) w
  [13]=
  string(1) H
  [14]=
  string(1) A
  [15]=
  string(1) I
  [16]=
  string(1) e
  [17]=
  string(1) J
  [18]=
  string(1) i
  [19]=
  string(1) K
  [20]=
  string(1) m
  [21]=
  string(1) L
  [22]=
  string(1) q
  [23]=
  string(1) M
  [24]=
  string(1) u
  [25]=
  string(1) N
  [26]=
  string(1) y
  [27]=
  string(1) O
  [28]=
  string(2) ü
  [29]=
  string(1) P
  [30]=
  string(1) b
  [31]=
  string(1) Q
  [32]=
  string(1) d
  [33]=
  string(1) R
  [34]=
  string(1) f
  [35]=
  string(1) S
  [36]=
  string(1) h
  [37]=
  string(1) T
  [38]=
  string(1) j
  [39]=
  string(1) U
  [40]=
  string(1) l
  [41]=
  string(1) V
  [42]=
  string(1) n
  [43]=
  string(1) W
  [44]=
  string(1) p
  [45]=
  string(1) X
  [46]=
  string(1) r
  [47]=
  string(1) Y
  [48]=
  string(1) t
  [49]=
  string(1) Z
  [50]=
  string(1) v
  [51]=
  string(2) Ä
  [52]=
  string(1) x
  [53]=
  string(2) Ö
  [54]=
  string(1) z
  [55]=
  string(2) Ü
  [56]=
  string(2) ö
  [57]=
  string(1) a
  [58]=
  string(2) ß
}





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



#45062 [Opn]: thttpd problem displaying .html pages when patched with php on 64 bits OS

2008-10-27 Thread j dot orfeuil at courantmultimedia dot fr
 ID:   45062
 User updated by:  j dot orfeuil at courantmultimedia dot fr
 Reported By:  j dot orfeuil at courantmultimedia dot fr
 Status:   Open
 Bug Type: Other web server
 Operating System: debian 4.0 x86_64
 PHP Version:  5.2.6
 New Comment:

Hum ok,
this was a little bit the aim of this report... to know whether this
was gonna be fixed.
Why did php support thttpd in first place if it's not supported after?
Well, if you have any lead or any patch or even a strict no, we won't
correct this please let me know :)
Or maybe a good man could pass hereby and say : I will fix this :)
Otherwise maybe with a lead we could do it ourselves.
Thx anyway :)

Regards
Joseph


Previous Comments:


[2008-10-27 14:00:38] [EMAIL PROTECTED]

I doubt anyone has updated the thttpd patch required so I doubt it will
ever work in 64bit systems.



[2008-10-27 08:44:05] j dot orfeuil at courantmultimedia dot fr

First of all thx for the answer :)
Of course i've heard about other light web servers thx but the fact is
we already have a whole system running on thttpd.
We actually just need to move our system on a new hardware plateform
(actually on many VPS on a new hardware plateform) and a new OS based on
64bits debian system. For obvious bug reasons and testing time, we just
wanted to clone the web part as it is bugless (or at least with small
ones :p)
Changing webserver would be an idea and it would probably work but we
wanted to understand why there was a problem with specific 64 bits OS...
(as we believe it is related to patching thttpd sources with php...) and
of course, as i said before, for bug reason...

On the other hand i don't know if thttpd is still maintained and it
would be recommended to change for an active project but the version we
have is stable and if the bug comes from php, we would have no reason to
change.

Well, hoping you can understand our needs and why we're still looking
for a lead through php bugs, maybe you could help us :)

Regards
Joseph



[2008-10-25 13:15:28] [EMAIL PROTECTED]

Does someone actually maintain thttpd anymore? Have you ever heard of 
lighttpd and FastCGI..? 




[2008-05-22 07:23:43] j dot orfeuil at courantmultimedia dot fr

thttpd v2.21b



[2008-05-21 22:03:05] j dot orfeuil at courantmultimedia dot fr

Description:

thttpd problem displaying .html pages when patched with php :

gcc 4.1 or gcc 3.3
In all cases, thttpd and php compile well.

Compiling thttpd alone = .html files display correctly
Compiling php with thttpd (--with-thttpd option) and then thttpd =
.php files display correctly but .html file cause thttpd server to
crash.

This behaviour doesn't occur on an 32bits systems but only on my 64
bits debian OS.

My guess is patchning thttpd sources with php when compiling causes
types problems (maybe buffer lenght problems) with 64bits OS.

Reproduce code:
---
Compilation options :

php first :

./configure --with-thttpd=thttpd_source_dir
make
make install

thttpd then :

./configure
make

Expected result:

Both html and php files display correctly

Actual result:
--
Only php files display correctly. Html files causes thttpd to crash





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



#46401 [Bgs]: String concatenation with class attribute

2008-10-27 Thread victor at equillon dot ro
 ID:   46401
 User updated by:  victor at equillon dot ro
 Reported By:  victor at equillon dot ro
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

I apologise, I wasn't paying much attention. You can close this bug.


Previous Comments:


[2008-10-27 13:43:31] [EMAIL PROTECTED]

I suggest you turn on full error_reporting on your development
machine:

# php -derror_reporting=E_ALL -n t.php

Notice: Trying to get property of non-object in /home/jani/t.php on
line 18

And then read about constructors and classnames..



[2008-10-27 13:17:20] victor at equillon dot ro

Description:

When concatenating a string with an attribute of a class, the attribute
is considered to be void or something. It doesn't always run like that.

It can be fixed by doing this:

echo Monster .($this-monsters[0]-name). hit something;

Reproduce code:
---
class Monster {
   public $name;
}

class test {
   private $monsters; 
   
   public function init() {
  for ($i=0; $i100; $i++) {
 $this-monsters[$i] = new Monster();
 $this-monsters[$i]-name = test;
  }
   }

   public function test() {
  echo Monster .$this-monsters[0]-name. hit something;
   }
}

$abc = new test();
$abc-init();
$abc-test();

Expected result:

Monster test hit something

Actual result:
--
Monster hit something





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



#42374 [Asn-Bgs]: --as-needed causes configure failures

2008-10-27 Thread jani
 ID:   42374
 Updated by:   [EMAIL PROTECTED]
 Reported By:  galtgendo at o2 dot pl
-Status:   Assigned
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Gentoo
 PHP Version:  5.2CVS-2007-08-23
 Assigned To:  jani
 New Comment:

If somewhere in configure are places where LDFLAGS is populated with -l
entries, point them out in separate bug reports. Closing this as bogus.


Previous Comments:


[2007-12-10 18:42:05] galtgendo at o2 dot pl

OK, I did some more reading on autotools.
A quote from autoconf info page:
 -- Variable: LDFLAGS
...
 This variable's contents should contain options like `-s' and
`-L'
 that affect only the behavior of the linker.
...
 Don't use this variable to pass library names (`-l') to the
 linker; use `LIBS' instead.

So title of this bug should be something along the lines of:
'rewrite your macros to conform to specs instead of simply work'

While doing that it may be a good idea to split all those libraries
into groups, so every extension (and php itself) doesn't get linked with
every libs needed for other extentions.



[2007-11-06 12:26:45] galtgendo at o2 dot pl

Please disregard most of my last comment, I misunderstood something.
I thought that --as-needed prevents linking with unused libraries, but
it only marks them as unused, so above listings of ldd -u mean that it
actually works, not the opposite. Anyway, what was exactly the problem
that --preserve-dup-defs works around, cause the note in configure.in
says only that there was a problem with older libtool, not what was it ?



[2007-11-05 22:49:15] galtgendo at o2 dot pl

There's a funny thing, though.
Command that built in example tidy.so was :
/bin/sh
/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p2007091
4/libtool --silent --preserve-dup-deps --mode=link
/var/tmp/portage/dev-lang/php
-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/meta_ccld -DPHP_ATOM_INC
-I/var/tmp
/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/include
-I/var
/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/main
-I/va
r/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914
-I/usr/in
clude/libxml2
-I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_
p20070914/ext/date/lib -I/usr/include/freetype2 -I/usr/include/imap
-I/var/tmp/p
ortage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/ext/mbstring/oni
guruma
-I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p200709
14/ext/mbstring/libmbfl
-I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/
php-5.2.4_p20070914/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql
-I/usr/includ
e/postgresql/libpq-4 -I/usr/include/pspell
-I/var/tmp/portage/dev-lang/php-5.2.4
_p20070914-r2/work/php-5.2.4_p20070914/TSRM
-I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/Zend
 -D_REENTRANT  -I/usr/include -O2 -march=athlon -mtune=athlon -pipe
-pthread -DZTS  -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro
-o ext/tidy/tidy.la -export-dynamic -avoid-version -prefer-pic -module
-rpath
/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/modules
-avoid-version -module ext/tidy/tidy.lo -ltidy -lcrypt -lcrypt -lsqlite
-lhistory -lreadline -lncurses -lresolv -lm -ldl -lnsl -lxml2 -lz -lm
-lgssapi -lkrb5 -lcom_err -lssl -lcrypto -ldl -lxml2 -lz -lm -lxml2 -lz
-lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt

so theoretically it should not have those dependencies, unless  
--preserve-dup-deps messes that up. I think I'll test this theory.

Of course, this is a completely separate issue to the one this bug is
about.



[2007-11-05 21:39:39] galtgendo at o2 dot pl

This may seem like nagging, but I wonder how are things comming along.
And to add my 2c:
ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/tidy.so
Unused direct dependencies:

/usr/lib/libtidy-0.99.so.0
/lib/libcrypt.so.1
/usr/lib/libsqlite.so.0
/lib/libhistory.so.5
/lib/libreadline.so.5
/lib/libncurses.so.5
/lib/libresolv.so.2
/lib/libm.so.6
/lib/libdl.so.2
/lib/libnsl.so.1
/lib/libz.so.1
libgssapi.so.1
/usr/lib/libkrb5.so.22
/lib/libcom_err.so.2
/usr/lib/libssl.so.0.9.8
/usr/lib/libcrypto.so.0.9.8
/usr/lib/libxml2.so.2
/lib/libpthread.so.0
ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/zlib.so
Unused direct dependencies:

/lib/libz.so.1
/lib/libcrypt.so.1
/usr/lib/libsqlite.so.0
/lib/libhistory.so.5

#43535 [Asn-Opn]: parse_ini_file('http://example.com/some.ini') and allow_url_include=off

2008-10-27 Thread jani
 ID:   43535
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sskaje at gmail dot com
-Status:   Assigned
+Status:   Open
-Bug Type: Filesystem function related
+Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.2.5
 Assigned To:  jani


Previous Comments:


[2007-12-12 10:12:07] [EMAIL PROTECTED]

This requires changes too big for a bugfix (this is more like a new
feature as such) so most likely this will be in PHP 5.3.0 at earliest.



[2007-12-11 10:01:08] sskaje at gmail dot com

There is a ini file on a http server which has something i need on it.
so i tried to use parse_ini_file() to get the content and parse it.
i set teh 'allow_url_include' Off due to security issue, but i got an
error which said that i must turn it On



[2007-12-10 09:58:56] [EMAIL PROTECTED]

And what exactly is the problem you have?
Currently the file opening for this function happens exactly how a
script is opened and I don't think there's anything wrong with that.



[2007-12-08 13:53:09] sskaje at gmail dot com

Description:

parse_ini_file() should not be configured with allow_url_include in
php.ini but allow_url_fopen
that make me cant directly parse the ini file on http server

Expected result:

nothing

Actual result:
--
nothing





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



#46403 [NEW]: backslash namespace delimiter sucks

2008-10-27 Thread nospam at yandex dot ru
From: nospam at yandex dot ru
Operating system: 
PHP version:  5.3.0alpha2
PHP Bug Type: Feature/Change Request
Bug description:  backslash namespace delimiter sucks

Description:

Backslash delimiter is absolutely unreadable (example: MVl\V\_L\J::$x )
and doesn't corresponds to C/Java syntax style of PHP.
Most of russian phpclub.ru forum members are annoyed by this news
(http://phpclub.ru/talk/showthread.php?s=postid=821935).



-- 
Edit bug report at http://bugs.php.net/?id=46403edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46403r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46403r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46403r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46403r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46403r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46403r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=46403r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=46403r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=46403r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=46403r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=46403r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=46403r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=46403r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46403r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=46403r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=46403r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=46403r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=46403r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=46403r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=46403r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=46403r=mysqlcfg



#46403 [Opn-Bgs]: backslash namespace delimiter sucks

2008-10-27 Thread tularis
 ID:  46403
 Updated by:  [EMAIL PROTECTED]
 Reported By: nospam at yandex dot ru
-Status:  Open
+Status:  Bogus
 Bug Type:Feature/Change Request
 PHP Version: 5.3.0alpha2
 New Comment:

The bugtracker is for BUGS, not for your complaints. Go take them
somewhere else.


Previous Comments:


[2008-10-27 14:34:10] nospam at yandex dot ru

Description:

Backslash delimiter is absolutely unreadable (example: MVl\V\_L\J::$x )
and doesn't corresponds to C/Java syntax style of PHP.
Most of russian phpclub.ru forum members are annoyed by this news
(http://phpclub.ru/talk/showthread.php?s=postid=821935).







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



#44193 [Fbk-Opn]: snmp v3 noAuthNoPriv doesn't work

2008-10-27 Thread mavezeau at colubris dot com
 ID:   44193
 User updated by:  mavezeau at colubris dot com
-Summary:  snmp v3 doesn't work
 Reported By:  mavezeau at colubris dot com
-Status:   Feedback
+Status:   Open
 Bug Type: SNMP related
 Operating System: Mandriva 2005/linux
 PHP Version:  5.2.5
 New Comment:

Now, 

Some parts work. The security level AuthNoPriv and AuthPriv work but
noAuthNoPriv doesn't works because php doesn't accept null or '' to
auth_protocol and priv_protocol. I think this fix is simple the snmp v3
with noAuthNopriv is very similar of snmp v2c.

if I try:
snmp3_walk('192.168.130.124','test','noAuthNoPriv','MD5','','','','');
I have this error error(snmp3_walk(): Could not generate key for
authentication pass phrase: MD5) 

if I try:
snmp3_walk('192.168.130.124','test','noAuthNoPriv',null,null,null,null,'');
or 
snmp3_walk('192.168.130.124','test','noAuthNoPriv','',null,null,null,'');
I have this error Invalid authenfication protocol:


Previous Comments:


[2008-10-23 12:30:06] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2008-02-20 21:23:28] mavezeau at colubris dot com

Description:

I try to make a query with snmp v3 and I have an error: snmp3_walk():
An error occurred or snmp3_walk(): No response from 192.168.130.124.
If I execute a query with net-snmp 5.4.1 the query is ok. If I execute
the similar query with php I have those errors. 



Reproduce code:
---
AuthNoPriv
net-snmp Query:
snmpwalk -v 3 -l authNoPriv -a MD5 -A jesuisuntest  -u test5
192.168.130.124
it Works!

Php snmp
snmp3_walk('192.168.130.124','test5','authNoPriv','MD5','jesuisuntest','','','');
Error !

noAuthNoPriv
net-snmp query:
snmpwalk -v 3 -l noAuthNoPriv -u test 192.168.130.124
it works!

PHP snmp
snmp3_walk('192.168.130.124','test','noAuthNoPriv','','','','','');
error(snmp3_walk(): Invalid authentication protocol)
if use the default

snmp3_walk('192.168.130.124','test','noAuthNoPriv','MD5','','','','');
error(snmp3_walk(): Could not generate key for authentication pass
phrase: MD5) 

Expected result:

Similar return value than smnp v2c 

Actual result:
--
all method make an error





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



#46404 [NEW]: request for magic method __toNative()

2008-10-27 Thread info at netmosfera dot it
From: info at netmosfera dot it
Operating system: irrelevant
PHP version:  5.2.6
PHP Bug Type: Feature/Change Request
Bug description:  request for magic method __toNative()

Description:

hello, i'm asking for a new php magic method

__toNative()

useful for 

-a better type hinting
-user defined implementations of native types
-a better way to extend native types without global scope functions
 or class static functions




Reproduce code:
---
just a feature request:

http://rafb.net/p/qJ97Gf69.html


-- 
Edit bug report at http://bugs.php.net/?id=46404edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46404r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46404r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46404r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46404r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46404r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46404r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=46404r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=46404r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=46404r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=46404r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=46404r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=46404r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=46404r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46404r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=46404r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=46404r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=46404r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=46404r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=46404r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=46404r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=46404r=mysqlcfg



#46384 [Com]: expr() or continue;

2008-10-27 Thread info at netmosfera dot it
 ID:   46384
 Comment by:   info at netmosfera dot it
 Reported By:  zyss at mail dot zp dot ua
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: RHEL4, WinXP
 PHP Version:  5.2.6
 New Comment:

because break and continue can't represents boolean values :)


Previous Comments:


[2008-10-25 21:11:06] zyss at mail dot zp dot ua

try



[2008-10-25 13:08:22] zyss at mail dot zp dot ua

Description:

Why it is possible to write:

  foo() or die(Can't foo);

but impossible to write:

  foreach ($bars as $bar) {
foo($bar) or contine; // or break
do_something($bar);
  }

Having this functionality would be very convenient as a short form of
the following:

  if (!foo($bar)) continue;  // or break






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



#30301 [Com]: connection_status and connection_aborted not working.

2008-10-27 Thread ger_stingray427 at yahoo dot com
 ID:   30301
 Comment by:   ger_stingray427 at yahoo dot com
 Reported By:  phpbug at zone-mr dot ath dot cx
 Status:   No Feedback
 Bug Type: IIS related
 Operating System: Windows 2003 Server
 PHP Version:  5.0.2
 New Comment:

before year 2004 this function worked ?
maybe we request new feature and this function works, but not as
expected for us.


Previous Comments:


[2008-09-22 06:41:57] samedi at online dot de

I am having exactly the same problem! (Using PHP 5.2.6)

Four years and this bug does really still exist?



[2007-06-01 16:50:14] mike at dodgeit dot com

How about fixing this bug thats been open since 2004!!!



[2007-04-19 05:14:30] benb at dpac dot tas dot gov dot au

I too am experiencing this problem with Apache 2.2.4 and PHP 5.2.1 on
Ubuntu. Kernel 2.6. 

Using a similar script to the one listed above. Connection_status()
returns 0, as does connection_aborted.

However I am streaming video. When streaming this amount of data, the
connection does in fact hang as the image data can't make it to the
client.

I added a shutdown function with register_shutdown_function() to verify
this though. Several minutes after my on-disk log file stops recording
data being sent, the shutdown function writes a message to the same log
file to say that the script has finally been terminated.

So i'm assuming that apache is still trying to send data to the client
even though they're no longer listening and it's the apache
write_timeout that's finally killing the thread.

Because the script is effectively dead in the water while waiting for
data to be received by the client, i can't put in any timeout code to
compensate. So i'm about to try and put a set_time_limit(10) call before
each data transmission so that an output hang is (hopefully) handled
after 10 seconds rather than several minutes.

It would be great though if this was fixed. It would make life so much
easier!



[2007-02-13 21:02:32] akravtsov at rogers dot com

I am having the same problem! I have tried everything. This has not
been fixed since Oct 2004??

This is my code:


?php
//ob_end_flush();
//This should make it work:
set_time_limit(0);
ignore_user_abort(false);
error_reporting(E_ALL);
ini_set(max_execution_time, 0);

$x = 0;
$error = fopen(file.txt, a);
echo Beginning neverending loop;

//Alternate method
register_shutdown_function(help);


while($x  40)
{

//ob_end_clean();

//ob_start();

$xx =  $x.__Connstat: .connection_status().Aborted?
.connection_aborted().\r\n\r\n;
echo $xx;
fwrite($error, $xx, strlen($xx)); //This is written fine.
$x++;
flush();  //If I include this flush, the program stops when I 
hit the
stop button. If I don't, it doesn't stop even if I hit the stop button.
sleep(1);

if(connection_status() != 0 || connection_aborted())
{
$msg = QUIT;
fwrite($error, $msg, strlen($msg));
exit();

} 
}

function help()
{
$f = fopen(test.txt, a);
$m = QUIT;
fwrite($f, $m, strlen($m));
fclose($f);
exit();
}


?



[2006-02-08 14:30:09] phpbug at paragontech dot com

Try to do a ob_end_flush(); at the top of your script.



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
http://bugs.php.net/30301

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



#46128 [Com]: Magic function __cast($to)

2008-10-27 Thread info at netmosfera dot it
 ID:   46128
 Comment by:   info at netmosfera dot it
 Reported By:  131 dot php at cloudyks dot org
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

AWESOME!
php developers, please, we need it!!
http://bugs.php.net/bug.php?id=46404


Previous Comments:


[2008-10-06 04:15:03] mark at hell dot ne dot jp

Backported to PHP 5.2.6 :

http://ookoo.org/svn/snip/php-5.2.6_class_cast_func.patch



[2008-10-05 16:33:07] 131 dot php at cloudyks dot org

This is awesome



[2008-10-05 08:49:55] mark at hell dot ne dot jp

Did a test implementation only supporting a few types (int, float,
bool, string).

This works as expected.

Test code:
--
class test {
public function __cast($type) {
switch($type) {
case 'string': return 'a string';
case 'bool': return true;
case 'float': return 123.456;
case 'int': return 978;
default:
var_dump($type);
return null;
}
}
}

$t = new test();

var_dump((string)$t);
var_dump((int)$t);
var_dump((float)$t);
var_dump((bool)$t);

Result:
string(8) a string
int(978)
float(123.456)
bool(true)

Here's the patch file for this simple implementation against PHP
5.3.0alpha2.

http://ookoo.org/svn/snip/php-5.3.0alpha2_class_cast_func.patch



[2008-09-19 15:52:29] 131 dot php at cloudyks dot org

Description:

The same way __toString is implemented, i suggest new magics functions
__toBool, __toInt, __toArray, or maybe, as suggested on php.general, a
generic magic function __cast($type){}

An example of implementation could be
class error extends exeption {
 __toBool(){return false; }
}




Reproduce code:
---
?
//by C. Guthrie
class MyClass {
  function __cast($type)
  {
   switch ($type)
   {
 case 'string':
   return 'Foo';
 case 'array':
   return array('Foo');
 case 'DomDocument':
   // etc.
   }
  }
}
$my = new MyClass();


$xml = (DomDocument)$foo;

It would return the result of __cast called with $type ==
'DomDocument'.







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



#46285 [Asn-Csd]: lastInsertId() returns 0 when a deferenced PDOStatement is executed

2008-10-27 Thread johannes
 ID:   46285
 Updated by:   [EMAIL PROTECTED]
 Reported By:  phpwnd at gmail dot com
-Status:   Assigned
+Status:   Closed
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.3CVS-2008-10-13 (CVS)
 Assigned To:  johannes
 New Comment:

This bug has been fixed in CVS.

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.




Previous Comments:


[2008-10-13 18:11:31] phpwnd at gmail dot com

I had just submitted this bug when I realized I didn't have to
recompile PHP to test another database library. The same reproduce code
with
  $db = new PDO('sqlite::memory:');

...shows the expected result, so I assume the bug can be attributed to
mysqlnd or possibly PDO_MYSQL.



[2008-10-13 18:04:55] phpwnd at gmail dot com

Description:

lastInsertId() always returns 0 after executing a dereferenced native
(non-emulated) prepared statement. Storing the PDOStatement in a
variable _then_ executing it solves that problem, and so does using
emulated prepared statements.

PHP was compiled with --enable-debug --with-pdo-mysql=mysqlnd, I
haven't tested with other combinations yet.

Reproduce code:
---
?php
$db = new
PDO('mysql:dbname=test;unix_socket=/var/run/mysqld/mysqld.sock', 'user',
'password', array(
PDO::ATTR_EMULATE_PREPARES = false
));

$db-exec('DROP TABLE IF EXISTS test');
$db-exec('CREATE TABLE test (id INT auto_increment, PRIMARY KEY
(id))');

$sql = 'INSERT INTO test (id) VALUES (NULL)';


$db-prepare($sql)-execute();
var_dump($db-lastInsertId());

$stmt = $db-prepare($sql);
$stmt-execute();
var_dump($db-lastInsertId());
?

Expected result:

string(1) 1
string(1) 2

Actual result:
--
string(1) 0
string(1) 2





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



#44135 [Asn-Tbd]: PDO MySQL does not support CLIENT_FOUND_ROWS

2008-10-27 Thread johannes
 ID:   44135
 Updated by:   [EMAIL PROTECTED]
 Reported By:  chx1975 at gmail dot com
-Status:   Assigned
+Status:   To be documented
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.2.5
 Assigned To:  johannes
 New Comment:

This bug has been fixed in CVS.

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.

New attributes PDO::MYSQL_ATTR_FOUND_ROWS and 
PDO::MYSQL_ATTR_IGNORE_SPACE added which can be used while connecting:


$p = new PDO($dsn, $u, $p,
   array(PDO::MYSQL_ATTR_FOUND_ROWS = true, 
 PDO::MYSQL_ATTR_IGNORE_SPACE= true));


Previous Comments:


[2008-10-23 19:55:24] chx1975 at gmail dot com

I renamed it to what MySQL calls it. Please just drop the defines then,
I copied them from mysql_com.h -- sorry, I am a n00b in doing this.
Please also drop any client flags you do not feel useful.



[2008-10-23 13:25:24] [EMAIL PROTECTED]

Thanks for the patch, a few comments/questions:

- Why are you renaming the connect_opts variable? Any particular
reason?

- You shouldn't use the numeric values, as they might change, but the
values provided by the client library, this also ensures that only flags
supported by the library are being used.

- I think the SSL flag won't work without specific SSL certs  stuff,
but I have to check that myself



[2008-10-23 01:34:27] chx1975 at gmail dot com

An attempt to fix this can be found at
http://drupal4hu.com/php-44135.patch . I added a number of flags not
just the one I needed.

running 
?php
$p = new PDO('mysql:host=localhost;dbname=test', 'root', '',
array(PDO::MYSQL_ATTR_CLIENT_FLAGS = PDO::MYSQL_CLIENT_FOUND_ROWS));
$p-exec('TRUNCATE a');
$p-exec('INSERT INTO a VALUES (1)');
echo $p-exec('UPDATE a SET a = 1 WHERE a = 1');
$p = new PDO('mysql:host=localhost;dbname=test', 'root', '');
echo $p-exec('UPDATE a SET a = 1 WHERE a = 1');
?
shows a 1 (one row found) and then a 0 (0 updated) so the patch seems
to work.



[2008-02-16 03:29:44] larry at garfieldtech dot com

I can duplicate this problem.  The issue appears to be that by 
default, MySQL will return the number of affected rows from a 
previous UPDATE statement, not the number of matched rows.  That 
values will differ if the update statement would set a row to its 
existing value.  With ext/mysql and ext/mysqli, it can be set to 
return matched rows instead.  PDO does not appear to have a way to 
allow that.



[2008-02-16 03:26:34] chx1975 at gmail dot com

Description:

mysql_real_connect supports client flags
http://dev.mysql.com/doc/refman/4.1/en/mysql-real-connect.html most
importantly CLIENT_FOUND_ROWS but PDO provides no way to pass it in.






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



#46221 [Fbk-Opn]: bind_param and wrong result

2008-10-27 Thread dzyszla at dzyszla dot aplus dot pl
 ID:   46221
 User updated by:  dzyszla at dzyszla dot aplus dot pl
 Reported By:  dzyszla at dzyszla dot aplus dot pl
-Status:   Feedback
+Status:   Open
 Bug Type: MySQLi related
 Operating System: Linux (CentOS 5.2)
 PHP Version:  5.2.6
 New Comment:

Because problem is on public server, my web service provider sad, that
can't test any unofficial version. :(


Previous Comments:


[2008-10-26 17:49:29] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I can't reproduce it.



[2008-10-02 19:50:15] dzyszla at dzyszla dot aplus dot pl

(updated information about OS)
(one more correct: I wrote: don't wont, of course will be: don't
know ;) eh, my language...)
bind_result work 100% good. Before update this script work correctly.



[2008-10-02 18:28:47] dzyszla at dzyszla dot aplus dot pl

sorry, I replaced expected and actual result above. Now is: OKOKOKOK0,
and I expect: OKOKOKOK161



[2008-10-02 18:25:58] dzyszla at dzyszla dot aplus dot pl

Description:

My webserver provider changed the mysqli module to the newest version
(I don't wont, what number). And my code with mysqli_stmt_bind_param
dosen't work correctly, but i get no error message (by mysqli_stmt_error
after each command too). I do something wrong?

Reproduce code:
---
$stmt=mysqli_stmt_init($sql);
  if(mysqli_stmt_prepare($stmt,'SELECT COUNT(*) FROM posts WHERE 
`parent`=?'))
  {
   $parent=1;

   if (mysqli_stmt_bind_param($stmt,'i',$parent)) echo 'OK'; else echo
'FALSE';
   if (mysqli_stmt_bind_result($stmt,$enters)) echo 'OK'; else echo
'FALSE';

   if(mysqli_stmt_execute($stmt)) echo 'OK'; else echo 'FALSE';
   if (mysqli_stmt_fetch($stmt)) echo 'OK'; else echo 'FALSE';

   echo $enters;
  }
  mysqli_stmt_close($stmt);


Expected result:

OKOKOKOK0

Actual result:
--
OKOKOKOK161





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



#45591 [Com]: Bus error on file_get_contents

2008-10-27 Thread steveh at brendata dot co dot uk
 ID:   45591
 Comment by:   steveh at brendata dot co dot uk
 Reported By:  rommer at active dot by
 Status:   No Feedback
 Bug Type: Reproducible crash
 Operating System: linux-2.6.x i386
 PHP Version:  5.2CVS-2008-07-22 (snap)
 New Comment:

I'm seeing the same issue, also, the original poster has supplied the
required information but has not changed the status so this may have
been missed?

php -v

PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23
2008 06:44:49)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans

php -m

[PHP Modules]
bcmath
bz2
calendar
ctype
date
dba
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mime_magic
mysql
mysqli
ncurses
openssl
pcntl
pcre
PDO
pdo_mysql
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]
Xdebug


Previous Comments:


[2008-09-29 15:29:48] rlucia at iscanet dot com

# php -v
PHP 5.2.5 (cli) (built: Apr 16 2008 19:24:05) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator,
by eAccelerator
# php -m
[PHP Modules]
ctype
curl
date
dom
eAccelerator
ffmpeg
filter
gd
geoip
hash
iconv
json
libxml
magickwand
mcrypt
memcache
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
posix
Reflection
session
SimpleXML
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]
eAccelerator






Core was generated by `/usr/local/apache2//bin/httpd -k start'.
Program terminated with signal 7, Bus error.
#0  0xb7d09b35 in memcpy () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7d09b35 in memcpy () from /lib/tls/i686/cmov/libc.so.6
#1  0xb7af3f4c in _php_stream_copy_to_mem (src=0xb6ed7db8,
buf=0xbff4f9bc, maxlen=4294967295, persistent=0)
at /usr/local/src/php-5.2.5/main/streams/streams.c:1223
#2  0xb7a83106 in zif_file_get_contents (ht=1, return_value=0xb2372fd4,
return_value_ptr=0x0, this_ptr=0x0, 
return_value_used=1) at
/usr/local/src/php-5.2.5/ext/standard/file.c:563
#3  0xb7b3cbb2 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff4fbd0)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:200
#4  0xb7b3bbe8 in execute (op_array=0xb23b6330) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#5  0xb7b3c618 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff4fe10)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:234
#6  0xb7b3bbe8 in execute (op_array=0xb23b6330) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#7  0xb7b3c618 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff50050)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:234
#8  0xb7b3bbe8 in execute (op_array=0xb23b6330) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#9  0xb7b3c618 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff50290)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:234
#10 0xb7b3bbe8 in execute (op_array=0xb23b6330) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#11 0xb7b3c618 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff50740)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:234
#12 0xb7b3bbe8 in execute (op_array=0xb23b5e9c) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#13 0xb7b3c618 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff50a40)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:234
#14 0xb7b3bbe8 in execute (op_array=0xb23af4b8) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#15 0xb7b13df8 in zend_call_function (fci=0xbff50b88,
fci_cache=0xbff50bac)
at /usr/local/src/php-5.2.5/Zend/zend_execute_API.c:990
#16 0xb7a03ca5 in zim_reflection_method_invokeArgs (ht=2,
return_value=0xb236d4f8, return_value_ptr=0x0, 
this_ptr=0xb236cedc, return_value_used=1) at
/usr/local/src/php-5.2.5/ext/reflection/php_reflection.c:2479
#17 0xb7b3cbb2 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff50dc0)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:200
#18 0xb7b3bbe8 in execute (op_array=0xb23e9094) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#19 0xb7b3c618 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff51080)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:234
#20 0xb7b3bbe8 in execute (op_array=0xb23e9160) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#21 0xb7b3c618 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff512d0)
at /usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:234
#22 0xb7b3bbe8 in execute (op_array=0xb6ed78ac) at
/usr/local/src/php-5.2.5/Zend/zend_vm_execute.h:92
#23 0xb7b1e574 in zend_execute_scripts (type=8, retval=value optimized
out, file_count=3)
at /usr/local/src/php-5.2.5/Zend/zend.c:1134
#24 

#46404 [Com]: request for magic method __toNative()

2008-10-27 Thread info at netmosfera dot it
 ID:   46404
 Comment by:   info at netmosfera dot it
 Reported By:  info at netmosfera dot it
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: irrelevant
 PHP Version:  5.2.6
 New Comment:

~same request
http://bugs.php.net/bug.php?id=46128


Previous Comments:


[2008-10-27 16:42:50] info at netmosfera dot it

Description:

hello, i'm asking for a new php magic method

__toNative()

useful for 

-a better type hinting
-user defined implementations of native types
-a better way to extend native types without global scope functions
 or class static functions




Reproduce code:
---
just a feature request:

http://rafb.net/p/qJ97Gf69.html






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



#46405 [NEW]: Allow Side-By-Side Execution

2008-10-27 Thread xwisdom at gmail dot com
From: xwisdom at gmail dot com
Operating system: Windows
PHP version:  5.3CVS-2008-10-27 (snap)
PHP Bug Type: Feature/Change Request
Bug description:  Allow Side-By-Side Execution

Description:

I would like to recommend that a feature be added to PHP 5.3 or 6.0 that
will allow the execution of an application using a different version of the
runtime.

This could be done via the php.ini. For example:

[interpreters]
php44 = c:/php4/php.exe
php51 = c:/php51/php-cgi.exe
php5 = c:/php52/php-cgi.exe

[interpreter_mapping]
php44 = c:/website/oldapps/addressbook/;
php5 = c:/website/currentapps/crm/;

With the above, the current version of PHP would be the default
interpreter. This means that if no mapping was found for the current path
then the current interpreters will be used, otherwise system should pass
control over to the selected interpreter. 

This technique might be a little slower when passing control from the
current to an older interpreter but it gives the user greater flexibility
and more time to work with both the new php releases and the older
interpreters. Plus it allows applications designed for older versions of
php to run side-by-side on same server with no special configuration
changes to the server or file settings.




-- 
Edit bug report at http://bugs.php.net/?id=46405edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46405r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46405r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46405r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46405r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46405r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46405r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=46405r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=46405r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=46405r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=46405r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=46405r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=46405r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=46405r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46405r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=46405r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=46405r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=46405r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=46405r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=46405r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=46405r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=46405r=mysqlcfg



#46384 [Opn]: expr() or continue;

2008-10-27 Thread zyss at mail dot zp dot ua
 ID:   46384
 User updated by:  zyss at mail dot zp dot ua
 Reported By:  zyss at mail dot zp dot ua
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: RHEL4, WinXP
 PHP Version:  5.2.6
 New Comment:

Yes, that's pretty obvious, but PHP could be modified to be able to do
that. This change will make code more clear (like ?: operator) therefore
it is worth implementing.


Previous Comments:


[2008-10-27 16:58:47] info at netmosfera dot it

because break and continue can't represents boolean values :)



[2008-10-25 21:11:06] zyss at mail dot zp dot ua

try



[2008-10-25 13:08:22] zyss at mail dot zp dot ua

Description:

Why it is possible to write:

  foo() or die(Can't foo);

but impossible to write:

  foreach ($bars as $bar) {
foo($bar) or contine; // or break
do_something($bar);
  }

Having this functionality would be very convenient as a short form of
the following:

  if (!foo($bar)) continue;  // or break






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