#45979 [NEW]: Select and Delete Mysql

2008-09-03 Thread d dot durieux at siprossii dot com
From: d dot durieux at siprossii dot com
Operating system: FreeBSD 7.0 AMD64
PHP version:  5.2.6
PHP Bug Type: MySQL related
Bug description:  Select and Delete Mysql

Description:

There is a problem when I select a line in mysql table and afet I delete
it.


Reproduce code:
---
It works : 
$sql = 'SELECT * FROM sous_domaine WHERE id=10 ';
$req = mysql_query($sql) or die('Erreur SQL
!br'.$sql.'br'.mysql_error()); 
while($data = mysql_fetch_assoc($req)) {
 echo $data['id'];
}
$sql2 = 'DELETE FROM sous_domaine WHERE id=10 ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!br'.$sql2.'br'.mysql_error());

It don't work : 

$sql = 'SELECT * FROM sous_domaine WHERE id='.$_GET['id'].' ';
$req = mysql_query($sql) or die('Erreur SQL
!br'.$sql.'br'.mysql_error()); 
while($data = mysql_fetch_assoc($req)) {
 echo $data['id'];
}
$sql2 = 'DELETE FROM sous_domaine WHERE id='.$_GET['id'].' ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!br'.$sql2.'br'.mysql_error());

Expected result:

In first case (it works) : I see the id get in mysql and it delete it
after

In second case (it don't work) : I don't see id get in mysql. It's like if
it delete it first and after select.

I have not error in php log.


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



#45979 [Com]: Select and Delete Mysql

2008-09-03 Thread d dot durieux at siprossii dot com
 ID:   45979
 Comment by:   d dot durieux at siprossii dot com
 Reported By:  d dot durieux at siprossii dot com
 Status:   Open
 Bug Type: MySQL related
 Operating System: FreeBSD 7.0 AMD64
 PHP Version:  5.2.6
 New Comment:

It's on FreeBSD 7.0 i386 and not AMD64


Previous Comments:


[2008-09-03 06:28:11] d dot durieux at siprossii dot com

Description:

There is a problem when I select a line in mysql table and afet I
delete it.


Reproduce code:
---
It works : 
$sql = 'SELECT * FROM sous_domaine WHERE id=10 ';
$req = mysql_query($sql) or die('Erreur SQL
!br'.$sql.'br'.mysql_error()); 
while($data = mysql_fetch_assoc($req)) {
 echo $data['id'];
}
$sql2 = 'DELETE FROM sous_domaine WHERE id=10 ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!br'.$sql2.'br'.mysql_error());

It don't work : 

$sql = 'SELECT * FROM sous_domaine WHERE id='.$_GET['id'].' ';
$req = mysql_query($sql) or die('Erreur SQL
!br'.$sql.'br'.mysql_error()); 
while($data = mysql_fetch_assoc($req)) {
 echo $data['id'];
}
$sql2 = 'DELETE FROM sous_domaine WHERE id='.$_GET['id'].' ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!br'.$sql2.'br'.mysql_error());

Expected result:

In first case (it works) : I see the id get in mysql and it delete it
after

In second case (it don't work) : I don't see id get in mysql. It's like
if it delete it first and after select.

I have not error in php log.






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



#45979 [Opn-Bgs]: Select and Delete Mysql

2008-09-03 Thread tularis
 ID:   45979
 Updated by:   [EMAIL PROTECTED]
 Reported By:  d dot durieux at siprossii dot com
-Status:   Open
+Status:   Bogus
 Bug Type: MySQL related
 Operating System: FreeBSD 7.0 AMD64
 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.




Previous Comments:


[2008-09-03 06:30:38] d dot durieux at siprossii dot com

It's on FreeBSD 7.0 i386 and not AMD64



[2008-09-03 06:28:11] d dot durieux at siprossii dot com

Description:

There is a problem when I select a line in mysql table and afet I
delete it.


Reproduce code:
---
It works : 
$sql = 'SELECT * FROM sous_domaine WHERE id=10 ';
$req = mysql_query($sql) or die('Erreur SQL
!br'.$sql.'br'.mysql_error()); 
while($data = mysql_fetch_assoc($req)) {
 echo $data['id'];
}
$sql2 = 'DELETE FROM sous_domaine WHERE id=10 ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!br'.$sql2.'br'.mysql_error());

It don't work : 

$sql = 'SELECT * FROM sous_domaine WHERE id='.$_GET['id'].' ';
$req = mysql_query($sql) or die('Erreur SQL
!br'.$sql.'br'.mysql_error()); 
while($data = mysql_fetch_assoc($req)) {
 echo $data['id'];
}
$sql2 = 'DELETE FROM sous_domaine WHERE id='.$_GET['id'].' ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!br'.$sql2.'br'.mysql_error());

Expected result:

In first case (it works) : I see the id get in mysql and it delete it
after

In second case (it don't work) : I don't see id get in mysql. It's like
if it delete it first and after select.

I have not error in php log.






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



#35345 [Com]: SQLite won't load (specified module not found)

2008-09-03 Thread niz_reez4 at yahoo dot com
 ID:   35345
 Comment by:   niz_reez4 at yahoo dot com
 Reported By:  csaba at alum dot mit dot edu
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: Win XP Pro
 PHP Version:  5CVS-2005-11-23 (snap)
 Assigned To:  wez
 New Comment:

?php

//create table
if(file_exists(test.db)) {
$weNeedToCreateTheDatabase = false;
} else {
$weNeedToCreateTheDatabase = true;

}

//create or open database
$db = sqlite_open(test.db) or die(failed to open/create the
database);

//create table
if($weNeedToCreateTheDatabase) {
sqlite_query($db, CREATE TABLE Members(FirstName,LastName));
}

//add info
sqlite_query($db,INSERT INTO Members VALUES ('Jim', 'Rockerton'));

//get info
$dt = sqlite_query($db, SELECT * FROM Members);
while ($row = sqlite_fetch_array($dt)) {
echo row: $row[FirstName] $row[LastName]br/;
}

//close database
sqlite_close($db);

?


Previous Comments:


[2007-05-24 10:59:57] scriper at mail dot ru

Well, when i upgraded from 5.1.6 i've saved my php.ini, now i have
replaced it with php.ini.recommended from 5.2.2 dist, uncommented
modules and everything goes ok.



[2007-05-24 10:26:32] scriper at mail dot ru

Well, after copying php_pdo.dll and php_sqlite.dll to c:/php i have
another warning coming: Cannot load module 'SQLite' because required
module 'pdo' is not loaded



[2007-05-24 09:50:35] scriper at mail dot ru

Actually i have the same problem. I've have win xp sp2,php 5.2.2 and
apache 2.2.4. In my php.ini i've uncommented:
extension php_pdo.dll
extension php_pdo_mysql.dll
extension php_pdo_sqlite.dll
extension php_pdo_sqlite_external.dll
extension=php_sqlite.dll
I checked ext dir, it contains all of that. After restarting apache,
and give a request for example http://localhost/index.php i get a
Warning:
PHP Startup: Unable to load dynamic library
'C:/php/ext/php_sqlite.dll'- The specified module could not be found.



[2007-05-06 23:43:02] kunalspunjabi at yahoo dot com

I am seeing the following error when I add the following lines to my
php.ini file:
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_sqlite.dll

I then restarted Apache and invoked PHP from the command line:

$ php
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program
Files\PHP\ext\php_sqlite.dll' - The specified module could not be
found.
 in Unknown on line 0


My PHP extensions directory contains all these DLLs, apparently
php_sqlite.dll is the only one that does not load. Why?



[2007-02-08 18:45:21] sazzad_10 at yahoo dot com

how to solve this problem?

Fatal error: Call to undefined function sqlite_open() in
c:\webs\test\testSqlite.php5 on line 13

what i did, In php.ini you must uncomment the line:
extension=php_sqlite.dll and above it, add the line:
extension=php_pdo.dll Then, restart apache and reload the page

But till now same masses Fatal error: Call to undefined function
sqlite_open() in c:\webs\test\testSqlite.php5 on line 13 can you help me
plc.



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

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



#39010 [Com]: create_function leaks memory

2008-09-03 Thread laysoft at gmail dot com
 ID:   39010
 Comment by:   laysoft at gmail dot com
 Reported By:  djgrrr at gmail dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.1.6
 New Comment:

My reproduction code:

?

ini_set('display_errors',TRUE);
ini_set('memory_limit','2M');
error_reporting(E_ALL);

for ($i=0;$i3;$i++) {
$func=create_function('$m','return($m);');
unset($func);
echo '. ';
}

echo 'h1OK/h1';

?

It breaks with Fatal error: Allowed memory size of 2097152 bytes 
exhausted... error. Is there any way, to solve this problem?


Previous Comments:


[2006-10-01 15:29:35] djgrrr at gmail dot com

Description:

The PHP version is actually Irrelevant

If you use create_function many times in a script to make lambda
functions, it will use more and more memory.

Now, I know that this is the expected result, but it would be really
good to have a function like free_function or delete_function that could
be used to remove the lambda functions, and free up the memory they
use.

Obviously this function would have to be limited to only lambda
function, and it not be possible to use it on normal functions.

Personally, I think this is VERY essential to the CLI version of PHP as
many CLI PHP programs do not often restart, but keep running, simply
rehashing its config and any modules (using lambda functions)






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



#33693 [Com]: mssql uniqueidentifier in select crashes php

2008-09-03 Thread steveh at brendata dot co dot uk
 ID:   33693
 Comment by:   steveh at brendata dot co dot uk
 Reported By:  r dot vanicek at seznam dot cz
 Status:   No Feedback
 Bug Type: Sybase-ct (ctlib) related
 Operating System: Linux (Debian 3.1)
 PHP Version:  4.4.0
 New Comment:

This is still an issue on the php 5.2.1, is it intended to fix this?


Previous Comments:


[2007-09-27 10:50:41] walter at wjd dot nu

You need tds version 7.0 for the bug to rear it's head.

E.g. by tds version = 7.0 in /etc/freetds/freetds.conf or with
TDSVER=7.0 environment variable.
(The 7.0 version transmits UCS-2 instead of ASCII which is used with
4.2) 

I'd really like this fixed, because I need 7.0 for working UTF8 support
(with NVARCHARs in my database).

When PHP is run from an apache module and the bug occurs, apache fails
to serve (crashes?) any page that uses sybase-connections!


#--
# Versions
#--
PHP 5.2.0-8+etch7 (cli) (built: Jul  2 2007 21:46:15)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

#--
# Output of my own test code using SELECT *
#--
$ TDSVER=4.2 php test2.php
Success!
$ TDSVER=7.0 php test2.php
error_handler: Data-conversion resulted in overflow.
Segmentation fault (core dumped)



[2007-07-12 21:41:58] shiftlessways at hotmail dot com

This bug still seems to exist in current php 5 and 6 snapshots.

I don't know how exactly there is not enough info in the original post
but while the provided patch does fix the problem and work perfectly,
patching php may not be an option. So altering your sql to cast the id
value into a varchar before it is returned can be used as a workaround
untill this ever gets fixed.



[2005-07-26 01:00:05] 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.



[2005-07-18 02:37:25] [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.






[2005-07-14 10:53:46] r dot vanicek at seznam dot cz

Description:

I am connecting from PHP to Sybase and MSSQL. I have sybase-ct
extension enabled. I use freetds-0.63. When I select from MSSQL any
column of type uniqueidentifier, PHP crashes on fetch.

The problem is conversion. Sybase-ct module does not handle
CS_UNIQUE_TYPE,  and tries to store the 38 byte string that freetds
returns to it into 16 byte string. Freetds refuses to do so and signals
an error, which is probably fatal.

Test suite: see reproduce code.

The solution I suggest is to intoduce CS_UNIQUE_TYPE into
php_sybase_ct.c, function php_sybase_fetch_result_set for example like
this:

case CS_DECIMAL_TYPE:
result-datafmt[i].maxlength = 
result-datafmt[i].precision + 3;
/* numeric(10) vs numeric(10, 1) */
result-numerics[i] = (result-datafmt[i].scale 
== 0) ? 3 : 2;
break;
case CS_UNIQUE_TYPE:
result-datafmt[i].maxlength = 38;
result-numerics[i] = 0;
break;
default:
result-datafmt[i].maxlength++;
result-numerics[i] = 0;
break;



This solution works for me quite well.


Reproduce code:
---
create table TEST (a int, b varchar, c uniqueidentifier);
insert into TEST values (1,'hello',newid());

sybase_connect( srv, uid, pwd );
sybase_select_db( dbname );

// this works fine
$res = sybase_query( select a,b from TEST );
$row = sybase_fetch_array( $res );

// this crashes
$res = sybase_query( select a,b,c from TEST );
$row = sybase_fetch_array( $res );

It is all the same if you use mssql_ functions instead of sybase_
functions.


Expected result:

eg. row containing
1
'hello'
'EB668095-F85D-4C59-A202-120C5CE1B65'

Actual result:
--
crash, in Apache error.log I see this:

[notice] child pid 

#33693 [NoF-Fbk]: mssql uniqueidentifier in select crashes php

2008-09-03 Thread pajoye
 ID:   33693
 Updated by:   [EMAIL PROTECTED]
 Reported By:  r dot vanicek at seznam dot cz
-Status:   No Feedback
+Status:   Feedback
 Bug Type: Sybase-ct (ctlib) related
 Operating System: Linux (Debian 3.1)
 PHP Version:  4.4.0
 New Comment:

Can you try using the latest 5.2.x and 5.3.0 snapshot?


Previous Comments:


[2008-09-03 09:45:14] steveh at brendata dot co dot uk

This is still an issue on the php 5.2.1, is it intended to fix this?



[2007-09-27 10:50:41] walter at wjd dot nu

You need tds version 7.0 for the bug to rear it's head.

E.g. by tds version = 7.0 in /etc/freetds/freetds.conf or with
TDSVER=7.0 environment variable.
(The 7.0 version transmits UCS-2 instead of ASCII which is used with
4.2) 

I'd really like this fixed, because I need 7.0 for working UTF8 support
(with NVARCHARs in my database).

When PHP is run from an apache module and the bug occurs, apache fails
to serve (crashes?) any page that uses sybase-connections!


#--
# Versions
#--
PHP 5.2.0-8+etch7 (cli) (built: Jul  2 2007 21:46:15)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

#--
# Output of my own test code using SELECT *
#--
$ TDSVER=4.2 php test2.php
Success!
$ TDSVER=7.0 php test2.php
error_handler: Data-conversion resulted in overflow.
Segmentation fault (core dumped)



[2007-07-12 21:41:58] shiftlessways at hotmail dot com

This bug still seems to exist in current php 5 and 6 snapshots.

I don't know how exactly there is not enough info in the original post
but while the provided patch does fix the problem and work perfectly,
patching php may not be an option. So altering your sql to cast the id
value into a varchar before it is returned can be used as a workaround
untill this ever gets fixed.



[2005-07-26 01:00:05] 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.



[2005-07-18 02:37:25] [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.






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

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



#45978 [Bgs]: round() errors.

2008-09-03 Thread johannes
 ID:   45978
 Updated by:   [EMAIL PROTECTED]
 Reported By:  firealwaysworks at gmail dot com
 Status:   Bogus
 Bug Type: Math related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

It's the CPU which is broken, read the link provided.


Previous Comments:


[2008-09-03 05:50:33] firealwaysworks at gmail dot com

Cool,  but this is still an inconsistency.  Any string value of the
number is treated is differently then when passed to round().   This is
still a very serious problem for us because we are storing all of this
information in a SQL database,  the number will be lost when we build
the query. 

I think you'll tell me that you don't care if people loose money when
they use your platform and that you'll tell me to use someone Else's
code,  like BC Math.   I think that relying on 3rd party extensions to
fix your mistakes is unprofessional.

Peace



[2008-09-03 05:16:45] [EMAIL PROTECTED]

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about floats and what IEEE
754 is, read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.

The result of 21.33*1.015 is stored as slightly less than 21.64995
(21.6499497 on my Windows system), different than when you write
the literal static value. The result of 21.33*1.015 when printing it
(happens differently than round() function, so results may vary) or
rounding 5-14 decimal places, those extra internal 9s are rolled over.



[2008-09-03 02:09:39] firealwaysworks at gmail dot com

Description:

In this example the multiplication of two floats yields a number with 5
significant figures.  The round() function incorrectly handles this
number only when it is working with the answer to a mathematical
operation.  It is important to note that the round() function is working
properly for static values. 

I found this because I am writing financial software in PHP.   I have
absolutely no doubt that this bug would cause our company to loose
money.

Reproduce code:
---
print 21.33*1.015.br;
print round(21.33*1.015,2).br;
print round(21.33*1.015,4).br;
print round(21.64995,4);

Expected result:

21.64995
21.65
21.65
21.65

Actual result:
--
21.64995
21.65
21.6499
21.65





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



#45980 [NEW]: Detect MAC Address With PHP

2008-09-03 Thread lalit774 at gmail dot com
From: lalit774 at gmail dot com
Operating system: Linux and windows 
PHP version:  5.2.6
PHP Bug Type: Unknown/Other Function
Bug description:  Detect MAC Address With PHP 

Description:

 Is there some way can detect MAC address with PHP?

 http://www.itracs.edmissions.com/mac_test.php

 

I want trace the mac address of every visitor on my web site.

I there any method exists? 

Reproduce code:
---
location = rtrim(/sbin/arp -a );
exec(location, output);
echo 'pre';
print_r(output);
exit;

Expected result:

mac address of client pc who access the my site.


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



#45980 [Opn-Bgs]: Detect MAC Address With PHP

2008-09-03 Thread derick
 ID:   45980
 Updated by:   [EMAIL PROTECTED]
 Reported By:  lalit774 at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Linux and windows
 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.

(And no, you can't).


Previous Comments:


[2008-09-03 12:20:43] lalit774 at gmail dot com

Description:

 Is there some way can detect MAC address with PHP?

 http://www.itracs.edmissions.com/mac_test.php

 

I want trace the mac address of every visitor on my web site.

I there any method exists? 

Reproduce code:
---
location = rtrim(/sbin/arp -a );
exec(location, output);
echo 'pre';
print_r(output);
exit;

Expected result:

mac address of client pc who access the my site.






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



#45981 [NEW]: function escapeshellarg excessively quotes single quotes

2008-09-03 Thread jeroen at asystance dot nl
From: jeroen at asystance dot nl
Operating system: debian linux
PHP version:  5.2CVS-2008-09-03 (snap)
PHP Bug Type: Unknown/Other Function
Bug description:  function escapeshellarg excessively quotes single quotes

Description:

escapeshellarg inserts single quotes (') before and after an escaped
single quote

I observed the bug in 5.2.6-3 and the php5.3-200809031030 CVS snapshot

Reproduce code:
---
?php
echo escapeshellarg(single ' quote) . \n;
echo escapeshellarg('single \' quote') . \n;
?

Expected result:

'single \' quote'
'single \' quote'

Actual result:
--
'single '\'' quote'
'single '\'' quote'

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



#45982 [NEW]: The constant crash at start mysql_close(constant) from function

2008-09-03 Thread skonev at september dot ru
From: skonev at september dot ru
Operating system: GNU/Linux Ubuntu 8.04.1
PHP version:  5.2.6
PHP Bug Type: Variables related
Bug description:  The constant crash at start mysql_close(constant) from 
function

Description:

1. Constant LINK is set. 
2. In a file login.php before function auth I check that constant LINK
exists: 
resource (4) of type (mysql link) 
3. Function auth from a file login.php is started. 
4. In the function beginning I check that constant LINK exists: resource
(4) of type (mysql link)
5. I close connection mysql_close(LINK);
6. After mysql_close(LINK) I check that constant LINK exists: 
a constant is damaged: resource (4) of type (Unknown).

Reproduce code:
---
configdb.php
define ('DBHOST', localhost);
define ('DBUSER', root);
define ('DBPASSWORD', x);
define ('DBNAME', base1);
define ('LINK', mysql_connect(DBHOST, DBUSER,DBPASSWORD));


login.php
var_dump(LINK); // resource(4) of type (mysql link)
if (isset($_POST[confirmForm])  !empty($_POST[confirmForm])){
auth($_POST[nameForm], $_POST[passwordForm]);}
var_dump(LINK);// resource(4) of type (Unknown)


lib.php
function auth($name, $password){
var_dump(LINK); // resource(4) of type (mysql link)
$query = select count(*) from Names where name='$name' and
password=MD5('$password');
$result=mysql_query($query, LINK);
$row=mysql_fetch_array($result);
  resource(4) of type (mysql link)
mysql_close(LINK);
var_dump(LINK);// resource(4) of type (Unknown)}


Expected result:

I want that constant LINK did not change after mysql_close(LINK).
I want that after run mysql_close(LINK): resource(4) of type (mysql link)

Actual result:
--
resource(4) of type (Unknown) 

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



#45983 [NEW]: strval() on float values sometimes gives invalid output

2008-09-03 Thread ivoras at gmail dot com
From: ivoras at gmail dot com
Operating system: FreeBSD
PHP version:  5.2.6
PHP Bug Type: Scripting Engine problem
Bug description:  strval() on float values sometimes gives invalid output

Description:

Calling strval() on certain floating point numbers (not all) on FreeBSD
sometimes inexplicably truncates or rounds the result. Checked on both
FreeBSD 6.3 and 7.0. Works fine in Linux.

Reproduce code:
---
?php
$v = 4867.8;
echo strval($v);
?


Expected result:

4867.8

Actual result:
--
4867

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



#45981 [Opn-Bgs]: function escapeshellarg excessively quotes single quotes

2008-09-03 Thread pajoye
 ID:   45981
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jeroen at asystance dot nl
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: debian linux
 PHP Version:  5.2CVS-2008-09-03 (snap)
 New Comment:

How is it supposed to know that the string argument is already
escaped?

What is done in your example is not different than:

print_r(escapeshellarg(escapeshellarg(single ' quote)));

Not a bug.


Previous Comments:


[2008-09-03 13:05:10] jeroen at asystance dot nl

Description:

escapeshellarg inserts single quotes (') before and after an escaped
single quote

I observed the bug in 5.2.6-3 and the php5.3-200809031030 CVS snapshot

Reproduce code:
---
?php
echo escapeshellarg(single ' quote) . \n;
echo escapeshellarg('single \' quote') . \n;
?

Expected result:

'single \' quote'
'single \' quote'

Actual result:
--
'single '\'' quote'
'single '\'' quote'





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



#45983 [Opn]: Is interaction between strval() and precision setting in php.ini intended?

2008-09-03 Thread ivoras at gmail dot com
 ID:   45983
 User updated by:  ivoras at gmail dot com
-Summary:  strval() on float values sometimes gives invalid
   output
 Reported By:  ivoras at gmail dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: FreeBSD
 PHP Version:  5.2.6
 New Comment:

Addition to the bug report: I tracked the issue down to the precision
setting in php.ini. When set to 4, when strval() receives a number
with 4 digits to the left of the decimal point, the output will only be
a string og 4 digits. E.g. strval(1001.1) returns 1001. The
documentation for precision setting says:


  precision  integer
The number of significant digits displayed in floating point
numbers. 


It doesn't mention strval() (and strval() manual page doesn't mention
precision) and it's a bit ambiguous.

(the behaviour is the same on Linux and FreeBSD).


Previous Comments:


[2008-09-03 13:32:03] ivoras at gmail dot com

Description:

Calling strval() on certain floating point numbers (not all) on FreeBSD
sometimes inexplicably truncates or rounds the result. Checked on both
FreeBSD 6.3 and 7.0. Works fine in Linux.

Reproduce code:
---
?php
$v = 4867.8;
echo strval($v);
?


Expected result:

4867.8

Actual result:
--
4867





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



#45982 [Opn-Bgs]: The constant crash at start mysql_close(constant) from function

2008-09-03 Thread johannes
 ID:   45982
 Updated by:   [EMAIL PROTECTED]
 Reported By:  skonev at september dot ru
-Status:   Open
+Status:   Bogus
 Bug Type: Variables related
 Operating System: GNU/Linux Ubuntu 8.04.1
 PHP Version:  5.2.6
 New Comment:

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

You're keeping a constant version of the resource pointer, resources in
constants aren't really supported.


Previous Comments:


[2008-09-03 13:15:35] skonev at september dot ru

Description:

1. Constant LINK is set. 
2. In a file login.php before function auth I check that constant
LINK exists: 
resource (4) of type (mysql link) 
3. Function auth from a file login.php is started. 
4. In the function beginning I check that constant LINK exists:
resource (4) of type (mysql link)
5. I close connection mysql_close(LINK);
6. After mysql_close(LINK) I check that constant LINK exists: 
a constant is damaged: resource (4) of type (Unknown).

Reproduce code:
---
configdb.php
define ('DBHOST', localhost);
define ('DBUSER', root);
define ('DBPASSWORD', x);
define ('DBNAME', base1);
define ('LINK', mysql_connect(DBHOST, DBUSER,DBPASSWORD));


login.php
var_dump(LINK); // resource(4) of type (mysql link)
if (isset($_POST[confirmForm])  !empty($_POST[confirmForm])){
auth($_POST[nameForm], $_POST[passwordForm]);}
var_dump(LINK);// resource(4) of type (Unknown)


lib.php
function auth($name, $password){
var_dump(LINK); // resource(4) of type (mysql link)
$query = select count(*) from Names where name='$name' and
password=MD5('$password');
$result=mysql_query($query, LINK);
$row=mysql_fetch_array($result);
  resource(4) of type (mysql link)
mysql_close(LINK);
var_dump(LINK);// resource(4) of type (Unknown)}


Expected result:

I want that constant LINK did not change after mysql_close(LINK).
I want that after run mysql_close(LINK): resource(4) of type (mysql
link)

Actual result:
--
resource(4) of type (Unknown) 





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



#45976 [Asn]: SPL fails to load if simplexml is not loaded

2008-09-03 Thread development at domain51 dot com
 ID:   45976
 User updated by:  development at domain51 dot com
 Reported By:  development at domain51 dot com
 Status:   Assigned
 Bug Type: SPL related
 Operating System: OS X
 PHP Version:  5.3CVS-2008-09-02 (CVS)
 Assigned To:  helly
 New Comment:

Just my two cents: I agree with Johannes here.  If SimpleXMLIterator is

the only requirement on SimpleXML, I would definitely move that to the

SimpleXML extension and give SimpleXML a dependency on SPL - a 
dependency that should never fail as SPL is always on in versions = 
5.3.


Previous Comments:


[2008-09-02 23:49:40] [EMAIL PROTECTED]

No, the behavior is wrong, the configure system should fail not create
an invalid build.

The question is: Should we enforce the availability of SimpleXML or
not? Without too much thinking I tend to say no, and thinking a bit more
I'm wondering if it makes sense to move SimpleXMLIterator from SPL to
SimpleXML then we could get rid of that dependency. Marcus, what's your
opinion on this?



[2008-09-02 23:40:33] development at domain51 dot com

The problem is that SimpleXML should not be something that can be 
disabled if it is required for SPL and SPL can not be disabled.  This 
will break all manner of debian packages that compile with
--disable-all 
used.



[2008-09-02 23:20:34] [EMAIL PROTECTED]

What exactly is bugged about this according to you?

SPL requires simpleXML, which you explicitly disallow. Seems pretty
straightforward to me? enable simpleXML and SPL will load just fine
again.



[2008-09-02 16:52:18] development at domain51 dot com

Description:

When the SimpleXML extension is not loaded, SPL fails to load.

Reproduce code:
---
$ ./configure --disable-simplexml  make  make install
$ php -v

Expected result:

PHP 5.3.0alpha3-dev (cli) (built: Sep  2 2008 11:09:22) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies


Actual result:
--
PHP Warning:  Cannot load module 'SPL' because required module
'simplexml' is not loaded in Unknown on line 0
PHP 5.3.0alpha3-dev (cli) (built: Sep  2 2008 11:09:22) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies






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



#45984 [NEW]: make fails with AC_SYS_LARGEFILE

2008-09-03 Thread jhuckaby at gmail dot com
From: jhuckaby at gmail dot com
Operating system: Fedora Core 6
PHP version:  5.2.6
PHP Bug Type: Compile Failure
Bug description:  make fails with AC_SYS_LARGEFILE

Description:

In order to support 64-bit files in PHP, I was instructed by crrodriguez
at suse dot de to do the following:

You dont pass D_FILE_OFFSET_BITS=64 directly, but add AC_SYS_LARGEFILE to
configure.in then run ./buildconf --force and rebuild PHP.

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

Following these instructions, I got the following error from `make`:

/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c: In function 'zif_posix_uname':
/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c:471: error: 'struct utsname' has no member 
named 'domainname'
make: *** [ext/posix/posix.lo] Error 1

It should be noted that if I add --disable-all --disable-cgi to the
./configure then this works perfectly.  It compiles, installs and 64-bit
files work flawlessly.  But a bare bones PHP will not suffice, as I need
several modules compiled in.

Reproduce code:
---
echo AC_SYS_LARGEFILE  configure.in
./buildconf --force

./configure --with-apache=../apache_1.3.39 --prefix=/ipix/php --with-
config-file-path=/ipix/php/lib

make





Expected result:

I expected the 'make' to complete without errors, as it does when I add
--disable-all --disable-cgi.


Actual result:
--
/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c: In function 'zif_posix_uname':
/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c:471: error: 'struct utsname' has no member 
named 'domainname'
make: *** [ext/posix/posix.lo] Error 1


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



#45985 [NEW]: touch() opened file

2008-09-03 Thread david at grudl dot com
From: david at grudl dot com
Operating system: Windows XP SP3
PHP version:  5.3.0alpha2
PHP Bug Type: Filesystem function related
Bug description:  touch() opened file

Description:

Opened file can be touched in Windows succefully, but under PHP 5.3 alpha
2 it generates error message 'Utime failed'. I think error is caused by new
function win32_utime() in tsrm_virtual_cwd.c called from virtual_utime().



Reproduce code:
---
$f = fopen('test.dat', 'r');
touch('test.dat');
fclose($f);

Expected result:

modification time of file test.dat is updated

Actual result:
--
Warning: touch(): Utime failed: Bad file descriptor

or

Warning: touch(): Utime failed: No such file or directory

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



#45986 [NEW]: rename() generates Bad file descriptor

2008-09-03 Thread david at grudl dot com
From: david at grudl dot com
Operating system: Windows XP SP3
PHP version:  5.3.0alpha2
PHP Bug Type: Filesystem function related
Bug description:  rename() generates Bad file descriptor

Description:

Renaming of non-existent file generates in PHP 5.2.6 warning:

   Warning: rename(foo,bar) [function.rename]: No such file or directory 

And in PHP 5.3.0 alpha2 it generates warning:

   Warning: rename(foo,bar): Bad file descriptor

I am not sure, but maybe this points to any hidden bug in renaming
routine...


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



#45985 [Opn-Asn]: touch() opened file

2008-09-03 Thread pajoye
 ID:   45985
 Updated by:   [EMAIL PROTECTED]
 Reported By:  david at grudl dot com
-Status:   Open
+Status:   Assigned
 Bug Type: Filesystem function related
 Operating System: Windows XP SP3
 PHP Version:  5.3.0alpha2
-Assigned To:  
+Assigned To:  pajoye


Previous Comments:


[2008-09-03 16:52:56] david at grudl dot com

Description:

Opened file can be touched in Windows succefully, but under PHP 5.3
alpha 2 it generates error message 'Utime failed'. I think error is
caused by new function win32_utime() in tsrm_virtual_cwd.c called from
virtual_utime().



Reproduce code:
---
$f = fopen('test.dat', 'r');
touch('test.dat');
fclose($f);

Expected result:

modification time of file test.dat is updated

Actual result:
--
Warning: touch(): Utime failed: Bad file descriptor

or

Warning: touch(): Utime failed: No such file or directory





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



#45986 [Opn-Asn]: rename() generates Bad file descriptor

2008-09-03 Thread pajoye
 ID:   45986
 Updated by:   [EMAIL PROTECTED]
 Reported By:  david at grudl dot com
-Status:   Open
+Status:   Assigned
 Bug Type: Filesystem function related
 Operating System: Windows XP SP3
 PHP Version:  5.3.0alpha2
-Assigned To:  
+Assigned To:  pajoye


Previous Comments:


[2008-09-03 17:02:39] david at grudl dot com

Description:

Renaming of non-existent file generates in PHP 5.2.6 warning:

   Warning: rename(foo,bar) [function.rename]: No such file or
directory 

And in PHP 5.3.0 alpha2 it generates warning:

   Warning: rename(foo,bar): Bad file descriptor

I am not sure, but maybe this points to any hidden bug in renaming
routine...






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



#45987 [NEW]: Problem in paths that have backslashes

2008-09-03 Thread masiena at hotmail dot com
From: masiena at hotmail dot com
Operating system: Windows Server 2003
PHP version:  5.3CVS-2008-09-03 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  Problem in paths that have backslashes

Description:

On Windows, directives that have backslashes (\) in file paths are
broken.
When something like \t is seen (like in error_log=c:\temp\err.log), it's
interpreted like a control sequence (in the example, a tab), and no error
logs are generated. This behavior is present in many directives relative to
file paths.
Solution (temporary?): use forward slashes instead (even in Windows).
The same is valid for PHP 6.
This is a PATH problem because, where error_log=syslog is used, the
messages are correctly sent to Event Viewer.
Another clue: phpinfo() output eats \t.

Reproduce code:
---
In PHP.INI:

error_log = D:\Progs\php\temp\Logs\php5.3_error_log.txt
include_path = .;D:\Progs\php\include
etc.


Expected result:

No error logs are generated.


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



#45987 [Opn-Fbk]: Problem in paths that have backslashes

2008-09-03 Thread pajoye
 ID:   45987
 Updated by:   [EMAIL PROTECTED]
 Reported By:  masiena at hotmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: Windows Server 2003
 PHP Version:  5.3CVS-2008-09-03 (snap)
 New Comment:

Try without the double quotes in php.ini or use / as path separator.

\x is used as special characters in double quotes string, nothing new
here. \t is a tab, \n a new line, etc.


Previous Comments:


[2008-09-03 19:54:17] masiena at hotmail dot com

Description:

On Windows, directives that have backslashes (\) in file paths are
broken.
When something like \t is seen (like in error_log=c:\temp\err.log),
it's interpreted like a control sequence (in the example, a tab), and no
error logs are generated. This behavior is present in many directives
relative to file paths.
Solution (temporary?): use forward slashes instead (even in Windows).
The same is valid for PHP 6.
This is a PATH problem because, where error_log=syslog is used, the
messages are correctly sent to Event Viewer.
Another clue: phpinfo() output eats \t.

Reproduce code:
---
In PHP.INI:

error_log = D:\Progs\php\temp\Logs\php5.3_error_log.txt
include_path = .;D:\Progs\php\include
etc.


Expected result:

No error logs are generated.






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



#37319 [Com]: MySQL server has gone away, with PDO::ATTR_PERSISTENT = true

2008-09-03 Thread arsukdeo at technocorp dot com
 ID:   37319
 Comment by:   arsukdeo at technocorp dot com
 Reported By:  j8859 at clix dot pt
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: Linux Slackware 10.2
 PHP Version:  5.1.3
 Assigned To:  wez
 New Comment:

Sep 03, 2008:

This problem might not be specific to a given version of linux, but
with respect to the nature of the web server handles processes with
PDO.
 
I have a client running:  php 5.1.6 on centos (Linux -.-.-
2.6.18-92.1.6.el5 i686)with apache 2.0 and the MySQL server has gone
away problem still occurs.

Interestingly, I developed a core framework with the necessary db
access code using PDO on XP with IIS and I did not see a problem until
I tried to run the code on centos.  The access code uses ATTR_PERSISTENT
set to true.

At the moment, I haven't found the triggering mechanism.  The client's
server was standalone and there was no load on it.

In any case, this is a real problem that requires investigation and it
should be fixed ASAP.


Previous Comments:


[2006-12-12 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.



[2006-12-04 15:12:36] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2006-05-28 10:59:30] j8859 at clix dot pt

After applying your suggestion, the problem didn't occur again.
Anyway, I guess this should only be a temporary solution, isn't it?



[2006-05-26 13:41:26] j8859 at clix dot pt

Apparently the problem stopped occurring.
I'll see what happens in the next days.
Anyway, the solution you suggest 
-- $db-setAttribute(PDO::ATTR_EMULATE_PREPARES, true); --
is it a temporary or a definitive one?



[2006-05-24 22:27:14] [EMAIL PROTECTED]

Try following the tips here:
http://netevil.org/node.php?uuid=444a6017-0548-2459-2943-44a601714d58



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

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



#45988 [NEW]: usort assumes comparison operation is transitive

2008-09-03 Thread php at sameprecision dot org
From: php at sameprecision dot org
Operating system: irrelevant
PHP version:  5.2.6
PHP Bug Type: Arrays related
Bug description:  usort assumes comparison operation is transitive

Description:

Using usort, not all pairs of elements are compared.  If a comparison
operation is not transitive, this leads to unexpected ordering, even though
every pair of elements are comparable.
This should probably be mentioned in the documentation.


Reproduce code:
---
//goal: sort $array so that an element is not a substring of any
subsequent elements

$array = array('aa','b','a');

//if $a is a substring of $b, return 1.  Else return -1
function compare($a,$b){
   return strpos($b,$a)===false ? -1 : 1;
}


usort($array,'compare');

print_r($array);

Expected result:

Array ( [0] = aa [1] = b [2] = a )

Actual result:
--
Array ( [0] = a [1] = b [2] = aa )


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



#45984 [Opn-Csd]: make fails with AC_SYS_LARGEFILE

2008-09-03 Thread jhuckaby at gmail dot com
 ID:   45984
 User updated by:  jhuckaby at gmail dot com
 Reported By:  jhuckaby at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: Compile Failure
 Operating System: Fedora Core 6
 PHP Version:  5.2.6
 New Comment:

This issue is not reproducible with Fedora 9.  This is apparently an 
incompatibility issue with the old C libraries that ship with Fedora 
Core 6.  I am closing this bug.


Previous Comments:


[2008-09-03 16:03:21] jhuckaby at gmail dot com

Description:

In order to support 64-bit files in PHP, I was instructed by
crrodriguez at suse dot de to do the following:

You dont pass D_FILE_OFFSET_BITS=64 directly, but add AC_SYS_LARGEFILE
to configure.in then run ./buildconf --force and rebuild PHP.

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

Following these instructions, I got the following error from `make`:

/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c: In function 'zif_posix_uname':
/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c:471: error: 'struct utsname' has no member 
named 'domainname'
make: *** [ext/posix/posix.lo] Error 1

It should be noted that if I add --disable-all --disable-cgi to the
./configure then this works perfectly.  It compiles, installs and 64-bit
files work flawlessly.  But a bare bones PHP will not suffice, as I need
several modules compiled in.

Reproduce code:
---
echo AC_SYS_LARGEFILE  configure.in
./buildconf --force

./configure --with-apache=../apache_1.3.39 --prefix=/ipix/php --with-
config-file-path=/ipix/php/lib

make





Expected result:

I expected the 'make' to complete without errors, as it does when I add
--disable-all --disable-cgi.


Actual result:
--
/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c: In function 'zif_posix_uname':
/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c:471: error: 'struct utsname' has no member 
named 'domainname'
make: *** [ext/posix/posix.lo] Error 1






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



#45942 [Opn-Csd]: D_FILE_OFFSET_BITS=64 causes PHP to run at half speed

2008-09-03 Thread jhuckaby at gmail dot com
 ID:   45942
 User updated by:  jhuckaby at gmail dot com
 Reported By:  jhuckaby at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: Performance problem
 Operating System: Fedora Core 6
 PHP Version:  5.2.6
 New Comment:

This can be solved by using AC_SYS_LARGEFILE and a more modern
operating 
system (tested with Mac OS X 10.5 and Fedora 9).  Apparently Fedora
Core 
6 is too old to support the flag.  I am closing this bug.


Previous Comments:


[2008-08-29 21:30:35] jhuckaby at gmail dot com

I should have also noted, this same error happens with 5.2.4 stable, 
5.2.6 stable, and the CVS daily snapshot build for Aug 29, 2008.



[2008-08-29 21:27:01] jhuckaby at gmail dot com

Wait, I spoke too soon!  Please don't close the bug yet.  As soon as I

removed the --disable-all --disable-cgi ./configure command-line 
options, I got this build error from the make step:

/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c: In function 'zif_posix_uname':
/home/jhuckaby/dev/3rdparty/source/apache-1.3/php-
5.2.7/ext/posix/posix.c:471: error: 'struct utsname' has no member 
named 'domainname'
make: *** [ext/posix/posix.lo] Error 1

I didn't add any new command-line options, I simply removed the --
disable-all --disable-cgi.

./configure --with-apache=../apache_1.3.39 --prefix=/ipix/php --with-
config-file-path=/ipix/php/lib  --disable-all --disable-cgi

Any ideas?

Should I file this under a separate bug?



[2008-08-29 20:28:04] jhuckaby at gmail dot com

Okay, I followed your instructions.  I added AC_SYS_LARGEFILE to
configure.in, then ran ./buildconf --force.  Then I followed with
./configure..., make, and make install.  I found the following output
from ./configure of interest:

checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown

Anyway, it compiled clean and installed.  And it seems to work
correctly, writing 2GB large files without error AND the interpreter
speed is fast!  Thanks!

[EMAIL PROTECTED] php-5.2.6]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 310
[EMAIL PROTECTED] php-5.2.6]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 311
[EMAIL PROTECTED] php-5.2.6]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 312
[EMAIL PROTECTED] php-5.2.6]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 306
[EMAIL PROTECTED] php-5.2.6]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 311

I guess we can close this bug!



[2008-08-29 19:03:20] crrodriguez at suse dot de

You dont pass D_FILE_OFFSET_BITS=64 directly, but add

AC_SYS_LARGEFILE

to configure.in then run ./buildconf --force and rebuild PHP.

BTW.. it is known that large file support may not work currenlty with
PHP.



[2008-08-28 21:20:42] jhuckaby at gmail dot com

Good idea.

CFLAGS=-D_FILE_OFFSET_BITS=64 ./configure --disable-all --disable-
cgi --with-apache=../apache_1.3.39 --prefix=/ipix/php --with-config-
file-path=/ipix/php/lib

[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 157
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 157
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 156

./configure --disable-all --disable-cgi --with-apache=../apache_1.3.39

--prefix=/ipix/php --with-config-file-path=/ipix/php/lib

[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 285
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 293
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 289
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 298
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 287
[EMAIL PROTECTED] buildscripts]# /ipix/php/bin/php ~/benchmark.php 
CPU Benchmark: 293
[EMAIL PROTECTED] 

#44973 [Com]: SimpleXMLElement doesn't read attributes if xml nodes has a value

2008-09-03 Thread zircote at zircote dot com
 ID:   44973
 Comment by:   zircote at zircote dot com
 Reported By:  norbert_schuetz at bigfoot dot com
 Status:   Verified
 Bug Type: SimpleXML related
 Operating System: Linux 2.6.18-5-686
 PHP Version:  5.2.6
 New Comment:

PHP Versions:
 * Windows / php 5.2.5 (WAMP 5)
 

 
  WSDL Description of the object ***
s:complexType mixed=true name=ProductDescription
s:annotation
s:documentation One of several 
possible descriptions for this
product. A
product description has a type 
and a text description. The text
is in the
body of this element. 
/s:documentation
/s:annotation
s:attribute name=t type=s:int
s:annotation
s:documentationProduct types 
are 1, 2 and 3./s:documentation
/s:annotation
/s:attribute
/s:complexType

soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
soap:Body
descriptions
pd t=2Sharp XL-DK255 Hi-Fi System/pd
pd t=3Micro System 100W - CD Player/pd
pd t=1Sharp XL-DK255 Hi-Fi System 100W - CD Player/pd
pd t=0Stylish compact and powerful.../pd
/descriptions
/soap:Body
/soap:Envelope


$client = new SoapClient($wsdl);

print_r( $client-Search(SearchRequest $searchRequest));

 [descriptions] = stdClass Object ( 
 [pd] = Array ( 
 [0] = stdClassObject ( [t] = 2 ) 
 [1] = stdClass Object ( [t] = 3 ) 
 [2] = stdClass Object ( [t] = 1 ) 
 [3] = stdClass Object ( [t] = 0 ) ) 
 )


Previous Comments:


[2008-06-24 14:21:35] thomas dot sarlandie at backelite dot com

We have encountered the same problem.

PHP Versions:
 * Windows / php 5.2.5 (WAMP 5)
 * MacOSX php 5.2.5 (OsX 10.5.3)
 * PHP 5.1.2 (linux/ubuntu edgy)

This is our test case:

?php
//XML string
$xml = '?xml version=1.0 encoding=UTF-8?
a last=1214311502
b
c name=xxx a=negatif
valeur type=points444/valeur
evo type=%1.10/evo
/c
/b
/a';

// XML Parsing
$object_xml = simplexml_load_string($xml);

echo pre;
print_r($object_xml);
echo /pre;
?

regards,
thomas



[2008-05-13 13:29:47] [EMAIL PROTECTED]

The attribute can be accessed, however toString really doesn't show
it.

print_r($xml-product[1]);

SimpleXMLElement Object
(
[EMAIL PROTECTED] = Array
(
[order_id] = 0002
)

[0] = PHP book
)




[2008-05-12 15:44:22] norbert_schuetz at bigfoot dot com

Description:

PHP Version: PHP 5.2.0-8+etch11 (CLI) from
php5-cli_5.2.0-8+etch10_i386.deb
Linux 2.6.18-5-686 #1 SMP Sun Aug 12 21:57:02 UTC 2007 i686 GNU/Linux
Simplexml support = enabled
Revision = $Revision: 1.151.2.22.2.15 $
Schema support = enabled
libexpat1_1.95.8-3.4_i386.deb

Description of problem:
For the second xml product item from the sample XML there is no
order_id-attribute in the resulting object, while both first an last
items have it.


Reproduce code:
---
?php
$xmlstr=EOXML
?xml version='1.0' standalone='yes'?
products
product order_id=0001/product
product order_id=0002PHP book/product
product order_id=0003
namePHP book/name
/product
/products
EOXML;


$xml=new SimpleXMLElement($xmlstr);
print_r($xml);
?


Expected result:

@attributes array for second item as well

Actual result:
--
SimpleXMLElement Object
(
[product] = Array
(
[0] = SimpleXMLElement Object
(
[EMAIL PROTECTED] = Array
(
[order_id] = 0001
)

)

[1] = PHP book
[2] = SimpleXMLElement Object
(
[EMAIL PROTECTED] = Array
(
[order_id] = 0003
)

[name] = PHP book
)

)

)






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



#45964 [Opn]: pg_unescape_bytea() does not unescape correctly

2008-09-03 Thread felipe
 ID:   45964
 Updated by:   [EMAIL PROTECTED]
 Reported By:  skrald at amossen dot dk
 Status:   Open
 Bug Type: PostgreSQL related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

Well, actually the result isn't reversed to original state.
Anyway it seems an expected behavior.

?php

$data = \0\t;

$esc = pg_escape_bytea($data);
$unesc = pg_unescape_bytea($esc);

var_dump($esc, $unesc);

?

Output:

string(10) \\000\\011
string(8) \000\011


Nevertheless, says the documentation: 

  This conversion is not exactly the inverse of PQescapeBytea, because
the string is not expected to be escaped when received from
PQgetvalue. In particular this means there is no need for string quoting
considerations, and so no need for a PGconn parameter.

And about the two backslashes:

  Certain byte values must be escaped (but all byte values can be
escaped) when used as part of a bytea literal in an SQL statement. In
general, to escape a byte, it is converted into the three digit octal
number equal to the octet value, and preceded by usually two
backslashes.


Previous Comments:


[2008-09-01 13:10:19] skrald at amossen dot dk

Description:

Calling pg_unescape_bytea() on some data that has been escaped with
pg_escape_bytea() does not produce the original data as expected. That
is: the unescape method is not the opposite of the escape method.


Reproduce code:
---
?php
$data = file_get_contents(/path/to/binary/file);
$esc = pg_escape_bytea($data);
$unesc = pg_unescape_bytea($esc);

print($unesc == $data ? equal : different);
?


Expected result:

equal



Actual result:
--
different





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



#43199 [Com]: Many segmentation faults

2008-09-03 Thread tikitiki at mybboard dot com
 ID:   43199
 Comment by:   tikitiki at mybboard dot com
 Reported By:  eugene dot pikalov at gmail dot com
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: Linux  Fedora  2.6.22.5-76.fc7
 PHP Version:  5.2.4
 New Comment:

Hello,

I help run a site (http://ncaabbs.com/) which has recently been
experiencing the same thing - It's reproducible in PHP 5.2.6 (that's
what we're running right now)

# cat /var/log/apache2/error_log | grep Segmentation
[Wed Sep 03 17:32:50 2008] [notice] child pid 25431 exit signal
Segmentation fault (11)
[Wed Sep 03 17:32:53 2008] [notice] child pid 26658 exit signal
Segmentation fault (11)
[Wed Sep 03 17:32:53 2008] [notice] child pid 26777 exit signal
Segmentation fault (11)

It's causing apache to crash every few minutes


Previous Comments:


[2008-08-15 22:21:46] jfrisby at adknowledge dot com

Follow-up: Changing the DSN in the sample code to sqlite::memory: per

Johannes' suggestion -- and removing the actual query since the table 
doesn't exist -- produces the same behavior.

We will attempt to test 5.2.6, and if it occurs there, 5.3.0.



[2008-08-15 21:17:24] jfrisby at adknowledge dot com

We're seeing an almost identical stack trace from a php commandline 
program.  Basically, if we connect to a DB using PDO_mysql, we get an 
exit code of 1 after all our code has successfully executed without 
error -- but only if we use persistent connections.

This is on PHP 5.2.4 under Ubuntu Hardy.

Per suggestions on #php.pecl, will try SQLite driver, and if possible,

5.3.

---snip---

?php
error_reporting(E_ALL|E_STRICT);
 
 
try {
$obj = new PDO(mysql:host=localhost;dbname=ls_dev_jfrisby,root,
   ,array(PDO::ATTR_PERSISTENT = true));
$stmt = $obj-prepare(select count(1) cnt from channel_map_bids);
$stmt-execute();
var_dump($stmt-fetchAll());
 
$obj = null;
} catch (Exception $e) {
   print exception:  . (string)$e . \n;
}
 
exit(0);
 
?



[2007-11-13 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.



[2007-11-09 08:38:05] serban dot ghita at verasys dot com

i can confirm this on slackware after upgrading.
Linux www 2.6.21.5-smp #1 SMP Sat Nov 3 15:51:44 Local time zone must
be set--see zic m i686 Intel(R) Xeon(R) CPU E5335  @ 2.00GHz
GenuineIntel GNU/Linux

i was running httpd-2.2.6 with PHP 5.2.4

i tried compiling both apache and php with less options, nothing
worked.

temporary workaround: installed httpd-2.0.58 + PHP 5.2.4 and everithing
worked. i cannot generate a backtrace at the moment because i'm on a
production server



[2007-11-05 23:46:17] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to Open. Thank you for helping
us make PHP better.





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

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



#43199 [Com]: Many segmentation faults

2008-09-03 Thread tikitiki at mybboard dot com
 ID:   43199
 Comment by:   tikitiki at mybboard dot com
 Reported By:  eugene dot pikalov at gmail dot com
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: Linux  Fedora  2.6.22.5-76.fc7
 PHP Version:  5.2.4
 New Comment:

We btw, aren't using PDO so I don't think that is the direct cause.


Previous Comments:


[2008-09-03 23:31:03] tikitiki at mybboard dot com

Hello,

I help run a site (http://ncaabbs.com/) which has recently been
experiencing the same thing - It's reproducible in PHP 5.2.6 (that's
what we're running right now)

# cat /var/log/apache2/error_log | grep Segmentation
[Wed Sep 03 17:32:50 2008] [notice] child pid 25431 exit signal
Segmentation fault (11)
[Wed Sep 03 17:32:53 2008] [notice] child pid 26658 exit signal
Segmentation fault (11)
[Wed Sep 03 17:32:53 2008] [notice] child pid 26777 exit signal
Segmentation fault (11)

It's causing apache to crash every few minutes



[2008-08-15 22:21:46] jfrisby at adknowledge dot com

Follow-up: Changing the DSN in the sample code to sqlite::memory: per

Johannes' suggestion -- and removing the actual query since the table 
doesn't exist -- produces the same behavior.

We will attempt to test 5.2.6, and if it occurs there, 5.3.0.



[2008-08-15 21:17:24] jfrisby at adknowledge dot com

We're seeing an almost identical stack trace from a php commandline 
program.  Basically, if we connect to a DB using PDO_mysql, we get an 
exit code of 1 after all our code has successfully executed without 
error -- but only if we use persistent connections.

This is on PHP 5.2.4 under Ubuntu Hardy.

Per suggestions on #php.pecl, will try SQLite driver, and if possible,

5.3.

---snip---

?php
error_reporting(E_ALL|E_STRICT);
 
 
try {
$obj = new PDO(mysql:host=localhost;dbname=ls_dev_jfrisby,root,
   ,array(PDO::ATTR_PERSISTENT = true));
$stmt = $obj-prepare(select count(1) cnt from channel_map_bids);
$stmt-execute();
var_dump($stmt-fetchAll());
 
$obj = null;
} catch (Exception $e) {
   print exception:  . (string)$e . \n;
}
 
exit(0);
 
?



[2007-11-13 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.



[2007-11-09 08:38:05] serban dot ghita at verasys dot com

i can confirm this on slackware after upgrading.
Linux www 2.6.21.5-smp #1 SMP Sat Nov 3 15:51:44 Local time zone must
be set--see zic m i686 Intel(R) Xeon(R) CPU E5335  @ 2.00GHz
GenuineIntel GNU/Linux

i was running httpd-2.2.6 with PHP 5.2.4

i tried compiling both apache and php with less options, nothing
worked.

temporary workaround: installed httpd-2.0.58 + PHP 5.2.4 and everithing
worked. i cannot generate a backtrace at the moment because i'm on a
production server



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

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



#45983 [Opn-Bgs]: Is interaction between strval() and precision setting in php.ini intended?

2008-09-03 Thread felipe
 ID:   45983
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ivoras at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: FreeBSD
 PHP Version:  5.2.6
 New Comment:

That is an expected behavior.
The strval() isn't required to you get this result, the echo statement,
var_dump(), and etc will print the value according to the precision
setting.

Thanks.


Previous Comments:


[2008-09-03 13:42:15] ivoras at gmail dot com

Addition to the bug report: I tracked the issue down to the precision
setting in php.ini. When set to 4, when strval() receives a number
with 4 digits to the left of the decimal point, the output will only be
a string og 4 digits. E.g. strval(1001.1) returns 1001. The
documentation for precision setting says:


  precision  integer
The number of significant digits displayed in floating point
numbers. 


It doesn't mention strval() (and strval() manual page doesn't mention
precision) and it's a bit ambiguous.

(the behaviour is the same on Linux and FreeBSD).



[2008-09-03 13:32:03] ivoras at gmail dot com

Description:

Calling strval() on certain floating point numbers (not all) on FreeBSD
sometimes inexplicably truncates or rounds the result. Checked on both
FreeBSD 6.3 and 7.0. Works fine in Linux.

Reproduce code:
---
?php
$v = 4867.8;
echo strval($v);
?


Expected result:

4867.8

Actual result:
--
4867





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



#45989 [NEW]: json_decode() passes through certain invalid JSON strings

2008-09-03 Thread steven at acko dot net
From: steven at acko dot net
Operating system: Mac OS X
PHP version:  5.2.6
PHP Bug Type: JSON related
Bug description:  json_decode() passes through certain invalid JSON strings

Description:

When json_decode() is given certain invalid JSON strings, it will return 
the literal string as the result, rather than returning NULL.

Note: in #38680, the decision was made to allow json_decode() to accept 
literal basic types (strings, ints, ...) even though this is not allowed 
by RFC 4627 (which only allows objects/arrays). This bug report is 
different because even under the PHP interpretation of JSON, these 
strings can not be considered valid, and trivial variations on them do 
in fact throw an error as expected.

(The non-standard behaviour introduced in #38680 is not documented at 
all by the way, which is kind of ironic given the numerous issues that 
have 'go read the spec' as the answer)




Reproduce code:
---
var_dump(json_decode('invalid json'));
var_dump(json_decode('invalid json'));
var_dump(json_decode(' {'));
var_dump(json_decode(' ['));



Expected result:

NULL
NULL
NULL
NULL

Actual result:
--
string(14) 'invalid json'
string(12) invalid json
string(2)  {
string(2)  [






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



#45990 [NEW]: ldap_get_entries does not preserve the case of the attribute

2008-09-03 Thread ninglis at nextdigital dot com
From: ninglis at nextdigital dot com
Operating system: FreeBSD 7
PHP version:  5.2.6
PHP Bug Type: LDAP related
Bug description:  ldap_get_entries does not preserve the case of the attribute

Description:

ldap_get_entries() does not preserve the correct case of teh attribute
names from ldap_search result. 

eg: objectClass becomes objectclass

if I use ldap_get_attributes() I do not get this problem.

the loss of case is very important as if you try to reinsert these values,
the attribute names no longer match the LDAP schema.

Expected result:

[objectClass]=
array(5) {
  [count]=
  int(4)
  [0]=
  string(3) top
  [1]=
  string(6) person
  [2]=
  string(13) inetOrgPerson
  [3]=
  string(9) qmailUser
}
[2]=
string(11) objectClass
  

Actual result:
--

this is a snipet of the vardump: As you can see the objectclass
attribute has lost its camel case


[objectclass]=
array(5) {
  [count]=
  int(4)
  [0]=
  string(3) top
  [1]=
  string(6) person
  [2]=
  string(13) inetOrgPerson
  [3]=
  string(9) qmailUser
}
[2]=
string(11) objectclass

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



KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA

2008-09-03 Thread fatriyanto akase
->










  
  KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
  
  
  
  
  
  








	

	php-bugs 

	
		
			-- Thread --
			-- Date --
			





			
		
	



	
	
	





		
			KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
			fatriyanto akase
			Wed, 03 Sep 2008 19:29:31 -0700
		


 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to



  
  





 
 








 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to



  
  





 
 








 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to



  
  





 
 








 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to



  
  





 
 








 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to



  
  





 
 








 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to



  
  





 
 








 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to



  
  





 
 








 













KLIK IKLAN DAPAT RUPIAH LANGSUNG DI BAYAR KE BANK ANDA
fatriyanto akase
 


 






  
  





Reply via email to