#44952 [NEW]: isset() does not checks correctly variable variable

2008-05-09 Thread vesko at webstudiobulgaria dot com
From: vesko at webstudiobulgaria dot com
Operating system: Debian Lenny
PHP version:  5.3CVS-2008-05-09 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  isset() does not checks correctly variable variable

Description:

When giving variable variable argument to isset() it is not checking
correctly.
It was working property with the snap from 21 February (and of course
works correctly with php 5.2 branch).

Reproduce code:
---
?
$var_name = 'unexisting';
if(isset($$var_name))
{
print $$var_name;
}
?

Expected result:

//print nothing

Actual result:
--
Notice: Undefined variable: unexisting in /home/local/test/t3.php on line
5

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



#44953 [NEW]: Variable variables dont work in foreach

2008-05-09 Thread ies_clan at hotmail dot com
From: ies_clan at hotmail dot com
Operating system: Linux
PHP version:  5.2.6
PHP Bug Type: Variables related
Bug description:  Variable variables dont work in foreach

Description:

If you try to use Variable variables in a foreach, the output of the array
is wrong

Reproduce code:
---
$array = Array(
0 = Array('11', '12', '13'), 
1 = Array('21', '22', '23'), 
2 = Array('31', '32', '33')
);
$key= 'key';
$value  = 'value';
foreach($array AS ${$key} = ${$value}){
echo ${$key}. -\n;
}

Expected result:

1
2

Actual result:
--
0
1
2

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



#44681 [Opn-Csd]: Resources used as array keys get converted to 0

2008-05-09 Thread mattwil
 ID:   44681
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ilewis at uk dot ibm dot com
-Status:   Open
+Status:   Closed
 Bug Type: Arrays related
 Operating System: Windows XP SP2
 PHP Version:  5.3CVS-2008-04-10 (snap)
 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.

Just fixed the reported bug with resources used as offsets:
$myarray[$fres]. They will still give Illegal offset type (as always)
if used as an index in an array( ... ) construct. I wasn't sure if that
should be changed to be consistent...


Previous Comments:


[2008-04-13 10:42:25] [EMAIL PROTECTED]

This was introduced after the Jan 23rd changes to zend_execute.c,
causing the resource ID to be read as a double. case statements just
need to be rearranged. :-)

I also noticed that trying to use a resource key like array($fres =
'bob') doesn't work (never has) and just gives Illegal offset type.
Seems like it should be consistent either way? The following patches
also make that work, if they want to add it.

http://realplain.com/php/bug44681.diff
http://realplain.com/php/bug44681_5_3.diff



[2008-04-10 09:32:56] ilewis at uk dot ibm dot com

Description:

Using todays prebuilt snap of 5.3 on Windows, it looks like resources
being used as array keys are being converted to int(0). The prevents
them being used as unique array keys. This is a big change from php
5.2.5,

Reproduce code:
---
?php

error_reporting(E_ALL | E_STRICT);

$fres = fopen(g:/tmp/arraytest.php, r);
$fres2 = fopen(g:/tmp/arraytest.phpb, w);

var_dump($fres);
var_dump($fres2);

$myarray = array(1,2);

var_dump($myarray);

$myarray[$fres] = bob;
$myarray[$fres2] = bob2;

var_dump($myarray);

?


Expected result:

PHP Strict Standards:  Resource ID#5 used as offset, casting to integer
(5) in G:\tmp\arraytest.php on line 15


PHP Strict Standards:  Resource ID#6 used as offset, casting to integer
(6) in G:\tmp\arraytest.php on line 16


array(4) {
  [0]=
  int(1)
  [1]=
  int(2)
  [5]=
  string(3) bob
  [6]=
  string(4) bob2
}

Actual result:
--
Strict Standards: Resource ID#5 used as offset, casting to integer (5)
in G:\tmp\arraytest.php on line 15

Strict Standards: Resource ID#6 used as offset, casting to integer (6)
in G:\tmp\arraytest.php on line 16

array(2) {
  [0]=
  string(4) bob2
  [1]=
  int(2)
}





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



#44953 [Opn]: Variable variables dont work in foreach

2008-05-09 Thread ies_clan at hotmail dot com
 ID:   44953
 User updated by:  ies_clan at hotmail dot com
 Reported By:  ies_clan at hotmail dot com
 Status:   Open
 Bug Type: Variables related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

oh sry i interchanges the field...

Expected result:

0
1
2

Actual result:
--
1
2


Previous Comments:


[2008-05-09 09:58:03] ies_clan at hotmail dot com

Description:

If you try to use Variable variables in a foreach, the output of the
array is wrong

Reproduce code:
---
$array = Array(
0 = Array('11', '12', '13'), 
1 = Array('21', '22', '23'), 
2 = Array('31', '32', '33')
);
$key= 'key';
$value  = 'value';
foreach($array AS ${$key} = ${$value}){
echo ${$key}. -\n;
}

Expected result:

1
2

Actual result:
--
0
1
2





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



#44953 [Opn-Bgs]: Variable variables dont work in foreach

2008-05-09 Thread colder
 ID:   44953
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ies_clan at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Variables related
 Operating System: Linux
 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.

This is expected:
The evaluation of ${$key} in your foreach is done at each loop.
So you're overwriting $key with $$key as $key is initially key. 

$key= 'otherkey';
$value  = 'othervalue';
foreach($array AS ${$key} = ${$value}){
echo ${$key}. -\n; // echo $otherkey. -\n
}

will work just fine.


Previous Comments:


[2008-05-09 10:27:37] ies_clan at hotmail dot com

oh sry i interchanges the field...

Expected result:

0
1
2

Actual result:
--
1
2



[2008-05-09 09:58:03] ies_clan at hotmail dot com

Description:

If you try to use Variable variables in a foreach, the output of the
array is wrong

Reproduce code:
---
$array = Array(
0 = Array('11', '12', '13'), 
1 = Array('21', '22', '23'), 
2 = Array('31', '32', '33')
);
$key= 'key';
$value  = 'value';
foreach($array AS ${$key} = ${$value}){
echo ${$key}. -\n;
}

Expected result:

1
2

Actual result:
--
0
1
2





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



#44830 [Opn-Csd]: Very minor issue with backslash in heredoc

2008-05-09 Thread mattwil
 ID:   44830
 Updated by:   [EMAIL PROTECTED]
 Reported By:  slattery at uk dot ibm dot com
-Status:   Open
+Status:   Closed
 Bug Type: Scripting Engine problem
 Operating System: windows
 PHP Version:  5.2.5
 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-04-28 13:04:49] [EMAIL PROTECTED]

Yeah, good catch. (And a backslash would actually always be lost at the
end of a heredoc, even with other text before it.) Because of a check in
the loop that scans for escape sequences, the \ becomes \0 (null byte).

For the devs: I removed the additional check for end of string. All
that will happen with this reproduce code is variable s will be
incremented past the end of the string at the end of the while () -- but
I believe that's safe because it won't be read from afterwards.

Patches for all 3 branches:
http://realplain.com/php/bug44830.diff
http://realplain.com/php/bug44830_5_3.diff
http://realplain.com/php/bug44830_5_2.diff



[2008-04-25 11:21:28] slattery at uk dot ibm dot com

Description:

There is a very minor issue when a heredoc contains only a single
backslash.

The doc says heredoc behaves exactly as double quoted string - so in
this one particular case of the single backslash - we have a case which
cannot be produced in a double quoted string - so the behaviour is
undefined.

The engine appears to treat is as a 'record separator', but I think
it would be better treated as a backslash.

Im quite happy for this to be closed as bogus - Its just that the code
below is from a php test case - I dont suppose anyone will actually do
this.

Reproduce code:
---
?php
$heredoc_string_only_backslash =EOT
\
EOT;

$str = $heredoc_string_only_backslash;
var_dump(bin2hex($str));

$str_addslashes = addslashes($str);
var_dump(bin2hex($str_addslashes));

$str_stripslashes = stripslashes($str_addslashes);
var_dump(bin2hex($str_stripslashes));
?



Expected result:

On running the code  I get: 

string(2) 00
string(4) 5c30
string(2) 00

which looks a little strange, I would have expected: 

string(2) 5c
string(4) 5c5c
string(2) 5c







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



#44954 [NEW]: file_get_contents crashes Apache

2008-05-09 Thread abakker at gmx dot net
From: abakker at gmx dot net
Operating system: Win XP
PHP version:  5.2.6
PHP Bug Type: Reproducible crash
Bug description:  file_get_contents crashes Apache

Description:

Apache crashes if a lot of file_get_contents are done. The Apache
error.log only contains this (I guess this just confirms that the Apache
server has crashed and no longer responds): [Fri May 09 12:15:04 2008]
[error] [client 192.168.0.1] PHP Warning: 
file_get_contents(http://localhost/test.htm) [a
href='function.file-get-contents'function.file-get-contents/a]: failed
to open stream: A connection attempt failed because the connected party did
not properly respond after a period of time, or established connection
failed because connected host has failed to respond.\r\n in
C:\\Andre\\Apache\\test.php on line 6


Reproduce code:
---
The following PHP script reproduces the problem:

?php
echo 'pre';
for ($i=1;;$i++)
{ echo $i.\n;
  flush();ob_flush();
  $contents = file_get_contents('http://localhost/test.htm');
}
?

After 203 iterations the Apache server crashes. The result is the same
whether localhost or IP address is used.

The problem depends on the contents of the test.htm file. If it only
contains

html
body
/body
/html

the script runs until it reaches the max execution time.

The test.htm that reproduces the problem contains:

html
head
link rel=stylesheet href=/systeem/style/style.css
titleV.V. De Meern/title
meta name=description content=V.V. De Meern
meta name=robots content=index,follow
script src=/beheer/include/header.js/script
/head
body
script src=menu.js/script
a href=menu.html/a
h1Home pagina A1/h1
pimg src=a1.jpg border=0 alt= //p
h1Spelers/h1
pNicky Vermeulen, Jon Gruters, Jerryl Smeenk, Bram van Wiggen, Rolf van
Elderen, Sander van der Woude, Melvin van Nood, Jorgos Katsivilis, Leo
Wakelkamp, Chen Margolin, Luis Plein, Danny Berkhouwer, Whaheed
Khodabaks,
Alessandro Damen, Thomas van Amerongen/p
h1Leiders/h1
pJohn Dunsbergen, Joost Satink, Lex van der Woude/p
script src=/beheer/include/footer.js/script
/body
/html

Expected result:

Run until max execution time exceeded.

Actual result:
--
Crashed beforehand.

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



#44954 [Opn-Fbk]: file_get_contents crashes Apache

2008-05-09 Thread jani
 ID:   44954
 Updated by:   [EMAIL PROTECTED]
 Reported By:  abakker at gmx dot net
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Win XP
 PHP Version:  5.2.6
 New Comment:

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.





Previous Comments:


[2008-05-09 11:22:01] abakker at gmx dot net

Description:

Apache crashes if a lot of file_get_contents are done. The Apache
error.log only contains this (I guess this just confirms that the Apache
server has crashed and no longer responds): [Fri May 09 12:15:04 2008]
[error] [client 192.168.0.1] PHP Warning: 
file_get_contents(http://localhost/test.htm) [a
href='function.file-get-contents'function.file-get-contents/a]:
failed to open stream: A connection attempt failed because the connected
party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond.\r\n in
C:\\Andre\\Apache\\test.php on line 6


Reproduce code:
---
The following PHP script reproduces the problem:

?php
echo 'pre';
for ($i=1;;$i++)
{ echo $i.\n;
  flush();ob_flush();
  $contents = file_get_contents('http://localhost/test.htm');
}
?

After 203 iterations the Apache server crashes. The result is the same
whether localhost or IP address is used.

The problem depends on the contents of the test.htm file. If it only
contains

html
body
/body
/html

the script runs until it reaches the max execution time.

The test.htm that reproduces the problem contains:

html
head
link rel=stylesheet href=/systeem/style/style.css
titleV.V. De Meern/title
meta name=description content=V.V. De Meern
meta name=robots content=index,follow
script src=/beheer/include/header.js/script
/head
body
script src=menu.js/script
a href=menu.html/a
h1Home pagina A1/h1
pimg src=a1.jpg border=0 alt= //p
h1Spelers/h1
pNicky Vermeulen, Jon Gruters, Jerryl Smeenk, Bram van Wiggen, Rolf
van
Elderen, Sander van der Woude, Melvin van Nood, Jorgos Katsivilis, Leo
Wakelkamp, Chen Margolin, Luis Plein, Danny Berkhouwer, Whaheed
Khodabaks,
Alessandro Damen, Thomas van Amerongen/p
h1Leiders/h1
pJohn Dunsbergen, Joost Satink, Lex van der Woude/p
script src=/beheer/include/footer.js/script
/body
/html

Expected result:

Run until max execution time exceeded.

Actual result:
--
Crashed beforehand.





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



#44942 [Opn-Fbk]: exec() hangs apache

2008-05-09 Thread jani
 ID:   44942
 Updated by:   [EMAIL PROTECTED]
 Reported By:  inqualab1985 at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Program Execution
 Operating System: Microsoft Window 2000 SP4
 PHP Version:  5.2.5
 New Comment:

What exactly does this sample.exe do? It's most likely not any PHP
problem at all anyway, you just call some exe that hangs itself..


Previous Comments:


[2008-05-08 05:40:53] inqualab1985 at gmail dot com

Description:

Hi! PHP Team

I am facing a problem of apache hang up due to exec() function.

I am using PHP 5.2.5 and Apache 2.2 on MS Window 2000 SP4  also on MS
Window XP.

The problem is that I have to execute a exe, for which I have use
exec(). Normally it works Fine, but sometime (randomly) it hang up. It
will lock the apache and if we call the same page or any other page of
php having exec(), it hang up at the line where exec() function is used.
If we commented the line having exec(), then the page run  loaded
correctly.

The problem also become critical because there is no error for this.
Also none of the error handling  logging mechanism works.

The only solution to this problem is to restart the Apache.

I am providing you as much as information as possible to catch the
problem correctly.
 

Reproduce code:
---
$exeFilePath = realpath(../sample.exe);   

if (eregi(win, PHP_OS))
$command = \\$exeFilePath\ argument1\;
else
$command = \$exeFilePath\ argument1;

$output = null;
$returnVal = null;
$result = exec($command,$output,$returnVal);
if($returnVal !=0)
   echo Error;
else
   echo $output[0];

echo end of the program;

Expected result:

it will show the output of exe for particular argument. 

Actual result:
--
Normally it works correctly as expected but sometime the the execution
of the page hang at line $result = exec($command,$output,$returnVal); 
. After this has happen I am not able to run any script that will use
the exec(). In all scripts apache hangs at exec() function, do not
matter  which exe will be called. 





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



#44939 [Opn-Asn]: Depcreated functions while instealling pear

2008-05-09 Thread jani
 ID:   44939
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jay3ld at yahoo dot com
-Status:   Open
+Status:   Assigned
 Bug Type: Compile Warning
 Operating System: Mac OS X 10.5
 PHP Version:  5.3CVS-2008-05-08 (snap)
-Assigned To:  
+Assigned To:  cellog
 New Comment:

Assigned to the PEAR guru.


Previous Comments:


[2008-05-08 02:22:32] jay3ld at yahoo dot com

Description:

While installing a snap shot of PHP 5.3, I received tons of errors when
it was downloading an installing pear.

Please note this is a bug in the pear itself and not my own coding. I
did not make pear, I only received these messages while installing the
latest snapshot of 5.3

Installing man pages: /usr/share/man/man1/
  page: phpize53.1
  page: php-config53.1
Installing PEAR environment:  /usr/php/53/
Conntected...
Filesize: 3630013
Mime-type: text/plain
[===]
99% (3543/3544 kb)
Done!

Deprecated: Assigning the return value of new by reference is
deprecated in phar://install-pear-nozlib.phar/index.php on line 126

Deprecated: Assigning the return value of new by reference is
deprecated in phar://install-pear-nozlib.phar/PEAR/Installer.php on line
557

Deprecated: Assigning the return value of new by reference is
deprecated in phar://install-pear-nozlib.phar/PEAR/Installer.php on line
1113

Deprecated: Assigning the return value of new by reference is
deprecated in phar://install-pear-nozlib.phar/PEAR/Installer.php on line
1172

This list continues on for a while and I don't want to paste all of
them in here.






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



#44937 [Opn-Asn]: Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Out of mem

2008-05-09 Thread jani
 ID:   44937
 Updated by:   [EMAIL PROTECTED]
 Reported By:  aalvarez at n2bsolutions dot com
-Status:   Open
+Status:   Assigned
 Bug Type: LDAP related
 Operating System: Ubuntu 7.10
 PHP Version:  5.2.6
-Assigned To:  
+Assigned To:  sixd
 New Comment:

Oracle libs used to have their own implementation for ldap funcs. 
So I guess you just need to compile PHP ldap extension to use those
libs instead of openldap. I don't know if that instant client thing has
the same issue, so assigning to the Oracle guru. :)


Previous Comments:


[2008-05-07 18:49:48] aalvarez at n2bsolutions dot com

Description:

I have Apache2.2.6 running php5.2.6 with support for:

CFLAGS=' -O3 -I/usr/src/instantclient_11_1/sdk/include -I/usr/lib32
-I/usr/include -I/usr/include/sasl' \
CXXFLAGS='-I/usr/src/instantclient_11_1/sdk/include -I/usr/lib32
-I/usr/include -I/usr/include/sasl' \
'./configure' \
'--includedir=/usr/src/instantclient_11_1/sdk/include' \
'--includedir=/usr/src/instantclient_11_1/sdk' \
'--with-oci8=/usr/src/instantclient_11_1/' \
'--with-jpge' \
'--with-jpeg-dir' \
'--with-pgsql' \
'--with-gd' \
'--with-png-dir' \
'--with-zlib-dir' \
'--with-apxs2=/usr/local/apache226/bin/apxs' \
'--with-openssl' \
'--with-openssl' \
'--with-tiff' \
'--without-pdo-oci' \
'--enable-sigchild' \
'--enable-soap' \
'--enable-ftp' \
'--with-curl' \
'--with-curlwrappers' \
'--with-ldap' \
'--with-ldap-sasl'
$@

I know where is the problem but i don´t know how to fix it...

When i change ennvars like that disabling Oracle oci8 lib
all works perfectly :-/

LD_LIBRARY_PATH=/usr/local/apache226/lib:/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
export ORACLE_HOME=/usr/src/instantclient_11_1
#export TNS_ADMIN=$ORACLE_HOME/network/admin
#export TWO_TASK=$ORACLE_HOME/network/admin/tnsnames.ora
export ORACLE_SID=XE
export
LD_PRELOAD=/usr/lib/libldap.so:/usr/lib/libldap_r.so:/usr/lib/sasl2/libldapdb.so:/usr/lib32/libldap.so.2:
#$ORACLE_HOME/lib/libclntsh.so
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252

It doesn´t matter if i load first the libldap.so 

Any Ideas?
Thxs a lots


Reproduce code:
---
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server:
Out of memory in /home/www/web1/web/ss_dev/__fvalida.php


Expected result:

Ok if the user have valid password in may OpenLDAP 2.2.3 server
it works without oracle LD_PRELOAD but ... i need it too :-(








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



#44955 [NEW]: socket array keys not working as expected

2008-05-09 Thread fidojones at fidojones dot com
From: fidojones at fidojones dot com
Operating system: Linux
PHP version:  5.2.6
PHP Bug Type: Sockets related
Bug description:  socket array keys not working as expected

Description:

This bugfixed 

http://bugs.php.net/bug.php?id=44197

make work socket arrays some strange. 

I think that some HASH_KEY is not contemplate in switch case line 605

switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(sock_array), key,
key_len, num_key, 0, NULL)) {

Nanoweb server http://nanoweb.si.kz/, when try to access it, eat cpu at
99% time with this socket patch.


Reproduce code:
---
?php
$ary = array();
$strone = 'Message From Parent.';
$strtwo = 'Message From Child.';
if (socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $ary) === false) {
echo socket_create_pair() failed. Reason:
.socket_strerror(socket_last_error());
}
$pid = pcntl_fork();
if ($pid == -1) {
echo 'Could not fork Process.';
} elseif ($pid) {
/*parent*/
socket_close($ary[0]);
if (socket_write($ary[1], $strone, strlen($strone)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[1]));
}
if (socket_read($ary[1], strlen($strtwo), PHP_BINARY_READ) == $strtwo)
{
echo Recieved $strtwo\n;
}
socket_close($ary[1]);
} else {
/*child*/
socket_close($ary[1]);
if (socket_write($ary[0], $strtwo, strlen($strtwo)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[0]));
}
if (socket_read($ary[0], strlen($strone), PHP_BINARY_READ) == $strone)
{
echo Recieved $strone\n;
}
socket_close($ary[0]);
}
?

Expected result:

php 5.2.5 result:

bash$ php socket.php 
Recieved Message From Child.
Recieved Message From Parent.


Actual result:
--
php 5.2.6 result:

bash# php socket.php 
Recieved Message From Child.
bash# Recieved Message From Parent.

An here wait and you should hit return to see the bash prompt again


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



#41350 [Com]: Error in my_thread_global_end()

2008-05-09 Thread chris at crgs dot co dot uk
 ID:   41350
 Comment by:   chris at crgs dot co dot uk
 Reported By:  graham at directhostinguk dot com
 Status:   No Feedback
 Bug Type: MySQL related
 Operating System: Windows 2003
 PHP Version:  5.2.3
 New Comment:

Just upgraded to PHP 5.2.6. As others have experienced, the error
message is gone, but there is still an unacceptable 5 second delay at
the end of loading every page, whether or not it accesses the MySQL
database or not.

Downgrading to libmysql.dll from PHP 5.2.1 fixed the problem, as
always.


Previous Comments:


[2008-05-06 14:52:22] newcomer at hotmail dot com

to alienoiduk:

What kind of the application do you run under PHPMySQL? we are running
a wordpress blog. it was doing fine with the old version php (5.0 or
older).When we upgraded php to 5.2.5, the blog got the error message.
Then I replaced the libmysql.dll from php v.5.0.51, the error message
disappear, but the blog runs very slow. it is so slow we have to switch
php back to the old version. 

anyone has this experience with wordpress?



[2008-04-27 13:59:48] alienoiduk at yahoo dot com

You need to install MySQL5.051a for linux and MySQL 5.0.5b1 for
windows. If installed the wrong way around there will be a delay in
executing. 
Also copy the correct libmysql.dll to the C:\PHP\ folder I installed
MySQL 5.0.51b at C:\Mysql\ therfor the libmysql.dll file you require
will be in folder C:\MySQL\lib\opt  the file is the Application
Extension file size of about 2,000K.

This worked on a brand new server running IIS6 windows 2003 server
latest download from PHP 5.2.5 and MySQL 5.0.51b did as above no errors
no hangup or delays. I am not run MySQLi.



[2008-04-22 14:01:29] newcomer at hotmail dot com

We just upgraded to PHP Version 5.2.5. the Error in
my_thread_global_end(): 1 threads didn't exit appeared no matter the
application uses MySQL or not. Replaced the libmysql.dll from V.5.0.45,
the error disappear. But the application is running very slow. Switched
back to PHP version4. Everything back to normal.



[2008-04-16 04:12:17] tristen_e at yahoo dot com

This is still a problem:

$ php --version
PHP 5.2.5 (cli) (built: Nov  8 2007 23:18:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies



[2008-04-09 15:16:21] jdolecek at NetBSD dot org

Downgrading BOTH libmysql.dll AND php_mysql.dll to version bundled with
PHP 5.2.1 fixed the issue for me, too.



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

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



#44956 [NEW]: stripslashes() removes slashes not added by addslashes()

2008-05-09 Thread webmaster at drk dot com dot ar
From: webmaster at drk dot com dot ar
Operating system: Linux
PHP version:  5.2.6
PHP Bug Type: Scripting Engine problem
Bug description:  stripslashes() removes slashes not added by addslashes()

Description:

stripslashes() removes slashes not added by addslashes()

I expect a function to do what is described in the first line of its
documentation. As published in this site un-quotes strings quoted with
addslashes()

It is water clear this functions isn't working as expected. As it
shouldn't remove any slash that addslashes() wouldn't add. In example, a
slash before a space won't be added by addslashes() and mustn't be removed
by stripslashes()

You can refuse to correct the code. In that case, which I consider most
useless, you ought to correct the documentation.

I ask myself won't be useful a function which undoes what addslashes()
does?

Reproduce code:
---
?
$str = the first \ should stay. it\'s the  \right\ case;
$str = stripslashes($str);
var_dump($str);
?

Expected result:

the first \ should stay. it's the  right case

Actual result:
--
the first  should stay. it's the  right case

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



#44956 [Com]: stripslashes() removes slashes not added by addslashes()

2008-05-09 Thread c dot onogol at gmail dot com
 ID:   44956
 Comment by:   c dot onogol at gmail dot com
 Reported By:  webmaster at drk dot com dot ar
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

I agree.
The documentation makes you think it's the exact opposite of 
addslashes(), both in the function description and its return values 
(which happen to be explicitly listed, and there's no mention of 
removing single slashes that are not escaping anything).


There's no string that produces this \ that after a call to 
addslashes().


addslashes(this that) would never output this \ that...

The doc says clearly Un-quotes a quoted string, it's clear its 
purpose is to run it on strings to be inserted in a DB, why would it 
remove single slashes?


Previous Comments:


[2008-05-09 15:43:35] webmaster at drk dot com dot ar

Description:

stripslashes() removes slashes not added by addslashes()

I expect a function to do what is described in the first line of its
documentation. As published in this site un-quotes strings quoted with
addslashes()

It is water clear this functions isn't working as expected. As it
shouldn't remove any slash that addslashes() wouldn't add. In example, a
slash before a space won't be added by addslashes() and mustn't be
removed by stripslashes()

You can refuse to correct the code. In that case, which I consider most
useless, you ought to correct the documentation.

I ask myself won't be useful a function which undoes what addslashes()
does?

Reproduce code:
---
?
$str = the first \ should stay. it\'s the  \right\ case;
$str = stripslashes($str);
var_dump($str);
?

Expected result:

the first \ should stay. it's the  right case

Actual result:
--
the first  should stay. it's the  right case





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



#44955 [Opn-Asn]: socket array keys not working as expected

2008-05-09 Thread jani
 ID:   44955
 Updated by:   [EMAIL PROTECTED]
 Reported By:  fidojones at fidojones dot com
-Status:   Open
+Status:   Assigned
 Bug Type: Sockets related
 Operating System: Linux
 PHP Version:  5.2.6
-Assigned To:  
+Assigned To:  felipe
 New Comment:

Assigned to Felipe who broke this.


Previous Comments:


[2008-05-09 14:58:09] fidojones at fidojones dot com

Description:

This bugfixed 

http://bugs.php.net/bug.php?id=44197

make work socket arrays some strange. 

I think that some HASH_KEY is not contemplate in switch case line 605

switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(sock_array), key,
key_len, num_key, 0, NULL)) {

Nanoweb server http://nanoweb.si.kz/, when try to access it, eat cpu at
99% time with this socket patch.


Reproduce code:
---
?php
$ary = array();
$strone = 'Message From Parent.';
$strtwo = 'Message From Child.';
if (socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $ary) === false) {
echo socket_create_pair() failed. Reason:
.socket_strerror(socket_last_error());
}
$pid = pcntl_fork();
if ($pid == -1) {
echo 'Could not fork Process.';
} elseif ($pid) {
/*parent*/
socket_close($ary[0]);
if (socket_write($ary[1], $strone, strlen($strone)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[1]));
}
if (socket_read($ary[1], strlen($strtwo), PHP_BINARY_READ) ==
$strtwo) {
echo Recieved $strtwo\n;
}
socket_close($ary[1]);
} else {
/*child*/
socket_close($ary[1]);
if (socket_write($ary[0], $strtwo, strlen($strtwo)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[0]));
}
if (socket_read($ary[0], strlen($strone), PHP_BINARY_READ) ==
$strone) {
echo Recieved $strone\n;
}
socket_close($ary[0]);
}
?

Expected result:

php 5.2.5 result:

bash$ php socket.php 
Recieved Message From Child.
Recieved Message From Parent.


Actual result:
--
php 5.2.6 result:

bash# php socket.php 
Recieved Message From Child.
bash# Recieved Message From Parent.

An here wait and you should hit return to see the bash prompt again






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



#44956 [Com]: stripslashes() removes slashes not added by addslashes()

2008-05-09 Thread c dot onogol at gmail dot com
 ID:   44956
 Comment by:   c dot onogol at gmail dot com
 Reported By:  webmaster at drk dot com dot ar
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

I realized my previous comment needs some clarification.

The function does work when you do:

assert($a == stripslashes(addslashes($a)))

This function breaks strings when not used in conjunction with 
addslashes(). By simply skipping single backslashes you can make this 
function safe to use in all cases.

Wouldn't it be an enhancement if you made it so single slashes are 
simply skipped, since most likely they have not been used with 
addslashes()?


Previous Comments:


[2008-05-09 15:56:30] c dot onogol at gmail dot com

I agree.
The documentation makes you think it's the exact opposite of 
addslashes(), both in the function description and its return values 
(which happen to be explicitly listed, and there's no mention of 
removing single slashes that are not escaping anything).


There's no string that produces this \ that after a call to 
addslashes().


addslashes(this that) would never output this \ that...

The doc says clearly Un-quotes a quoted string, it's clear its 
purpose is to run it on strings to be inserted in a DB, why would it 
remove single slashes?



[2008-05-09 15:43:35] webmaster at drk dot com dot ar

Description:

stripslashes() removes slashes not added by addslashes()

I expect a function to do what is described in the first line of its
documentation. As published in this site un-quotes strings quoted with
addslashes()

It is water clear this functions isn't working as expected. As it
shouldn't remove any slash that addslashes() wouldn't add. In example, a
slash before a space won't be added by addslashes() and mustn't be
removed by stripslashes()

You can refuse to correct the code. In that case, which I consider most
useless, you ought to correct the documentation.

I ask myself won't be useful a function which undoes what addslashes()
does?

Reproduce code:
---
?
$str = the first \ should stay. it\'s the  \right\ case;
$str = stripslashes($str);
var_dump($str);
?

Expected result:

the first \ should stay. it's the  right case

Actual result:
--
the first  should stay. it's the  right case





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



#44954 [Fbk-Opn]: file_get_contents crashes Apache

2008-05-09 Thread abakker at gmx dot net
 ID:   44954
 User updated by:  abakker at gmx dot net
 Reported By:  abakker at gmx dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: Win XP
 PHP Version:  5.2.6
 New Comment:

What more information do you need? As already mentioned:

1) create a test.htm file (in your top level directory that localhost
points to) with the following content:

html
head
link rel=stylesheet href=/systeem/style/style.css
titleV.V. De Meern/title
meta name=description content=V.V. De Meern
meta name=robots content=index,follow
script src=/beheer/include/header.js/script
/head
body
script src=menu.js/script
a href=menu.html/a
h1Home pagina A1/h1
pimg src=a1.jpg border=0 alt= //p
h1Spelers/h1
pNicky Vermeulen, Jon Gruters, Jerryl Smeenk, Bram van Wiggen, Rolf
van
Elderen, Sander van der Woude, Melvin van Nood, Jorgos Katsivilis, Leo
Wakelkamp, Chen Margolin, Luis Plein, Danny Berkhouwer, Whaheed
Khodabaks,
Alessandro Damen, Thomas van Amerongen/p
h1Leiders/h1
pJohn Dunsbergen, Joost Satink, Lex van der Woude/p
script src=/beheer/include/footer.js/script
/body
/html

2) Create a test.php file containing:

?php
echo 'pre';
for ($i=1;;$i++)
{ echo $i.\n;
  flush();ob_flush();
  $contents = file_get_contents('http://localhost/test.htm');
}
?

3) Run the test.php file from your browser. It display 1, 2, 3, 4, etc
and after 202 iterations it hangs because the Apache server has
crashed.

PS. The problem also occurs if you use fopen(), fgets(), fclose()
instead of file_get_contents.


Previous Comments:


[2008-05-09 14:12:22] [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.






[2008-05-09 11:22:01] abakker at gmx dot net

Description:

Apache crashes if a lot of file_get_contents are done. The Apache
error.log only contains this (I guess this just confirms that the Apache
server has crashed and no longer responds): [Fri May 09 12:15:04 2008]
[error] [client 192.168.0.1] PHP Warning: 
file_get_contents(http://localhost/test.htm) [a
href='function.file-get-contents'function.file-get-contents/a]:
failed to open stream: A connection attempt failed because the connected
party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond.\r\n in
C:\\Andre\\Apache\\test.php on line 6


Reproduce code:
---
The following PHP script reproduces the problem:

?php
echo 'pre';
for ($i=1;;$i++)
{ echo $i.\n;
  flush();ob_flush();
  $contents = file_get_contents('http://localhost/test.htm');
}
?

After 203 iterations the Apache server crashes. The result is the same
whether localhost or IP address is used.

The problem depends on the contents of the test.htm file. If it only
contains

html
body
/body
/html

the script runs until it reaches the max execution time.

The test.htm that reproduces the problem contains:

html
head
link rel=stylesheet href=/systeem/style/style.css
titleV.V. De Meern/title
meta name=description content=V.V. De Meern
meta name=robots content=index,follow
script src=/beheer/include/header.js/script
/head
body
script src=menu.js/script
a href=menu.html/a
h1Home pagina A1/h1
pimg src=a1.jpg border=0 alt= //p
h1Spelers/h1
pNicky Vermeulen, Jon Gruters, Jerryl Smeenk, Bram van Wiggen, Rolf
van
Elderen, Sander van der Woude, Melvin van Nood, Jorgos Katsivilis, Leo
Wakelkamp, Chen Margolin, Luis Plein, Danny Berkhouwer, Whaheed
Khodabaks,
Alessandro Damen, Thomas van Amerongen/p
h1Leiders/h1
pJohn Dunsbergen, Joost Satink, Lex van der Woude/p
script src=/beheer/include/footer.js/script
/body
/html

Expected result:

Run until max execution time exceeded.

Actual result:
--
Crashed beforehand.





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



#44955 [Asn-Opn]: socket array keys not working as expected

2008-05-09 Thread felipe
 ID:   44955
 Updated by:   [EMAIL PROTECTED]
 Reported By:  fidojones at fidojones dot com
-Status:   Assigned
+Status:   Open
 Bug Type: Sockets related
 Operating System: Linux
 PHP Version:  5.2.6
 Assigned To:  felipe
 New Comment:

The problem isn't related with the patch... It just fixed a problem in
socket_select(). Your script doesn't use it.


Previous Comments:


[2008-05-09 16:27:02] [EMAIL PROTECTED]

Assigned to Felipe who broke this.



[2008-05-09 14:58:09] fidojones at fidojones dot com

Description:

This bugfixed 

http://bugs.php.net/bug.php?id=44197

make work socket arrays some strange. 

I think that some HASH_KEY is not contemplate in switch case line 605

switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(sock_array), key,
key_len, num_key, 0, NULL)) {

Nanoweb server http://nanoweb.si.kz/, when try to access it, eat cpu at
99% time with this socket patch.


Reproduce code:
---
?php
$ary = array();
$strone = 'Message From Parent.';
$strtwo = 'Message From Child.';
if (socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $ary) === false) {
echo socket_create_pair() failed. Reason:
.socket_strerror(socket_last_error());
}
$pid = pcntl_fork();
if ($pid == -1) {
echo 'Could not fork Process.';
} elseif ($pid) {
/*parent*/
socket_close($ary[0]);
if (socket_write($ary[1], $strone, strlen($strone)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[1]));
}
if (socket_read($ary[1], strlen($strtwo), PHP_BINARY_READ) ==
$strtwo) {
echo Recieved $strtwo\n;
}
socket_close($ary[1]);
} else {
/*child*/
socket_close($ary[1]);
if (socket_write($ary[0], $strtwo, strlen($strtwo)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[0]));
}
if (socket_read($ary[0], strlen($strone), PHP_BINARY_READ) ==
$strone) {
echo Recieved $strone\n;
}
socket_close($ary[0]);
}
?

Expected result:

php 5.2.5 result:

bash$ php socket.php 
Recieved Message From Child.
Recieved Message From Parent.


Actual result:
--
php 5.2.6 result:

bash# php socket.php 
Recieved Message From Child.
bash# Recieved Message From Parent.

An here wait and you should hit return to see the bash prompt again






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



#44866 [Bgs]: curl CURLOPT_INFILE leaks handle reference

2008-05-09 Thread david at acz dot org
 ID:   44866
 User updated by:  david at acz dot org
 Reported By:  david at acz dot org
 Status:   Bogus
 Bug Type: cURL related
 Operating System: SLES 10 x86_64
 PHP Version:  5.2.5
 New Comment:

That does not help for long-running (e.g. CLI) scripts.


Previous Comments:


[2008-05-05 23:04:03] [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

The file will be closed at the end of the request.



[2008-04-30 01:05:03] david at acz dot org

Description:

File handles are normally closed automatically when the reference count
hits zero.  For example, if you fopen() something in a function and only
assign it to a local variable, the file is closed when the function
returns.

CURLOPT_INFILE breaks this behavior.  Presumably, the curl resource
destructor does not decrement the reference count for the file handle.  

Reproduce code:
---
?
$name = tempnam(/tmp, phpbug);
$n = count(scandir(/proc/self/fd));

test_simple($name);
var_dump(count(scandir(/proc/self/fd)) == $n);

test_curl($name, true);
var_dump(count(scandir(/proc/self/fd)) == $n);

test_curl($name, false);
var_dump(count(scandir(/proc/self/fd)) == $n);

function test_simple($name)
{
$fp = fopen($name, r);
}

function test_curl($name, $close)
{
$fp = fopen($name, r);
$c = curl_init();
curl_setopt($c, CURLOPT_PUT, true);
curl_setopt($c, CURLOPT_INFILE, $fp);
curl_setopt($c, CURLOPT_INFILESIZE, 0);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_exec($c);
curl_close($c);
if ($close)
fclose($fp);
}
?


Expected result:

bool(true)
bool(true)
bool(true)


Actual result:
--
bool(true)
bool(true)
bool(false)






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



#44866 [Bgs]: curl CURLOPT_INFILE leaks handle reference

2008-05-09 Thread david at acz dot org
 ID:   44866
 User updated by:  david at acz dot org
 Reported By:  david at acz dot org
 Status:   Bogus
 Bug Type: cURL related
 Operating System: SLES 10 x86_64
 PHP Version:  5.2.5
 New Comment:

That does not help for long running (e.g. CLI) scripts.


Previous Comments:


[2008-05-09 18:03:49] david at acz dot org

That does not help for long-running (e.g. CLI) scripts.



[2008-05-05 23:04:03] [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

The file will be closed at the end of the request.



[2008-04-30 01:05:03] david at acz dot org

Description:

File handles are normally closed automatically when the reference count
hits zero.  For example, if you fopen() something in a function and only
assign it to a local variable, the file is closed when the function
returns.

CURLOPT_INFILE breaks this behavior.  Presumably, the curl resource
destructor does not decrement the reference count for the file handle.  

Reproduce code:
---
?
$name = tempnam(/tmp, phpbug);
$n = count(scandir(/proc/self/fd));

test_simple($name);
var_dump(count(scandir(/proc/self/fd)) == $n);

test_curl($name, true);
var_dump(count(scandir(/proc/self/fd)) == $n);

test_curl($name, false);
var_dump(count(scandir(/proc/self/fd)) == $n);

function test_simple($name)
{
$fp = fopen($name, r);
}

function test_curl($name, $close)
{
$fp = fopen($name, r);
$c = curl_init();
curl_setopt($c, CURLOPT_PUT, true);
curl_setopt($c, CURLOPT_INFILE, $fp);
curl_setopt($c, CURLOPT_INFILESIZE, 0);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_exec($c);
curl_close($c);
if ($close)
fclose($fp);
}
?


Expected result:

bool(true)
bool(true)
bool(true)


Actual result:
--
bool(true)
bool(true)
bool(false)






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



#44955 [Opn]: socket array keys not working as expected

2008-05-09 Thread fidojones at fidojones dot com
 ID:   44955
 User updated by:  fidojones at fidojones dot com
 Reported By:  fidojones at fidojones dot com
 Status:   Open
 Bug Type: Sockets related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

I'm using the socket.c file in ext/socket/ from php 5.2.5 in php 5.2.6
and all is working fine. And the only diff in socket.c is the patch
http://bugs.php.net/bug.php?id=44197 ,so explain me if not related with
this patch, why is working perfect? if I only overwrite the socket.c
file...

You should test the script and say me if you see the execution
diference and I encourage to try http://nanoweb.si.kz/ that has been
working with all php versions from 4 to 5.2.5 and only fails with php
5.2.6.


Previous Comments:


[2008-05-09 17:50:12] [EMAIL PROTECTED]

The problem isn't related with the patch... It just fixed a problem in
socket_select(). Your script doesn't use it.



[2008-05-09 16:27:02] [EMAIL PROTECTED]

Assigned to Felipe who broke this.



[2008-05-09 14:58:09] fidojones at fidojones dot com

Description:

This bugfixed 

http://bugs.php.net/bug.php?id=44197

make work socket arrays some strange. 

I think that some HASH_KEY is not contemplate in switch case line 605

switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(sock_array), key,
key_len, num_key, 0, NULL)) {

Nanoweb server http://nanoweb.si.kz/, when try to access it, eat cpu at
99% time with this socket patch.


Reproduce code:
---
?php
$ary = array();
$strone = 'Message From Parent.';
$strtwo = 'Message From Child.';
if (socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $ary) === false) {
echo socket_create_pair() failed. Reason:
.socket_strerror(socket_last_error());
}
$pid = pcntl_fork();
if ($pid == -1) {
echo 'Could not fork Process.';
} elseif ($pid) {
/*parent*/
socket_close($ary[0]);
if (socket_write($ary[1], $strone, strlen($strone)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[1]));
}
if (socket_read($ary[1], strlen($strtwo), PHP_BINARY_READ) ==
$strtwo) {
echo Recieved $strtwo\n;
}
socket_close($ary[1]);
} else {
/*child*/
socket_close($ary[1]);
if (socket_write($ary[0], $strtwo, strlen($strtwo)) === false) {
echo socket_write() failed. Reason:
.socket_strerror(socket_last_error($ary[0]));
}
if (socket_read($ary[0], strlen($strone), PHP_BINARY_READ) ==
$strone) {
echo Recieved $strone\n;
}
socket_close($ary[0]);
}
?

Expected result:

php 5.2.5 result:

bash$ php socket.php 
Recieved Message From Child.
Recieved Message From Parent.


Actual result:
--
php 5.2.6 result:

bash# php socket.php 
Recieved Message From Child.
bash# Recieved Message From Parent.

An here wait and you should hit return to see the bash prompt again






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



#44687 [NoF-Opn]: curl_multi_* crashes apache randomly

2008-05-09 Thread r_luca at tiscali dot it
 ID:   44687
 User updated by:  r_luca at tiscali dot it
 Reported By:  r_luca at tiscali dot it
-Status:   No Feedback
+Status:   Open
 Bug Type: cURL related
 Operating System: windows vista
 PHP Version:  5.2.5
 New Comment:

I've followed the backtrace tutorial step by step, using the debug pack
from the same build as the binaries but debug diag hasn't find any error
but apache is still crashing.

I've notice that many people did have this problem and guess that at
this stage an updated version of php_curl.dll with the latest curl lib
would be a possible solution.


Previous Comments:


[2008-05-02 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to Open.



[2008-04-24 16:10:42] [EMAIL PROTECTED]

You need to use the debug pack from the same build as the binaries:

http://snaps.php.net/win32/php5.2-win32-200804241630.zip
http://snaps.php.net/win32/php5.2-dbgpack-win32-200804241630.zip




[2008-04-22 18:10:44] r_luca at tiscali dot it

I am still trying to get the  backtrace but when the process crashes 
debug diagnostics gives back a rule error. 

Is there a way to retrieve an updated version of the php_cul.dll file
(with a recent curl version)?



[2008-04-15 21:15:35] r_luca at tiscali dot it

I am already using the debug version, apache crashes (very randomly)
but no backtrace.



[2008-04-15 14:19:00] [EMAIL PROTECTED]

At http://snaps.php.net/ you can find the debug pack required to get
proper backtraces on windows. 




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

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



#44767 [Opn-Bgs]: Incorrect handling of a closing # to # based comments

2008-05-09 Thread ikickdogsforfun at hotmail dot com
 ID:   44767
 User updated by:  ikickdogsforfun at hotmail dot com
 Reported By:  ikickdogsforfun at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Gentoo Linux
 PHP Version:  5.2.6RC5
 New Comment:

Ah I see. Thanks for the explanation, it had puzzled me somewhat. As
for whose logic is right, it's not mine =P But thanks that's clarified a
few things for me.
I have also marked this bug as 'bogus' (If it will let me), I hope that
was correct =)


Previous Comments:


[2008-05-05 21:35:19] whitewolf24 at hotmail dot com

no, # is a ONE line comment. the end of the line ended the comment. 
as for the error. you should get them as that code would break anyway.

your lacking ; on the end of lines. {they are commented out}
nothing on the line after the first # is read by the parser. 

the problem your having is that your ending your code before it's
closed line three is ? and the interpreter is seeing this and asking
you about the messed up syntax

?
echo \some .
?

these should be the two errors you are getting

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in file
on line 2

Parse error: syntax error, unexpected ';' in file on line 3

done believe me? try this line which is a code complete and doesn't
error

?
echo this ;#works# echo works.;
?

if you were right about your logic then you should get this works 
else if I'm correct you will just get this



[2008-05-02 13:27:13] ikickdogsforfun at hotmail dot com

In which case the comment is handled incorrectly if a second # appears,
note the code above which produces 2 errors. One of the errors refers to
a third line, even though there is only code on line. This suggests that
the interpretor has closed the comment and is attempting to handle the
rest of the code after the second # by treating it as a new line.



[2008-04-29 23:28:07] whitewolf24 at hotmail dot com

um, last I checked and have read in the manual
# comments to the end of the line OR the end of the php block, which
ever happens first. not to another #



[2008-04-17 20:49:53] ikickdogsforfun at hotmail dot com

Description:

A # comment can be closed by a second # causing PHP to act rather
oddly. Any errors that occur on the same line but after the closing #
are reported as an error on the next line, however if there are no
errors anything after the second # is ignored and not processed as if it
was a comment. I think based on this, there needs to be some concistency
about what happens when a second # is encountered. Are these intended to
be embedded comments which can be be closed? Or should everything being
ignored after the first # untill a new line character is encountered?

Reproduce code:
---
This produces 2 errors, one on line 2, one on line 3, though they are
both about line 3:
?
echo \some .# This is an imbedded comment#text;
?
This only echos out 'some':
?
echo some .# This is an imbedded comment#hi;
?

Expected result:

I would expect to see 'some text' echoed out, as I was under the
impression these kinds of comments were imbedded.

Actual result:
--
See the code section





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



#44940 [Fbk-Csd]: Typecast does not work for function in class

2008-05-09 Thread blue765d at aol dot com
 ID:   44940
 User updated by:  blue765d at aol dot com
 Reported By:  blue765d at aol dot com
-Status:   Feedback
+Status:   Closed
 Bug Type: Scripting Engine problem
 Operating System: WinXP
 PHP Version:  5.2.6
 New Comment:

Sorry, this is bogus. My mistake. I had a small typo in my code that
caused it.


Previous Comments:


[2008-05-08 07:35:42] [EMAIL PROTECTED]

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

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

Please avoid embedding huge scripts into the report.

Please give a complete reproduce script, so far your report looks
bogous.



[2008-05-08 03:59:22] blue765d at aol dot com

Description:

When a function in a class returns something that was typecasted, the
typecast is ignored.

Reproduce code:
---
class test
{

public function foo()
{
$bar = 90;
return (int)$bar;
}

}



Expected result:

The expected result is for $bar to be returned as an integer. 

Actual result:
--
The actual result is that $bar is returned as a string.





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



#44957 [NEW]: Scripting stops after calling a magic setter from a static function

2008-05-09 Thread junker at slooz dot com
From: junker at slooz dot com
Operating system: Windows XP
PHP version:  5.3CVS-2008-05-10 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  Scripting stops after calling a magic setter from a static 
function

Description:

Magic __set function fails when called from a static method.

The sample code will work as expected if $o-Dummy = $o2; is replaced
with, for example, $o-Dummy = 'abc';.

Reproduce code:
---
?
class A {   
public static function who () { return __CLASS__; } 
public static function create () {
$type = static::who ();
$o = new $type ();  
if ($type == 'B') {
$o2 = C::create ();
$o-Dummy = $o2;
}
return $o;
}   
public function __set ($key, $value) {
echo [setting $key];
}
}   
class B extends A {public static function who () { return __CLASS__; }} 
class C extends A {public static function who () { return __CLASS__; }} 
$obj_b = B::create (); echo '[Done]';
?

Expected result:

[setting Dummy][Done]

Actual result:
--
No output. The scripting of the code seems to stop during this command:
$o-Dummy = $o2;

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



#44957 [Opn-Bgs]: Scripting stops after calling a magic setter from a static function

2008-05-09 Thread junker at slooz dot com
 ID:   44957
 User updated by:  junker at slooz dot com
 Reported By:  junker at slooz dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.3CVS-2008-05-10 (snap)
 New Comment:

Sorry, false alarm. I had a missing __toString method, which was
causing the problem.


Previous Comments:


[2008-05-10 03:39:09] junker at slooz dot com

Description:

Magic __set function fails when called from a static method.

The sample code will work as expected if $o-Dummy = $o2; is replaced
with, for example, $o-Dummy = 'abc';.

Reproduce code:
---
?
class A {   
public static function who () { return __CLASS__; } 
public static function create () {
$type = static::who ();
$o = new $type ();  
if ($type == 'B') {
$o2 = C::create ();
$o-Dummy = $o2;
}
return $o;
}   
public function __set ($key, $value) {
echo [setting $key];
}
}   
class B extends A {public static function who () { return __CLASS__;
}}  
class C extends A {public static function who () { return __CLASS__;
}}  
$obj_b = B::create (); echo '[Done]';
?

Expected result:

[setting Dummy][Done]

Actual result:
--
No output. The scripting of the code seems to stop during this command:
$o-Dummy = $o2;





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



#44958 [NEW]: Installer does not correctly configure MySQL support

2008-05-09 Thread Zian dot Choy at gmail dot com
From: Zian dot Choy at gmail dot com
Operating system: Windows XP SP3
PHP version:  5.2.6
PHP Bug Type: Unknown/Other Function
Bug description:  Installer does not correctly configure MySQL support

Description:

Viewing a PHP file that attempts to connect to MySQL results in a HTTP
500.

Reproduce code:
---
1. Install the latest version of Apache using the Windows installer with
Open SSL, using all defaults
2. Stop Apache
3. Install the latest version of PHP using the MSI.

In the configuration of the PHP install...
1. Pick Apache 2.2
2. Point the installer at Apache's conf directory
3. Under Extensions, select MySQL and MySQLi

4. Start Apache
5. Start MySQL
6. Run the following code inside a file:
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
titleSQL Test/title
/head
body
?php
$dbServer='localhost';
// username and password
$dbUser='[root username]';
$dbPass='[password]';
// name of database
$dbName='test';  
$link = mysql_connect($dbServer, $dbUser, $dbPass) or
die(Could not connect);
print Connected successfullybr;   
mysql_select_db($dbName) or die(Could not select database);
print Database selected successfullybr;
mysql_close($link);
?
/body
/html

Expected result:

I expected to see:
Connected successfully
Database selected successfully

Actual result:
--
The IE7 HTTP 500 error screen and the following entry in the Apache
error.log file:
[Fri May 09 22:03:08 2008] [error] [client 127.0.0.1] PHP Fatal error: 
Call to undefined function mysql_connect() in C:\\Program Files\\Apache
Software Foundation\\Apache2.2\\htdocs\\sql.php on line 14

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