#42174 [Opn->Bgs]: i used exec function to execute command and it did not executed

2007-08-02 Thread derick
 ID:   42174
 Updated by:   [EMAIL PROTECTED]
 Reported By:  marwa dot yousef at mediaintl dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Apache related
 Operating System: Apache
 PHP Version:  4.4.7
 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.

.


Previous Comments:


[2007-08-02 06:39:40] marwa dot yousef at mediaintl dot net

Description:

i want to convert a video file of any extension to a flv extension
(flash extension) and save it in a specific folder. i used the execute
function built in php (exec[command]) to run a command to do that but it
didn't work. i don't know why. so please help me to fix this error.

Reproduce code:
---
if($config[vresize] == 1) {$encodecommand="$config[mencoder]
$config[vdodir]/$vdoname -o $config[flvdodir]/".$vid."x.flv -of lavf
-oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts
vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last_pred=3
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vop
scale=$config[vresize_x]:$config[vresize_y] -srate $config[sbitrate]";
  }else {
$encodecommand="$config[mencoder] $config[vdodir]/$vdoname -o
$config[flvdodir]/".$vid."x.flv -of lavf -oac mp3lame -lameopts
abr:br=56 -ovc lavc -lavcopts
vcodec=flv:vbitrate=$config[vbitrate]:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last_pred=3
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -srate
$config[sbitrate]";
  }
if(exec("$encodecommand")) {
  //update flv metatags
  exec("flvtool2 -Uv $config[flvdodir]/".$vid."x.flv
$config[flvdodir]/".$vid.".flv");
  exec("$config[metainject] -Uv $config[flvdodir]/".$vid."x.flv
$config[flvdodir]/".$vid.".flv");

Expected result:

convert any video file from its extension to .flv extension and move it
to a flvdir folder.

Actual result:
--
didn't executed at all.





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


#25361 [Bgs->Fbk]: Program Execution Functions fail in certain cases

2007-08-02 Thread rquadling
 ID:   25361
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sam at freepeers dot com
-Status:   Bogus
+Status:   Feedback
 Bug Type: Program Execution
 Operating System: Windows 2000
 PHP Version:  4.3.2
 New Comment:

For Windows NT+ (i.e. not win98-), this SEEMS to work.

cmd /s /c ""your long command" "another file""

Compare this against ...

cmd /c "your long command" "another file"

which doesn't work.

The /S option basically treats the rest of the string in quotes as a
command line.

This is slightly different behaviour.


%COMPSPEC% /S /C ""C:\Program Files\Internet Explorer\IEXPLORE.EXE"
"http://www.php.net"";


This is a patch to proc_open.c which I think should deal with the
issue. It may need to be optimized.

Index: proc_open.c
===
RCS file: /repository/php-src/ext/standard/proc_open.c,v
retrieving revision 1.57
diff -u -r1.57 proc_open.c
--- proc_open.c 28 May 2007 23:00:25 -  1.57
+++ proc_open.c 2 Aug 2007 09:21:02 -
@@ -740,7 +740,12 @@
if (bypass_shell) {
newprocok = CreateProcess(NULL, command, &security, &security, 
TRUE,
NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd, &si, &pi);
} else {
-   spprintf(&command_with_cmd, 0, "%s /c %s", GetVersion() < 
0x8000
? COMSPEC_NT : COMSPEC_9X, command);
+   if (GetVersion() < 0x8000) {
+   /* Wrap command in quotes and use the /s parameter to 
pass quotes
to the command line. */
+   spprintf(&command_with_cmd, 0, "%s /s /c \"%s\"", 
COMSPEC_NT,
command);
+   } else {
+   spprintf(&command_with_cmd, 0, "%s /c %s", COMSPEC_9X, 
command);
+   }
 
newprocok = CreateProcess(NULL, command_with_cmd, &security,
&security, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd,
&si, &pi);
 
http://pastie.caboo.se/84303


Previous Comments:


[2003-09-02 18:08:10] [EMAIL PROTECTED]

PHP uses "cmd.exe /c" for executing programs under windows.
You can try your examples on command line:

cmd.exe /c "your long command" "another file"

And you'll see it does not work. This is not PHP problem but yet
another windows problem. 

You must always use the '8.3' format of the paths/filenames.





[2003-09-02 11:07:00] sam at freepeers dot com

Description:

Running PHP on Windows 2000 with IIS 5.

Basic program executation does not work in certain cases. 

This is ok:

$output = `C:\executable.exe C:\\file1.txt`;

Now, lets suppose that both the filename and the executable names
contain spaces, and therefore each are to be enclosed in quotes.  Then
it fails:

This is not ok:

$output = `"C:\executable.exe" "C:\\file1.txt"`;

This is ok again:

$output = `C:\executable.exe "C:\\file1.txt"`;

This is also ok:

$output = `"C:\executable.exe" C:\\file1.txt`;

So, the problem arises when BOTH the command and the file are enclosed
in quotes.  In some cases you do need to enclose both the command and
the file in quotes. You will not be able to.

This affects all forms of command execution (exec, system,
backticks...)
  

Reproduce code:
---
1.  Create file called "Test.txt" and put it into C: drive.Put some
random text in it.

2.  Try this code:

";

$output = "";
$output = `"more" C:\\Test.txt`;
echo "Test.txt contains $output.  This works";

$output = "";
$output = `more "C:\\Test.txt"`;
echo "Test.txt contains $output.  This works";

$output = "";
$output = `"more" "C:\\Test.txt"`;
echo "Test.txt contains $output.  This does not works";

?>

Expected result:

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This does not works

Actual result:
--
Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains . This does not works





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


#25361 [Fbk]: Program Execution Functions fail in certain cases

2007-08-02 Thread rquadling
 ID:   25361
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sam at freepeers dot com
 Status:   Feedback
 Bug Type: Program Execution
 Operating System: Windows 2000
 PHP Version:  4.3.2
 New Comment:

It may be that the /S is not required.

http://pastie.caboo.se/84306


Previous Comments:


[2007-08-02 09:28:08] [EMAIL PROTECTED]

And thanks to Ashar Lohmar <[EMAIL PROTECTED]>, as he put me onto
this fix. He had a similar issue with wscript.



[2007-08-02 09:22:46] [EMAIL PROTECTED]

For Windows NT+ (i.e. not win98-), this SEEMS to work.

cmd /s /c ""your long command" "another file""

Compare this against ...

cmd /c "your long command" "another file"

which doesn't work.

The /S option basically treats the rest of the string in quotes as a
command line.

This is slightly different behaviour.


%COMPSPEC% /S /C ""C:\Program Files\Internet Explorer\IEXPLORE.EXE"
"http://www.php.net"";


This is a patch to proc_open.c which I think should deal with the
issue. It may need to be optimized.

Index: proc_open.c
===
RCS file: /repository/php-src/ext/standard/proc_open.c,v
retrieving revision 1.57
diff -u -r1.57 proc_open.c
--- proc_open.c 28 May 2007 23:00:25 -  1.57
+++ proc_open.c 2 Aug 2007 09:21:02 -
@@ -740,7 +740,12 @@
if (bypass_shell) {
newprocok = CreateProcess(NULL, command, &security, &security, 
TRUE,
NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd, &si, &pi);
} else {
-   spprintf(&command_with_cmd, 0, "%s /c %s", GetVersion() < 
0x8000
? COMSPEC_NT : COMSPEC_9X, command);
+   if (GetVersion() < 0x8000) {
+   /* Wrap command in quotes and use the /s parameter to 
pass quotes
to the command line. */
+   spprintf(&command_with_cmd, 0, "%s /s /c \"%s\"", 
COMSPEC_NT,
command);
+   } else {
+   spprintf(&command_with_cmd, 0, "%s /c %s", COMSPEC_9X, 
command);
+   }
 
newprocok = CreateProcess(NULL, command_with_cmd, &security,
&security, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd,
&si, &pi);
 
http://pastie.caboo.se/84303



[2003-09-02 18:08:10] [EMAIL PROTECTED]

PHP uses "cmd.exe /c" for executing programs under windows.
You can try your examples on command line:

cmd.exe /c "your long command" "another file"

And you'll see it does not work. This is not PHP problem but yet
another windows problem. 

You must always use the '8.3' format of the paths/filenames.





[2003-09-02 11:07:00] sam at freepeers dot com

Description:

Running PHP on Windows 2000 with IIS 5.

Basic program executation does not work in certain cases. 

This is ok:

$output = `C:\executable.exe C:\\file1.txt`;

Now, lets suppose that both the filename and the executable names
contain spaces, and therefore each are to be enclosed in quotes.  Then
it fails:

This is not ok:

$output = `"C:\executable.exe" "C:\\file1.txt"`;

This is ok again:

$output = `C:\executable.exe "C:\\file1.txt"`;

This is also ok:

$output = `"C:\executable.exe" C:\\file1.txt`;

So, the problem arises when BOTH the command and the file are enclosed
in quotes.  In some cases you do need to enclose both the command and
the file in quotes. You will not be able to.

This affects all forms of command execution (exec, system,
backticks...)
  

Reproduce code:
---
1.  Create file called "Test.txt" and put it into C: drive.Put some
random text in it.

2.  Try this code:

";

$output = "";
$output = `"more" C:\\Test.txt`;
echo "Test.txt contains $output.  This works";

$output = "";
$output = `more "C:\\Test.txt"`;
echo "Test.txt contains $output.  This works";

$output = "";
$output = `"more" "C:\\Test.txt"`;
echo "Test.txt contains $output.  This does not works";

?>

Expected result:

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This does not works

Actual result:
--
Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains . This does not works





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


#25361 [Fbk]: Program Execution Functions fail in certain cases

2007-08-02 Thread rquadling
 ID:   25361
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sam at freepeers dot com
 Status:   Feedback
 Bug Type: Program Execution
 Operating System: Windows 2000
 PHP Version:  4.3.2
 New Comment:

And thanks to Ashar Lohmar <[EMAIL PROTECTED]>, as he put me onto
this fix. He had a similar issue with wscript.


Previous Comments:


[2007-08-02 09:22:46] [EMAIL PROTECTED]

For Windows NT+ (i.e. not win98-), this SEEMS to work.

cmd /s /c ""your long command" "another file""

Compare this against ...

cmd /c "your long command" "another file"

which doesn't work.

The /S option basically treats the rest of the string in quotes as a
command line.

This is slightly different behaviour.


%COMPSPEC% /S /C ""C:\Program Files\Internet Explorer\IEXPLORE.EXE"
"http://www.php.net"";


This is a patch to proc_open.c which I think should deal with the
issue. It may need to be optimized.

Index: proc_open.c
===
RCS file: /repository/php-src/ext/standard/proc_open.c,v
retrieving revision 1.57
diff -u -r1.57 proc_open.c
--- proc_open.c 28 May 2007 23:00:25 -  1.57
+++ proc_open.c 2 Aug 2007 09:21:02 -
@@ -740,7 +740,12 @@
if (bypass_shell) {
newprocok = CreateProcess(NULL, command, &security, &security, 
TRUE,
NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd, &si, &pi);
} else {
-   spprintf(&command_with_cmd, 0, "%s /c %s", GetVersion() < 
0x8000
? COMSPEC_NT : COMSPEC_9X, command);
+   if (GetVersion() < 0x8000) {
+   /* Wrap command in quotes and use the /s parameter to 
pass quotes
to the command line. */
+   spprintf(&command_with_cmd, 0, "%s /s /c \"%s\"", 
COMSPEC_NT,
command);
+   } else {
+   spprintf(&command_with_cmd, 0, "%s /c %s", COMSPEC_9X, 
command);
+   }
 
newprocok = CreateProcess(NULL, command_with_cmd, &security,
&security, TRUE, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd,
&si, &pi);
 
http://pastie.caboo.se/84303



[2003-09-02 18:08:10] [EMAIL PROTECTED]

PHP uses "cmd.exe /c" for executing programs under windows.
You can try your examples on command line:

cmd.exe /c "your long command" "another file"

And you'll see it does not work. This is not PHP problem but yet
another windows problem. 

You must always use the '8.3' format of the paths/filenames.





[2003-09-02 11:07:00] sam at freepeers dot com

Description:

Running PHP on Windows 2000 with IIS 5.

Basic program executation does not work in certain cases. 

This is ok:

$output = `C:\executable.exe C:\\file1.txt`;

Now, lets suppose that both the filename and the executable names
contain spaces, and therefore each are to be enclosed in quotes.  Then
it fails:

This is not ok:

$output = `"C:\executable.exe" "C:\\file1.txt"`;

This is ok again:

$output = `C:\executable.exe "C:\\file1.txt"`;

This is also ok:

$output = `"C:\executable.exe" C:\\file1.txt`;

So, the problem arises when BOTH the command and the file are enclosed
in quotes.  In some cases you do need to enclose both the command and
the file in quotes. You will not be able to.

This affects all forms of command execution (exec, system,
backticks...)
  

Reproduce code:
---
1.  Create file called "Test.txt" and put it into C: drive.Put some
random text in it.

2.  Try this code:

";

$output = "";
$output = `"more" C:\\Test.txt`;
echo "Test.txt contains $output.  This works";

$output = "";
$output = `more "C:\\Test.txt"`;
echo "Test.txt contains $output.  This works";

$output = "";
$output = `"more" "C:\\Test.txt"`;
echo "Test.txt contains $output.  This does not works";

?>

Expected result:

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This does not works

Actual result:
--
Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains Contents of file. . This works

Test.txt contains . This does not works





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


#42143 [Asn]: The constant NAN is reported as 0 on Windows build

2007-08-02 Thread pajoye
 ID:   42143
 Updated by:   [EMAIL PROTECTED]
 Reported By:  zoe at uk dot ibm dot com
 Status:   Assigned
 Bug Type: Math related
 Operating System: Windows
 PHP Version:  5CVS-2007-07-30 (snap)
 Assigned To:  edink
 New Comment:

I tried using vc 2k3 and 2k5 and NAN is correctly defined. VC6 seems to
have a different way to define/get/use NAN. Maybe we can rely on
fmod(1,0) instead (always return NaN on windows).


Previous Comments:


[2007-07-31 11:42:49] [EMAIL PROTECTED]

Edin, can you check if there's some problem with the win32 build in
this?



[2007-07-30 08:05:26] zoe at uk dot ibm dot com

Description:

The constant NAN is reported as '0' on the Windows binary downloaded
from the snaps.php.net site. The function is correct on Linux.

A colleague built locally (on Windows) from source and got the correct
value for NAN (ie NAN). We stepped through this code (in
basic_functions.c): 

PHPAPI double php_get_nan(void)
{
#if HAVE_HUGE_VAL_NAN
return HUGE_VAL + -HUGE_VAL;
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) ||
defined(_ALPHA) || defined(__alpha)
double val = 0.0;
((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
((php_uint32*)&val)[0] = 0;
return val;
#elif HAVE_ATOF_ACCEPTS_NAN
return atof("NAN");
#else
return 0.0/0.0;
#endif
}

and found that the local build goes through the first "if" section,
that is, HAVE_HUGE_VAL_NAN is true. We can't step through the Windows
binary we downloaded but guessing that it's not executing the same
section. 

Reproduce code:
---



Expected result:

NAN= float(NAN)

Actual result:
--
NAN= float(0)





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


#41615 [Com]: "Out of memory" errors

2007-08-02 Thread tyb at egon dot gyaloglo dot hu
 ID:   41615
 Comment by:   tyb at egon dot gyaloglo dot hu
 Reported By:  sms at inbox dot ru
 Status:   No Feedback
 Bug Type: Unknown/Other Function
 Operating System: Windows 2000 SP4
 PHP Version:  5.2.3
 New Comment:

I have the same problem.

PHP Fatal error:  Out of memory (allocated 786432) (tried to allocate
393216 bytes)

First time it happens when running a PHPMyAdmin script. After that I
cannot start any php sessions until I restart Apache.

Environment:
Windows Server 2003 SP1
Apache 2.0.58, binary
PHP 5.2.1


Previous Comments:


[2007-06-21 12:19:55] pepegsay at hotmail dot com

I'm not sure if I'm supposed to add this "how I solved this" note but
here goes:

I solved this error by reducing the Apache ThreadsPerChild. We had
threadsperchild rather high at 250 threads, and if you do the math:
64megs X 250 threads you would require 16 gigs of ram if:

1. Apache never restarted on its own
2. Eventually each thread was used for your largest process

Either way our modest 2 gigs was being eaten up. Whereas PHP used to
either no throw an error or not fault it now says "out of memory".

We have reduced ThreadsPerChild to a level that makes sense when you
multiply memory_limit x ThreadsPerChild, with a touch of overhead since
our processes rarely max out or memory limit, and are no longer seeing
this problem.



[2007-06-19 23:45:13] jetmah at gmail dot com

I have the same error in php-5.2.3-Win32, too.



[2007-06-19 01:50:34] jarit at qq dot com

I have the some proplem too. I set memory_limit to 1024M, but it's no
use.
I use:
php 5.2.3-win32
apache 2.2.0

why does the error "out of memory" happen? thinks.



[2007-06-15 01:00:00] 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".



[2007-06-08 21:47:21] pepegsay at hotmail dot com

I think that this is a bug which requires more than a simple script to
reproduce. I am receiving similar results on our, primarily, phpBB site
after upgrading to 5.2.2 today. The sits is running on Windows 2003 and
Apache.

 Out of memory (allocated 1048576) (tried to allocate 393216 bytes) 
 Out of memory (allocated 1048576) (tried to allocate 393216 bytes) 
 Out of memory (allocated 1048576) (tried to allocate 393216 bytes) 
 Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
 Out of memory (allocated 786432) (tried to allocate 393216 bytes) 
 Out of memory (allocated 1310720) (tried to allocate 393216 bytes)

Obviously, I do not have a random amount allocated to memory_limit, and
a ini_get returns the real value which is 32M. We received similar
errors in php 5.1.4 but they were only logged in the Apache logs.



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

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



#42175 [NEW]: feof() fails to detect the end of file

2007-08-02 Thread nikhil dot gupta at in dot ibm dot com
From: nikhil dot gupta at in dot ibm dot com
Operating system: Linux, Win32-xp
PHP version:  5CVS-2007-08-02 (snap)
PHP Bug Type: Filesystem function related
Bug description:  feof() fails to detect the end of file

Description:

feof() is not able to detect the end of file even when the file pointer is
set to EOF using fseek() or any other ways. If we use the sample code
similar to that given in the help docs for feof() on php.net:



The code runs to endless loop as feof donot detect the EOF.

Reproduce code:
---


Expected result:

int(0)
int(0)
int(3)
bool(true)

Actual result:
--
int(0)
int(0)
int(3)
bool(false)

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


#42175 [Opn]: feof() fails to detect the end of file

2007-08-02 Thread nikhil dot gupta at in dot ibm dot com
 ID:   42175
 User updated by:  nikhil dot gupta at in dot ibm dot com
 Reported By:  nikhil dot gupta at in dot ibm dot com
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: Linux, Win32-xp
 PHP Version:  5CVS-2007-08-02 (snap)
 New Comment:

I observed that when I use fgetcsv() to read a file to end, and then
check for EOF, feof() returns true. Hence I suspect the problem is with
fseek() that although it succceeds in taking the file pointer to EOF but
fails to set the EOF flag.


Previous Comments:


[2007-08-02 10:23:45] nikhil dot gupta at in dot ibm dot com

Description:

feof() is not able to detect the end of file even when the file pointer
is set to EOF using fseek() or any other ways. If we use the sample code
similar to that given in the help docs for feof() on php.net:



The code runs to endless loop as feof donot detect the EOF.

Reproduce code:
---


Expected result:

int(0)
int(0)
int(3)
bool(true)

Actual result:
--
int(0)
int(0)
int(3)
bool(false)





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


#42177 [NEW]: Warning "array_merge_recursive(): recursion detected" comes again...

2007-08-02 Thread rl at ez dot no
From: rl at ez dot no
Operating system: linux mandriva 2006
PHP version:  4.4.7
PHP Bug Type: Arrays related
Bug description:  Warning "array_merge_recursive(): recursion detected" comes 
again...

Description:

Just run the code below and please answer the question:
Why those marked as 'warning' generate warning "array_merge_recursive():
recursion detected" while others marked as 'clear' do not?

example 1";
$a1 = array( 'a' => 1, 'b' => 2 );
$az = array_merge_recursive( $a1, $a1 );
unset( $a1, $a2 );

// clear
echo "example 2";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// clear
echo "example 3";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 4";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = $a1;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 5";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = $a2;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 6";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$a2[] = 3; // $a2['c'] = 3; - no matter, warning anyway
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// clear
echo "example 7";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a2[] = 3;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 8";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = $a2;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// warning
echo "example 9";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$a3 = & $a2;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// clear
echo "example 10";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = & $a2;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// warning
echo "example 11";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$a3 = $a2;
$a3[] = 3;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// clear
echo "example 12";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = & $a2;
$a3[] = 3;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

?>


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


#39707 [Com]: Sending more then one parameter to SP will not return output parameters

2007-08-02 Thread aballard at gmail dot com
 ID:   39707
 Comment by:   aballard at gmail dot com
 Reported By:  aspen dot olmsted at alliance dot biz
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Windows XP SP2
 PHP Version:  5.2.0
 Assigned To:  wez
 New Comment:

I believe Bug #42076 is the same as this. I found it first and tacked
my comments there, but as this bug report is earlier and already
assigned, I guess  I should be following this one.


Previous Comments:


[2007-07-23 06:52:00] ydiazc at gmail dot com

On the stores procedures not returned parameter of output or input
output with php pdo and driver ODBC in both cases (sql server and
oracle). 
PDO('odbc:Driver={Microsoft ODBC for Oracle}...
PDO('odbc:Driver={SQL Native Client}...

vote on the bug, is idem for both databases

the parameters of input or input output, They enter without problems to
store procedure, But they do not go out with value of procedure.

help me !!!, I need to use multiple engines.

Thank you for his help



[2006-12-01 18:50:41] aspen dot olmsted at alliance dot biz

The line that says:
 $sth = $dbh->prepare("EXECUTE spReturn_Int ?");
should be:
 $sth = $dbh->prepare("EXECUTE spReturn_Int ?,?");

Sorry when I simplified the example I made this mistake



[2006-12-01 18:00:40] aspen dot olmsted at alliance dot biz

Description:

I am trying to pass output parameters to MSSQL through PDO using the
odbc driver.

If there is just one parameter it works.  If there is more than one it
will not.

There is a sample to send an inout parameter to SQL on the pdo
documentation page I used as a starting place

Reproduce code:
---
SQL:

ALTER PROCEDURE spReturn_Int @err int OUTPUT, @err2 varchar(255)
AS
SET @err = 11

  $sth = $dbh->prepare("EXECUTE spReturn_Int ?");
  $invalue = 'Dog';
  $sth->bindParam(1, $return_value,
PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT);
  $sth->bindParam(2, $invalue, PDO::PARAM_STR);
  $sth->execute();
  print "procedure returned $return_value\n";


Expected result:

It should print "procedure returned 11"

Actual result:
--
It prints "procedure returned 





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


#39707 [Com]: Sending more then one parameter to SP will not return output parameters

2007-08-02 Thread aballard at gmail dot com
 ID:   39707
 Comment by:   aballard at gmail dot com
 Reported By:  aspen dot olmsted at alliance dot biz
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Windows XP SP2
 PHP Version:  5.2.0
 Assigned To:  wez
 New Comment:

I also appear to be unable to retrieve stored procedure return values.

SQL Procedure:
==

CREATE PROCEDURE [dbo].[Write]
@id varchar(255),
@data varchar(4000)
AS

SET NOCOUNT ON

IF EXISTS(SELECT * FROM MyTable WHERE id = @id)
UPDATE MyTable SET
data = @data
WHERE id = @id


ELSE
INSERT INTO MyTable (id, data)
VALUES (@id, @data)

RETURN @@ROWCOUNT
GO


PHP:
===

$stmt = $this->dbHandle->handle()->prepare("EXEC ? =
dbo.WebSession_Write ?, ?");

$stmt->bindParam(1, $return_value,
PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT);
$stmt->bindParam(2, $sessID, PDO::PARAM_STR);
$stmt->bindParam(3, $value, PDO::PARAM_STR);


$stmt->execute();

$stmt = null;

if ($return_value == 1) {
return true;
} else {
return false;
}


Previous Comments:


[2007-08-02 12:28:55] aballard at gmail dot com

I believe Bug #42076 is the same as this. I found it first and tacked
my comments there, but as this bug report is earlier and already
assigned, I guess  I should be following this one.



[2007-07-23 06:52:00] ydiazc at gmail dot com

On the stores procedures not returned parameter of output or input
output with php pdo and driver ODBC in both cases (sql server and
oracle). 
PDO('odbc:Driver={Microsoft ODBC for Oracle}...
PDO('odbc:Driver={SQL Native Client}...

vote on the bug, is idem for both databases

the parameters of input or input output, They enter without problems to
store procedure, But they do not go out with value of procedure.

help me !!!, I need to use multiple engines.

Thank you for his help



[2006-12-01 18:50:41] aspen dot olmsted at alliance dot biz

The line that says:
 $sth = $dbh->prepare("EXECUTE spReturn_Int ?");
should be:
 $sth = $dbh->prepare("EXECUTE spReturn_Int ?,?");

Sorry when I simplified the example I made this mistake



[2006-12-01 18:00:40] aspen dot olmsted at alliance dot biz

Description:

I am trying to pass output parameters to MSSQL through PDO using the
odbc driver.

If there is just one parameter it works.  If there is more than one it
will not.

There is a sample to send an inout parameter to SQL on the pdo
documentation page I used as a starting place

Reproduce code:
---
SQL:

ALTER PROCEDURE spReturn_Int @err int OUTPUT, @err2 varchar(255)
AS
SET @err = 11

  $sth = $dbh->prepare("EXECUTE spReturn_Int ?");
  $invalue = 'Dog';
  $sth->bindParam(1, $return_value,
PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT);
  $sth->bindParam(2, $invalue, PDO::PARAM_STR);
  $sth->execute();
  print "procedure returned $return_value\n";


Expected result:

It should print "procedure returned 11"

Actual result:
--
It prints "procedure returned 





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


#42180 [NEW]: php in fastcgi environment periodicaly get 90% of CPU

2007-08-02 Thread a dot simonov at favoritbet dot com
From: a dot simonov at favoritbet dot com
Operating system: Linux
PHP version:  4.4.7
PHP Bug Type: CGI related
Bug description:  php in fastcgi environment periodicaly get 90% of CPU

Description:

php in fastcgi environment periodicaly get >90% of CPU and >1.5g of
memory

fast-cgi environment:
SPAWNFCGI="/usr/local/bin/spawn-fcgi"
FCGIPROGRAM="/usr/local/bin/php"
FCGIPORT=""
PHP_FCGI_CHILDREN=200
PHP_FCGI_MAX_REQUESTS=2000
FCGI_WEB_SERVER_ADDRS="127.0.0.1"
ALLOWED_ENV="PATH USER"
ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS FCGI_WEB_SERVER_ADDRS"

periodicaly i have in top:
4968 www-data  19   0 1964m 1.4g 149m R 59.0 17.7   1:46.77 php
4856 www-data  17   0 2054m 1.6g 148m R 31.9 17.5   1:59.90 php
4846 www-data  18   0 1316m 1.1g 148m R 26.1 14.8   1:16.63 php
4866 www-data  15   0  153m  14m 149m S  5.5  0.2   0:15.51 php
4788 www-data  15   0  155m  16m 152m S  4.5  0.2   0:11.37 php
4809 www-data  16   0  154m  15m 149m S  4.5  0.2   0:11.07 php
4890 www-data  15   0  153m  13m 148m R  3.5  0.2   0:11.96 php
4870 www-data  16   0  153m  15m 148m S  2.6  0.2   0:12.22 php
7126 www-data  15   0  153m  14m 148m S  2.3  0.2   0:10.43 php
4945 www-data  15   0  152m  13m 148m S  1.9  0.2   0:13.35 php
4986 www-data  15   0  153m  14m 149m S  1.6  0.2   0:14.95 php
4823 www-data  15   0  152m  13m 148m S  1.3  0.2   0:14.64 php
4829 www-data  15   0  153m  13m 149m S  1.3  0.2   0:13.09 php
4879 www-data  15   0  153m  14m 148m S  1.3  0.2   0:17.27 php

strace -p pid shows only next:
mremap(0x2a9f3fa000, 1812733952, 1812733952, MREMAP_MAYMOVE) =
0x2a9f3fa000



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


#41350 [Com]: Error in my_thread_global_end()

2007-08-02 Thread phpuser at gmail dot com
 ID:   41350
 Comment by:   phpuser at gmail dot com
 Reported By:  graham at directhostinguk dot com
 Status:   Assigned
 Bug Type: MySQL related
 Operating System: Windows 2003
 PHP Version:  5.2.3
 Assigned To:  edink
 New Comment:

Please don't forget about php_pdo_mysql.dll!


Previous Comments:


[2007-07-24 10:45:26] [EMAIL PROTECTED]

Assigning to edink since we need to upgrade the bundled MySQL
libraries.



[2007-07-24 10:24:18] nick dot dixon at gmail dot com

I see the same with 5.2.3 on Windows 2000 whenever php_mysql or
php_mysqli (or both) are enabled

So either the fault is in both php_mysql.dll AND php_mysqli.dll, or
it's a problem with the MySQL client library (libmySQL.dll).

Setting mysql.allow_persistent = Off makes no difference.

MySQL version is 5.0.45, with the libmySQL.dll copied to a directory
that's in the PATH (the PHP ext directory)

Minimal test case using PHP cli:
php -v
PHP 5.2.3 (cli) (built: May 31 2007 09:37:22)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Now if I run the CLI and send EOF:

php
^Z
   (...pause of about 6 seconds...)
Error in my_thread_global_end(): 1 threads didn't exit



[2007-07-19 11:16:47] ng dot sick dot no at gmail dot com

Tried the latest CVS snaps today (php5.2-win32-200707120030.zip) with
php5apache22.dll, MySQL 5.0.45 Server on Windows XP, but Apache 2.2.4's
log still shows up:

Error in my_thread_global_end(): 1 threads didn't exit



[2007-07-18 23:27:32] aaronbair at hotmail dot com

CLI and FAST-CGI can not handle persistent MySQL connections.  How can
an unloaded processes remember a connection?

Turn that option off in php.ini and the error goes away.

mysql.allow_persistent = Off

The real problem here is that this option is set On in
php.ini-recommended



[2007-07-13 10:16:00] [EMAIL PROTECTED]

So that we won't forget.
http://server.macvicar.net/patches/php-bug41350.patch



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=41350&edit=1


#42183 [NEW]: classmap cause error in non-wsdl mode

2007-08-02 Thread heitor dot m at gmail dot com
From: heitor dot m at gmail dot com
Operating system: Linux RedHat Enterprise V4
PHP version:  5.2.3
PHP Bug Type: SOAP related
Bug description:  classmap cause error in non-wsdl mode

Description:

Hi,

I was tryning to implement a soap server-cliint in non-wsdl mode but i get
some strange errors. This set o tests is about the class option.
I try to use this option in non-wsdl mode. Like i don't find any explicity
explanatin about the possibility of this use, i has been maked some tests,
and i think tath i found a bug.

When i put the classmap option in the server i have the follow response:

(HTTP) Error Fetching http headers


And when i put the classmap in the client i have no response. The server
offer to me download the called file, but this is a blank archive.


I hav been reported the documentation leak here:
http://bugs.php.net/bug.php?id=42182

i already serach to related bug reports and don't find nothing.

Reproduce code:
---
SERVER:
prop1 = $a;
$this->prop2 = $b;
$this->propc = $c;
}

}

function send($client_builded) 
{

$server_builded = new PHPObject("server_sttuf", 0.3, false);

$arr_params['server_builded'] = $server_builded;
$arr_params['client_builded'] = $client_builded;

return $arr_params;
}

$classmap = array('Object' => 'PHPObject');

$server = new SoapServer(NULL, array('uri' => 'http://ws.sit.com',
'classmap' => $classmap));

$server->addFunction(array("send"));
$server->handle();  

?>

=
Client:
prop1 = $a;
$this->prop2 = $b;
$this->propc = $c;
}

}

try {

$classmap = array('Object' => 'PHPObject');

$client = new SoapClient(NULL, 
array(
'uri' => 'http://ws.sit.com', 
'location' =>
'http://10.11.40.177/developers/heitor/ws/teste2/teste2_ser.php',
'trace' => 1
)
);

$obj = new PHPObject("things", 3.14, TRUE);
$res = $client->__call('send', array(new SoapParam($obj, 'Object')));

echo "SEND";
var_dump($res);
echo "";

echo "RESPONSE";
echo htmlspecialchars(str_replace("><", ">\n<",
$client->__getLastResponse()));
echo "";

} catch (SoapFault $sf) {

echo "";
print_r("(" . $sf->faultcode . ") " . $sf->faultstring);
echo "";

} catch (Exception  $e) { 

echo "";
print_r($e);
echo "";

}

?>

Expected result:

the print of the obects

Actual result:
--
described errors

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


#42177 [Opn]: Warning "array_merge_recursive(): recursion detected" comes again...

2007-08-02 Thread rl at ez dot no
 ID:   42177
 User updated by:  rl at ez dot no
 Reported By:  rl at ez dot no
 Status:   Open
 Bug Type: Arrays related
 Operating System: linux mandriva 2006
 PHP Version:  4.4.7
 New Comment:

let's continue

// clear
echo "example 13";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = array();
$a1 = array_merge_recursive( $a1, $a2 );
$a1 = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 14";
$a1 = array();
$a2 = array( 'key1' => 1, 'key3' => 2 );
$a1 = array_merge_recursive( $a1, $a2 );
$a1 = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

why does example 14 generate a warning while example 13 does not?
seems like if first parameter is empty then function
array_merge_recursive just assigns first parameter variable to the
second one and makes some internal marks about two arrays which point on
the same data but actually are different for a enduser. but second call
of array_merge_recursive does not know anything about it.
or something like that... no matter, but these warnings are definitely
incorrect.


Previous Comments:


[2007-08-02 12:24:08] rl at ez dot no

Description:

Just run the code below and please answer the question:
Why those marked as 'warning' generate warning
"array_merge_recursive(): recursion detected" while others marked as
'clear' do not?

example 1";
$a1 = array( 'a' => 1, 'b' => 2 );
$az = array_merge_recursive( $a1, $a1 );
unset( $a1, $a2 );

// clear
echo "example 2";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// clear
echo "example 3";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 4";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = $a1;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 5";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = $a2;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 6";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$a2[] = 3; // $a2['c'] = 3; - no matter, warning anyway
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// clear
echo "example 7";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a2[] = 3;
$az = array_merge_recursive( $a1, $a2 );
unset( $a1, $a2 );

// warning
echo "example 8";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = $a2;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// warning
echo "example 9";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$a3 = & $a2;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// clear
echo "example 10";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = & $a2;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// warning
echo "example 11";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = $a1;
$a3 = $a2;
$a3[] = 3;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

// clear
echo "example 12";
$a1 = array( 'key1' => 1, 'key3' => 2 );
$a2 = & $a1;
$a3 = & $a2;
$a3[] = 3;
$az = array_merge_recursive( $a1, $a3 );
unset( $a1, $a2, $a3 );

?>






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


#41445 [Csd]: parse_ini_file function has a problem with certain types of integer as sections

2007-08-02 Thread philip
 ID:   41445
 Updated by:   [EMAIL PROTECTED]
 Reported By:  dcox at conxxus dot com
 Status:   Closed
 Bug Type: PHP options/info functions
 Operating System: linux 2.4.32
 PHP Version:  5.2.2
 Assigned To:  tony2001
 New Comment:

FWIW, this bug also exists (and was documented) via:

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

The documentation will be updated to reflect the new fixed behaviour.


Previous Comments:


[2007-06-26 12:10:11] [EMAIL PROTECTED]

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.





[2007-05-19 22:42:46] dcox at conxxus dot com

Description:

I stumbled across this when storing MAC configuration in an INI file.
When the MAC address (length=12) had all numbers and started with "00"
then the MAC would not be stored as a section correctly.

Reproduce code:
---


-- test.ini --
[001099030277]
option1 = yes

[011099030277]
option2 = yes



Expected result:

Array
(
[001099030277] => Array
(
[option1] => 1
)

[011099030277] => Array
(
[option2] => 1
)

)

Actual result:
--
Array
(
[8] => Array
(
[option1] => 1
)

[011099030277] => Array
(
[option2] => 1
)

)





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


#42158 [Opn]: SimpleXMLElement as parameter for preg_match leads to memory leak

2007-08-02 Thread chabrol at vfnm dot de
 ID:   42158
 User updated by:  chabrol at vfnm dot de
 Reported By:  chabrol at vfnm dot de
 Status:   Open
 Bug Type: PCRE related
 Operating System: Linux
 PHP Version:  5CVS-2007-07-31 (snap)
 New Comment:

Same effect with PHP 6.0.0-dev (php6.0-200708021030.tar.bz2)


Previous Comments:


[2007-08-01 07:55:24] chabrol at vfnm dot de

Hello Judas!

In my case it's an long-term running script (using php-cli). So script
shutdown doesn't occur timely. Casting to string looks for me like junst
an workaround because

1) other functions like ereg doesn't have the same problem. Try it
with
ereg("/bar/", $xml->name);
instead of
preg_match("/bar/", $xml->name);

2) if the engine expects an string and therefore cast the value
internally, why should this behave different than casting manually in
sight of memory usage?

Best regards
Daniel Chabrol



[2007-08-01 07:04:26] ibapty at gmail dot com

I can vouch for the workaround based on a similar issue (see
http://bugs.php.net/bug.php?id=41911) I encountered. Unfortunately that
bug got marked as bogus with a similar explaination. 

I accept that in 99% of uses of PHP where script shutdown occurs that
this type of memory leak is acceptable. However, in my case I am using
PHP persistently with the win32service module (php.net/win32service). In
the end I have had to setup a routine to restart the service every few
minutes to workaround this type of memory leak instead of trying to
track them all down.



[2007-07-31 23:04:51] judas dot iscariote at gmail dot com

There is no memory leak, those leaks are reported at script shutdown by
the Zend Engine.

to fix your problem do this

 preg_match("/bar/", (string)$xml->name);


yes, cast it to string.



[2007-07-31 13:19:38] chabrol at vfnm dot de

little imprecision fix: Memory is only increasing until hitting
configured memory if you replace the limited for-loop by a while(true)
...



[2007-07-31 13:13:45] chabrol at vfnm dot de

Description:

If you use a SimpleXMLElement as parameter for preg_match or
preg_match_all, memory is lost.

P.S.: If you cast the parameter explicit with (string)$xml->name memory
usage doesn't increase. So i suppose it's an problem related to internal
casting.

Reproduce code:
---
foo");
for ($i=1; $i<=20; $i++) {
  preg_match("/bar/", $xml->name);
  // or preg_match_all("/bar/", $xml->name, $matches);
  echo "Memory usage after $i iterations: " . memory_get_usage() .
"\n";
}

?>


Expected result:

I would expect an more or less equal memory usage.

Actual result:
--
Memory usage is constantly increasing until hitting configured memory
limit





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


#42184 [NEW]: Object Type mismatch using classmap in WSDL mode

2007-08-02 Thread heitor dot m at gmail dot com
From: heitor dot m at gmail dot com
Operating system: Linux RedHat Enterprise V4
PHP version:  5.2.3
PHP Bug Type: SOAP related
Bug description:  Object Type mismatch using classmap in WSDL mode

Description:

tryning to get the object type that i was specified in classmap option. i
ever get a object of the type stdClass.

I'm expecting to get in this case a instance of the Class PHPObject
previusly declared by me.

I already search for related bug reports and just has found this:
http://bugs.php.net/bug.php?id=42157
thats already closed.

Reproduce code:
---
SERVER(teste_ser.php):
prop1 = $a;
$this->prop2 = $b;
$this->propc = $c;
}
}

function send($arg_obj)
{
$obj = new PHPObject("SERVER_1", "SERVER_2", "SERVER_3");
return $obj;
}

$classmap = array('WSDLObject' => 'PHPObject');

$server = new SoapServer("teste.wsdl", array('classmap' => $classmap));

$server->addFunction(array("send"));

$server->handle();

?>
=
CLIENT(teste_cli.php):
prop1 = $a;
$this->prop2 = $b;
$this->propc = $c;
}
}

try {

$classmap = array('WSDLObject' => 'PHPObject');

$client = new SoapClient("teste.wsdl", array("classmap"  => $classmap,
'trace' => 1));

$arg_obj = new PHPObject("ARG_1", "ARG_2", "ARG_3");

$res = $client->send($arg_obj);

echo "RESPONSE FROM SERVER";
var_dump($res);
echo "";

echo "SOAP RESPONSE";
echo htmlspecialchars(str_replace("><", ">\n<",
$client->__getLastResponse()));
echo "";

} catch (SoapFault $sf) {

echo "";
print_r("(" . $sf->faultcode . ") " . $sf->faultstring);
echo "";

} catch (Exception  $e) { 

echo "";
print_r($e);
echo "";

} 

?>
==
WSDL(teste.wsdl):


http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:tns="http://www.sit.com.br/wsdl"; 
xmlns:soap-env="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://www.w3.org/2003/06/wsdl"; 
xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding"; 
targetNamespace="http://www.sit.com.br/wsdl";>



 















 


  









  



















http://schemas.xmlsoap.org/soap/http"/>



http://schemas.xmlsoap.org/soap/encoding/";
namespace="urn:Types" use="literal" />


http://schemas.xmlsoap.org/soap/encoding/";
namespace="urn:Types" use="literal" />








Web-Services para operaes matematicas

http://10.11.40.177/developers/heitor/ws/teste/teste_ser.php"/>






Expected result:

RESPONSE FROM SERVER

object(PHPObject)[3]
  public 'prop1' => string 'SERVER_1' (length=8)
  public 'prop2' => string 'SERVER_2' (length=8)
  public 'propc' => string 'SERVER_3' (length=8)
  [methods list]

SOAP RESPONSE


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>


SERVER_1
SERVER_2
SERVER_3






Actual result:
--
RESPONSE FROM SERVER

object(stdClass)[3]
  public 'prop1' => string 'SERVER_1' (length=8)
  public 'prop2' => string 'SERVER_2' (length=8)
  public 'propc' => string 'SERVER_3' (length=8)

SOAP RESPONSE


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>


SERVER_1
SERVER_2
SERVER_3






-- 
Edit bug report at http://bugs.php.net/?id=42184&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42184&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42184&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42184&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42184&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42184&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42184&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42184&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42184&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42184&r=support
Expected behavior:http://bugs.php.net/fix.php?id=42184&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42184&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/f

#42185 [NEW]: Apache-2.2.4 crashes on graceful/restart

2007-08-02 Thread artiom at hotbox dot ru
From: artiom at hotbox dot ru
Operating system: Freebes 6.0
PHP version:  5.2.3
PHP Bug Type: Apache2 related
Bug description:  Apache-2.2.4 crashes on graceful/restart

Description:

The same thing as the bug #27810. Now on apache 2.2.4 and php 5.2.3.

Reproduce code:
---
- Install apache-2.2.4
- Compile php-5.2.3 with PCRE support using apxs
- run apachectl start
- run apachectl restart or apachectl graceful and apache will die

Expected result:

If I remove the PCRE extention, it works normally.


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


#42186 [NEW]: json_decode() won't work with \l

2007-08-02 Thread djlopez at gmx dot de
From: djlopez at gmx dot de
Operating system: All
PHP version:  5.2.3
PHP Bug Type: Unknown/Other Function
Bug description:  json_decode() won't work with \l

Description:

json_decode() returns nothing, when the string contains an \l (lowercase
L), maybe (internal) crash!?

Reproduce code:
---
$json = '{"stringwithbreak":"line with a \lbreak!"}';
print_r(json_decode($json, true));


Expected result:

print_r() is NOT returning anything, json_decode() seems to be not
executed.

Actual result:
--
Could be "solved" this way:

print_r(json_decode(str_replace("\\l", "", $json), true));
However, it's a bug...

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


#42173 [Opn->Csd]: Query with "INTERVAL DAY TO SECOND" returns false

2007-08-02 Thread sixd
 ID:   42173
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Closed
 Bug Type: OCI8 related
 Operating System: n/a
 PHP Version:  6CVS-2007-08-02 (CVS)
 Assigned To:  sixd
 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.

The fixes were applied to PHP5 and PHP6.


Previous Comments:


[2007-08-02 05:29:51] [EMAIL PROTECTED]

Third issue is that the output from oci_field_type() for a TIMESTAMP
WITH TIMEZONE column should be changed from TIMESTAMP_TZ to TIMESTAMP
WITH TIMEZONE to match standard terminology.



[2007-08-02 05:23:20] [EMAIL PROTECTED]

Description:

Queries for INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND work in
PHP5, but the latter returns a null value in PHP6 with
unicode.semantics=On due to the outcol storage size being too short.

A second issue with PHP5 and PHP6 is that oci_field_type() doesn't know
these two types nor the type TIMESTAMP WITH LOCAL TIMEZONE.







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


#42187 [NEW]: (null): unable to initialize module

2007-08-02 Thread mike dot kloc at reuters dot com
From: mike dot kloc at reuters dot com
Operating system: Windows 2003 Server SP2
PHP version:  5.2.3
PHP Bug Type: PHP options/info functions
Bug description:  (null): unable to initialize module

Description:

Installed PHP 5.2.3 to connect to MySQL server using PHPmyAdmin. This is
under IIS 6.  Everything works fine but when the system is restarted, the
console displays 4 errors boxes:

Unknown(): (null): Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20020429, debug=0, thread-safety=1
These options need to match

I installed from the MSI file and do not have any other versions  or
modules loaded.  The only modules added as part of the install are MySQL
and Multi-Byte String.  Is there anything I can do to resolve this or is it
a bug?

Reproduce code:
---
n/a

Expected result:

n/a

Actual result:
--
n/a

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


#42187 [Opn->Bgs]: (null): unable to initialize module

2007-08-02 Thread pajoye
 ID:   42187
 Updated by:   [EMAIL PROTECTED]
 Reported By:  mike dot kloc at reuters dot com
-Status:   Open
+Status:   Bogus
 Bug Type: PHP options/info functions
 Operating System: Windows 2003 Server SP2
 PHP Version:  5.2.3
 New Comment:

Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20020429, debug=0, thread-safety=1
 

The API dates differ. You are trying to load a module compiled for a
given version php using another (5.2.3). You certainly left some old
extension dll from the old install/php versions.

not a bug > bogus.


Previous Comments:


[2007-08-02 19:17:21] mike dot kloc at reuters dot com

Description:

Installed PHP 5.2.3 to connect to MySQL server using PHPmyAdmin. This
is under IIS 6.  Everything works fine but when the system is restarted,
the console displays 4 errors boxes:

Unknown(): (null): Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20020429, debug=0, thread-safety=1
These options need to match

I installed from the MSI file and do not have any other versions  or
modules loaded.  The only modules added as part of the install are MySQL
and Multi-Byte String.  Is there anything I can do to resolve this or is
it a bug?

Reproduce code:
---
n/a

Expected result:

n/a

Actual result:
--
n/a





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


#42185 [Opn->Fbk]: Apache-2.2.4 crashes on graceful/restart

2007-08-02 Thread jani
 ID:   42185
 Updated by:   [EMAIL PROTECTED]
 Reported By:  artiom at hotbox dot ru
-Status:   Open
+Status:   Feedback
 Bug Type: Apache2 related
 Operating System: Freebes 6.0
 PHP Version:  5.2.3
 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:


[2007-08-02 18:38:46] artiom at hotbox dot ru

Description:

The same thing as the bug #27810. Now on apache 2.2.4 and php 5.2.3.

Reproduce code:
---
- Install apache-2.2.4
- Compile php-5.2.3 with PCRE support using apxs
- run apachectl start
- run apachectl restart or apachectl graceful and apache will die

Expected result:

If I remove the PCRE extention, it works normally.






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


#42188 [NEW]: session_start segfaults with Apache 2

2007-08-02 Thread h dot fietz at dezem dot de
From: h dot fietz at dezem dot de
Operating system: Gentoo 2006.1
PHP version:  5.2.3
PHP Bug Type: Reproducible crash
Bug description:  session_start segfaults with Apache 2

Description:

PHP crashes ("Child pid xxx exit signal segmentation fault" in Apache's
error_log) on calling session_start().

Environment:
AMD Opteron 146 (64bit)
Gentoo Linux 2006.1
Apache 2.0.58
PHP 5.2.3 from portage ebuild

Reproduce code:
---
";
?>


Expected result:

session starts

Actual result:
--
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46971518093328 (LWP 26146)]
0x2ab8688ac430 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x2ab8688ac430 in strlen () from /lib/libc.so.6
#1  0x2ab86a81c934 in zif_session_encode () from
/usr/lib64/apache2/modules/libphp5.so
#2  0x2ab86a81efc5 in php_session_start () from
/usr/lib64/apache2/modules/libphp5.so
#3  0x2ab86a81f8b9 in zif_session_start () from
/usr/lib64/apache2/modules/libphp5.so
#4  0x2ab86a975512 in execute () from
/usr/lib64/apache2/modules/libphp5.so
#5  0x2ab86a9660d3 in execute () from
/usr/lib64/apache2/modules/libphp5.so
#6  0x2ab86a94715d in zend_execute_scripts () from
/usr/lib64/apache2/modules/libphp5.so
#7  0x2ab86a905b18 in php_execute_script () from
/usr/lib64/apache2/modules/libphp5.so
#8  0x2ab86a9c5dbd in php_ap2_register_hook () from
/usr/lib64/apache2/modules/libphp5.so
#9  0x00426d69 in ap_run_handler ()
#10 0x00429c62 in ap_invoke_handler ()
#11 0x00424d38 in ap_process_request ()
#12 0x0041fd30 in _start ()


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


#42187 [Bgs->Csd]: (null): unable to initialize module

2007-08-02 Thread mike dot kloc at reuters dot com
 ID:   42187
 User updated by:  mike dot kloc at reuters dot com
 Reported By:  mike dot kloc at reuters dot com
-Status:   Bogus
+Status:   Closed
 Bug Type: PHP options/info functions
 Operating System: Windows 2003 Server SP2
 PHP Version:  5.2.3
 New Comment:

Found that HP System Monitoring Homepage utility had php4ts.dll under
its modules folder and that was causing conflict with PHP 5.  I renamed
that file and no errors occur.


Previous Comments:


[2007-08-02 19:21:17] [EMAIL PROTECTED]

Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20020429, debug=0, thread-safety=1
 

The API dates differ. You are trying to load a module compiled for a
given version php using another (5.2.3). You certainly left some old
extension dll from the old install/php versions.

not a bug > bogus.



[2007-08-02 19:17:21] mike dot kloc at reuters dot com

Description:

Installed PHP 5.2.3 to connect to MySQL server using PHPmyAdmin. This
is under IIS 6.  Everything works fine but when the system is restarted,
the console displays 4 errors boxes:

Unknown(): (null): Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20020429, debug=0, thread-safety=1
These options need to match

I installed from the MSI file and do not have any other versions  or
modules loaded.  The only modules added as part of the install are MySQL
and Multi-Byte String.  Is there anything I can do to resolve this or is
it a bug?

Reproduce code:
---
n/a

Expected result:

n/a

Actual result:
--
n/a





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


#42189 [NEW]: xmlrpc_set_type crashes php

2007-08-02 Thread giunta dot gaetano at gmail dot com
From: giunta dot gaetano at gmail dot com
Operating system: windows xp or 2000
PHP version:  5.2.3
PHP Bug Type: XMLRPC-EPI related
Bug description:  xmlrpc_set_type crashes php

Description:

Trying to cast a non-iso8601 conforming string to an xmlrpc datetime
object crashes php.
This happens if the characters in position 0 to 6 are too high in the
ascii table, presumably moving the converted date too far away in the
future

This is repro with php 447 and 523

Note that it 'might' be the same bug as #22468 (the cause looks the same
allright), with the difference that you get corrupted data on gentoo, and a
core dump on winblows...

Reproduce code:
---


Expected result:

false

Actual result:
--
CRASH'N'BURN

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


#29150 [Csd]: Roman number format for months

2007-08-02 Thread ataols at latnet dot lv
 ID:   29150
 User updated by:  ataols at latnet dot lv
 Reported By:  ataols at latnet dot lv
 Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: Gentoo Linux
 PHP Version:  4.3.7
 Assigned To:  derick
 New Comment:

I still can not find it in the date() function manual. What's happen,
is it included or not?


Previous Comments:


[2005-06-20 09:34:43] [EMAIL PROTECTED]

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.

Fixed for PHP 5.1.



[2004-07-14 16:38:28] [EMAIL PROTECTED]

Assigning to myself, i will have a look at this for my new datetime
stuff.



[2004-07-14 16:11:33] ataols at latnet dot lv

It is good enough, but not for this case. It's not a problem to write a
conversion function, I can do (and I already did)it myself. But, for
example, if I need to store different time formats choosed by users, the
formats with Arabic months' numbers I can store just a parametter for
those functions, but for Roman monnt's numbers I need an additional
conversion function. I think, it is better to integrate such possibility
in "date", "strftime" and similar functions. It is the sense of these
functions to have an ability to output the date in any popular format,
and the months output with Roman numbers is popular enough to be
included.



[2004-07-14 16:11:27] ataols at latnet dot lv

It is good enough, but not for this case. It's not a problem to write a
conversion function, I can do (and I already did)it myself. But, for
example, if I need to store different time formats choosed by users, the
formats with Arabic months' numbers I can store just a parametter for
those functions, but for Roman monnt's numbers I need an additional
conversion function. I think, it is better to integrate such possibility
in "date", "strftime" and similar functions. It is the sense of these
functions to have an ability to output the date in any popular format,
and the months output with Roman numbers is popular enough to be
included.



[2004-07-14 16:02:01] [EMAIL PROTECTED]

Isn't http://pear.php.net/package/Numbers_Roman good enough for you?
Another argument would be, that strftime is modelled after the
c-function.




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

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


#42143 [Asn]: The constant NAN is reported as 0 on Windows build

2007-08-02 Thread stas
 ID:   42143
 Updated by:   [EMAIL PROTECTED]
 Reported By:  zoe at uk dot ibm dot com
 Status:   Assigned
 Bug Type: Math related
 Operating System: Windows
 PHP Version:  5CVS-2007-07-30 (snap)
 Assigned To:  edink
 New Comment:

Saw a bug under msvc2005 that can be related to this - get_nan()
function produced FP exception. Weird thing is that it happens only if
engine is started, shut down and then started again inside the same
process. Maybe has something to do with some kind of floating point.
Using PHP_DOUBLE_QUIET_NAN_HIGH instead seems to fix the problem. 


Previous Comments:


[2007-08-02 09:47:42] [EMAIL PROTECTED]

I tried using vc 2k3 and 2k5 and NAN is correctly defined. VC6 seems to
have a different way to define/get/use NAN. Maybe we can rely on
fmod(1,0) instead (always return NaN on windows).



[2007-07-31 11:42:49] [EMAIL PROTECTED]

Edin, can you check if there's some problem with the win32 build in
this?



[2007-07-30 08:05:26] zoe at uk dot ibm dot com

Description:

The constant NAN is reported as '0' on the Windows binary downloaded
from the snaps.php.net site. The function is correct on Linux.

A colleague built locally (on Windows) from source and got the correct
value for NAN (ie NAN). We stepped through this code (in
basic_functions.c): 

PHPAPI double php_get_nan(void)
{
#if HAVE_HUGE_VAL_NAN
return HUGE_VAL + -HUGE_VAL;
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) ||
defined(_ALPHA) || defined(__alpha)
double val = 0.0;
((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
((php_uint32*)&val)[0] = 0;
return val;
#elif HAVE_ATOF_ACCEPTS_NAN
return atof("NAN");
#else
return 0.0/0.0;
#endif
}

and found that the local build goes through the first "if" section,
that is, HAVE_HUGE_VAL_NAN is true. We can't step through the Windows
binary we downloaded but guessing that it's not executing the same
section. 

Reproduce code:
---



Expected result:

NAN= float(NAN)

Actual result:
--
NAN= float(0)





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


#42185 [Com]: Apache-2.2.4 crashes on graceful/restart

2007-08-02 Thread judas dot iscariote at gmail dot com
 ID:   42185
 Comment by:   judas dot iscariote at gmail dot com
 Reported By:  artiom at hotbox dot ru
 Status:   Feedback
 Bug Type: Apache2 related
 Operating System: Freebes 6.0
 PHP Version:  5.2.3
 New Comment:

not reproducible with apache 2.2.4 , php 5_2 CVS and PCRE 7.2 on linux.


Previous Comments:


[2007-08-02 19:39:58] [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.






[2007-08-02 18:38:46] artiom at hotbox dot ru

Description:

The same thing as the bug #27810. Now on apache 2.2.4 and php 5.2.3.

Reproduce code:
---
- Install apache-2.2.4
- Compile php-5.2.3 with PCRE support using apxs
- run apachectl start
- run apachectl restart or apachectl graceful and apache will die

Expected result:

If I remove the PCRE extention, it works normally.






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


#42191 [NEW]: Multiple SOAP Calls Fail in WSDL Mode

2007-08-02 Thread jsinglet at gmail dot com
From: jsinglet at gmail dot com
Operating system: Mac OS X 10.4.10
PHP version:  5.2.3
PHP Bug Type: SOAP related
Bug description:  Multiple SOAP Calls Fail in WSDL Mode

Description:

Multiple calls from a PHP-based SOAPClient to a PHP-based SOAPServer 
fail. When you make even two using the same client handle, the call 
fails with the error: 

PHP Warning:  SoapClient::__doRequest(): 7168 bytes of buffered data 
lost during stream conversion! 




Reproduce code:
---
THE SERVER CODE

$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
ini_set("soap.wsdl_cache_enabled", 0);

$s = new SoapServer('MyWS.wsdl');
$s->setClass('ClientService');
$s->handle();

CLIENT CLODE

ini_set("soap.wsdl_cache_enabled", 0);

$client = new SoapClient('MyWS.wsdl',
array("classmap"=>array("NewClient"=>"NewClient")));

$result = $client->getNewClient();
//SECOND CALL CREATES WARNING
$result = $client->getNewClient();




Expected result:

The script should run with no errors or warnings.

Actual result:
--
PHP Warning:  SoapClient::__doRequest(): 7168 bytes of buffered data 
lost during stream conversion! in /Users/../test.php

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


#42192 [NEW]: PHP Variable $_GET not correct filled from HTTP Request

2007-08-02 Thread michael dot gautschi at gmx dot ch
From: michael dot gautschi at gmx dot ch
Operating system: Windows
PHP version:  5.2.3
PHP Bug Type: URL related
Bug description:  PHP Variable $_GET not correct filled from HTTP Request

Description:

pi.php contains only phpinfo();

When called with 'http://localhost/pi.php?file=%2520B.txt', the value of
'_GET["file"]' is '%20B.txt'. Expected was '%2520B.txt'. 

Reproduce code:
---
pi.php contains only phpinfo();

When called with 'http://localhost/pi.php?file=%2520B.txt', the value of
'_GET["file"]' is '%20B.txt'. Expected was '%2520B.txt'. 

Expected result:

'$_GET["file"]' is '%2520B.txt'

Actual result:
--
'$_GET["file"]' is '%20B.txt'

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


#42192 [Opn->Bgs]: PHP Variable $_GET not correct filled from HTTP Request

2007-08-02 Thread jani
 ID:   42192
 Updated by:   [EMAIL PROTECTED]
 Reported By:  michael dot gautschi at gmx dot ch
-Status:   Open
+Status:   Bogus
 Bug Type: URL related
 Operating System: Windows
 PHP Version:  5.2.3
 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.




Previous Comments:


[2007-08-02 22:46:48] michael dot gautschi at gmx dot ch

Description:

pi.php contains only phpinfo();

When called with 'http://localhost/pi.php?file=%2520B.txt', the value
of '_GET["file"]' is '%20B.txt'. Expected was '%2520B.txt'. 

Reproduce code:
---
pi.php contains only phpinfo();

When called with 'http://localhost/pi.php?file=%2520B.txt', the value
of '_GET["file"]' is '%20B.txt'. Expected was '%2520B.txt'. 

Expected result:

'$_GET["file"]' is '%2520B.txt'

Actual result:
--
'$_GET["file"]' is '%20B.txt'





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


#42188 [Opn->Fbk]: session_start segfaults with Apache 2

2007-08-02 Thread jani
 ID:   42188
 Updated by:   [EMAIL PROTECTED]
 Reported By:  h dot fietz at dezem dot de
-Status:   Open
+Status:   Feedback
-Bug Type: Reproducible crash
+Bug Type: Session related
 Operating System: Gentoo 2006.1
 PHP Version:  5.2.3
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi




Previous Comments:


[2007-08-02 20:03:12] h dot fietz at dezem dot de

Description:

PHP crashes ("Child pid xxx exit signal segmentation fault" in Apache's
error_log) on calling session_start().

Environment:
AMD Opteron 146 (64bit)
Gentoo Linux 2006.1
Apache 2.0.58
PHP 5.2.3 from portage ebuild

Reproduce code:
---
";
?>


Expected result:

session starts

Actual result:
--
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46971518093328 (LWP 26146)]
0x2ab8688ac430 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x2ab8688ac430 in strlen () from /lib/libc.so.6
#1  0x2ab86a81c934 in zif_session_encode () from
/usr/lib64/apache2/modules/libphp5.so
#2  0x2ab86a81efc5 in php_session_start () from
/usr/lib64/apache2/modules/libphp5.so
#3  0x2ab86a81f8b9 in zif_session_start () from
/usr/lib64/apache2/modules/libphp5.so
#4  0x2ab86a975512 in execute () from
/usr/lib64/apache2/modules/libphp5.so
#5  0x2ab86a9660d3 in execute () from
/usr/lib64/apache2/modules/libphp5.so
#6  0x2ab86a94715d in zend_execute_scripts () from
/usr/lib64/apache2/modules/libphp5.so
#7  0x2ab86a905b18 in php_execute_script () from
/usr/lib64/apache2/modules/libphp5.so
#8  0x2ab86a9c5dbd in php_ap2_register_hook () from
/usr/lib64/apache2/modules/libphp5.so
#9  0x00426d69 in ap_run_handler ()
#10 0x00429c62 in ap_invoke_handler ()
#11 0x00424d38 in ap_process_request ()
#12 0x0041fd30 in _start ()






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


#42194 [NEW]: $argc/$argv[] won't work when .php extension is assigned to php.exe

2007-08-02 Thread backbone46 at gmail dot com
From: backbone46 at gmail dot com
Operating system: Windows XP
PHP version:  6CVS-2007-08-03 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description:  $argc/$argv[] won't work when .php extension is assigned to 
php.exe

Description:

I did a right-click->open-with->chose-program->browsed to php.exe
Checked the "Always use the selected program to open this kind of file"
OK

So launched the following line in the console
C:\>script.php 1arg 2arg 3arg

Reproduce code:
---


Expected result:

Arguments:4

Actual result:
--
Arguments:1

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


#42143 [Asn]: The constant NAN is reported as 0 on Windows build

2007-08-02 Thread pajoye
 ID:   42143
 Updated by:   [EMAIL PROTECTED]
 Reported By:  zoe at uk dot ibm dot com
 Status:   Assigned
 Bug Type: Math related
 Operating System: Windows
 PHP Version:  5CVS-2007-07-30 (snap)
 Assigned To:  edink
 New Comment:

Little notice about VC6, using it with the very last SDK works. I'm not
sure which SDK is used on our win32 build box. It may be a platform sdk
bug more than a VC bug. Edin, can you try to upgrade the SDK (if we can
upgrade it:)?


Previous Comments:


[2007-08-02 22:27:25] [EMAIL PROTECTED]

Saw a bug under msvc2005 that can be related to this - get_nan()
function produced FP exception. Weird thing is that it happens only if
engine is started, shut down and then started again inside the same
process. Maybe has something to do with some kind of floating point.
Using PHP_DOUBLE_QUIET_NAN_HIGH instead seems to fix the problem. 



[2007-08-02 09:47:42] [EMAIL PROTECTED]

I tried using vc 2k3 and 2k5 and NAN is correctly defined. VC6 seems to
have a different way to define/get/use NAN. Maybe we can rely on
fmod(1,0) instead (always return NaN on windows).



[2007-07-31 11:42:49] [EMAIL PROTECTED]

Edin, can you check if there's some problem with the win32 build in
this?



[2007-07-30 08:05:26] zoe at uk dot ibm dot com

Description:

The constant NAN is reported as '0' on the Windows binary downloaded
from the snaps.php.net site. The function is correct on Linux.

A colleague built locally (on Windows) from source and got the correct
value for NAN (ie NAN). We stepped through this code (in
basic_functions.c): 

PHPAPI double php_get_nan(void)
{
#if HAVE_HUGE_VAL_NAN
return HUGE_VAL + -HUGE_VAL;
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) ||
defined(_ALPHA) || defined(__alpha)
double val = 0.0;
((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
((php_uint32*)&val)[0] = 0;
return val;
#elif HAVE_ATOF_ACCEPTS_NAN
return atof("NAN");
#else
return 0.0/0.0;
#endif
}

and found that the local build goes through the first "if" section,
that is, HAVE_HUGE_VAL_NAN is true. We can't step through the Windows
binary we downloaded but guessing that it's not executing the same
section. 

Reproduce code:
---



Expected result:

NAN= float(NAN)

Actual result:
--
NAN= float(0)





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