Bug #60723 [Com]: error_log error time has changed to UTC ignoring default timezo

2013-04-07 Thread andrea dot ganduglia at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=60723edit=1

 ID: 60723
 Comment by: andrea dot ganduglia at gmail dot com
 Reported by:olemarkus at gentoo dot org
 Summary:error_log error time has changed to UTC ignoring
 default timezo
 Status: Closed
 Type:   Bug
 Package:Date/time related
 Operating System:   Gentoo Linux
 PHP Version:5.3.9
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

I can confirm that the problem persist on Debian testing

# apt-cache policy php5
php5:
  Installed: 5.4.4-14
  Candidate: 5.4.4-14
  Version table:
 *** 5.4.4-14 0
500 http://mirrors.gandi.net/debian/ wheezy/main amd64 Packages
100 /var/lib/dpkg/status

# tail -1 error.log
[07-Apr-2013 11:30:56 UTC] PHP Strict Standards ...


Previous Comments:

[2013-03-06 19:25:12] pixelchutes at gmail dot com

I can confirm this has indeed been patched (Confirmed for v5.3.22)

BEFORE:
[04-Mar-2013 00:39:07 UTC] PHP Warning:

AFTER:
[06-Mar-2013 06:27:16 America/Denver] PHP Warning:


[2013-02-25 11:14:51] martin dot marques at gmail dot com

Don't see the fix in Debians testing packages (specifically 5.4.4), still 
seeing the UTC time instead of the local time:

# apt-cache policy php5
php5:
  Instalados: 5.4.4-13
  Candidato:  5.4.4-13
  Tabla de versión:
 5.5.0~alpha4-1 0
 40 http://ftp.de.debian.org/debian/ experimental/main i386 Packages
 *** 5.4.4-13 0
500 http://ftp.de.debian.org/debian/ testing/main i386 Packages
 50 http://ftp.de.debian.org/debian/ unstable/main i386 Packages
100 /var/lib/dpkg/status
 5.3.3-7+squeeze14 0
500 http://security.debian.org/ squeeze/updates/main i386 Packages
500 http://ftp.de.debian.org/debian/ stable/main i386 Packages

From the log file:

[25-Feb-2013 11:05:46 UTC] PHP Deprecated:  Assigning the return value of new 
by reference is deprecated in /usr/share/php/MDB2.php on line 390


[2013-01-28 15:24:11] spam2 at rhsoft dot net

i do not see anything fixed 
errorlog still contains the timezone

PHP 5.3.21 as also 5.4.11

[28-Jan-2013 16:22:38 Europe/Vienna] PHP Parse error:  syntax error, unexpected 
end of file in Command line code on line 1

the sysadmin knows his timezone well enough...


[2012-10-10 21:19:40] pixelchutes at gmail dot com

Should hopefully be released in 5.3.18, since 5.3.17 was released just a few 
days 
before the patch was committed (13-Sep-2012 vs 23-Sep-2012). Glad to hear this 
has been resolved, thanks!


[2012-09-24 03:04:55] larue...@php.net

hey, committed to 5.3 5.4 branches, will fixed in next release, thanks




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

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


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


Bug #12415 [Com]: changing mysql.default_socket in /etc/php.ini doesn't work

2011-11-07 Thread john dot andrea at satlantic dot com
Edit report at https://bugs.php.net/bug.php?id=12415edit=1

 ID: 12415
 Comment by: john dot andrea at satlantic dot com
 Reported by:akoski at iobox dot com
 Summary:changing mysql.default_socket in /etc/php.ini
 doesn't work
 Status: Bogus
 Type:   Bug
 Package:MySQL related
 Operating System:   Linux Mandrake 8.0
 PHP Version:4.0.6
 Block user comment: N
 Private report: N

 New Comment:

Also trouble in 5.3.8

I say its a documentation error as there is no description or example (see: 
http://www.php.net/manual/en/ini.sections.php) of the use of semi-colons.

Oddly, the mysql.default_socket was the only setting which needed the 
semi-colon in order to be recognized.


Previous Comments:

[2001-07-27 23:21:54] sni...@php.net

user error.



[2001-07-27 03:21:45] akoski at iobox dot com

Found the problem. There was a missing ; .

I thought ;'s are only used for comments...


[2001-07-27 03:07:55] cy...@php.net

are you sure PHP actually reads that php.ini? you can see the location where 
PHP looks for the file in the output of phpinfo(). as with all changes in 
php.ini, you have to restart apache for this to become effective.


[2001-07-27 02:52:41] akoski at iobox dot com

I have tried to change MySQL's socket path to something else than the default. 
I found that there's a mysql.default_socket in /etc/php.ini.

I changed it to point to the socket file, but it doesn't seem to have any 
effect. PHP produces error message saying that it cannot find mysql.sock, and 
the path points still to the default location. phpinfo() shows also the default 
location.

There's a workaround: symbolic link to real socket file.





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


[PHP-BUG] Bug #54977 [NEW]: UTF-8 files and folder are not shown

2011-06-02 Thread andrea dot rizzini at slidepath dot com
From: 
Operating system: Window 7
PHP version:  5.2.17
Package:  Filesystem function related
Bug Type: Bug
Bug description:UTF-8 files and folder are not shown

Description:

Listing the content of a directory using the standard php functions does
not return any files or folders which have UTF-8 charcters.



Windows 7 Supports Unicode UCS-2LE so you can create any folder / files
like the following: (王 (king in Japanese) and 汚れて掘る (dirty dog
on Japanese)).



If you list the directory where you have these files you will get ?,
?.



After a bit of investigation I've noticed that PHP internally treats any
string literal in ISO8859-1. 



I've tried to change the default encoding to UTF-8 in the php.ini but IT
DOES NOT WORK.





Test script:
---
Create several UTF-8 folders using chinese or japanese character.



List them using the standard php function opendir like:



$myDirectory = opendir(.);

// get each entry

while($entryName = readdir($myDirectory)) {

$dirArray[] = $entryName;

}

// close directory

closedir($myDirectory);

//  count elements in array

$indexCount = count($dirArray);

Print ($indexCount filesbr\n);





Notice that the UTF-8 encoded files are returned as ???





Expected result:

It should return the full list of directoried including directories with
UTF-8 encoded name

Actual result:
--
It only return folders which have a characters contained in IS08859-1 .

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



Bug #54977 [Dup]: UTF-8 files and folder are not shown

2011-06-02 Thread andrea dot rizzini at slidepath dot com
Edit report at http://bugs.php.net/bug.php?id=54977edit=1

 ID: 54977
 User updated by:andrea dot rizzini at slidepath dot com
 Reported by:andrea dot rizzini at slidepath dot com
 Summary:UTF-8 files and folder are not shown
 Status: Duplicate
 Type:   Bug
 Package:Filesystem function related
 Operating System:   Window 7
 PHP Version:5.2.17
 Block user comment: N
 Private report: N

 New Comment:

Well as you know window 7 is the base of window 2008 R1 and window 2008 R2 
servers while window 2003 server is based on the vista. Both of these systems 
use Unicode - UCS-2LE character encoding. 



Any ideas on when it will be fixed? 



Could you suggest a workaround or a temporary fix?



I'm building a PHP extension with BOOST and WString in order to amend to this 
shortfall. Is there any suggestion to can tell me? 



You help is very appreciated.



Regards



Andrea


Previous Comments:

[2011-06-02 14:17:37] paj...@php.net

There is already a request about supporting unicode FS on Windows.


[2011-06-02 14:15:54] andrea dot rizzini at slidepath dot com

Description:

Listing the content of a directory using the standard php functions does not 
return any files or folders which have UTF-8 charcters.



Windows 7 Supports Unicode UCS-2LE so you can create any folder / files like 
the following: (王 (king in Japanese) and 汚れて掘る (dirty dog on 
Japanese)).



If you list the directory where you have these files you will get ?, ?.



After a bit of investigation I've noticed that PHP internally treats any string 
literal in ISO8859-1. 



I've tried to change the default encoding to UTF-8 in the php.ini but IT DOES 
NOT WORK.





Test script:
---
Create several UTF-8 folders using chinese or japanese character.



List them using the standard php function opendir like:



$myDirectory = opendir(.);

// get each entry

while($entryName = readdir($myDirectory)) {

$dirArray[] = $entryName;

}

// close directory

closedir($myDirectory);

//  count elements in array

$indexCount = count($dirArray);

Print ($indexCount filesbr\n);





Notice that the UTF-8 encoded files are returned as ???





Expected result:

It should return the full list of directoried including directories with UTF-8 
encoded name

Actual result:
--
It only return folders which have a characters contained in IS08859-1 .






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


Bug #52340 [Bgs]: strtotime conversion error

2010-07-15 Thread andrea dot romagnoli at getlocal dot it
Edit report at http://bugs.php.net/bug.php?id=52340edit=1

 ID:   52340
 User updated by:  andrea dot romagnoli at getlocal dot it
 Reported by:  andrea dot romagnoli at getlocal dot it
 Summary:  strtotime conversion error
 Status:   Bogus
 Type: Bug
 Package:  Date/time related
 Operating System: Linux
 PHP Version:  5.3.2

 New Comment:

Yes, but if I check the difference day by day from 22 march to 29 march
is ever of 24H, why the daylight saving is show to me only if I subtract
a week?


Previous Comments:

[2010-07-15 10:58:18] sala...@php.net

The actual number of seconds between those two date/times is expected.
This is 

because it crosses a Daylight Savings boundary (at
2010-03-28T01:00:00+). 

Since the clocks went forward by an hour at that time, the number of
seconds 

between the dates reflects that resulting in a missing hour.



For more information see
http://en.wikipedia.org/wiki/Daylight_saving_time


[2010-07-15 01:50:18] andrea dot romagnoli at getlocal dot it

Description:

The result of subtraction between result of strtotime(Monday 29 March
2010 06:00:00) and the result of strtotime(Monday 22 March 2010
06:00:00) is not a week, but instead is a week less 2,5 minutes...



Infact a week are 604800 seconds but the result of this subtraction is
601200.



I tried to subtract day per day in the interval and all subtractions are
correct and results every time 86400 seconds.

Test script:
---
?php

error_reporting(E_ALL|E_STRICT);

date_default_timezone_set ('Europe/London');



$dates = array(Monday 15 March 2010 06:00:00, Monday 22 March 2010
06:00:00,

  Monday 29 March 2010 06:00:00, Monday 05 April 2010 06:00:00,
Monday 12 April 2010 06:00:00, Monday 19 April 2010 06:00:00);



var_dump($dates);

$datesInt = array();

foreach($dates as $date)

  $datesInt[] = strtotime($date);



$lastDate = $datesInt[0];

for($i = 1; $i  count($datesInt); $i++){

  $tmp = $datesInt[$i]-$lastDate;

  var_dump($tmp);

  $lastDate = $datesInt[$i];

}

?

Expected result:

I think that all subtractions should be return 604800 seconds.

Actual result:
--
Actually one of subtractions return 601200 instead of 604800 seconds.






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


Bug #52340 [Bgs]: strtotime conversion error

2010-07-15 Thread andrea dot romagnoli at getlocal dot it
Edit report at http://bugs.php.net/bug.php?id=52340edit=1

 ID:   52340
 User updated by:  andrea dot romagnoli at getlocal dot it
 Reported by:  andrea dot romagnoli at getlocal dot it
 Summary:  strtotime conversion error
 Status:   Bogus
 Type: Bug
 Package:  Date/time related
 Operating System: Linux
 PHP Version:  5.3.2

 New Comment:

Sorry, I made a big mistake...

Next time I will pay more attention before post a bug report.



Good work.

Best regards.


Previous Comments:

[2010-07-15 11:21:57] sala...@php.net

The following will return 23 hours. If the result does not equate to
your own 

day by day values please provide a similar short script to demonstrate
the 

problem.



?php

date_default_timezone_set('Europe/London');

$diff = strtotime('28 March 2010 06:00:00') - strtotime('27 March 2010 

06:00:00');

var_dump($diff / 3600); // difference in hours (23)

?


[2010-07-15 11:07:20] andrea dot romagnoli at getlocal dot it

Yes, but if I check the difference day by day from 22 march to 29 march
is ever of 24H, why the daylight saving is show to me only if I subtract
a week?


[2010-07-15 10:58:18] sala...@php.net

The actual number of seconds between those two date/times is expected.
This is 

because it crosses a Daylight Savings boundary (at
2010-03-28T01:00:00+). 

Since the clocks went forward by an hour at that time, the number of
seconds 

between the dates reflects that resulting in a missing hour.



For more information see
http://en.wikipedia.org/wiki/Daylight_saving_time


[2010-07-15 01:50:18] andrea dot romagnoli at getlocal dot it

Description:

The result of subtraction between result of strtotime(Monday 29 March
2010 06:00:00) and the result of strtotime(Monday 22 March 2010
06:00:00) is not a week, but instead is a week less 2,5 minutes...



Infact a week are 604800 seconds but the result of this subtraction is
601200.



I tried to subtract day per day in the interval and all subtractions are
correct and results every time 86400 seconds.

Test script:
---
?php

error_reporting(E_ALL|E_STRICT);

date_default_timezone_set ('Europe/London');



$dates = array(Monday 15 March 2010 06:00:00, Monday 22 March 2010
06:00:00,

  Monday 29 March 2010 06:00:00, Monday 05 April 2010 06:00:00,
Monday 12 April 2010 06:00:00, Monday 19 April 2010 06:00:00);



var_dump($dates);

$datesInt = array();

foreach($dates as $date)

  $datesInt[] = strtotime($date);



$lastDate = $datesInt[0];

for($i = 1; $i  count($datesInt); $i++){

  $tmp = $datesInt[$i]-$lastDate;

  var_dump($tmp);

  $lastDate = $datesInt[$i];

}

?

Expected result:

I think that all subtractions should be return 604800 seconds.

Actual result:
--
Actually one of subtractions return 601200 instead of 604800 seconds.






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


[PHP-BUG] Bug #52340 [NEW]: strtotime conversion error

2010-07-14 Thread andrea dot romagnoli at getlocal dot it
From: 
Operating system: Linux
PHP version:  5.3.2
Package:  Calendar related
Bug Type: Bug
Bug description:strtotime conversion error

Description:

The result of subtraction between result of strtotime(Monday 29 March 2010
06:00:00) and the result of strtotime(Monday 22 March 2010 06:00:00) is
not a week, but instead is a week less 2,5 minutes...



Infact a week are 604800 seconds but the result of this subtraction is
601200.



I tried to subtract day per day in the interval and all subtractions are
correct and results every time 86400 seconds.

Test script:
---
?php

error_reporting(E_ALL|E_STRICT);

date_default_timezone_set ('Europe/London');



$dates = array(Monday 15 March 2010 06:00:00, Monday 22 March 2010
06:00:00,

  Monday 29 March 2010 06:00:00, Monday 05 April 2010 06:00:00, Monday
12 April 2010 06:00:00, Monday 19 April 2010 06:00:00);



var_dump($dates);

$datesInt = array();

foreach($dates as $date)

  $datesInt[] = strtotime($date);



$lastDate = $datesInt[0];

for($i = 1; $i  count($datesInt); $i++){

  $tmp = $datesInt[$i]-$lastDate;

  var_dump($tmp);

  $lastDate = $datesInt[$i];

}

?

Expected result:

I think that all subtractions should be return 604800 seconds.

Actual result:
--
Actually one of subtractions return 601200 instead of 604800 seconds.

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



#49579 [Bgs]: Strange behavior for warning Invalid multibyte sequence in argument

2009-09-18 Thread andrea dot barani at tin dot it
 ID:   49579
 User updated by:  andrea dot barani at tin dot it
 Reported By:  andrea dot barani at tin dot it
 Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Windows 7 (x64)
 PHP Version:  5.3.0
 New Comment:

Sorry for double submission, I've searched for a similar bug but
haven't found it.

I read your comment on the other bug entry and checked out source code,
but i don't get the point to make it intentional. We have to retest our
whole code with display_errors=off in order to check for errors that
otherwise won't be displayed? :S

Anyway thank you for your response. :)


Previous Comments:


[2009-09-18 13:00:58] j...@php.net

See bug #47494 and my comment there for reason. Another reason for this
to be bogus: you failed to search before submitting another report about
same issue.



[2009-09-17 17:06:29] andrea dot barani at tin dot it

Description:

The warning message is only generated when display_errors = off

Tested using Apache 2.2.13 (win32)

Reproduce code:
---
echo htmlspecialchars(chr(224), ENT_COMPAT, 'utf-8');

Expected result:

PHP Warning:  htmlentities(): Invalid multibyte sequence in argument in
[...] on line [...]

Actual result:
--
display_errors = Off   -   The error message is logged but not
displayed (correct)
display_errors = On-   No error message is neither displayed nor
logged (buggy?)

Obviously assuming log_errors = On.

With a custom error handler and display_errors = off the handler is
called and the error informations are correct.

If display_errors = on the custom error handler isn't called.





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



#49579 [NEW]: Strange behavior for warning Invalid multibyte sequence in argument

2009-09-17 Thread andrea dot barani at tin dot it
From: andrea dot barani at tin dot it
Operating system: Windows 7 (x64)
PHP version:  5.3.0
PHP Bug Type: Scripting Engine problem
Bug description:  Strange behavior for warning Invalid multibyte sequence in 
argument

Description:

The warning message is only generated when display_errors = off

Tested using Apache 2.2.13 (win32)

Reproduce code:
---
echo htmlspecialchars(chr(224), ENT_COMPAT, 'utf-8');

Expected result:

PHP Warning:  htmlentities(): Invalid multibyte sequence in argument in
[...] on line [...]

Actual result:
--
display_errors = Off   -   The error message is logged but not displayed
(correct)
display_errors = On-   No error message is neither displayed nor
logged (buggy?)

Obviously assuming log_errors = On.

With a custom error handler and display_errors = off the handler is called
and the error informations are correct.

If display_errors = on the custom error handler isn't called.

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



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

2009-03-28 Thread andrea at 3site dot it
 ID:   46128
 Comment by:   andrea at 3site dot it
 Reported By:  131 dot php at cloudyks dot org
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

I wonder why you guys do not implement in core the PECL php_operator
which would make code style and life much easier.

I cannot imagine a Number class which needs (int)$obj for every single
operation.
Please do not get me wrong, __cast is a good idea, but it covers only
explicit cases while every other decent language (C#, Java, Python)
allows developer to implement implic cast behavior as well.

This, in PHP 5.3, would be excellent (but probaly an illusion thou).
Regards


Previous Comments:


[2009-02-06 00:11:19] rayro at gmx dot de

This is such a nice Implementation and very useful, but i prefer to add
the methods __toBool, __toInt and __toArray rather than __cast, stay
tuned with PHP's other magic methods..

I dont agree fully with that post in feature request #38508 from helly.
If that'll be the way, why did the decision for magic methods?
Isnt that all complex although? ^^
We know, but in my eyes (and many others), i think that these magically
stuff is one of the top key features for php. And none of these features
will become critism i think. If not needed, just dont use them!

The additional goody __toInvoke() introduced in 5_3 is a such nice
addition for developing quick gets based on nested object sets:
?php
$magazine(3)-getArticles();
// old way
$magazine-getArticle($magazine-useMagazine(3));
?
This helper is a backdoor like way to enable PHP to fully write
nested Objects like in Javascript. And my opinion for that: I LIKE THIS
:)

I think this is a very very discussable topic to the changes for 5_3 or
6_0 beside the wanted support for traditional type hinting and utf8!

thanks



[2008-11-23 09:01:02] mark at hell dot ne dot jp

Please test the following extension :

http://ookoo.org/svn/snip/phpcastable/

This extension adds a Castable interface. Any class implementing this
interface have to implement a __cast() function. This function will be
called when the object needs to be casted to a type.

This extension is EXPERIMENTAL and needs more testing/review before
being used in any production system.



[2008-10-27 17:08:24] info at netmosfera dot it

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



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

Backported to PHP 5.2.6 :

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



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

This is awesome



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

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



#38001 [Com]: In PDO mysql running multiple queries with one exec, subsequent query fails

2008-07-16 Thread andrea at bhweb dot it
 ID:   38001
 Comment by:   andrea at bhweb dot it
 Reported By:  mark-phpbugs at vectrex dot org dot uk
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.1.4
 New Comment:

Although nasty, I found a workaround, like the one used in mysqli to 
consume the resultsets:

$stmt=$ppdb-prepare($query);
$stmt-execute();
do { $stmt-fetch(); $stmt-closeCursor(); ++$line; } while($stmt-
nextRowset());

I found this only works using prepare and execute this way, not if you

directly execute the query with query().

HTH


Previous Comments:


[2006-07-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-07-04 22:11:48] mark-phpbugs at vetrex dot org dot uk

I've tried this with the latest snapshot, php5.2-200607042030, and the
problem remains.



[2006-07-04 19:40:37] [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

Works for me using MySQ 5.0.22



[2006-07-04 09:12:06] mark-phpbugs at vectrex dot org dot uk

Description:

When running multiple queries with one exec, the queries
succeed (or appear to succeed, with no exception), but a
subsequent query fails with 2013 Lost connection to MySQL server during
query

I'm using MySQL 5.0.20a-Debian_2-log on Debian Linux. Client library
version is 

PDO Driver for MySQL, client library version = 5.0.22

This is similar to bogus bug #37732 which affects mysqli - But in PDO
there is no way to manually consume the empty result sets from an
exec() - PDO should really do it automatically.

Reproduce code:
---
?php

error_reporting(E_ALL);
 
function DbInit()
{
global $db;

$options = array();

$connstr = mysql:host=localhost;dbname=test;
$db = new PDO($connstr, root, , $options);
$db-setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);

// Make sure our connections use utf8.
$db-exec(SET NAMES utf8);
}

function TestBatch()
{
global $db;
$sql = CREATE TEMPORARY table b (t varchar(20));
$sql2 =  INSERT INTO b VALUES ('hello');
/* This works
$db-exec($sql);
$db-exec($sql2);
*/
/* This fails because the subsequent query gives 2013 Lost connection
to MySQL server during query */
$db-exec($sql . ; . $sql2);  
$sth = $db-query(SELECT * FROM b);
var_dump($sth-fetchAll(PDO::FETCH_ASSOC));
}

DbInit();
TestBatch();

?

Expected result:

array(1) {
  [0]=
  array(1) {
[t]=
string(5) hello
  }
}


Actual result:
--
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server
during query' in /home/mark/progs/phptest/pdobatch.php:30
Stack trace:
#0 /home/mark/progs/phptest/pdobatch.php(30): PDO-query('SELECT * FROM
b')
#1 /home/mark/progs/phptest/pdobatch.php(35): TestBatch()
#2 {main}
  thrown in /home/mark/progs/phptest/pdobatch.php on line 30






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



#44685 [Fbk-Opn]: SIGSEGV in _zend_is_inconsistent

2008-04-11 Thread andrea dot granata at starnetsrl dot it
 ID:   44685
 User updated by:  andrea dot granata at starnetsrl dot it
 Reported By:  andrea dot granata at starnetsrl dot it
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: freebsd
 PHP Version:  5.2.5
 New Comment:

Hi, 

same problem with 5.2.6 RC6. compiled with

./configure --with-layout=GNU
--with-config-file-scan-dir=/usr/local/etc/php --disable-all
--enable-libxml --with-libxml-dir=/usr/local --enable-reflection
--program-prefix= --disable-cgi --with-regex=php --with-zend-vm=CALL
--enable-debug --prefix=/usr/local --mandir=/usr/local/man
--infodir=/usr/local/info/ --with-pdo-pgsql


Starting program: /usr/src/php5.2-200804110430/sapi/cli/php index.php
[New LWP 100142]
[New Thread 0x28759400 (LWP 100142)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x28759400 (LWP 100142)]
0x081a2849 in _zend_is_inconsistent (ht=0x0, file=0x8297af0
/usr/src/php5.2-200804110430/Zend/zend_hash.c, line=1015)
at /usr/src/php5.2-200804110430/Zend/zend_hash.c:53
53  if (ht-inconsistent==HT_OK) {


Previous Comments:


[2008-04-10 22:47:49] [EMAIL PROTECTED]

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





[2008-04-10 22:36:04] andrea dot granata at starnetsrl dot it

Description:

Same bug on freebsd 7.0 and ubuntu 7.10 with php 5.2.3.
tested with php-cli and mod_php.


Reproduce code:
---
?php
//tested with Zend Framework 1.5.1

set_include_path('../library' . PATH_SEPARATOR . get_include_path());

require_once 'Zend/Db.php';

$db = Zend_Db::factory('Pdo_Pgsql', array(
'host' = '127.0.0.1',
'username' = 'postgres',
'password' = '*',
'dbname'   = 'test'
));

$db-getConnection();
$data = $db-fetchRow('SELECT * FROM actions', 2);
var_dump($data);


Expected result:

The var_dump of $data variable.

Actual result:
--
faure# gdb php
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for
details.
This GDB was configured as i386-marcel-freebsd...
(gdb) run index.php
Starting program: /usr/local/bin/php index.php
[New LWP 100190]
[New Thread 0x28759300 (LWP 100190)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x28759300 (LWP 100190)]
0x081a40e9 in _zend_is_inconsistent (ht=0x0, file=0x8295be8
/usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c, line=1209)
at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c:54
54  /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c: No such
file or directory.
in /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c
(gdb) 






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



#44685 [Fbk-Opn]: SIGSEGV in _zend_is_inconsistent

2008-04-11 Thread andrea dot granata at starnetsrl dot it
 ID:   44685
 User updated by:  andrea dot granata at starnetsrl dot it
 Reported By:  andrea dot granata at starnetsrl dot it
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: freebsd
 PHP Version:  5.2.5
 New Comment:

Hi Felipe.

Here's the full backtrace

(gdb) bt
#0  0x081a2849 in _zend_is_inconsistent (ht=0x0, file=0x8297af0
/usr/src/php5.2-200804110430/Zend/zend_hash.c, line=1015)
at /usr/src/php5.2-200804110430/Zend/zend_hash.c:53
#1  0x081a55a1 in zend_hash_num_elements (ht=0x0) at
/usr/src/php5.2-200804110430/Zend/zend_hash.c:1015
#2  0x296331c4 in pgsql_stmt_param_hook () from
/usr/local/lib/php/20060613-debug/pdo_pgsql.so
#3  0x292175b6 in zim_PDOStatement_execute () from
/usr/local/lib/php/20060613-debug/pdo.so
#4  0x081be240 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfc5c8) at zend_vm_execute.h:200
#5  0x081beedd in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfc5c8) at zend_vm_execute.h:322
#6  0x081bdd92 in execute (op_array=0x29866f10) at
zend_vm_execute.h:92
#7  0x081be3ba in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfc9e8) at zend_vm_execute.h:234
#8  0x081beedd in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfc9e8) at zend_vm_execute.h:322
#9  0x081bdd92 in execute (op_array=0x2988a824) at
zend_vm_execute.h:92
#10 0x081be3ba in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfccb8) at zend_vm_execute.h:234
#11 0x081beedd in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfccb8) at zend_vm_execute.h:322
#12 0x081bdd92 in execute (op_array=0x2874f6f8) at
zend_vm_execute.h:92
#13 0x081be3ba in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfcff8) at zend_vm_execute.h:234
#14 0x081beedd in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfcff8) at zend_vm_execute.h:322
#15 0x081bdd92 in execute (op_array=0x2988bd64) at
zend_vm_execute.h:92
#16 0x081be3ba in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfd238) at zend_vm_execute.h:234
#17 0x081beedd in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfd238) at zend_vm_execute.h:322
#18 0x081bdd92 in execute (op_array=0x2988d744) at
zend_vm_execute.h:92
#19 0x081be3ba in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfd4c8) at zend_vm_execute.h:234
#20 0x081beedd in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfd4c8) at zend_vm_execute.h:322
#21 0x081bdd92 in execute (op_array=0x2871d9b0) at
zend_vm_execute.h:92
#22 0x081984d2 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php5.2-200804110430/Zend/zend.c:1134
#23 0x081456a6 in php_execute_script (primary_file=0xbfbfeb70) at
/usr/src/php5.2-200804110430/main/main.c:2005
#24 0x0821757c in main (argc=2, argv=0xbfbfec58) at
/usr/src/php5.2-200804110430/sapi/cli/php_cli.c:1140


Previous Comments:


[2008-04-11 14:03:26] [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.

Please. Can you post the full backtrace?



[2008-04-11 06:37:00] andrea dot granata at starnetsrl dot it

Hi, 

same problem with 5.2.6 RC6. compiled with

./configure --with-layout=GNU
--with-config-file-scan-dir=/usr/local/etc/php --disable-all
--enable-libxml --with-libxml-dir=/usr/local --enable-reflection
--program-prefix= --disable-cgi --with-regex=php --with-zend-vm=CALL
--enable-debug --prefix=/usr/local --mandir=/usr/local/man
--infodir=/usr/local/info/ --with-pdo-pgsql


Starting program: /usr/src/php5.2-200804110430/sapi/cli/php index.php
[New LWP 100142]
[New Thread 0x28759400 (LWP 100142)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x28759400 (LWP 100142)]
0x081a2849 in _zend_is_inconsistent (ht=0x0, file=0x8297af0
/usr/src/php5.2-200804110430/Zend/zend_hash.c, line=1015)
at /usr/src/php5.2-200804110430/Zend/zend_hash.c:53
53  if (ht-inconsistent==HT_OK) {



[2008-04-10 22:47:49] [EMAIL PROTECTED]

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





[2008-04-10 22:36:04] andrea dot granata at starnetsrl dot it

Description:

Same bug on freebsd 7.0 and ubuntu 7.10

#44685 [NEW]: SIGSEGV in _zend_is_inconsistent

2008-04-10 Thread andrea dot granata at starnetsrl dot it
From: andrea dot granata at starnetsrl dot it
Operating system: freebsd
PHP version:  5.2.5
PHP Bug Type: Reproducible crash
Bug description:  SIGSEGV in _zend_is_inconsistent

Description:

Same bug on freebsd 7.0 and ubuntu 7.10 with php 5.2.3.
tested with php-cli and mod_php.


Reproduce code:
---
?php
//tested with Zend Framework 1.5.1

set_include_path('../library' . PATH_SEPARATOR . get_include_path());

require_once 'Zend/Db.php';

$db = Zend_Db::factory('Pdo_Pgsql', array(
'host' = '127.0.0.1',
'username' = 'postgres',
'password' = '*',
'dbname'   = 'test'
));

$db-getConnection();
$data = $db-fetchRow('SELECT * FROM actions', 2);
var_dump($data);


Expected result:

The var_dump of $data variable.

Actual result:
--
faure# gdb php
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for
details.
This GDB was configured as i386-marcel-freebsd...
(gdb) run index.php
Starting program: /usr/local/bin/php index.php
[New LWP 100190]
[New Thread 0x28759300 (LWP 100190)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x28759300 (LWP 100190)]
0x081a40e9 in _zend_is_inconsistent (ht=0x0, file=0x8295be8
/usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c, line=1209)
at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c:54
54  /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c: No such file
or directory.
in /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_hash.c
(gdb) 


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



#44568 [NEW]: class name as defined constant

2008-03-30 Thread andrea at 3site dot it
From: andrea at 3site dot it
Operating system: Windows XP
PHP version:  5.2.6RC3
PHP Bug Type: Feature/Change Request
Bug description:  class name as defined constant

Description:

It seems to be an ambiguity issue and a probable future problem.
You can create a class and define a constant with the same name and
vice-versa.
Who is the class and who is the constant?

For future problems: currently, the magic __toString method works as magic
instance method even if it is declared as public static ( ... and inherited
in instances as public without static ... but this is another problem ... )
If one day PHP would like to support a public static __toString method this
ambiguity will be a problem to understand if we are trying to get them, or
the possible defined constant.

Reproduce code:
---
class Test{}
define('Test', 123);

// defined('Test') or class_exists('Test') ?



define('Test2', 'Test2');
class Test2{}

get_class(new Test2) === Test2; // true
echo Test2; // Test2
$ref = Test2;
new $ref; // an instanceof Test2 ... 

is_string(Test2); // true

Expected result:

A fatal error, because a constant should be a unique and immutable value
with a name that could not be used as class one and a class should be
unique as well (if we cannot use the same name for two different classes,
how can we have two totally different meaning with a sngle name, the class
and the constant)

Actual result:
--
It is possible to create a class and then define a constant with the same
name, and it is possible to define a constant and then a class with the
same name.

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



#44139 [Opn]: new ReflectionFunction fails to invoke native functions

2008-02-18 Thread andrea at 3site dot it
 ID:   44139
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.2.5
 New Comment:

Felipe, I'm testing PHP Version 5.2.6-dev and I have the same problem.

?php
$arr= array(2, 3, 4);
$ref= new ReflectionFunction('array_unshift');
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 1));
var_dump($arr);
exit;
?

Warning: Call-time pass-by-reference has been deprecated; If you would
like to pass it by reference, modify the declaration of [runtime
function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file in ...

I guess above warning should not exists. So, can you confirm that this
is a bug?
Cheers


Previous Comments:


[2008-02-17 23:41:00] [EMAIL PROTECTED]

$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // correct and expected result

Doesn't show warning on 5.2.6 and 5.3. That was my message.



[2008-02-17 23:17:39] andrea at 3site dot it

Hi Felipe, I don't understand your messages.

I know that it generates a Fatal error as I know that send the array
forcing reference works as expected but it generates a warning.

As I wrote on php.net manual too, to solve this strange behaviour I
used a non-sense strategy (at least for me) ...

$arr = array(2, 3, 4);
$ref = new ReflectionFunction('array_unshift');
$ref-invokeArgs(array_merge(array($arr), array(1)));
$ref-invokeArgs(array_merge(array($arr), array(0)));
// $arr == [0,1,2,3,4]

I can't understand why one single value is accepted by reference inside
an array while more than one is not accepted.

Since PHP 5 should manage by itself references I think that
ReflectionFunction should do the same, without reference requirement but
working as expected.

Do you think am I wrong?
Kind Regards



[2008-02-17 19:45:57] [EMAIL PROTECTED]

Ops... 5_3 also issued 'Fatal error'.

Warning: Parameter 1 to array_unshift() expected to be a reference,
value given in %s on line %d

Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed' in %s:%d
Stack trace:
#0 %s(19): ReflectionFunction-invoke(Array, 1)
#1 {main}
  thrown in %s on line %d




[2008-02-17 19:40:54] [EMAIL PROTECTED]

PHP 5.2.6:

$ref-invoke($arr, 1);
Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed' 

$ref-invokeArgs(array($arr, 0));
Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed'

PHP 5.3.0:

$ref-invoke($arr, 1); and $ref-invokeArgs(array($arr, 0));
Warning: Parameter 1 to array_unshift() expected to be a reference,
value given





[2008-02-17 00:06:41] andrea at 3site dot it

Description:

For some reason, ReflectionFunction doesn't allow me to to invoke a
basic function like, for example, array_unshift.

Reproduce code:
---
$arr = array(2, 3, 4);

/** EXPECTED RESULT
 * array_unshift($arr, 1);
 * array_unshift($arr, 0);
 * var_dump($arr);  // 0, 1, 2, 3, 4
 */

$ref = new ReflectionFunction('array_unshift');

// WARNING: Call-time pass-by-reference has been deprecated
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // correct and expected result

// FATAL ERROR - Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed'
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // nothing, because of fatal error ... 

exit;

Expected result:

I would like to do what I'm trying to do without errors.
I mean both fatal and warning.

Actual result:
--
An illogical problem for a simple operation.

You have a passed by reference in your core but you choosed to
disable send by reference in PHP ... and ReflectionFunction doesn't seem
to be able to manage this kind of situation.

Please do not reply with something like: change your PHP configuration
... I would like to write not deprecated code. Thank You.





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


#44139 [Opn]: new ReflectionFunction fails to invoke native functions

2008-02-18 Thread andrea at 3site dot it
 ID:   44139
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.2.5
 New Comment:

Sorry, this is what I would like to be able to do:

?php
$arr= array(2, 3, 4);
$ref= new ReflectionFunction('array_unshift');
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 1));
var_dump($arr);
exit;
?

Without fatal errors, simply because if send by reference is
deprecated, ReflectionFunction (... and I didn't test ReflectionMethod
...) should be able to manage correctly variables by references.

This is another Fatal Error example:

?php
function unshift($arr, $mix){
return  array_unshift($arr, $mix);
}
$arr= array(2, 3, 4);
$ref= new ReflectionFunction('unshift');
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 1));
var_dump($arr);
exit;
?

I hope these examples explain correctly where and what is the problem.
Kind Regards


Previous Comments:


[2008-02-18 09:42:17] andrea at 3site dot it

Felipe, I'm testing PHP Version 5.2.6-dev and I have the same problem.

?php
$arr= array(2, 3, 4);
$ref= new ReflectionFunction('array_unshift');
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 1));
var_dump($arr);
exit;
?

Warning: Call-time pass-by-reference has been deprecated; If you would
like to pass it by reference, modify the declaration of [runtime
function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file in ...

I guess above warning should not exists. So, can you confirm that this
is a bug?
Cheers



[2008-02-17 23:41:00] [EMAIL PROTECTED]

$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // correct and expected result

Doesn't show warning on 5.2.6 and 5.3. That was my message.



[2008-02-17 23:17:39] andrea at 3site dot it

Hi Felipe, I don't understand your messages.

I know that it generates a Fatal error as I know that send the array
forcing reference works as expected but it generates a warning.

As I wrote on php.net manual too, to solve this strange behaviour I
used a non-sense strategy (at least for me) ...

$arr = array(2, 3, 4);
$ref = new ReflectionFunction('array_unshift');
$ref-invokeArgs(array_merge(array($arr), array(1)));
$ref-invokeArgs(array_merge(array($arr), array(0)));
// $arr == [0,1,2,3,4]

I can't understand why one single value is accepted by reference inside
an array while more than one is not accepted.

Since PHP 5 should manage by itself references I think that
ReflectionFunction should do the same, without reference requirement but
working as expected.

Do you think am I wrong?
Kind Regards



[2008-02-17 19:45:57] [EMAIL PROTECTED]

Ops... 5_3 also issued 'Fatal error'.

Warning: Parameter 1 to array_unshift() expected to be a reference,
value given in %s on line %d

Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed' in %s:%d
Stack trace:
#0 %s(19): ReflectionFunction-invoke(Array, 1)
#1 {main}
  thrown in %s on line %d




[2008-02-17 19:40:54] [EMAIL PROTECTED]

PHP 5.2.6:

$ref-invoke($arr, 1);
Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed' 

$ref-invokeArgs(array($arr, 0));
Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed'

PHP 5.3.0:

$ref-invoke($arr, 1); and $ref-invokeArgs(array($arr, 0));
Warning: Parameter 1 to array_unshift() expected to be a reference,
value given





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

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


#44139 [Opn]: Fatal error with ReflectionFunction and ReflectionMethod using reference

2008-02-18 Thread andrea at 3site dot it
 ID:   44139
 User updated by:  andrea at 3site dot it
-Summary:  new ReflectionFunction fails to invoke native
   functions
 Reported By:  andrea at 3site dot it
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.2.5
 New Comment:

As expected, this problem is present on ReflectionMethod too.

Basically, the summary of this bug is wrong and I guess that correct
could be the changed one.

I tested both problems in PHP 5.2.5 and 5.2.6-dev.

This example shows the problem using methods as well.

?php

class Test{
public  function unshift($arr, $mix){
return  array_unshift($arr, $mix);
}
}

$instance   = new Test;
$arr= array(2, 3, 4);
$ref= new ReflectionMethod('Test', 'unshift');

// WARNING
$ref-invoke($instance, $arr, 1);
$ref-invokeArgs($instance, array($arr, 0));
var_dump($arr); // [0,1,2,3,4]

// FATAL ERROR
$ref-invoke($instance, $arr, 1);
$ref-invokeArgs($instance, array($arr, 0));
var_dump($arr);
exit;

?

Thanks for solving this problem.
Kind Regards.


Previous Comments:


[2008-02-18 09:46:58] andrea at 3site dot it

Sorry, this is what I would like to be able to do:

?php
$arr= array(2, 3, 4);
$ref= new ReflectionFunction('array_unshift');
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 1));
var_dump($arr);
exit;
?

Without fatal errors, simply because if send by reference is
deprecated, ReflectionFunction (... and I didn't test ReflectionMethod
...) should be able to manage correctly variables by references.

This is another Fatal Error example:

?php
function unshift($arr, $mix){
return  array_unshift($arr, $mix);
}
$arr= array(2, 3, 4);
$ref= new ReflectionFunction('unshift');
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 1));
var_dump($arr);
exit;
?

I hope these examples explain correctly where and what is the problem.
Kind Regards



[2008-02-18 09:42:17] andrea at 3site dot it

Felipe, I'm testing PHP Version 5.2.6-dev and I have the same problem.

?php
$arr= array(2, 3, 4);
$ref= new ReflectionFunction('array_unshift');
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 1));
var_dump($arr);
exit;
?

Warning: Call-time pass-by-reference has been deprecated; If you would
like to pass it by reference, modify the declaration of [runtime
function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file in ...

I guess above warning should not exists. So, can you confirm that this
is a bug?
Cheers



[2008-02-17 23:41:00] [EMAIL PROTECTED]

$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // correct and expected result

Doesn't show warning on 5.2.6 and 5.3. That was my message.



[2008-02-17 23:17:39] andrea at 3site dot it

Hi Felipe, I don't understand your messages.

I know that it generates a Fatal error as I know that send the array
forcing reference works as expected but it generates a warning.

As I wrote on php.net manual too, to solve this strange behaviour I
used a non-sense strategy (at least for me) ...

$arr = array(2, 3, 4);
$ref = new ReflectionFunction('array_unshift');
$ref-invokeArgs(array_merge(array($arr), array(1)));
$ref-invokeArgs(array_merge(array($arr), array(0)));
// $arr == [0,1,2,3,4]

I can't understand why one single value is accepted by reference inside
an array while more than one is not accepted.

Since PHP 5 should manage by itself references I think that
ReflectionFunction should do the same, without reference requirement but
working as expected.

Do you think am I wrong?
Kind Regards



[2008-02-17 19:45:57] [EMAIL PROTECTED]

Ops... 5_3 also issued 'Fatal error'.

Warning: Parameter 1 to array_unshift() expected to be a reference,
value given in %s on line %d

Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed' in %s:%d
Stack trace:
#0 %s(19): ReflectionFunction-invoke(Array, 1)
#1 {main}
  thrown in %s on line %d




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

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


#44139 [Opn]: new ReflectionFunction fails to invoke native functions

2008-02-17 Thread andrea at 3site dot it
 ID:   44139
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.2.5
 New Comment:

Hi Felipe, I don't understand your messages.

I know that it generates a Fatal error as I know that send the array
forcing reference works as expected but it generates a warning.

As I wrote on php.net manual too, to solve this strange behaviour I
used a non-sense strategy (at least for me) ...

$arr = array(2, 3, 4);
$ref = new ReflectionFunction('array_unshift');
$ref-invokeArgs(array_merge(array($arr), array(1)));
$ref-invokeArgs(array_merge(array($arr), array(0)));
// $arr == [0,1,2,3,4]

I can't understand why one single value is accepted by reference inside
an array while more than one is not accepted.

Since PHP 5 should manage by itself references I think that
ReflectionFunction should do the same, without reference requirement but
working as expected.

Do you think am I wrong?
Kind Regards


Previous Comments:


[2008-02-17 19:45:57] [EMAIL PROTECTED]

Ops... 5_3 also issued 'Fatal error'.

Warning: Parameter 1 to array_unshift() expected to be a reference,
value given in %s on line %d

Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed' in %s:%d
Stack trace:
#0 %s(19): ReflectionFunction-invoke(Array, 1)
#1 {main}
  thrown in %s on line %d




[2008-02-17 19:40:54] [EMAIL PROTECTED]

PHP 5.2.6:

$ref-invoke($arr, 1);
Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed' 

$ref-invokeArgs(array($arr, 0));
Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed'

PHP 5.3.0:

$ref-invoke($arr, 1); and $ref-invokeArgs(array($arr, 0));
Warning: Parameter 1 to array_unshift() expected to be a reference,
value given





[2008-02-17 00:06:41] andrea at 3site dot it

Description:

For some reason, ReflectionFunction doesn't allow me to to invoke a
basic function like, for example, array_unshift.

Reproduce code:
---
$arr = array(2, 3, 4);

/** EXPECTED RESULT
 * array_unshift($arr, 1);
 * array_unshift($arr, 0);
 * var_dump($arr);  // 0, 1, 2, 3, 4
 */

$ref = new ReflectionFunction('array_unshift');

// WARNING: Call-time pass-by-reference has been deprecated
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // correct and expected result

// FATAL ERROR - Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed'
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // nothing, because of fatal error ... 

exit;

Expected result:

I would like to do what I'm trying to do without errors.
I mean both fatal and warning.

Actual result:
--
An illogical problem for a simple operation.

You have a passed by reference in your core but you choosed to
disable send by reference in PHP ... and ReflectionFunction doesn't seem
to be able to manage this kind of situation.

Please do not reply with something like: change your PHP configuration
... I would like to write not deprecated code. Thank You.





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


#44139 [NEW]: new ReflectionFunction fails to invoke native functions

2008-02-16 Thread andrea at 3site dot it
From: andrea at 3site dot it
Operating system: Windows XP
PHP version:  5.2.5
PHP Bug Type: Scripting Engine problem
Bug description:  new ReflectionFunction fails to invoke native functions

Description:

For some reason, ReflectionFunction doesn't allow me to to invoke a basic
function like, for example, array_unshift.

Reproduce code:
---
$arr = array(2, 3, 4);

/** EXPECTED RESULT
 * array_unshift($arr, 1);
 * array_unshift($arr, 0);
 * var_dump($arr);  // 0, 1, 2, 3, 4
 */

$ref = new ReflectionFunction('array_unshift');

// WARNING: Call-time pass-by-reference has been deprecated
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // correct and expected result

// FATAL ERROR - Uncaught exception 'ReflectionException' with message
'Invocation of function array_unshift() failed'
$ref-invoke($arr, 1);
$ref-invokeArgs(array($arr, 0));
var_dump($arr); // nothing, because of fatal error ... 

exit;

Expected result:

I would like to do what I'm trying to do without errors.
I mean both fatal and warning.

Actual result:
--
An illogical problem for a simple operation.

You have a passed by reference in your core but you choosed to disable
send by reference in PHP ... and ReflectionFunction doesn't seem to be able
to manage this kind of situation.

Please do not reply with something like: change your PHP configuration ...
I would like to write not deprecated code. Thank You.

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


#43350 [Fbk-Opn]: 500 HTTP response even on not blank pages (totally bogus)

2007-11-21 Thread andrea dot spacca at gmail dot com
 ID:   43350
 User updated by:  andrea dot spacca at gmail dot com
 Reported By:  andrea dot spacca at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: *General Issues
 Operating System: Gentoo (probably all)
 PHP Version:  5.2.5
 New Comment:

what in [EMAIL PROTECTED] decided to change the status to bogus with too
much hurry you didn't understand?
i don't know if you are used to think that people are so idiot to post
a bug according to wrong code, surely you don't have the perspicacity to
see that i put the right code here


Previous Comments:


[2007-11-21 07:05:27] [EMAIL PROTECTED]

What in your script has parse error you didn't understand?



[2007-11-21 04:53:22] carsten_sttgt at gmx dot de

Hello,

I can't reproduce this behaviour on Windwows/FreeBSD with a normal
PHP script (testBug.php).

BTW:
How have you setup your Apache to recognize *.cgi as a PHP-Script?
Because a normal *.cgi script should have a shebang.



[2007-11-20 18:08:46] andrea dot spacca at gmail dot com

Description:

When E_NOTICE or E_WARNING happen in eval'd code the script return 500
HTTP respons even on not blank pages


PS: i'm sorry i have to report this bug twice, but [EMAIL PROTECTED] decided
to change the status to bogus with too much hurry

Reproduce code:
---
?php
eval('$pluto = test .UNDEFINED_CONST. test;');

echo 'AFTER';
?

Expected result:

Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi
HTTP/1.1 200 25

Actual result:
--
Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi
HTTP/1.1 500 25





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


#43358 [NEW]: 500 HTTP response even on not blank pages

2007-11-21 Thread andrea dot spacca at gmail dot com
From: andrea dot spacca at gmail dot com
Operating system: Gentoo
PHP version:  5.2.5
PHP Bug Type: *General Issues
Bug description:  500 HTTP response even on not blank pages

Description:

When E_NOTICE or E_WARNING happen in eval'd code the script return 500
HTTP respons even on not blank pages

PS: third time i have to open the bug, 'cause [EMAIL PROTECTED] continue to
close it as bogus without wait my reply to his comments. i'll put, as soon
as possibile, a script online on our server so you could test the behaviour
on the enviroment where we reproduce the bug

Reproduce code:
---
?php
eval('$pluto = test .UNDEFINED_CONST. test;');

echo 'AFTER';
?


Expected result:

Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi HTTP/1.1
200 25

Actual result:
--
Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi HTTP/1.1
500 25

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


#43358 [Com]: 500 HTTP response even on not blank pages

2007-11-21 Thread andrea at spacca dot org
 ID:   43358
 Comment by:   andrea at spacca dot org
 Reported By:  andrea dot spacca at gmail dot com
 Status:   Open
 Bug Type: *General Issues
 Operating System: Gentoo
 PHP Version:  5.2.5
 New Comment:

from our httpd.conf:
LoadModule php5_module etc etc
AddType application/x-httpd-php .php .cgi


Previous Comments:


[2007-11-21 10:13:12] andrea dot spacca at gmail dot com

Description:

When E_NOTICE or E_WARNING happen in eval'd code the script return 500
HTTP respons even on not blank pages

PS: third time i have to open the bug, 'cause [EMAIL PROTECTED] continue to
close it as bogus without wait my reply to his comments. i'll put, as
soon as possibile, a script online on our server so you could test the
behaviour on the enviroment where we reproduce the bug

Reproduce code:
---
?php
eval('$pluto = test .UNDEFINED_CONST. test;');

echo 'AFTER';
?


Expected result:

Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi
HTTP/1.1
200 25

Actual result:
--
Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi
HTTP/1.1
500 25





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


#43358 [Com]: 500 HTTP response even on not blank pages

2007-11-21 Thread andrea at spacca dot org
 ID:   43358
 Comment by:   andrea at spacca dot org
 Reported By:  andrea dot spacca at gmail dot com
 Status:   Open
 Bug Type: *General Issues
 Operating System: Gentoo
 PHP Version:  5.2.5
 New Comment:

here you can test the http response on our enviroment:
http://89.186.95.3/test/testBug.cgi


Previous Comments:


[2007-11-21 10:23:41] andrea at spacca dot org

from our httpd.conf:
LoadModule php5_module etc etc
AddType application/x-httpd-php .php .cgi



[2007-11-21 10:13:12] andrea dot spacca at gmail dot com

Description:

When E_NOTICE or E_WARNING happen in eval'd code the script return 500
HTTP respons even on not blank pages

PS: third time i have to open the bug, 'cause [EMAIL PROTECTED] continue to
close it as bogus without wait my reply to his comments. i'll put, as
soon as possibile, a script online on our server so you could test the
behaviour on the enviroment where we reproduce the bug

Reproduce code:
---
?php
eval('$pluto = test .UNDEFINED_CONST. test;');

echo 'AFTER';
?


Expected result:

Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi
HTTP/1.1
200 25

Actual result:
--
Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi
HTTP/1.1
500 25





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


#43349 [NEW]: 500 HTTP respons even on not blank pages

2007-11-20 Thread andrea dot spacca at gmail dot com
From: andrea dot spacca at gmail dot com
Operating system: Gentoo (probably all)
PHP version:  5.2.5
PHP Bug Type: *General Issues
Bug description:  500 HTTP respons even on not blank pages

Description:

When E_NOTICE or E_WARNING happen in eval'd code the script return 500
HTTP respons even on not blank pages

Reproduce code:
---
?php
eval('$pluto = test '.UNDEFINED_CONST.' test;');

echo 'AFTER';
?


Expected result:

Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi HTTP/1.1
200 25

Actual result:
--
Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi HTTP/1.1
500 25

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


#43350 [NEW]: 500 HTTP respons even on not blank pages (not bogus)

2007-11-20 Thread andrea dot spacca at gmail dot com
From: andrea dot spacca at gmail dot com
Operating system: Gentoo (probably all)
PHP version:  5.2.5
PHP Bug Type: *General Issues
Bug description:  500 HTTP respons even on not blank pages (not bogus)

Description:

When E_NOTICE or E_WARNING happen in eval'd code the script return 500
HTTP respons even on not blank pages


PS: i'm sorry i have to report this bug twice, but [EMAIL PROTECTED] decided to
change the status to bogus with too much hurry

Reproduce code:
---
?php
eval('$pluto = test .UNDEFINED_CONST. test;');

echo 'AFTER';
?

Expected result:

Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi HTTP/1.1
200 25

Actual result:
--
Apache Access Log:
192.168.1.1 - - [20/Nov/2007:16:09:23 +0100] GET /testBug.cgi HTTP/1.1
500 25

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


#41930 [Bgs]: Error strings are trimmed in custom error handlers for catchable fatal errors

2007-07-09 Thread andrea dot barani at tin dot it
 ID:   41930
 User updated by:  andrea dot barani at tin dot it
 Reported By:  andrea dot barani at tin dot it
 Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Windows Vista (32bit)
 PHP Version:  5.2.3
 New Comment:

Ok, I was confused by the fact that most of the standard error messages
are in fact complete senteces. I thought the last words were part of the
message itself.

I apologize for the mistake. :)


Previous Comments:


[2007-07-09 14:13:50] [EMAIL PROTECTED]

Your error handler is just incomplete, here's how it works:

?php

function handler($errno, $errstr, $errfile, $errline)
{
echo $errstr,  on line $errline in file $errfile;
}
set_error_handler('handler');

class Test1
{
public function __construct(Test3 $variable)
{
}
}
class Test2
{
}

$test2 = new Test2;
$test1 = new Test1($test2);




[2007-07-08 23:56:07] andrea dot barani at tin dot it

Description:

Error strings are trimmed out in custom error handlers for catchable
fatal errors.
This following code uses type hinting available in Php 5 to produce a
recoverable error. As you can see the last part of the error string is
missing.
This code has been tested under different conditions and paths, the
string is always trimmed after the word 'defined'.

Reproduce code:
---
?php

function handler($errno, $errstr)
{
echo $errstr;
}
set_error_handler('handler');

class Test1
{
public function __construct(Test3 $variable)
{
}
}
class Test2
{
}

$test2 = new Test2;
$test1 = new Test1($test2);

?

Expected result:

Argument 1 passed to Test1::__construct() must be an instance of Test3,
instance of Test2 given, called in D:\Web\test.php on line 20 and
defined in D:\Web\test.php on line 11

Actual result:
--
Argument 1 passed to Test1::__construct() must be an instance of Test3,
instance of Test2 given, called in D:\Web\test.php on line 20 and
defined





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


#41930 [NEW]: Error strings are trimmed in custom error handlers for catchable fatal errors

2007-07-08 Thread andrea dot barani at tin dot it
From: andrea dot barani at tin dot it
Operating system: Windows Vista (32bit)
PHP version:  5.2.3
PHP Bug Type: Unknown/Other Function
Bug description:  Error strings are trimmed in custom error handlers for 
catchable fatal errors

Description:

Error strings are trimmed out in custom error handlers for catchable fatal
errors.
This following code uses type hinting available in Php 5 to produce a
recoverable error. As you can see the last part of the error string is
missing.
This code has been tested under different conditions and paths, the string
is always trimmed after the word 'defined'.

Reproduce code:
---
?php

function handler($errno, $errstr)
{
echo $errstr;
}
set_error_handler('handler');

class Test1
{
public function __construct(Test3 $variable)
{
}
}
class Test2
{
}

$test2 = new Test2;
$test1 = new Test1($test2);

?

Expected result:

Argument 1 passed to Test1::__construct() must be an instance of Test3,
instance of Test2 given, called in D:\Web\test.php on line 20 and defined
in D:\Web\test.php on line 11

Actual result:
--
Argument 1 passed to Test1::__construct() must be an instance of Test3,
instance of Test2 given, called in D:\Web\test.php on line 20 and defined

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


#41622 [Opn-Csd]: no binding with prepare/execute

2007-06-08 Thread andrea dot spacca at gmail dot com
 ID:   41622
 User updated by:  andrea dot spacca at gmail dot com
 Reported By:  andrea dot spacca at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.2.3
 New Comment:

Solved on my own: it seems tha matter was with libsqlite. I switched
back to 3.3.5 and now the binding works. The bug must be in libsqlite
somewhere between 3.3.5 and 3.3.12


Previous Comments:


[2007-06-07 12:54:57] andrea dot spacca at gmail dot com

 mysql CREATE TABLE tbl (field);
 ERROR 1064 (42000): You have an error in your SQL syntax; check the
 manual that corresponds to your MySQL server version for the right
 syntax to use near ')' at line 1

please, pay attention: i'm using sqlite



[2007-06-07 12:53:02] [EMAIL PROTECTED]

mysql CREATE TABLE tbl (field);
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ')' at line 1




[2007-06-07 12:49:10] andrea dot spacca at gmail dot com

 Works just fine here.

i've no doubt, otherwise you'd open the bug before me


 (And apparently everywhere else, since this is a very basic
 functionality and you're the only one complaining.)

that's false: i'm not the only one complaining, see
http://pecl.php.net/bugs/bug.php?id=6030 and
http://bugs.php.net/bug.php?id=36788. the fact that the complaints were
ignored doesn't mean that the bug doesn't exist


 Sorry, I don't understand what you're talking about.

i'll be more explicit:
[code]
try {
$createSql = 'CREATE TABLE tbl (field)';
$insertSql = array();
$insertSql[1] = 'INSERT INTO tbl (field) VALUES (1)';
$insertSql[2] = 'INSERT INTO tbl (field) VALUES (2)';
$insertSql[3] = 'INSERT INTO tbl (field) VALUES (3)';
$insertSql[4] = 'INSERT INTO tbl (field) VALUES (4)';
$insertSql[5] = 'INSERT INTO tbl (field) VALUES (5)';
$insertSql[6] = 'INSERT INTO tbl (field) VALUES (6)';
$insertSql[7] = 'INSERT INTO tbl (field) VALUES (7)';

$selectSql = 'SELECT field FROM tbl WHERE field BETWEEN 3 AND
5';
$bindedSql = 'SELECT field FROM tbl WHERE field BETWEEN :first
AND :last';

$bindedValues = array(':first' = 3, ':last' = 5);

$db = new PDO('sqlite:test.db');

$db-exec($createSql);
foreach ($insertSql as $query) {
$db-exec($query);
}

$testNoBind = $db-query($selectSql);
$rowsNoBind = $testNoBind-fetchAll();

var_dump($rowsNoBind);

$testWithBind = $db-prepare($bindedSql);
$testWithBind-execute($bindedValues);
$rowsWithBind = $testWithBind-fetchAll();

var_dump($rowsWithBind);

$db = NULL;
} catch (Exception $e) {
var_dump($e);
}
[/code]

[expected]
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
[/expected]

[result]
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
array(0) {
}
[/result]

is it more clear now?



[2007-06-07 10:20:05] [EMAIL PROTECTED]

i thought that PDOStatement::queryString will change will executing
 the PDOStatement.

Well, you were wrong.

obviously it isn't so, otherwise i hadn't open the bug
i haven't yet tested it on another enviroment, but on the one i'm
working it doesn't work.

Works just fine here.
(And apparently everywhere else, since this is a very basic
functionality and you're the only one complaining.)

have i to open another bug showing the difference making the query
strainght with no binding and without it? (the first works, not the
latter)

Sorry, I don't understand what you're talking about.



[2007-06-07 10:15:16] andrea dot spacca at gmail dot com

 Binds are processed by the database drivers (where available), so
 $tmp-queryString contains original query, not the processed one.

i thought that PDOStatement::queryString will change will executing

#41622 [Fbk-Opn]: no binding with prepare/execute

2007-06-07 Thread andrea dot spacca at gmail dot com
 ID:   41622
 User updated by:  andrea dot spacca at gmail dot com
 Reported By:  andrea dot spacca at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.2.3
 New Comment:

 Binds are processed by the database drivers (where available), so
 $tmp-queryString contains original query, not the processed one.

i thought that PDOStatement::queryString will change will executing the
PDOStatement.



 And you code works just fine when table
 exists and contains requested data.

obviously it isn't so, otherwise i hadn't open the bug

i haven't yet tested it on another enviroment, but on the one i'm
working it doesn't work.

have i to open another bug showing the difference making the query
strainght with no binding and without it? (the first works, not the
latter)


Previous Comments:


[2007-06-07 10:04:02] [EMAIL PROTECTED]

$tmp-quetryString haven't the :placeholder binded to the value
passed in execute(), so the query won't be a valid one and 
$tmp-fetchAll() will be empty

Binds are processed by the database drivers (where available), so
$tmp-queryString contains original query, not the processed one.

And you code works just fine when table exists and contains requested
data.





[2007-06-07 10:03:59] andrea dot spacca at gmail dot com

i haven't put the example in the code but the problem raises both with
named and anonymous placeholders



[2007-06-07 09:54:57] andrea dot spacca at gmail dot com

in expected result the var_dumped array should be:
array(1) {
  [0]=
  array(2) {
[field]=
string(1) 1
[0]=
string(1) 1
  }
}



[2007-06-07 09:53:44] andrea dot spacca at gmail dot com

Description:

Binding params to placeholders in prepared query don't work
(i tested the script both cli and in apache enviroment)

[pdo_mysql]
PDO Driver for MySQL, client library version = 5.0.34

[pdo_sqlite]
PDO Driver for SQLite 3.x = enabled
PECL Module version = 1.0.1
SQLite Library = 3.3.17

Reproduce code:
---
try {
$sql = 'SELECT field FROM table WHERE field = :placeholder
LIMIT 0, 1';

$db = new PDO([...]);
$tmp = $db-prepare($sql);
$tmp-execute(array(':placeholder' = 1));

var_dump($tmp-queryString);
var_dump($tmp-fetchAll());

$db = NULL;
} catch (Exception $e) {
var_dump($e);
}


Expected result:

$tmp-queryString should contain the :placeholder binded to the value
passed in execute(), and (as far as the query will produce row result
from the db) $tmp-fetchAll() should contain the resulted row


expected output:
string(61) SELECT field FROM table WHERE field = 1 LIMIT 0, 1
array(1) {
  [0]=
  array(2) {
[field]=
string(1) 1
[0]=
string(1) 1
[urlString]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[1]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[scheme]=
string(4) http
[2]=
string(4) http
[dominio]=
string(32) comequandofuoripiove.leonardo.it
[3]=
string(32) comequandofuoripiove.leonardo.it
[insertTimestamp]=
string(13) 1177596562453
[4]=
string(13) 1177596562453
[diffChk]=
string(1) 1
[5]=
string(1) 1
  }
}

Actual result:
--
$tmp-quetryString haven't the :placeholder binded to the value passed
in execute(), so the query won't be a valid one and $tmp-fetchAll()
will be empty

the same happens using PDOStatement::bindValue() or
PDOStatement::bindParam()

the result seems not being related to a specific db driver (i tested
with mysql and sqlite)

no exception is raised

script output:
string(61) SELECT * FROM table WHERE field = :placeholder
array(0) {
}



ps: if i remove the placeholder from prepare() and then try to still
bind a value in execute() an exception is raised: SQLSTATE[HY000]:
General error: 25 bind or column index out of range





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


#41622 [Fbk-Opn]: no binding with prepare/execute

2007-06-07 Thread andrea dot spacca at gmail dot com
 ID:   41622
 User updated by:  andrea dot spacca at gmail dot com
 Reported By:  andrea dot spacca at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.2.3
 New Comment:

 Works just fine here.

i've no doubt, otherwise you'd open the bug before me


 (And apparently everywhere else, since this is a very basic
 functionality and you're the only one complaining.)

that's false: i'm not the only one complaining, see
http://pecl.php.net/bugs/bug.php?id=6030 and
http://bugs.php.net/bug.php?id=36788. the fact that the complaints were
ignored doesn't mean that the bug doesn't exist


 Sorry, I don't understand what you're talking about.

i'll be more explicit:
[code]
try {
$createSql = 'CREATE TABLE tbl (field)';
$insertSql = array();
$insertSql[1] = 'INSERT INTO tbl (field) VALUES (1)';
$insertSql[2] = 'INSERT INTO tbl (field) VALUES (2)';
$insertSql[3] = 'INSERT INTO tbl (field) VALUES (3)';
$insertSql[4] = 'INSERT INTO tbl (field) VALUES (4)';
$insertSql[5] = 'INSERT INTO tbl (field) VALUES (5)';
$insertSql[6] = 'INSERT INTO tbl (field) VALUES (6)';
$insertSql[7] = 'INSERT INTO tbl (field) VALUES (7)';

$selectSql = 'SELECT field FROM tbl WHERE field BETWEEN 3 AND
5';
$bindedSql = 'SELECT field FROM tbl WHERE field BETWEEN :first
AND :last';

$bindedValues = array(':first' = 3, ':last' = 5);

$db = new PDO('sqlite:test.db');

$db-exec($createSql);
foreach ($insertSql as $query) {
$db-exec($query);
}

$testNoBind = $db-query($selectSql);
$rowsNoBind = $testNoBind-fetchAll();

var_dump($rowsNoBind);

$testWithBind = $db-prepare($bindedSql);
$testWithBind-execute($bindedValues);
$rowsWithBind = $testWithBind-fetchAll();

var_dump($rowsWithBind);

$db = NULL;
} catch (Exception $e) {
var_dump($e);
}
[/code]

[expected]
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
[/expected]

[result]
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
array(0) {
}
[/result]

is it more clear now?


Previous Comments:


[2007-06-07 10:20:05] [EMAIL PROTECTED]

i thought that PDOStatement::queryString will change will executing
 the PDOStatement.

Well, you were wrong.

obviously it isn't so, otherwise i hadn't open the bug
i haven't yet tested it on another enviroment, but on the one i'm
working it doesn't work.

Works just fine here.
(And apparently everywhere else, since this is a very basic
functionality and you're the only one complaining.)

have i to open another bug showing the difference making the query
strainght with no binding and without it? (the first works, not the
latter)

Sorry, I don't understand what you're talking about.



[2007-06-07 10:15:16] andrea dot spacca at gmail dot com

 Binds are processed by the database drivers (where available), so
 $tmp-queryString contains original query, not the processed one.

i thought that PDOStatement::queryString will change will executing the
PDOStatement.



 And you code works just fine when table
 exists and contains requested data.

obviously it isn't so, otherwise i hadn't open the bug

i haven't yet tested it on another enviroment, but on the one i'm
working it doesn't work.

have i to open another bug showing the difference making the query
strainght with no binding and without it? (the first works, not the
latter)



[2007-06-07 10:04:02] [EMAIL PROTECTED]

$tmp-quetryString haven't the :placeholder binded to the value
passed in execute(), so the query won't be a valid one and 
$tmp-fetchAll() will be empty

Binds are processed by the database drivers (where available), so
$tmp-queryString contains original query, not the processed one.

And you code works just fine when table exists and contains requested
data.





[2007-06-07 10:03:59] andrea dot spacca at gmail dot com

i

#41622 [Fbk-Opn]: no binding with prepare/execute

2007-06-07 Thread andrea dot spacca at gmail dot com
 ID:   41622
 User updated by:  andrea dot spacca at gmail dot com
 Reported By:  andrea dot spacca at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.2.3
 New Comment:

 mysql CREATE TABLE tbl (field);
 ERROR 1064 (42000): You have an error in your SQL syntax; check the
 manual that corresponds to your MySQL server version for the right
 syntax to use near ')' at line 1

please, pay attention: i'm using sqlite


Previous Comments:


[2007-06-07 12:53:02] [EMAIL PROTECTED]

mysql CREATE TABLE tbl (field);
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ')' at line 1




[2007-06-07 12:49:10] andrea dot spacca at gmail dot com

 Works just fine here.

i've no doubt, otherwise you'd open the bug before me


 (And apparently everywhere else, since this is a very basic
 functionality and you're the only one complaining.)

that's false: i'm not the only one complaining, see
http://pecl.php.net/bugs/bug.php?id=6030 and
http://bugs.php.net/bug.php?id=36788. the fact that the complaints were
ignored doesn't mean that the bug doesn't exist


 Sorry, I don't understand what you're talking about.

i'll be more explicit:
[code]
try {
$createSql = 'CREATE TABLE tbl (field)';
$insertSql = array();
$insertSql[1] = 'INSERT INTO tbl (field) VALUES (1)';
$insertSql[2] = 'INSERT INTO tbl (field) VALUES (2)';
$insertSql[3] = 'INSERT INTO tbl (field) VALUES (3)';
$insertSql[4] = 'INSERT INTO tbl (field) VALUES (4)';
$insertSql[5] = 'INSERT INTO tbl (field) VALUES (5)';
$insertSql[6] = 'INSERT INTO tbl (field) VALUES (6)';
$insertSql[7] = 'INSERT INTO tbl (field) VALUES (7)';

$selectSql = 'SELECT field FROM tbl WHERE field BETWEEN 3 AND
5';
$bindedSql = 'SELECT field FROM tbl WHERE field BETWEEN :first
AND :last';

$bindedValues = array(':first' = 3, ':last' = 5);

$db = new PDO('sqlite:test.db');

$db-exec($createSql);
foreach ($insertSql as $query) {
$db-exec($query);
}

$testNoBind = $db-query($selectSql);
$rowsNoBind = $testNoBind-fetchAll();

var_dump($rowsNoBind);

$testWithBind = $db-prepare($bindedSql);
$testWithBind-execute($bindedValues);
$rowsWithBind = $testWithBind-fetchAll();

var_dump($rowsWithBind);

$db = NULL;
} catch (Exception $e) {
var_dump($e);
}
[/code]

[expected]
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
[/expected]

[result]
array(3) {
  [0]=
  array(2) {
[field]=
string(1) 3
[0]=
string(1) 3
  }
  [1]=
  array(2) {
[field]=
string(1) 4
[0]=
string(1) 4
  }
  [2]=
  array(2) {
[field]=
string(1) 5
[0]=
string(1) 5
  }
}
array(0) {
}
[/result]

is it more clear now?



[2007-06-07 10:20:05] [EMAIL PROTECTED]

i thought that PDOStatement::queryString will change will executing
 the PDOStatement.

Well, you were wrong.

obviously it isn't so, otherwise i hadn't open the bug
i haven't yet tested it on another enviroment, but on the one i'm
working it doesn't work.

Works just fine here.
(And apparently everywhere else, since this is a very basic
functionality and you're the only one complaining.)

have i to open another bug showing the difference making the query
strainght with no binding and without it? (the first works, not the
latter)

Sorry, I don't understand what you're talking about.



[2007-06-07 10:15:16] andrea dot spacca at gmail dot com

 Binds are processed by the database drivers (where available), so
 $tmp-queryString contains original query, not the processed one.

i thought that PDOStatement::queryString will change will executing the
PDOStatement.



 And you code works just fine when table
 exists and contains requested data.

obviously it isn't so, otherwise i hadn't open the bug

i haven't yet tested it on another enviroment, but on the one i'm
working it doesn't work.

have i to open another bug showing the difference making the query

#41622 [NEW]: no binding with prepare/execute

2007-06-07 Thread andrea dot spacca at gmail dot com
From: andrea dot spacca at gmail dot com
Operating system: Linux
PHP version:  5.2.3
PHP Bug Type: PDO related
Bug description:  no binding with prepare/execute

Description:

Binding params to placeholders in prepared query don't work
(i tested the script both cli and in apache enviroment)

[pdo_mysql]
PDO Driver for MySQL, client library version = 5.0.34

[pdo_sqlite]
PDO Driver for SQLite 3.x = enabled
PECL Module version = 1.0.1
SQLite Library = 3.3.17

Reproduce code:
---
try {
$sql = 'SELECT field FROM table WHERE field = :placeholder LIMIT
0, 1';

$db = new PDO([...]);
$tmp = $db-prepare($sql);
$tmp-execute(array(':placeholder' = 1));

var_dump($tmp-queryString);
var_dump($tmp-fetchAll());

$db = NULL;
} catch (Exception $e) {
var_dump($e);
}


Expected result:

$tmp-queryString should contain the :placeholder binded to the value
passed in execute(), and (as far as the query will produce row result from
the db) $tmp-fetchAll() should contain the resulted row


expected output:
string(61) SELECT field FROM table WHERE field = 1 LIMIT 0, 1
array(1) {
  [0]=
  array(2) {
[field]=
string(1) 1
[0]=
string(1) 1
[urlString]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[1]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[scheme]=
string(4) http
[2]=
string(4) http
[dominio]=
string(32) comequandofuoripiove.leonardo.it
[3]=
string(32) comequandofuoripiove.leonardo.it
[insertTimestamp]=
string(13) 1177596562453
[4]=
string(13) 1177596562453
[diffChk]=
string(1) 1
[5]=
string(1) 1
  }
}

Actual result:
--
$tmp-quetryString haven't the :placeholder binded to the value passed in
execute(), so the query won't be a valid one and $tmp-fetchAll() will be
empty

the same happens using PDOStatement::bindValue() or
PDOStatement::bindParam()

the result seems not being related to a specific db driver (i tested with
mysql and sqlite)

no exception is raised

script output:
string(61) SELECT * FROM table WHERE field = :placeholder
array(0) {
}



ps: if i remove the placeholder from prepare() and then try to still bind
a value in execute() an exception is raised: SQLSTATE[HY000]: General
error: 25 bind or column index out of range

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


#41622 [Opn]: no binding with prepare/execute

2007-06-07 Thread andrea dot spacca at gmail dot com
 ID:   41622
 User updated by:  andrea dot spacca at gmail dot com
 Reported By:  andrea dot spacca at gmail dot com
 Status:   Open
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.2.3
 New Comment:

in expected result the var_dumped array should be:
array(1) {
  [0]=
  array(2) {
[field]=
string(1) 1
[0]=
string(1) 1
  }
}


Previous Comments:


[2007-06-07 09:53:44] andrea dot spacca at gmail dot com

Description:

Binding params to placeholders in prepared query don't work
(i tested the script both cli and in apache enviroment)

[pdo_mysql]
PDO Driver for MySQL, client library version = 5.0.34

[pdo_sqlite]
PDO Driver for SQLite 3.x = enabled
PECL Module version = 1.0.1
SQLite Library = 3.3.17

Reproduce code:
---
try {
$sql = 'SELECT field FROM table WHERE field = :placeholder
LIMIT 0, 1';

$db = new PDO([...]);
$tmp = $db-prepare($sql);
$tmp-execute(array(':placeholder' = 1));

var_dump($tmp-queryString);
var_dump($tmp-fetchAll());

$db = NULL;
} catch (Exception $e) {
var_dump($e);
}


Expected result:

$tmp-queryString should contain the :placeholder binded to the value
passed in execute(), and (as far as the query will produce row result
from the db) $tmp-fetchAll() should contain the resulted row


expected output:
string(61) SELECT field FROM table WHERE field = 1 LIMIT 0, 1
array(1) {
  [0]=
  array(2) {
[field]=
string(1) 1
[0]=
string(1) 1
[urlString]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[1]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[scheme]=
string(4) http
[2]=
string(4) http
[dominio]=
string(32) comequandofuoripiove.leonardo.it
[3]=
string(32) comequandofuoripiove.leonardo.it
[insertTimestamp]=
string(13) 1177596562453
[4]=
string(13) 1177596562453
[diffChk]=
string(1) 1
[5]=
string(1) 1
  }
}

Actual result:
--
$tmp-quetryString haven't the :placeholder binded to the value passed
in execute(), so the query won't be a valid one and $tmp-fetchAll()
will be empty

the same happens using PDOStatement::bindValue() or
PDOStatement::bindParam()

the result seems not being related to a specific db driver (i tested
with mysql and sqlite)

no exception is raised

script output:
string(61) SELECT * FROM table WHERE field = :placeholder
array(0) {
}



ps: if i remove the placeholder from prepare() and then try to still
bind a value in execute() an exception is raised: SQLSTATE[HY000]:
General error: 25 bind or column index out of range





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


#41622 [Opn]: no binding with prepare/execute

2007-06-07 Thread andrea dot spacca at gmail dot com
 ID:   41622
 User updated by:  andrea dot spacca at gmail dot com
 Reported By:  andrea dot spacca at gmail dot com
 Status:   Open
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.2.3
 New Comment:

i haven't put the example in the code but the problem raises both with
named and anonymous placeholders


Previous Comments:


[2007-06-07 09:54:57] andrea dot spacca at gmail dot com

in expected result the var_dumped array should be:
array(1) {
  [0]=
  array(2) {
[field]=
string(1) 1
[0]=
string(1) 1
  }
}



[2007-06-07 09:53:44] andrea dot spacca at gmail dot com

Description:

Binding params to placeholders in prepared query don't work
(i tested the script both cli and in apache enviroment)

[pdo_mysql]
PDO Driver for MySQL, client library version = 5.0.34

[pdo_sqlite]
PDO Driver for SQLite 3.x = enabled
PECL Module version = 1.0.1
SQLite Library = 3.3.17

Reproduce code:
---
try {
$sql = 'SELECT field FROM table WHERE field = :placeholder
LIMIT 0, 1';

$db = new PDO([...]);
$tmp = $db-prepare($sql);
$tmp-execute(array(':placeholder' = 1));

var_dump($tmp-queryString);
var_dump($tmp-fetchAll());

$db = NULL;
} catch (Exception $e) {
var_dump($e);
}


Expected result:

$tmp-queryString should contain the :placeholder binded to the value
passed in execute(), and (as far as the query will produce row result
from the db) $tmp-fetchAll() should contain the resulted row


expected output:
string(61) SELECT field FROM table WHERE field = 1 LIMIT 0, 1
array(1) {
  [0]=
  array(2) {
[field]=
string(1) 1
[0]=
string(1) 1
[urlString]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[1]=
string(44) http://comequandofuoripiove.leonardo.it/foto;
[scheme]=
string(4) http
[2]=
string(4) http
[dominio]=
string(32) comequandofuoripiove.leonardo.it
[3]=
string(32) comequandofuoripiove.leonardo.it
[insertTimestamp]=
string(13) 1177596562453
[4]=
string(13) 1177596562453
[diffChk]=
string(1) 1
[5]=
string(1) 1
  }
}

Actual result:
--
$tmp-quetryString haven't the :placeholder binded to the value passed
in execute(), so the query won't be a valid one and $tmp-fetchAll()
will be empty

the same happens using PDOStatement::bindValue() or
PDOStatement::bindParam()

the result seems not being related to a specific db driver (i tested
with mysql and sqlite)

no exception is raised

script output:
string(61) SELECT * FROM table WHERE field = :placeholder
array(0) {
}



ps: if i remove the placeholder from prepare() and then try to still
bind a value in execute() an exception is raised: SQLSTATE[HY000]:
General error: 25 bind or column index out of range





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


#38992 [Com]: ReflectionMethod::invoke() and ::invokeArgs() static method calls should match

2007-05-28 Thread andrea at 3site dot it
 ID:   38992
 Comment by:   andrea at 3site dot it
 Reported By:  matthew at zend dot com
 Status:   Assigned
 Bug Type: Feature/Change Request
 Operating System: Debian SID on i686
 PHP Version:  5.1.6
 Assigned To:  johannes
 New Comment:

I suppose this isn't a bug since PHP 5 inherits classes public static
methods too (and they call them ... feature ... ).

$r-invoke(new MyClass, array());

This should be expected bahaviour or there's something wrong on this
bogus: http://bugs.php.net/bug.php?id=40886

If this bug will be solved, PHP developers should think about
*difference* between public static methods and instances methods, that
are two different things, expecially without overload possibility
changing arguments or using __call too, that in this case, isn't so
magic, IMHO.


Previous Comments:


[2006-09-29 13:15:51] matthew at zend dot com

Description:

ReflectionMethod::invoke() and ReflectionMethod::invokeArgs()
implementations currently do not support the same functionality.

Currently, ReflectionMethod::invoke() can be called using a string
class name as the first argument *if* the method is declared static.
However, ReflectionMethod::invokeArgs(), called the same way, raises a
warning and does not invoke the method:

Warning: ReflectionMethod::invokeArgs() expects parameter 1 to be
object, string given

Calling with a string class name is undocumented currently, but a
useful feature to have. I'd request that invokeArgs() be made to match
the current invoke() functionality, and the documentation updated to
indicate this usage.

Reproduce code:
---
?php
class MyClass
{
public static function doSomething()
{
echo Did it!\n;
}
}

$r = new ReflectionMethod('MyClass', 'doSomething');
$args = array();
$r-invoke('MyClass', array());
$r-invokeArgs('MyClass', $args);


Expected result:

Did it!
Did it!

Actual result:
--
Did it!

Warning: ReflectionMethod::invokeArgs() expects parameter 1 to be
object, string given in ... line 13





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


#40886 [Bgs]: static methods assigned to instances

2007-03-23 Thread andrea at 3site dot it
 ID:   40886
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Windows XP SP2
 PHP Version:  5.2.1
 New Comment:

Finally a developer show me what PHP 5 developers did with static
behaviour ... it's totally the same of Java language but you probably
forget a tiny thing: PHP is not Java and Java supports methods overload
too!

At this point you implemented a keyword that get us less features than
Java but its behaviour is the same of Java.

I remember you that PHP isn't pseudo compiled, isn't fast as Java
should be and, as I've just said, it doesn't support pure method
overload so with Java You can change a method behaviour even if one
overload is static but you can't do the same thing with PHP.

This is an OO logic problem (if you don't want to call them *bug*)
and to copy some Java concept inside a scripting language is not the way
to have a better PHP, IMHO.

Regards, Andrea Giammarchi


Previous Comments:


[2007-03-22 16:38:20] andrea at 3site dot it

That's what I think about this feature.
http://webreflection.blogspot.com/2007/03/php-5-developers-teach-us-what-does.html

If a method is static, it should be static ... with PHP 5 a static
method become an instance method (not static) ... what a feature!

The solution is to remove static keyword from my static methods, well
done!

I hope PHP 6 will not have this ambiguity, regards.



[2007-03-22 14:51:05] [EMAIL PROTECTED]

this bug really shows how one person's bug is another person's 
feature. :)

the syntax $a-method() allows you to call a static method of the 
class that $a is an instantiated object of, something I find useful 
for objects that contain static methods in a parent/child 
inheritance hierarchy.  Using $a-method(), I don't need to do 
hackery to figure out which class $a is in order to call one of 
its static methods.  Consider the alternative:

?php
call_user_func_array(get_class($a), 'method', $args);
?

The above is the only alternative (save using reflection, which is 
even more verbose and inefficient) to:

?php
$a-method($arg1, $arg1);
?

Which syntax do you prefer?

The big difference between php 4 and php 5 is that a method declared 
as static does not have $this set.  You'll get a fatal error, in 
fact, if you try to use $this in a static method.

Why do you care so much about whether it's called with 
class::method() or $this-method()?  You can't have two methods with 
the same name, one static and one non-static, so there is no 
possibility of accidentally calling the wrong one.

If you are wanting absolutely perfect OO, there are plenty of 
other languages that will provide exactly the straightjacket and 
punishment you desire.  If you want to code efficient, easy to 
maintain, working programs, use PHP.



[2007-03-22 12:28:44] andrea at 3site dot it

Derick, this is a bug (any Object Oriented logic).
There's something wrong in your static keyword implementation, at least
for methods that uses static keyword.

This my last call and this is my last example:

?php
class ExampleClass {

public  $StaticExample;

public final function __construct(){
// bye bye public *parameter*
$this-StaticExample = create_function('$never', 'return 
welcome
PHP5 ambiguity;');
}

public final static function StaticExample(){
echo StaticExample, br /;
}
}

$test = new ExampleClass();
ExampleClass::StaticExample();
exit($test-StaticExample());
?

What does static keyword mean for PHP 5 developers?
If this is an expected behaviour you should explain them in
documentation page.

Regards (I'll never open again this *bug*)



[2007-03-22 12:18:16] [EMAIL PROTECTED]

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





[2007-03-22 12:15:28] [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/40886

-- 
Edit

#40886 [Bgs-Opn]: static methods assigned to instances

2007-03-22 Thread andrea at 3site dot it
 ID:   40886
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
-Status:   Bogus
+Status:   Open
 Bug Type: Class/Object related
 Operating System: Windows XP SP2
 PHP Version:  5.2.1
 New Comment:

This cannot be an expected behaviour because in this way a static
method is exactly the same of a generic public method.

Static parameters aren't (correctly) usable with instances so why
static methods should be assigned?

If this is an expected behaviour please tell us what do You think
static keyword means and explain them correctly on documentation page.


Previous Comments:


[2007-03-21 21:02:53] [EMAIL PROTECTED]

Expected behaviour.



[2007-03-21 20:13:21] andrea at 3site dot it

damn ... http://www.php.net/manual/en/language.oop5.static.php

Declaring class members or methods as static makes them accessible
without needing an instantiation of the class. A member declared as
static can not be accessed with an instantiated class object (though a
static method can).

Well ... C# and other languages doesn't assign static methods to
instances.

C++ does it but it assign static parameters too.

With PHP 5 we can't use the same name for 2 different methods (for
example one static and one public) but we can call a static method
without static declaration (only E_STRICT tells us there's something
wrong) while C++ can't call a public method, or parameter, with a class
if it's not declared as static.

At this point, why did You introduce the static method/property type?
This implementation is not Object Oriented, it's quite Hilarius
Oriented.

Sorry for this bug (and for me it's really a bug!).
Regards.



[2007-03-21 18:56:54] andrea at 3site dot it

Description:

Description:

I don't know if it is by design, but this is not what I would expect
logically ... (and with static variables it doesn't happen so it should
be a _strange_ logic)

I suppose this problem is related with this one:
http://bugs.php.net/bug.php?id=40837

but I think this one is *not* callable Irrelevant

Reproduce code:
---
?php
class ExampleClass {

public static function StaticExample(){
echo StaticExample, br /;
}

public function InstanceExample(){
echo InstanceExample, br /;
}
}

$test = new ExampleClass();
ExampleClass::StaticExample();  // ok
$test-InstanceExample();   // ok
$test-StaticExample(); // what the hell?
?

Expected result:

StaticExample
InstanceExample
FATAL ERROR ... undefined method StaticExample

Actual result:
--
StaticExample
InstanceExample
StaticExample





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


#40886 [Bgs-Opn]: static methods assigned to instances

2007-03-22 Thread andrea at 3site dot it
 ID:   40886
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
-Status:   Bogus
+Status:   Open
 Bug Type: Class/Object related
 Operating System: Windows XP SP2
 PHP Version:  5.2.1
 New Comment:

Derick, this is a bug (any Object Oriented logic).
There's something wrong in your static keyword implementation, at least
for methods that uses static keyword.

This my last call and this is my last example:

?php
class ExampleClass {

public  $StaticExample;

public final function __construct(){
// bye bye public *parameter*
$this-StaticExample = create_function('$never', 'return 
welcome
PHP5 ambiguity;');
}

public final static function StaticExample(){
echo StaticExample, br /;
}
}

$test = new ExampleClass();
ExampleClass::StaticExample();
exit($test-StaticExample());
?

What does static keyword mean for PHP 5 developers?
If this is an expected behaviour you should explain them in
documentation page.

Regards (I'll never open again this *bug*)


Previous Comments:


[2007-03-22 12:18:16] [EMAIL PROTECTED]

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





[2007-03-22 12:15:28] [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-03-22 11:29:22] daniele_dll at yahoo dot it

Hi,

i was talking with andrea yesterday evening and he was explaining me
that stuff.

I don't know if it is an expected behaviour or not, but i'm sure that
somewhere there is a problem!

Infact, if it is an expected behaviour the static keyword loss it
meanings and, probably, slowdown the php page compilation/execution, but
if it is normal documentation should be fixed because it says a totally
different stuff.

However, to get back to the problem, the manual says, as should be:
A member declared as static can not be accessed with an instantiated
class object

Because is a non sense say that something is static and after let to
the code to call it as non static



[2007-03-22 11:19:48] andrea at 3site dot it

This cannot be an expected behaviour because in this way a static
method is exactly the same of a generic public method.

Static parameters aren't (correctly) usable with instances so why
static methods should be assigned?

If this is an expected behaviour please tell us what do You think
static keyword means and explain them correctly on documentation page.



[2007-03-21 21:02:53] [EMAIL PROTECTED]

Expected behaviour.



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

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


#40886 [Bgs]: static methods assigned to instances

2007-03-22 Thread andrea at 3site dot it
 ID:   40886
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Windows XP SP2
 PHP Version:  5.2.1
 New Comment:

That's what I think about this feature.
http://webreflection.blogspot.com/2007/03/php-5-developers-teach-us-what-does.html

If a method is static, it should be static ... with PHP 5 a static
method become an instance method (not static) ... what a feature!

The solution is to remove static keyword from my static methods, well
done!

I hope PHP 6 will not have this ambiguity, regards.


Previous Comments:


[2007-03-22 14:51:05] [EMAIL PROTECTED]

this bug really shows how one person's bug is another person's 
feature. :)

the syntax $a-method() allows you to call a static method of the 
class that $a is an instantiated object of, something I find useful 
for objects that contain static methods in a parent/child 
inheritance hierarchy.  Using $a-method(), I don't need to do 
hackery to figure out which class $a is in order to call one of 
its static methods.  Consider the alternative:

?php
call_user_func_array(get_class($a), 'method', $args);
?

The above is the only alternative (save using reflection, which is 
even more verbose and inefficient) to:

?php
$a-method($arg1, $arg1);
?

Which syntax do you prefer?

The big difference between php 4 and php 5 is that a method declared 
as static does not have $this set.  You'll get a fatal error, in 
fact, if you try to use $this in a static method.

Why do you care so much about whether it's called with 
class::method() or $this-method()?  You can't have two methods with 
the same name, one static and one non-static, so there is no 
possibility of accidentally calling the wrong one.

If you are wanting absolutely perfect OO, there are plenty of 
other languages that will provide exactly the straightjacket and 
punishment you desire.  If you want to code efficient, easy to 
maintain, working programs, use PHP.



[2007-03-22 12:28:44] andrea at 3site dot it

Derick, this is a bug (any Object Oriented logic).
There's something wrong in your static keyword implementation, at least
for methods that uses static keyword.

This my last call and this is my last example:

?php
class ExampleClass {

public  $StaticExample;

public final function __construct(){
// bye bye public *parameter*
$this-StaticExample = create_function('$never', 'return 
welcome
PHP5 ambiguity;');
}

public final static function StaticExample(){
echo StaticExample, br /;
}
}

$test = new ExampleClass();
ExampleClass::StaticExample();
exit($test-StaticExample());
?

What does static keyword mean for PHP 5 developers?
If this is an expected behaviour you should explain them in
documentation page.

Regards (I'll never open again this *bug*)



[2007-03-22 12:18:16] [EMAIL PROTECTED]

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





[2007-03-22 12:15:28] [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-03-22 11:29:22] daniele_dll at yahoo dot it

Hi,

i was talking with andrea yesterday evening and he was explaining me
that stuff.

I don't know if it is an expected behaviour or not, but i'm sure that
somewhere there is a problem!

Infact, if it is an expected behaviour the static keyword loss it
meanings and, probably, slowdown the php page compilation/execution, but
if it is normal documentation should be fixed because it says a totally
different stuff.

However, to get back to the problem, the manual says, as should be:
A member declared as static can not be accessed with an instantiated
class object

Because is a non sense say that something is static and after let to
the code to call it as non static



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

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


#40886 [NEW]: static methods assigned to instances

2007-03-21 Thread andrea at 3site dot it
From: andrea at 3site dot it
Operating system: Windows XP SP2
PHP version:  5.2.1
PHP Bug Type: Class/Object related
Bug description:  static methods assigned to instances

Description:

Description:

I don't know if it is by design, but this is not what I would expect
logically ... (and with static variables it doesn't happen so it should be
a _strange_ logic)

I suppose this problem is related with this one:
http://bugs.php.net/bug.php?id=40837

but I think this one is *not* callable Irrelevant

Reproduce code:
---
?php
class ExampleClass {

public static function StaticExample(){
echo StaticExample, br /;
}

public function InstanceExample(){
echo InstanceExample, br /;
}
}

$test = new ExampleClass();
ExampleClass::StaticExample();  // ok
$test-InstanceExample();   // ok
$test-StaticExample(); // what the hell?
?

Expected result:

StaticExample
InstanceExample
FATAL ERROR ... undefined method StaticExample

Actual result:
--
StaticExample
InstanceExample
StaticExample

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


#40886 [Opn]: static methods assigned to instances

2007-03-21 Thread andrea at 3site dot it
 ID:   40886
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
 Status:   Open
 Bug Type: Class/Object related
 Operating System: Windows XP SP2
 PHP Version:  5.2.1
 New Comment:

damn ... http://www.php.net/manual/en/language.oop5.static.php

Declaring class members or methods as static makes them accessible
without needing an instantiation of the class. A member declared as
static can not be accessed with an instantiated class object (though a
static method can).

Well ... C# and other languages doesn't assign static methods to
instances.

C++ does it but it assign static parameters too.

With PHP 5 we can't use the same name for 2 different methods (for
example one static and one public) but we can call a static method
without static declaration (only E_STRICT tells us there's something
wrong) while C++ can't call a public method, or parameter, with a class
if it's not declared as static.

At this point, why did You introduce the static method/property type?
This implementation is not Object Oriented, it's quite Hilarius
Oriented.

Sorry for this bug (and for me it's really a bug!).
Regards.


Previous Comments:


[2007-03-21 18:56:54] andrea at 3site dot it

Description:

Description:

I don't know if it is by design, but this is not what I would expect
logically ... (and with static variables it doesn't happen so it should
be a _strange_ logic)

I suppose this problem is related with this one:
http://bugs.php.net/bug.php?id=40837

but I think this one is *not* callable Irrelevant

Reproduce code:
---
?php
class ExampleClass {

public static function StaticExample(){
echo StaticExample, br /;
}

public function InstanceExample(){
echo InstanceExample, br /;
}
}

$test = new ExampleClass();
ExampleClass::StaticExample();  // ok
$test-InstanceExample();   // ok
$test-StaticExample(); // what the hell?
?

Expected result:

StaticExample
InstanceExample
FATAL ERROR ... undefined method StaticExample

Actual result:
--
StaticExample
InstanceExample
StaticExample





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


#37917 [Opn]: Original Array modified after copy

2006-07-04 Thread andrea dot busia at axis-sv dot it
 ID:   37917
 User updated by:  andrea dot busia at axis-sv dot it
 Reported By:  andrea dot busia at axis-sv dot it
 Status:   Open
 Bug Type: Arrays related
 Operating System: Linux / WinXp
 PHP Version:  5.1.4
 New Comment:

No news? This bug is affecting many script and I haven't a workaround.
Is's a critical bug.

Thanks
Andrea Busia


Previous Comments:


[2006-06-26 12:55:36] andrea dot busia at axis-sv dot it

Because for a mistake Actual result had to be Expected result and
Expected result had to be Actual result.



[2006-06-26 12:52:10] andrea dot busia at axis-sv dot it

Description:

First problem: If I Create an array setting an element to a string and
another element as a reference to the first, then copy the array into
an other variable, if i modify the second variable also the original
array is modified.

Second problem:
why the second code line ($a[0]=foo;) produces
  [0]=
  string(3) foo

instead of
  [0]=
  string(3) foo

Thanks
Andrea Busia

Reproduce code:
---
?
$a=array();
$a[0]=foo;
$a[1] = $a[0];
var_dump($a);
$b=$a;
$b[0]=bar;
var_dump($a);
?


Expected result:

array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}


Actual result:
--
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}
array(2) {
  [0]=
  string(3) bar
  [1]=
  string(3) bar
}






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


#37917 [NEW]: Original Array modified after copy

2006-06-26 Thread andrea dot busia at axis-sv dot it
From: andrea dot busia at axis-sv dot it
Operating system: Linux / WinXp
PHP version:  5.1.4
PHP Bug Type: Arrays related
Bug description:  Original Array modified after copy

Description:

First problem: If I Create an array setting an element to a string and
another element as a reference to the first, then copy the array into an
other variable, if i modify the second variable also the original array is
modified.

Second problem:
why the second code line ($a[0]=foo;) produces
  [0]=
  string(3) foo

instead of
  [0]=
  string(3) foo

Thanks
Andrea Busia

Reproduce code:
---
?
$a=array();
$a[0]=foo;
$a[1] = $a[0];
var_dump($a);
$b=$a;
$b[0]=bar;
var_dump($a);
?


Expected result:

array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}


Actual result:
--
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}
array(2) {
  [0]=
  string(3) bar
  [1]=
  string(3) bar
}


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


#37917 [Opn]: Original Array modified after copy

2006-06-26 Thread andrea dot busia at axis-sv dot it
 ID:   37917
 User updated by:  andrea dot busia at axis-sv dot it
 Reported By:  andrea dot busia at axis-sv dot it
 Status:   Open
 Bug Type: Arrays related
 Operating System: Linux / WinXp
 PHP Version:  5.1.4
 New Comment:

Because for a mistake Actual result had to be Expected result and
Expected result had to be Actual result.


Previous Comments:


[2006-06-26 12:52:10] andrea dot busia at axis-sv dot it

Description:

First problem: If I Create an array setting an element to a string and
another element as a reference to the first, then copy the array into
an other variable, if i modify the second variable also the original
array is modified.

Second problem:
why the second code line ($a[0]=foo;) produces
  [0]=
  string(3) foo

instead of
  [0]=
  string(3) foo

Thanks
Andrea Busia

Reproduce code:
---
?
$a=array();
$a[0]=foo;
$a[1] = $a[0];
var_dump($a);
$b=$a;
$b[0]=bar;
var_dump($a);
?


Expected result:

array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}


Actual result:
--
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) foo
}
array(2) {
  [0]=
  string(3) bar
  [1]=
  string(3) bar
}






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


#35480 [Com]: Persistent connections + unknown column crashes

2005-11-30 Thread andrea at 3site dot it
 ID:   35480
 Comment by:   andrea at 3site dot it
 Reported By:  tim at komta dot com
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Windows XP
 PHP Version:  5CVS-2005-11-30 (snap)
 Assigned To:  wez
 New Comment:

Hi guys, theese are two result files generated by APD for PHP 5.1.1 ...
are theese usefull ?

First crash: 
#Pprof [APD] v1.0.1
caller=C:\Programmi\Apache Group\Apache2\htdocs\test.php

END_HEADER
! 2 C:\Programmi\Apache Group\Apache2\htdocs\test.php
 3 main 2
+ 3 2 2
 4 apd_set_pprof_trace 2
+ 4 2 2
@ 2 2 0 10014 7978
- 3
 6 PDO-__construct 1
+ 6 2 9
@ 2 9 0 0 271419
- 6
 7 PDO-prepare 1
+ 7 2 14
@ 2 14 0 0 106
- 7
 8 PDOStatement-execute 1
+ 8 2 15
@ 2 15 0 0 1164
- 8
@ 2 19 0 0 27
- 2


Second crash, script launched 1 time ... but two crashes:
#Pprof [APD] v1.0.1
caller=C:\Programmi\Apache Group\Apache2\htdocs\test.php

END_HEADER
! 1 C:\Programmi\Apache Group\Apache2\htdocs\test.php
 1 main 2
+ 1 1 2
 2 apd_set_pprof_trace 2
+ 2 1 2
@ 0 2 0 10014 3020
- 2
 4 PDO-__construct 1
+ 4 1 9
@ 1 9 0 0 7835
- 4
 5 PDO-prepare 1
+ 5 1 14
@ 1 14 0 0 77
- 5
 6 PDOStatement-execute 1
+ 6 1 15
@ 1 15 0 0 435
- 6
@ 1 19 0 0 22
- 1



Code used is the same of gm with apd starded:
?php
apd_set_pprof_trace();
try {
$dbo = new PDO(
'mysql:host=localhost;dbname=test',
'user',
'pass',
array(PDO::ATTR_PERSISTENT = true)
);
} catch(PDOException $e) {
echo 'Errore di connessione: '.$e-getMessage();
}

$pdostatement = $dbo-prepare('SELECT * FROM fake_table');
$pdostatement-execute();

echo 'print something';

?


Regards .

P.S. Windows XP SP2 full updated with Apache 2.0.52 and PHP 5.1.1 as
module


Previous Comments:


[2005-11-30 15:26:19] tim at komta dot com

With the snapshot linked by Sniper, the problem is still there.

Wez, I think I'm misunderstanding what you're asking...The method of
getting a backtrace that I know of (debug_backtrace()) requires PHP to
be running.  The script crashes in such a way that no output ever goes
to the user agent, in spite of no output buffering.

Is there something else I should be doing?

- Tim



[2005-11-30 14:07:51] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-11-30 03:35:09] [EMAIL PROTECTED]

tim, can you provide a backtrace?



[2005-11-29 23:09:53] [EMAIL PROTECTED]

Georg, this seems to be the same issue caused by protocol binary
incompatibility.



[2005-11-29 23:04:24] tim at komta dot com

Oops, sorry about that, it's MySQL 5.0.15



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

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


#35480 [Com]: Persistent connections + unknown column crashes

2005-11-30 Thread andrea at 3site dot it
 ID:   35480
 Comment by:   andrea at 3site dot it
 Reported By:  tim at komta dot com
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Windows XP
 PHP Version:  5CVS-2005-11-30 (snap)
 Assigned To:  wez
 New Comment:

Hi guys, it's me again :-)

MySQL used version for over debug was MySQL 4.1.9-nt ... but maybe the
problem is for the constant PDO::ATTR_PERSISTENT that creates some
problems on windows and Apache ... 

in sqlite, 2 or 3 default version, is the same .. in a different way,
if I try to connect with PDO::ATTR_PERSISTENT = true the database will
be undeletable and I need to stop Apache (with a crash) ... and then I
can delete my files.

It doesn't happen without PDO::ATTR_PERSISTENT during connection ...
but I wonder in a :memory: connection what should happen ... fear !
:oVVoVe:

Now this is the code:
?php
$dbfile1 = 'sqlite2.sql';
$dbfile2 = 'sqlite3.sql';
$sqlite = new PDO('sqlite2:'.$dbfile1, '', '',
array(PDO::ATTR_PERSISTENT = true));
unset($sqlite);
$sqlite = new PDO('sqlite:'.$dbfile2, '', '',
array(PDO::ATTR_PERSISTENT = true));
unset($sqlite);
unlink($dbfile1);
unlink($dbfile2);
?

Regards


Previous Comments:


[2005-11-30 16:07:45] andrea at 3site dot it

Hi guys, theese are two result files generated by APD for PHP 5.1.1 ...
are theese usefull ?

First crash: 
#Pprof [APD] v1.0.1
caller=C:\Programmi\Apache Group\Apache2\htdocs\test.php

END_HEADER
! 2 C:\Programmi\Apache Group\Apache2\htdocs\test.php
 3 main 2
+ 3 2 2
 4 apd_set_pprof_trace 2
+ 4 2 2
@ 2 2 0 10014 7978
- 3
 6 PDO-__construct 1
+ 6 2 9
@ 2 9 0 0 271419
- 6
 7 PDO-prepare 1
+ 7 2 14
@ 2 14 0 0 106
- 7
 8 PDOStatement-execute 1
+ 8 2 15
@ 2 15 0 0 1164
- 8
@ 2 19 0 0 27
- 2


Second crash, script launched 1 time ... but two crashes:
#Pprof [APD] v1.0.1
caller=C:\Programmi\Apache Group\Apache2\htdocs\test.php

END_HEADER
! 1 C:\Programmi\Apache Group\Apache2\htdocs\test.php
 1 main 2
+ 1 1 2
 2 apd_set_pprof_trace 2
+ 2 1 2
@ 0 2 0 10014 3020
- 2
 4 PDO-__construct 1
+ 4 1 9
@ 1 9 0 0 7835
- 4
 5 PDO-prepare 1
+ 5 1 14
@ 1 14 0 0 77
- 5
 6 PDOStatement-execute 1
+ 6 1 15
@ 1 15 0 0 435
- 6
@ 1 19 0 0 22
- 1



Code used is the same of gm with apd starded:
?php
apd_set_pprof_trace();
try {
$dbo = new PDO(
'mysql:host=localhost;dbname=test',
'user',
'pass',
array(PDO::ATTR_PERSISTENT = true)
);
} catch(PDOException $e) {
echo 'Errore di connessione: '.$e-getMessage();
}

$pdostatement = $dbo-prepare('SELECT * FROM fake_table');
$pdostatement-execute();

echo 'print something';

?


Regards .

P.S. Windows XP SP2 full updated with Apache 2.0.52 and PHP 5.1.1 as
module



[2005-11-30 15:26:19] tim at komta dot com

With the snapshot linked by Sniper, the problem is still there.

Wez, I think I'm misunderstanding what you're asking...The method of
getting a backtrace that I know of (debug_backtrace()) requires PHP to
be running.  The script crashes in such a way that no output ever goes
to the user agent, in spite of no output buffering.

Is there something else I should be doing?

- Tim



[2005-11-30 14:07:51] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-11-30 03:35:09] [EMAIL PROTECTED]

tim, can you provide a backtrace?



[2005-11-29 23:09:53] [EMAIL PROTECTED]

Georg, this seems to be the same issue caused by protocol binary
incompatibility.



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

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


#34620 [NEW]: Send an array to a class method change its value

2005-09-23 Thread andrea at 3site dot it
From: andrea at 3site dot it
Operating system: Windows XP SP2
PHP version:  5.1.0RC1
PHP Bug Type: Arrays related
Bug description:  Send an array to a class method change its value

Description:

While I interact with another class and I call a method sending a run-time
created array its values (integer value) is wrong.
This happen when I work with a lot of $_POST variables (I don't know if
this is a problem but without this bug is absent ...)

Reproduce code:
---
// code 
// NOTE: I develop with error_reporting E_ALL 
// and at this point is all OK

// die(print_r($artist_id, true));
// produce Array ( [0] = 1 [1] = image )

$GLOBALS['SES']-register('__artist_modify__', array($artist_id[0],
$artist_id[1]));

// external class, that work without problems ...
// on $GLOBALS['SES'] register method
function register($name, $value) {
die(print_r($value, true));
// produce Array ( [0] = 86724468 [1] = image )
}

Expected result:

Expected ? ... I send an array with two keys ... so what's up ?

Actual result:
--
// this code works perfectly ... 
function accept($name, $value) {
die(print_r($value, true));
}
$artist_id = array(1, 'image');
accept('__artist_modify__', array($artist_id[0], $artist_id[1]));

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


#34620 [Opn]: Send an array to a class method change its value

2005-09-23 Thread andrea at 3site dot it
 ID:   34620
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
 Status:   Open
 Bug Type: Arrays related
 Operating System: Windows XP SP2
 PHP Version:  5.1.0RC1
 New Comment:

P.S. ... with this code
$GLOBALS['SES']-register('__artist_modify__',
array(''.$artist_id[0].'', $artist_id[1]));

it works as expected ... then maybe a trouble with an integer value ?


Previous Comments:


[2005-09-23 23:20:34] andrea at 3site dot it

Description:

While I interact with another class and I call a method sending a
run-time created array its values (integer value) is wrong.
This happen when I work with a lot of $_POST variables (I don't know if
this is a problem but without this bug is absent ...)

Reproduce code:
---
// code 
// NOTE: I develop with error_reporting E_ALL 
// and at this point is all OK

// die(print_r($artist_id, true));
// produce Array ( [0] = 1 [1] = image )

$GLOBALS['SES']-register('__artist_modify__', array($artist_id[0],
$artist_id[1]));

// external class, that work without problems ...
// on $GLOBALS['SES'] register method
function register($name, $value) {
die(print_r($value, true));
// produce Array ( [0] = 86724468 [1] = image )
}

Expected result:

Expected ? ... I send an array with two keys ... so what's up ?

Actual result:
--
// this code works perfectly ... 
function accept($name, $value) {
die(print_r($value, true));
}
$artist_id = array(1, 'image');
accept('__artist_modify__', array($artist_id[0], $artist_id[1]));





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


#34620 [Fbk-Opn]: Send an array to a class method change its value

2005-09-23 Thread andrea at 3site dot it
 ID:   34620
 User updated by:  andrea at 3site dot it
 Reported By:  andrea at 3site dot it
-Status:   Feedback
+Status:   Open
 Bug Type: Arrays related
 Operating System: Windows XP SP2
 PHP Version:  5.1.0RC1
 New Comment:

Hi tony, I am at 220 line of an administration area that has about 12
class files ... then it's not possible for me reproduce the error but
if I pass a string error diseappear, then it's not a my own problem.
However, here is session class used:
http://www.devpro.it/php4_id_94.html
Follow its link to look at PDO for PHP4 example (but PDO doesn't do
anything different from all other pages).
Well , I pass a string, there are no problems, just an weisted hour to
find the error that's of PHP and not mine.
Maybe I' ll try with a PHP4 version to know more, best regards.


Previous Comments:


[2005-09-23 23:27:10] [EMAIL PROTECTED]

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

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.





[2005-09-23 23:24:32] andrea at 3site dot it

P.S. ... with this code
$GLOBALS['SES']-register('__artist_modify__',
array(''.$artist_id[0].'', $artist_id[1]));

it works as expected ... then maybe a trouble with an integer value ?



[2005-09-23 23:20:34] andrea at 3site dot it

Description:

While I interact with another class and I call a method sending a
run-time created array its values (integer value) is wrong.
This happen when I work with a lot of $_POST variables (I don't know if
this is a problem but without this bug is absent ...)

Reproduce code:
---
// code 
// NOTE: I develop with error_reporting E_ALL 
// and at this point is all OK

// die(print_r($artist_id, true));
// produce Array ( [0] = 1 [1] = image )

$GLOBALS['SES']-register('__artist_modify__', array($artist_id[0],
$artist_id[1]));

// external class, that work without problems ...
// on $GLOBALS['SES'] register method
function register($name, $value) {
die(print_r($value, true));
// produce Array ( [0] = 86724468 [1] = image )
}

Expected result:

Expected ? ... I send an array with two keys ... so what's up ?

Actual result:
--
// this code works perfectly ... 
function accept($name, $value) {
die(print_r($value, true));
}
$artist_id = array(1, 'image');
accept('__artist_modify__', array($artist_id[0], $artist_id[1]));





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


#33152 [NEW]: Segmentation Fault

2005-05-26 Thread andrea dot busia at axis-sv dot it
From: andrea dot busia at axis-sv dot it
Operating system: Linux Redhat ES
PHP version:  5CVS-2005-05-26 (dev)
PHP Bug Type: Mailparse related
Bug description:  Segmentation Fault

Description:

I have installed mailparse 2.1.1 modified as suggested in bug #32999.

I have again segmentation fault problems as described.

mail_bug.txt content:
--
Return-Path: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 11056 invoked from network); 26 May 2005 13:51:01 -
Received: from ppp-217-133-35-137.cust-adsl.tiscali.it (HELO axis20)
(217.133.35.137)
  by 212.100.249.98 with SMTP; 26 May 2005 13:51:01 -
Message-ID: [EMAIL PROTECTED]
From: Andrea Busia - Axis [EMAIL PROTECTED]
To: Andrea Busia - Axis [EMAIL PROTECTED]
Subject: bye bye
Date: Thu, 26 May 2005 15:50:41 +0200
MIME-Version: 1.0
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: base64
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527

YnllIGJ5ZQ0K




--




gdb backtrace:
--
(gdb) run tracking_mail_prova.php
Starting program: /usr/bin/php tracking_mail_prova.php
[Thread debugging using libthread_db enabled]
[New Thread 8192 (LWP 14106)]
Content-type: text/html
X-Powered-By: PHP/5.0.5-dev

bye bye

a

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 14106)]
0x0819784d in shutdown_memory_manager (silent=0, full_shutdown=0)
at /home/archivi/php5-STABLE-200505261236/Zend/zend_alloc.c:489
489 REMOVE_POINTER_FROM_LIST(ptr);
(gdb) bt
#0  0x0819784d in shutdown_memory_manager (silent=0, full_shutdown=0)
at /home/archivi/php5-STABLE-200505261236/Zend/zend_alloc.c:489
#1  0x0817a20f in php_request_shutdown (dummy=0x0)
at /home/archivi/php5-STABLE-200505261236/main/main.c:1239
#2  0x081e7b48 in main (argc=2, argv=0xbffecdf4)
at /home/archivi/php5-STABLE-200505261236/sapi/cgi/cgi_main.c:1640
--

Reproduce code:
---
?
$email_in=file_get_contents(mail_bug.txt);
$msg = new MimeMessage(var, $email_in);
echo $msg-extract_body(MAILPARSE_EXTRACT_RETURN);
$email_headers=$msg-extract_headers(MAILPARSE_EXTRACT_RETURN);

echo \na\n;
?

Expected result:

bye bye

a


Actual result:
--
bye bye

a
Segmentation fault


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


#32999 [Fbk-Opn]: Segmentation fault

2005-05-12 Thread andrea dot busia at axis-sv dot it
 ID:   32999
 User updated by:  andrea dot busia at axis-sv dot it
 Reported By:  andrea dot busia at axis-sv dot it
-Status:   Feedback
+Status:   Open
 Bug Type: Mailparse related
 Operating System: linux redhat enterprise
 PHP Version:  5.0.4
 New Comment:

It's necessary to try the CVS or I have to wait the application of the
parch submitted by andrew at sourcelabs?


Previous Comments:


[2005-05-11 22:52:14] andrew at sourcelabs dot com

The problem here is in mailparse.  In mailparse.c:151, 
zend_register_internal_class is called but the return value 
is ignored.  This function in PHP5 will always return a new 
object which should be used by the caller.  In PHP4, it 
wasn't replaced so the address was ok.  I will notify the 
maintainer of mailparse.

Here is a patch to fix mailparse:

1 73c73
  2  static zend_class_entry mimemsg_class_entry;
  3 ---
  4  static zend_class_entry *mimemsg_class_entry;
  5 140a141,142
  6zend_class_entry mmce;
  7  
  8 148,149c150,151
  9INIT_CLASS_ENTRY(mimemsg_class_entry, 
mimemessage, mimemessage_methods);
 10zend_register_internal_class
(mimemsg_class_entry TSRMLS_CC);
 11 ---
 12INIT_CLASS_ENTRY(mmce, mimemessage, 
mimemessage_methods);
 13mimemsg_class_entry = 
zend_register_internal_class(mmce TSRMLS_CC);
 14 214c216
 15object_init_ex(object, 
mimemsg_class_entry);
 16 ---
 17object_init_ex(object, mimemsg_class_entry);



[2005-05-11 21:00:47] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

Can't reproduce with latest CVS,



[2005-05-10 15:27:29] andrea dot busia at axis-sv dot it

Description:

All my scripts using mailparse exit with a segmentation fault since I
installed php5, in php4 it worked.

this is email_prova.txt content:

Return-Path: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 18935 invoked from network); 10 May 2005 13:12:48
-
Received: from ppp-217-133-20-168.cust-adsl.tiscali.it (HELO axis20)
(217.133.20.168)
  by 212.100.249.98 with SMTP; 10 May 2005 13:12:48 -
Message-ID: [EMAIL PROTECTED]
From: Andrea Busia - Axis [EMAIL PROTECTED]
To: Andrea Busia - Axis [EMAIL PROTECTED]
Subject: sdohhoisdfhi
Date: Tue, 10 May 2005 15:11:27 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary==_NextPart_000_0096_01C55572.897E0FA0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527

This is a multi-part message in MIME format.

--=_NextPart_000_0096_01C55572.897E0FA0
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

obidsfb=E8odfsb=E8odgbp=E8dgd
gs+dfghp=E8dfhp=E8gpdh=E8gfds
hgsfdhgiohpdsgoipsd
fdhoigsoidhgpfdfpo
--=_NextPart_000_0096_01C55572.897E0FA0
Content-Type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=3DContent-Type content=3Dtext/html; =
charset=3Diso-8859-1
META content=3DMSHTML 6.00.2900.2627 name=3DGENERATOR
STYLE/STYLE
/HEAD
BODY bgColor=3D#ff
DIVFONT face=3DArial =
size=3D2obidsfb=E8odfsb=E8odgbp=E8dgd/FONT/DIV
DIVFONT face=3DArial =
size=3D2gs+dfghp=E8dfhp=E8gpdh=E8gfds/FONT/DIV
DIVFONT face=3DArial size=3D2hgsfdhgiohpdsgoipsd/FONT/DIV
DIVFONT face=3DArial =
size=3D2fdhoigsoidhgpfdfpo/FONT/DIV/BODY/HTML

--=_NextPart_000_0096_01C55572.897E0FA0--





Reproduce code:
---
?
error_reporting(E_ALL);
$email_in=file_get_contents(email_prova.txt);
$msg = new MimeMessage(var, $email_in);

$n = $msg-get_child_count();
if ($n != 0) {
for ($i = 0; $i  $n; $i++) {
echo a $i $n\n;
$part = $msg-get_child($i);
echo b $i $n\n;
}
}
else echo 99\n;
?

Expected result:

a 0 3
b 0 3
a 1 3
b 1 3
a 2 3
b 2 3


Actual result:
--
a 0 3
Segmentation fault



backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 27129)]
zend_hash_apply_with_argument (ht=0x0,
apply_func=0x819e5a8 zval_update_constant, argument=0x1)
at /home/archivi/php-5.0.4/Zend/zend_hash.c:680
680 HASH_PROTECT_RECURSION(ht);
(gdb) bt

#0  zend_hash_apply_with_argument (ht=0x0,
apply_func=0x819e5a8 zval_update_constant, argument=0x1)
at /home/archivi/php-5.0.4/Zend/zend_hash.c:680
#1  0x081a9a58 in zend_update_class_constants (class_type=0x40522b40)
at /home/archivi/php-5.0.4/Zend/zend_API.c:694

#32999 [NEW]: Segmentation fault

2005-05-10 Thread andrea dot busia at axis-sv dot it
From: andrea dot busia at axis-sv dot it
Operating system: linux redhat enterprise
PHP version:  5.0.4
PHP Bug Type: Mailparse related
Bug description:  Segmentation fault

Description:

All my scripts using mailparse exit with a segmentation fault since I
installed php5, in php4 it worked.

this is email_prova.txt content:

Return-Path: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 18935 invoked from network); 10 May 2005 13:12:48 -
Received: from ppp-217-133-20-168.cust-adsl.tiscali.it (HELO axis20)
(217.133.20.168)
  by 212.100.249.98 with SMTP; 10 May 2005 13:12:48 -
Message-ID: [EMAIL PROTECTED]
From: Andrea Busia - Axis [EMAIL PROTECTED]
To: Andrea Busia - Axis [EMAIL PROTECTED]
Subject: sdohhoisdfhi
Date: Tue, 10 May 2005 15:11:27 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary==_NextPart_000_0096_01C55572.897E0FA0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527

This is a multi-part message in MIME format.

--=_NextPart_000_0096_01C55572.897E0FA0
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

obidsfb=E8odfsb=E8odgbp=E8dgd
gs+dfghp=E8dfhp=E8gpdh=E8gfds
hgsfdhgiohpdsgoipsd
fdhoigsoidhgpfdfpo
--=_NextPart_000_0096_01C55572.897E0FA0
Content-Type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=3DContent-Type content=3Dtext/html; =
charset=3Diso-8859-1
META content=3DMSHTML 6.00.2900.2627 name=3DGENERATOR
STYLE/STYLE
/HEAD
BODY bgColor=3D#ff
DIVFONT face=3DArial =
size=3D2obidsfb=E8odfsb=E8odgbp=E8dgd/FONT/DIV
DIVFONT face=3DArial =
size=3D2gs+dfghp=E8dfhp=E8gpdh=E8gfds/FONT/DIV
DIVFONT face=3DArial size=3D2hgsfdhgiohpdsgoipsd/FONT/DIV
DIVFONT face=3DArial =
size=3D2fdhoigsoidhgpfdfpo/FONT/DIV/BODY/HTML

--=_NextPart_000_0096_01C55572.897E0FA0--





Reproduce code:
---
?
error_reporting(E_ALL);
$email_in=file_get_contents(email_prova.txt);
$msg = new MimeMessage(var, $email_in);

$n = $msg-get_child_count();
if ($n != 0) {
for ($i = 0; $i  $n; $i++) {
echo a $i $n\n;
$part = $msg-get_child($i);
echo b $i $n\n;
}
}
else echo 99\n;
?

Expected result:

a 0 3
b 0 3
a 1 3
b 1 3
a 2 3
b 2 3


Actual result:
--
a 0 3
Segmentation fault



backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8192 (LWP 27129)]
zend_hash_apply_with_argument (ht=0x0,
apply_func=0x819e5a8 zval_update_constant, argument=0x1)
at /home/archivi/php-5.0.4/Zend/zend_hash.c:680
680 HASH_PROTECT_RECURSION(ht);
(gdb) bt

#0  zend_hash_apply_with_argument (ht=0x0,
apply_func=0x819e5a8 zval_update_constant, argument=0x1)
at /home/archivi/php-5.0.4/Zend/zend_hash.c:680
#1  0x081a9a58 in zend_update_class_constants (class_type=0x40522b40)
at /home/archivi/php-5.0.4/Zend/zend_API.c:694
#2  0x081a9aaa in _object_and_properties_init (arg=0x843509c,
class_type=0x40522b40, properties=0x0)
at /home/archivi/php-5.0.4/Zend/zend_API.c:714
#3  0x081a9b67 in _object_init_ex (arg=0x843509c, class_type=0x40522b40)
at /home/archivi/php-5.0.4/Zend/zend_API.c:734
#4  0x4051b1d4 in mailparse_mimemessage_export (part=0x84326e4,
object=0x843509c) at /tmp/tmpzRZItJ/mailparse-2.1.1/mailparse.c:214
#5  0x4051b99e in zif_mailparse_mimemessage_get_child (ht=1,
return_value=0x843509c, this_ptr=0x8436f54, return_value_used=1)
at /tmp/tmpzRZItJ/mailparse-2.1.1/mailparse.c:374
#6  0x081dd9db in zend_do_fcall_common_helper (execute_data=0xbffe9a50,
opline=0x8437e18, op_array=0x8431654)
at /home/archivi/php-5.0.4/Zend/zend_execute.c:2727
#7  0x081c4cfa in execute (op_array=0x8431654)
at /home/archivi/php-5.0.4/Zend/zend_execute.c:1406
#8  0x081a87a5 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /home/archivi/php-5.0.4/Zend/zend.c:1069
#9  0x0817a386 in php_execute_script (primary_file=0xbffebdd0)
at /home/archivi/php-5.0.4/main/main.c:1632
#10 0x081e6948 in main (argc=2, argv=0xbffebe74)
at /home/archivi/php-5.0.4/sapi/cgi/cgi_main.c:1577


-- 
Edit bug report at http://bugs.php.net/?id=32999edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32999r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32999r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32999r=trysnapshot51
Fixed in CVS:http://bugs.php.net/fix.php?id=32999r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=32999r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=32999r=needtrace
Need Reproduce Script:   http://bugs.php.net/fix.php?id=32999r=needscript
Try newer version:   http://bugs.php.net

#31153 [NEW]: foreach strange result

2004-12-17 Thread andrea dot busia at axis-sv dot it
From: andrea dot busia at axis-sv dot it
Operating system: Linux
PHP version:  4.3.10
PHP Bug Type: Arrays related
Bug description:  foreach strange result

Description:

When I use foreach on an array the values are wrong. It's very critical.


Reproduce code:
---
?
$a=array(5,10,15);
foreach($a as $b) var_dump($b);
?

Expected result:

int(5)
int(10)
int(15)

Actual result:
--
array(2) {
  [0]=
  int(5)
  [1]=
  int(0)
}
array(2) {
  [0]=
  int(10)
  [1]=
  int(1)
}
array(2) {
  [0]=
  int(15)
  [1]=
  int(2)
}


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


#29702 [NEW]: $a=$GLOBALS works as $a=$GLOBALS

2004-08-16 Thread andrea dot busia at axis-sv dot it
From: andrea dot busia at axis-sv dot it
Operating system: Win / Linux
PHP version:  5.0.1
PHP Bug Type: Scripting Engine problem
Bug description:  $a=$GLOBALS works as $a=$GLOBALS

Description:

In this script seems that the $GLOBALS value is changed by the unset
statement but I want to modify $ar, $GLOBALS must remain the same as
before.


Reproduce code:
---
?
$xml=array(aaa, bbb, ccc);
foo();

function foo() {
var_dump($GLOBALS[xml]);
$ar=$GLOBALS;
unset($ar['xml']);
var_dump($GLOBALS[xml]);
}
?

Expected result:

array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}


Actual result:
--
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
NULL


-- 
Edit bug report at http://bugs.php.net/?id=29702edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29702r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29702r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29702r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29702r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29702r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29702r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29702r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29702r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29702r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29702r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29702r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29702r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29702r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29702r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29702r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29702r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29702r=float


#29702 [Bgs-Opn]: $a=$GLOBALS works as $a=$GLOBALS

2004-08-16 Thread andrea dot busia at axis-sv dot it
 ID:   29702
 User updated by:  andrea dot busia at axis-sv dot it
 Reported By:  andrea dot busia at axis-sv dot it
-Status:   Bogus
+Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Win / Linux
 PHP Version:  5.0.1
 New Comment:

Is it documented? I didn't find this in the manual, probably this is a
documentation problem.


Previous Comments:


[2004-08-16 12:02:05] [EMAIL PROTECTED]

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

This is a feature.



[2004-08-16 11:45:17] andrea dot busia at axis-sv dot it

Description:

In this script seems that the $GLOBALS value is changed by the unset
statement but I want to modify $ar, $GLOBALS must remain the same as
before.


Reproduce code:
---
?
$xml=array(aaa, bbb, ccc);
foo();

function foo() {
var_dump($GLOBALS[xml]);
$ar=$GLOBALS;
unset($ar['xml']);
var_dump($GLOBALS[xml]);
}
?

Expected result:

array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}


Actual result:
--
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
NULL






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


#29702 [Opn]: $a=$GLOBALS works as $a=$GLOBALS

2004-08-16 Thread andrea dot busia at axis-sv dot it
 ID:   29702
 User updated by:  andrea dot busia at axis-sv dot it
 Reported By:  andrea dot busia at axis-sv dot it
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Win / Linux
 PHP Version:  5.0.1
 New Comment:

BTW:
Even if I try to use array_diff_assoc to have a COPY of $GLOBALS the
script gives me the same result.
I thing this is a very big problem without a array_copy function.

I tried:
?
$xml=array(aaa, bbb, ccc);
foo();

function foo() {
var_dump($GLOBALS[xml]);
$ar=array_diff_assoc($GLOBALS, array());
unset($ar['xml']);
var_dump($GLOBALS[xml]);
}
?


Previous Comments:


[2004-08-16 12:19:58] andrea dot busia at axis-sv dot it

Is it documented? I didn't find this in the manual, probably this is a
documentation problem.



[2004-08-16 12:02:05] [EMAIL PROTECTED]

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

This is a feature.



[2004-08-16 11:45:17] andrea dot busia at axis-sv dot it

Description:

In this script seems that the $GLOBALS value is changed by the unset
statement but I want to modify $ar, $GLOBALS must remain the same as
before.


Reproduce code:
---
?
$xml=array(aaa, bbb, ccc);
foo();

function foo() {
var_dump($GLOBALS[xml]);
$ar=$GLOBALS;
unset($ar['xml']);
var_dump($GLOBALS[xml]);
}
?

Expected result:

array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}


Actual result:
--
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
NULL






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


#29702 [Bgs-Opn]: $a=$GLOBALS works as $a=$GLOBALS

2004-08-16 Thread andrea dot busia at axis-sv dot it
 ID:   29702
 User updated by:  andrea dot busia at axis-sv dot it
 Reported By:  andrea dot busia at axis-sv dot it
-Status:   Bogus
+Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Win / Linux
 PHP Version:  5.0.1
 New Comment:

I see the manual page but I don't see anywhere that I cannot COPY
$GLOBALS content to an other variable.

Andrea Busia


Previous Comments:


[2004-08-16 14:33:31] [EMAIL PROTECTED]

http://no2.php.net/reserved.variables
read the section on $GLOBALS



[2004-08-16 12:28:03] andrea dot busia at axis-sv dot it

BTW:
Even if I try to use array_diff_assoc to have a COPY of $GLOBALS the
script gives me the same result.
I thing this is a very big problem without a array_copy function.

I tried:
?
$xml=array(aaa, bbb, ccc);
foo();

function foo() {
var_dump($GLOBALS[xml]);
$ar=array_diff_assoc($GLOBALS, array());
unset($ar['xml']);
var_dump($GLOBALS[xml]);
}
?



[2004-08-16 12:19:58] andrea dot busia at axis-sv dot it

Is it documented? I didn't find this in the manual, probably this is a
documentation problem.



[2004-08-16 12:02:05] [EMAIL PROTECTED]

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

This is a feature.



[2004-08-16 11:45:17] andrea dot busia at axis-sv dot it

Description:

In this script seems that the $GLOBALS value is changed by the unset
statement but I want to modify $ar, $GLOBALS must remain the same as
before.


Reproduce code:
---
?
$xml=array(aaa, bbb, ccc);
foo();

function foo() {
var_dump($GLOBALS[xml]);
$ar=$GLOBALS;
unset($ar['xml']);
var_dump($GLOBALS[xml]);
}
?

Expected result:

array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}


Actual result:
--
array(3) {
  [0]=
  string(3) aaa
  [1]=
  string(3) bbb
  [2]=
  string(3) ccc
}
NULL






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


#29702 [Bgs-Opn]: $a=$GLOBALS works as $a=$GLOBALS

2004-08-16 Thread andrea dot busia at axis-sv dot it
 ID:   29702
 User updated by:  andrea dot busia at axis-sv dot it
 Reported By:  andrea dot busia at axis-sv dot it
-Status:   Bogus
+Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Win / Linux
 PHP Version:  5.0.1
 New Comment:

I'm not asking support, I'm saying that this behaviour isn't written in
the documentation and this is a problem!


Previous Comments:


[2004-08-16 14:49:42] [EMAIL PROTECTED]

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. 

Thank you for your interest in PHP.





[2004-08-16 14:43:45] andrea dot busia at axis-sv dot it

I see the manual page but I don't see anywhere that I cannot COPY
$GLOBALS content to an other variable.

Andrea Busia



[2004-08-16 14:33:31] [EMAIL PROTECTED]

http://no2.php.net/reserved.variables
read the section on $GLOBALS



[2004-08-16 12:28:03] andrea dot busia at axis-sv dot it

BTW:
Even if I try to use array_diff_assoc to have a COPY of $GLOBALS the
script gives me the same result.
I thing this is a very big problem without a array_copy function.

I tried:
?
$xml=array(aaa, bbb, ccc);
foo();

function foo() {
var_dump($GLOBALS[xml]);
$ar=array_diff_assoc($GLOBALS, array());
unset($ar['xml']);
var_dump($GLOBALS[xml]);
}
?



[2004-08-16 12:19:58] andrea dot busia at axis-sv dot it

Is it documented? I didn't find this in the manual, probably this is a
documentation problem.



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

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


#24028 [Com]: Reading raw post message by php://input

2004-07-13 Thread andrea at yahoo dot com
 ID:   24028
 Comment by:   andrea at yahoo dot com
 Reported By:  xiongwei at aerafront dot com
 Status:   Closed
 Bug Type: CGI related
 Operating System: win32 only
 PHP Version:  4.3.2
 New Comment:

HOW TO TURN $6 INTO $6,000!!
  READING THIS COULD CHANGE YOUR LIFE!
  I found this on a bulletin board and decided to try it. A little
  while back, I was browsing through newsgroups, just like you are
now,
  and came across an article similar to this that said you could
make
  thousands of dollars within weeks with only an initial investment
of
  $6.00! So I thought, Yeah right, this must be a scam,but
  like most of us, I was curious, so I kept reading. Anyway, it
said
  that you send $1.00 to each of the 6 names and address stated in
the
  article. You then place your own name and address in the bottom
of
  the list at #6, and post the article in at least 200 newsgroups.
  (There are thousands) No catch, that was it. So after thinking
it
  over, and talking to a few people first, I thought about trying
it. I
  figured: what have I got to lose except 6 stamps and $6.00,
  right? Then I invested the measly $6.00. Well GUESS WHAT!!...
  within 7 days, I started getting money in the mail! I was
shocked! I
  figured it would end soon, but the money just kept coming in. In
my
  first week, I made about $25.00. By the end of the second week I
had
  made a total of over $1,000.00! In the third week I had over
  $10,000.00 and it's still growing. This is now my fourth week and
I
  have made a total of just over $42,000.00 and it's still coming
in
  rapidly. It's certainly worth $6.00, and 6 stamps, I have spent
more
  than that on the lottery!! Let me tell you how this works and
most
  importantly, why it worksAlso, make sure you print a copy of
this
  article NOW, so you can get the information off of it as you need
it.
  I promise you that if you follow the directions exactly, that
you
  will start making more money than you thought possible by doing
  something so easy!
  Suggestion: Read this entire message carefully! (print it out or
  download it.) Follow the simple directions and watch the money
come in!
  It's easy. It's legal. And, your investment is only $6.00 (Plus
postage)

  IMPORTANT: This is not a rip-off; it is not indecent; it is not
  illegal; and it is virtually no risk - it really works
  If all of the following instructions are adhered to, you will
receive
  extraordinary dividends.

  PLEASE NOTE:
  Please follow these directions EXACTLY, and $50,000 or more can
be
  yours in 20 to 60 days. This program remains successful because
of
  the honesty and integrity of the participants. Please continue
its
  success by carefully adhering to the instructions.
  You will now become part of the Mail Order business. In this
business
  your product is not solid and tangible, it's a service. You are
in
  the business of developing Mailing Lists. Many large corporations
are
  happy to pay big bucks for quality lists. However, the money
made
  from the mailing lists is secondary to the income which is made
from
  people like you and me asking to be included in that list.
  Here are the 4 easy steps to success:

  STEP 1: Get 6 separate pieces of paper and write the following on

  each piece of paper;PLEASE PUT ME ON YOUR MAILING LIST. Now
  get 6 US $1.00 bills and place ONE inside EACH of the 6 pieces
of
  paper so the bill will not be seen through the envelope (to
prevent
  thievery). Next, place one paper in each of the 6 envelopes and
seal
  them. You should now have 6 sealed envelopes, each with a piece
of
  paper stating the above phrase, your name and address, and a
$1.00
  bill. What you are doing is creating a service. THIS IS
ABSOLUTELY
  LEGAL! You are requesting a legitimate service and you are paying
for
  it! Like most of us I was a little skeptical and a little
worried
  about the legal aspects of it all. So I checked it out with the
U.S.
  Post Office (1-800-725-2161) and they confirmed that it is
indeed
  legal! Mail the 6 envelopes to the following addresses:

  #1) Joshua A. Goff
RT. 1 Box 406
Keysville, VA 23947
  #2) Jeff Millan
1113 N. 19 ½
McAllen,TX 78501
  #3) R. Overton
P.O. Box 18818
So. Lake Tahoe, CA 96151
  #4) KEVIN LEE
8377 APT. I MONTGOMERY RUN RD.
ELLICOTT CITY MD 21043
  #5) Stephanie Hicks
1283 Evening Canyon
Henderson NV 89014
  #6) Megan Murphy
447 S. Chauncey Ave #6
West Lafayette, IN 47906

  STEP 2: Now take the #1 name off the list that you see above,
move
  the other names up (6 becomes 5, 5 becomes 4

#26206 [Com]: argv and argc not defined

2004-01-07 Thread andrea dot busia at axis-sv dot it
 ID:   26206
 Comment by:   andrea dot busia at axis-sv dot it
 Reported By:  danielc at analysisandsolutions dot com
 Status:   Open
 Bug Type: CGI related
 Operating System: Windows 2000
 PHP Version:  5CVS-2003-11-11 (dev)
 New Comment:

I have the same problem

WinXp Professional
Apache 2.0.45
PHP Snapshot php5-win32-200401070730.zip

Andrea Busia


Previous Comments:


[2004-01-06 23:30:18] danielc at analysisandsolutions dot com

Sorry I didn't reply sooner.  Situation still exists as of
500rc1-dev--php5-win32-200401022330.  I still working on getting the
build environment to function properly so I can determine when the
change happened.



[2004-01-06 20:53:16] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Open. Thank you.





[2004-01-01 21:08:24] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2003-12-02 00:31:23] danielc at analysisandsolutions dot com

Yes.  Works fine with php4-win32-STABLE-200312020130.zip

Are the old PHP5 snapshots available anywhere?  I'll be glad to track
down when this problem started.



[2003-12-02 00:12:38] [EMAIL PROTECTED]

Does PHP 4 snapshots work?




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

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


#24476 [NEW]: Character translation in mssql_query

2003-07-03 Thread andrea dot balducci at antos dot it
From: andrea dot balducci at antos dot it
Operating system: WINXP / WIN2000 SRV
PHP version:  5.0.0b1 (beta1)
PHP Bug Type: MSSQL related
Bug description:  Character translation in mssql_query

Description:

I'm trying to insert chars like ò à è é ì in a sql server 2K table.
Sometimes the chars are traslated in others.



Tryed with php 4.x and 5

Reproduce code:
---
Table Sample:
CREATE TABLE pippo (
[a] [text] COLLATE Latin1_General_CI_AS NULL ,
[b] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
)

Script sample:
?php
$conn = mssql_connect('localhost','sa','');
if (!mssql_select_db('mydb', $conn))
{
mssql_close($conn);
return 0;
}
mssql_query(INSERT INTO PIPPO (A,B) VALUES ('òàèéìù','òàèéìù'),
$conn);
mssql_close($conn);
?


Expected result:

Select * from pippo
  A  B
--- ---
òàèéìù  òàèéìù

Actual result:
--
Select * from pippo
  A  B
--- ---
=ÓÞÚý¨  =ÓÞÚý¨


Using Sql Profiler i've discovered that the query issued to sql server by
mssql_query has the characters already changed. So sql exec INSERT INTO
PIPPO (A,B) VALUES ('=ÓÞÚý¨','=ÓÞÚý¨')

-- 
Edit bug report at http://bugs.php.net/?id=24476edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24476r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=24476r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=24476r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24476r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=24476r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=24476r=support
Expected behavior:  http://bugs.php.net/fix.php?id=24476r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=24476r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=24476r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=24476r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24476r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=24476r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=24476r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=24476r=gnused



#21658 [Fbk-Csd]: Strange sprintf behaviour

2003-01-17 Thread andrea
 ID:   21658
 User updated by:  [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Feedback
+Status:   Closed
 Bug Type: *General Issues
 Operating System: Gentoo Linux
 PHP Version:  4.3.0
 New Comment:

The strange behaviour was related to a strange combination of gcc and
glibc. Nothing was usefull (gcc and glibc recompilation). I had to
compile gcc and glibc on another machine, copy binaries of gentoo
emerge binary option system and all now is working fine.
It was a library problem.


Previous Comments:


[2003-01-15 12:35:31] [EMAIL PROTECTED]

Works fine here to.
Do you have any locales exported?



[2003-01-15 09:35:20] [EMAIL PROTECTED]

It works fine here (glibc 2.1.3)



[2003-01-15 08:06:22] [EMAIL PROTECTED]

mod_php 4.3.0 produce a strange sprintf behaviour

for($t=0;$t10;$t++) {
$r=(float) rand(0,1)/3;
echo $r. - .sprintf('%.3f',$r).\n;
}

will produce ...

1975. - ç.000
508.3 - ,.000
2483.6667 - ã.000
61.67 - m.000
2514.6667 - I00.000
2499.6667 - *0.000
1957. - ü.000
3167. - 0.é00
655.7 - 600.000
3321.6667 - ).000
2256. - 0.S00
383.7 - 0.,00
1565. - M.000

I suppose there's something wrong with glibc 2.3.1

Any ideas?




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




#21658 [NEW]: Strange sprintf behaviour

2003-01-15 Thread andrea
From: [EMAIL PROTECTED]
Operating system: Gentoo Linux
PHP version:  4.3.0
PHP Bug Type: *General Issues
Bug description:  Strange sprintf behaviour

mod_php 4.3.0 produce a strange sprintf behaviour

for($t=0;$t10;$t++) {
$r=(float) rand(0,1)/3;
echo $r. - .sprintf('%.3f',$r).\n;
}

will produce ...

1975. - ç.000
508.3 - ,.000
2483.6667 - ã.000
61.67 - m.000
2514.6667 - I00.000
2499.6667 - *0.000
1957. - ü.000
3167. - 0.é00
655.7 - 600.000
3321.6667 - ).000
2256. - 0.S00
383.7 - 0.,00
1565. - M.000

I suppose there's something wrong with glibc 2.3.1

Any ideas?
-- 
Edit bug report at http://bugs.php.net/?id=21658edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21658r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=21658r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=21658r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21658r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=21658r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=21658r=support
Expected behavior:  http://bugs.php.net/fix.php?id=21658r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=21658r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=21658r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=21658r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21658r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=21658r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=21658r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=21658r=gnused