Bug #54200 [Opn]: Access violation if extension can't be loaded

2011-03-11 Thread carsten_sttgt at gmx dot de
Edit report at http://bugs.php.net/bug.php?id=54200&edit=1

 ID: 54200
 User updated by:carsten_sttgt at gmx dot de
 Reported by:carsten_sttgt at gmx dot de
 Summary:Access violation if extension can't be loaded
 Status: Open
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Windows
-PHP Version:5.3.6RC2
+PHP Version:5.3.6RC3
 Block user comment: N
 Private report: N

 New Comment:

Still exists in 5.3.6RC3.



Something I just realized:



With the default "display_startup_errors = Off" there is immediately a
crash. 



With "display_startup_errors = On" you first have a "Warning" message
box "PHP Startup: Unable to load ...". Now the behavior depends on how
fast you click on "OK".:

- If you click fast on "OK" there is a crash.

- If you click slow on "OK" there is no "crash" (no message "CLI has
stopped working). But also no output with the version infos (parameter
-v in this example).


Previous Comments:

[2011-03-09 11:14:12] carsten_sttgt at gmx dot de

Description:

Only TS builds are affected.



Assuming this in my "php.ini:

| extension = "nonexistent.dll"



is resulting in a crash.



(6cc.1260): Access violation - code c005 (first chance)

First chance exceptions are reported before any exception handling.

This exception may be expected and handled.

eax=01b810c0 ebx=584f9674 ecx= edx=0802fb7c esi=01cf2858
edi=01cf2858

eip=58207620 esp=00b4f5b0 ebp=01cf2858 iopl=0 nv up ei pl nz na
pe nc

cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=
efl=00010206

php5ts!guess_timezone+0x20:

58207620 8b4204  mov eax,dword ptr [edx+4]
ds:0023:0802fb80=





BTW:

Using "dl('nonexistent.dll');" in a script is working as expected. Also
with NTS builds there is no problem.



Test script:
---
in the shell:

php -v

Expected result:

| Warning: PHP Startup: Unable to load dynamic library

| 'C:\Program Files\PHP\php-current\ext\nonexistent.dll'



Or no error with "display_startup_errors = Off"

Actual result:
--
CLI has stopped working






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


Bug #54203 [Opn]: Crash with global empty user_ini.filename and [PATH] section

2011-03-11 Thread carsten_sttgt at gmx dot de
Edit report at http://bugs.php.net/bug.php?id=54203&edit=1

 ID: 54203
 User updated by:carsten_sttgt at gmx dot de
 Reported by:carsten_sttgt at gmx dot de
 Summary:Crash with global empty user_ini.filename and [PATH]
 section
 Status: Open
 Type:   Bug
 Package:CGI related
 Operating System:   Windows
-PHP Version:5.3.6RC2
+PHP Version:5.3.6RC3
 Block user comment: N
 Private report: N

 New Comment:

Still exists in 5.3.6RC3


Previous Comments:

[2011-03-09 16:09:52] carsten_sttgt at gmx dot de

Description:

Ok, Pierre was writing this is a separate issue then #54197. So I'm
opening a new one. 



The crash happens with PHP CGI if you are setting user_ini.filename at
global level to none. And you must also have a PATH section for the
current script.



This only happens with Windows. With *nix it's working as expected.

Test script:
---
adding this to "php.ini":

user_ini.filename =

[PATH=C:/Users/Public/Documents/htdocs/]

upload_max_filesize = 5M



And then accessing a phpinfo.php through CGI.





Expected result:

user_ini.filename   no valueno value

upload_max_filesize 5M  2M



Actual result:
--
php-cgi is crashing.








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


Bug #54204 [Opn]: Can't set a value with a PATH section in php.ini

2011-03-11 Thread carsten_sttgt at gmx dot de
Edit report at http://bugs.php.net/bug.php?id=54204&edit=1

 ID: 54204
 User updated by:carsten_sttgt at gmx dot de
 Reported by:carsten_sttgt at gmx dot de
 Summary:Can't set a value with a PATH section in php.ini
 Status: Open
 Type:   Bug
 Package:CGI related
 Operating System:   Windows
-PHP Version:5.3.6RC2
+PHP Version:5.3.6RC3
 Block user comment: N
 Private report: N

 New Comment:

Still exists in 5.3.6RC3


Previous Comments:

[2011-03-09 16:22:36] carsten_sttgt at gmx dot de

Description:

I can't set a value inside a PATH section. The PATH section is for the
current script.



This only happens with Windows. With *nix it's working as expected.



Additionally this only happens with PHP5.3.6RC2, but not with 5.3.5.

 



Test script:
---
adding this to "php.ini":

[PATH=C:/Users/Public/Documents/htdocs/]

upload_max_filesize = 5M



And then accessing a phpinfo.php through CGI.





Expected result:

upload_max_filesize 5M  2M



Actual result:
--
upload_max_filesize 2M  2M








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


Req #43304 [Com]: Casting During Comparison

2011-03-11 Thread delphists at apollo dot lv
Edit report at http://bugs.php.net/bug.php?id=43304&edit=1

 ID: 43304
 Comment by: delphists at apollo dot lv
 Reported by:ken at smallboxsoftware dot net
 Summary:Casting During Comparison
 Status: Open
 Type:   Feature/Change Request
 Package:Feature/Change Request
 Operating System:   ALL
 PHP Version:5.2.5
 Block user comment: N
 Private report: N

 New Comment:

Sorry for digging up this bug report, but it's still opened, so I don't
think that digging it up should be a problem.



I agree with kissifrot about specific case - both values convert to
"(int)2147483647", at least on 32bit system, which is nowhere near to
"11000198358".



Though, I can't agree with drm. There is a reason for having two types
of comparisons - if you are sure that you don't need values to be
converted, just use strict comparison.



I agree that there are cases when numerical strings need to be compared
as strings, but there are also lots of cases when numerical strings have
to be compared as integers. For example, some functions that return data
from DB, return integers as strings, which may be compared to data from
browser, which by default is also string, but comparison needs to work
like if they were numbers.


Previous Comments:

[2011-02-17 08:58:37] kissifrot at gmail dot com

I agree with that, for example if I have

$ric1 = '11000198358';

$ric2 = '11000198455';

var_dump($ric1 == $ric2)



should return false, not true, just because it's logical.

But the current behavior makes PHP somewhat unreliable :(


[2008-09-06 23:49:58] drm at melp dot nl

Though documented (http://www.php.net/language.operators, quote "If you
compare two numerical strings, they are compared as integers."), this is
indeed unexpected behaviour (and thus a bug)



This bug will probably be closed and denoted as "sorry, documented
feature", but I think this is really a candidate for revision in any
next major PHP version.



Comparison should always feel intuitive, and PHP has made the move
towards more "secure" defaults. This falls (imo) under the same
category. Please witness following example.



client side code:



No selection

whatever
selection

   (...)





server side code:

if ( $_GET['selection'] == 0 ) {

   echo 'Please make a selection!';

} else {

   // process request

}



Though the example does not imply any security issues, they are not
unimaginable. Please reconsider the behaviour of the comparison
operator.



My suggestion:

Implement (and document!) the following:

Any left side of the comparison is only cast to number if the right side
doesn't fail to. Casting to number is considered successful, if and only
if the string would syntactically be a number in the PHP

Therefore, the string should match the following:



http://php.net/language.types.integer 

http://php.net/language.types.float



[At both pages, see the "formal" definition of both types.]



In any OTHER case, the comparison should act as follows:

If ANY of the sides is of a string type (and of course fails to cast to
number), the other side is cast to string, causing the types to follow
these rules:



integer: the string representation of the integer (e.g. "0", "-4" or
"123")

float: the string representation of the floating point number,
represented in one and only one particular format, preferably just the
%.f format.

boolean: cast to integer, cast to string (so true becomes 1, becomes
"1"; false becomes 0 becomes "0")

array: "array" causing a notice

object: "object" causing a notice, or calling the __toString method if
defined.



The oppposing problem is a non-generic way of handling any other
comparison. As a rule, we could state that any other comparison -if both
sides of different type- is handled the way it is in the current PHP
version. If they are of the same type, the == operator should act the
same as the === operator.



This is, as i am very sure, easily realized. 



Please do not hesitate to ask me any questions through mail.


[2007-11-15 16:27:02] ken at smallboxsoftware dot net

Description:

Casting during comparison should only happen if values of different
types are being compared. 



For example: "42" == "+42" should not return true. 



This result is not very intuitive and probably leads to a number of
subtle errors in various scripts. 

Reproduce code:
---
";

echo "Should Return False:".((string) "400" == (string) "+400")."";

echo "Does Return False:".("400" === "+400")."";



?>







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


[PHP-BUG] Bug #54221 [NEW]: mysqli::get_warnings segfault when used in multi queries

2011-03-11 Thread glen at delfi dot ee
From: 
Operating system: 
PHP version:  5.3.5
Package:  MySQLi related
Bug Type: Bug
Bug description:mysqli::get_warnings segfault when used in multi queries

Description:

http://php.net/manual/en/mysqli.get-warnings.php



can't use mysqli::get_warnings with multi queries reliably as it will get
either 

segfault or empty result.



the code is supposed to print 2 times warning:

"Warning: 1050: Table 'a' already exists"

"Warning: 1050: Table 'a' already exists"



but instead it segfaults (PHP 5.3.5).



also if i run queries where only one warning is printed. it will not
segfault. 

segfault seems to happen in ->next() call.



seems is because internally this is implemented as "SHOW WARNINGS" query
[1]



[1] http://svn.php.net/viewvc/php/php-

src/branches/PHP_5_3/ext/mysqli/mysqli_warning.c?annotate=306939#l76



segfault must be fixed, but regarding the usage, perhaps document that you
can't 

use it sanely with multi queries, due limitations of mysql protocol, as
seems it 

is problem in mysql protocol, that it returns warnings only from last of
the 

multi query

Test script:
---
connect_error) {

die('Connect Error (' . $dbh->connect_errno . ') ' .
$dbh->connect_error);

}



$create = "create temporary table if not exists a (a int4)";

$query = "$create;$create";$create;";

if ($dbh->multi_query($query)) {

do {

$sth = $dbh->store_result();



if ($dbh->warning_count) {

$e = $dbh->get_warnings();

do {

echo "Warning: $e->errno: $e->message\n"; 

} while ($e->next()); 

}

} while ($dbh->next_result());

}

?>


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



[PHP-BUG] Req #54223 [NEW]: enhance / change newline behavior

2011-03-11 Thread carsten_sttgt at gmx dot de
From: 
Operating system: 
PHP version:  Irrelevant
Package:  PCRE related
Bug Type: Feature/Change Request
Bug description:enhance / change newline behavior

Description:

At the moment (PHP bundled) PCRE is build with the default "#define NEWLINE
10".



As a result "$" means "\n" but not e.g. "\r\n" and "\r" remains as part of
the match. This is unexpected for some people, especially on Windows. See
the example below.



There are 3 solutions:

1)

Building PCRE with "#define NEWLINE -2", or with "#define NEWLINE -1"
(because PCRE is still build with Unicode support)



2)

Adding a INI option like "pcre.newline=any"



3)

Making PCRE_NEWLINE_ANY, PCRE_NEWLINE_CR, PCRE_NEWLINE_CRLF,
PCRE_NEWLINE_LF available to the userland (maybe as pattern modifier), like
you can do this with C using the PCRE library.  



(Well, 1) is not essential if 2) and 3) is available)



Test script:
---




Expected result:

array(1) {

  [0]=>

  array(3) {

[0]=>

string(5) "line1"

[1]=>

string(5) "line2"

[2]=>

string(5) "line3"

  }

}



Actual result:
--
array(1) {

  [0]=>

  array(3) {

[0]=>

"   string(6) "line1

[1]=>

"   string(6) "line2

[2]=>

"   string(6) "line3

  }

}



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



[PHP-BUG] Bug #54224 [NEW]: Sum comutative operation fails with minus on front

2011-03-11 Thread philip dot almeida at freedomson dot com
From: 
Operating system: Linux
PHP version:  Irrelevant
Package:  Math related
Bug Type: Bug
Bug description:Sum comutative operation fails with minus on front

Description:

Making a comutative sum operation the result does not return the expected
value.

Test script:
---
echo -6.3536+5+1.3536;

= -2.22044604925E-16



echo -6.3537+5+1.3537

= 0

Expected result:

Always 0

Actual result:
--
-2.22044604925E-16

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



Bug #52469 [Com]: Datetime affect the division

2011-03-11 Thread arialdomartini at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52469&edit=1

 ID: 52469
 Comment by: arialdomartini at gmail dot com
 Reported by:info at mirgorod dot ru
 Summary:Datetime affect the division
 Status: Feedback
 Type:   Bug
 Package:Date/time related
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

I'm able to reproduce this bug on



Windows Vista, PHP 5.3.(2/4/5)


Previous Comments:

[2010-07-28 12:13:39] degeb...@php.net

Please try using this snapshot:

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

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

Can't reproduce using 5.3-dev from SVN.


[2010-07-28 12:09:12] info at mirgorod dot ru

Sorry, this true description: Several launches of diff affects the
operation of division in php 5.3.2:


[2010-07-28 12:05:54] info at mirgorod dot ru

Description:

Several launches of 1911 affects the operation of division in php
5.3.2:



error_reporting(E_ALL); 



$now  = new Datetime();



for ($i = 0; $i < 4; $i++) 

{ 

$a = $now->diff($now); 

} 



$t = 100/5.5; 



var_dump($t);



// first running: float(18.181818181818)

// after update page: Warning:  Division by zero in G:\www\test.php on
line 10

bool(false)

?>









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


Bug #54109 [Com]: display_errors setting causes unwanted changes in errors reported

2011-03-11 Thread pinkgothic at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54109&edit=1

 ID: 54109
 Comment by: pinkgothic at gmail dot com
 Reported by:fake at example dot com
 Summary:display_errors setting causes unwanted changes in
 errors reported
 Status: Verified
 Type:   Bug
 Package:*Configuration Issues
 Operating System:   any
 PHP Version:trunk-SVN-2011-02-27 (SVN)
 Block user comment: N
 Private report: N

 New Comment:

See also Bug #47494.



I commented there, but reckon it might be a good idea to comment here,

as well, seeing as this bug is still open. :)



> I'm afraid this isn't just confusing, but actually punishes people

> who do it right by blindsiding them completely.

>

> Scenario:

>

>  * display_errors off

>  * an Exception-throwing error handler

>

> As far as I'm informed, this is good practise. (I acknowledge I may

> be misinformed.)

>

> However, due to this behaviour, you suddenly get application crashes

> in production without that anyone really understands why the code

> snippet is suddenly a culprit. 'But we tested it with broken UTF-8,

> why are -we- just getting empty strings? And the documentation says

> that's what we should be expecting...'

[...]

> If you've been a good developer and read the manual on

> htmlspecialchars(), you're not going to expect an error. You're

> going to expect an empty string. Unfortunately currently, nothing

> in the documentation reveals that the function results in an

> E_WARNING, either pure-log-only when display_errors is on, or

> log and trigger_error()ed when display_errors is off.



I reckon this should at the very least be a documentation error,

if this explanation from s...@php.net holds:



> The idea is to return an error but not display it (i.e. log it

> or allow custom error handlers to process it).

>

> The reason for it is that, unfortunately, people run servers in

> production with display_errors=On, and

> php_escape_html_entities_ex can be triggered from all kinds of

> code that usually doesn't produce errors, which can reveal

> sensitive information on public sites.  So we chose to go after

> lesser of two evils and not generate the error in this context.

>

> For debugging, I would suggest always logging errors and

> checking the error log, as some errors may be hard to spot in

> display anyway (especially true if your script produces

> something like JSON).


Previous Comments:

[2011-02-27 03:08:43] fake at example dot com

Description:

Following functions may report E_WARNING when invalid utf8 sequence
detected.

json_encode

htmlspecialchars

htmlentities



However, they only issue the warning if display_errors is OFF.
display_errors should not dictate whether the warning is triggered. 



They behave this way because of following dumb logic in source code





if (!PG(display_errors)) {

php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid UTF-8 sequence
in argument");

}





ext/standard/html.c php_escape_html_entities_ex

ext/json/json.c json_escape_string







This is more or less a repeat of http://bugs.php.net/bug.php?id=52397
which unfortunately got marked bogus.

Test script:
---
ini_set('display_errors', 1);

json_encode("\xFF");

var_dump(error_get_last());



echo "---\n";





ini_set('display_errors', 0);

json_encode("\xFF");

var_dump(error_get_last());



//these have same problem

//htmlspecialchars("\xFF", ENT_COMPAT, 'utf-8');

//htmlentities("\xFF", ENT_COMPAT, 'utf-8');

Expected result:

I expect both calls to error_get_last() should not return null. Also, I
should have two entries in my error log.

Actual result:
--
First call to error_get_last() returns null, second call works. Only one
message in error log. 






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


Bug->Req #54187 [Bgs->Opn]: unexpected results to comparing strings converted to floating

2011-03-11 Thread jose dot nobile at latinoaustralia dot com
Edit report at http://bugs.php.net/bug.php?id=54187&edit=1

 ID: 54187
 User updated by:jose dot nobile at latinoaustralia dot com
 Reported by:jose dot nobile at latinoaustralia dot com
 Summary:unexpected results to comparing strings converted to
 floating
-Status: Bogus
+Status: Open
-Type:   Bug
+Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   Windows XP Professional SP3
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

It is possible to override the mathematical operators with the functions
of 

arbitrary mathematical precision?



or to print accurate internal representation of floating-point number.
var_dump or 

print_r not show the exact value.


Previous Comments:

[2011-03-09 17:57:54] jose dot nobile at gmail dot com

I understand about IEEE 754 standard, Two's complement, Booth's
Algorithm, and 

more.



I found a workaround, 

$string = "1.123";//string

$number = 1.123;//float

$string2number = floatval($string);

var_dump($number < $string2number);//Fail, <, >, ==, === all fail

but 

$string = "1.123";//string

$number = 1.123;//float

$string2number = floatval($string);

$float2float = floatval("$number");//float to string, string to float

var_dump($string2number < $float2float);//OK, <, >, ==, === all OK



This is a small fix, but complex to implement in all code.



Other solutions:

BCMath Arbitrary Precision Mathematics



But, I question, is possible overwrite all Mathematics Operators with by
example 

BCMath? some is possible overwrite string with Multi-Byte string
functions?



How is the correct to operate with floats? (in invoicing applications is


critical point)



Thanks.


[2011-03-09 11:14:07] cataphr...@php.net

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

If you would like to know more about "floats" and what IEEE
754 is, read this:
http://www.floating-point-gui.de/

Thank you for your interest in PHP.




[2011-03-08 01:17:05] jose dot nobile at latinoaustralia dot com

Description:

I have a strings with float numbers, in format integer.decimal (eg
916.32), and 

using operators (<,>,==,===) don't working as expecting.



Additional info:



System  Windows NT WEBMASTER 5.1 build 2600 (Windows XP Professional
Service 

Pack 3) i586



Build Date  Jan 5 2011 20:26:24



CompilerMSVC9 (Visual C++ 2008)



Architecturex86



Configure Command   cscript /nologo configure.js "--enable-snapshot-build"


"--disable-isapi" "--enable-debug-pack" "--disable-

isapi"http://bugs.php.net/bugs-generating-backtrace.php
"--without-mssql" "--

without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=D:\php-

sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-

sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-

sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/"
"--

enable-com-dotnet" "--with-mcrypt=static"



precision   14  14

serialize_precision 100 100

PROCESSOR_ARCHITECTURE  x86

PROCESSOR_IDENTIFIERx86 Family 6 Model 15 Stepping 13, GenuineIntel

PROCESSOR_LEVEL 6

PROCESSOR_REVISION  0f0d



Intel Core 2 Duo CPU E4500 @ 2.2Ghz



Download from: http://windows.php.net/download/



Test script:
---
echo "";

$string1 = "932.16";

$substring1 = "3.16";

$substring2 = "454";

$substring3 = "475";

$number2 = floatval(floatval($substring1) + floatval($substring2) +
floatval($substring3));

$number1 = floatval($string1);

var_dump($number1);//expected: float(932.16), current: float(932.16),
OK

var_dump($number2);//expected: float(932.16), current: float(932.16),
OK

var_dump($number1 < $number2);//expected: bool(false), current:
bool(true), FAIL

var_dump($number1 > $number2);//expected: bool(false), current:
bool(false), OK

var_dump($number1 == $number2);//expected: bool(true), current:
bool(false), FAIL

var_dump($number1 === $number2);//expected: bool(true), current:
bool(false), FAIL

var_dump(bccomp($number1,$number2));//expected: int(0), current: int(0),
OK

echo "";

Expected result:

float(932.16)

float(932.16)

bool(false)

bool(false)

bool(true)

bool(true)

int(0)

Actual result:
--
float(932.16)

float(932.16)

bool(true)

bool(false)

bool(false)

bool(false)

int(0)






-- 
Edit this bug report at http://bugs.php.net/bug

Req #54187 [Opn->Bgs]: unexpected results to comparing strings converted to floating

2011-03-11 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=54187&edit=1

 ID: 54187
 Updated by: paj...@php.net
 Reported by:jose dot nobile at latinoaustralia dot com
 Summary:unexpected results to comparing strings converted to
 floating
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   Windows XP Professional SP3
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Please read the provided links.


Previous Comments:

[2011-03-11 14:36:23] jose dot nobile at latinoaustralia dot com

It is possible to override the mathematical operators with the functions
of 

arbitrary mathematical precision?



or to print accurate internal representation of floating-point number.
var_dump or 

print_r not show the exact value.


[2011-03-09 17:57:54] jose dot nobile at gmail dot com

I understand about IEEE 754 standard, Two's complement, Booth's
Algorithm, and 

more.



I found a workaround, 

$string = "1.123";//string

$number = 1.123;//float

$string2number = floatval($string);

var_dump($number < $string2number);//Fail, <, >, ==, === all fail

but 

$string = "1.123";//string

$number = 1.123;//float

$string2number = floatval($string);

$float2float = floatval("$number");//float to string, string to float

var_dump($string2number < $float2float);//OK, <, >, ==, === all OK



This is a small fix, but complex to implement in all code.



Other solutions:

BCMath Arbitrary Precision Mathematics



But, I question, is possible overwrite all Mathematics Operators with by
example 

BCMath? some is possible overwrite string with Multi-Byte string
functions?



How is the correct to operate with floats? (in invoicing applications is


critical point)



Thanks.


[2011-03-09 11:14:07] cataphr...@php.net

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

If you would like to know more about "floats" and what IEEE
754 is, read this:
http://www.floating-point-gui.de/

Thank you for your interest in PHP.




[2011-03-08 01:17:05] jose dot nobile at latinoaustralia dot com

Description:

I have a strings with float numbers, in format integer.decimal (eg
916.32), and 

using operators (<,>,==,===) don't working as expecting.



Additional info:



System  Windows NT WEBMASTER 5.1 build 2600 (Windows XP Professional
Service 

Pack 3) i586



Build Date  Jan 5 2011 20:26:24



CompilerMSVC9 (Visual C++ 2008)



Architecturex86



Configure Command   cscript /nologo configure.js "--enable-snapshot-build"


"--disable-isapi" "--enable-debug-pack" "--disable-

isapi"http://bugs.php.net/bugs-generating-backtrace.php
"--without-mssql" "--

without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=D:\php-

sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-

sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-

sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/"
"--

enable-com-dotnet" "--with-mcrypt=static"



precision   14  14

serialize_precision 100 100

PROCESSOR_ARCHITECTURE  x86

PROCESSOR_IDENTIFIERx86 Family 6 Model 15 Stepping 13, GenuineIntel

PROCESSOR_LEVEL 6

PROCESSOR_REVISION  0f0d



Intel Core 2 Duo CPU E4500 @ 2.2Ghz



Download from: http://windows.php.net/download/



Test script:
---
echo "";

$string1 = "932.16";

$substring1 = "3.16";

$substring2 = "454";

$substring3 = "475";

$number2 = floatval(floatval($substring1) + floatval($substring2) +
floatval($substring3));

$number1 = floatval($string1);

var_dump($number1);//expected: float(932.16), current: float(932.16),
OK

var_dump($number2);//expected: float(932.16), current: float(932.16),
OK

var_dump($number1 < $number2);//expected: bool(false), current:
bool(true), FAIL

var_dump($number1 > $number2);//expected: bool(false), current:
bool(false), OK

var_dump($number1 == $number2);//expected: bool(true), current:
bool(false), FAIL

var_dump($number1 === $number2);//expected: bool(true), current:
bool(false), FAIL

var_dump(bccomp($number1,$number2));//expected: int(0), current: int(0),
OK

echo "";

Expected result:

float(932.16)

float(932.16)

bool(false)

bool(false)

bool(true)

bool(true)

int(0)

Actual result:
--
float(932.16)

float(932.16)

bool(true)

bool(false)

bool(false)

bool(false)

int(0)



Req #54210 [Com]: provide a function to canonicalize timezone strings

2011-03-11 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=54210&edit=1

 ID: 54210
 Comment by: giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:provide a function to canonicalize timezone strings
 Status: Bogus
 Type:   Feature/Change Request
 Package:Date/time related
 Operating System:   all
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

exact, it is not a problem implement this in the user space



but it is nonsense since some php functions requires a canonical tz
string


Previous Comments:

[2011-03-10 14:54:45] dtajchre...@php.net

Not that it's hard to implement in userland code but it'd be nice if the


DateTimezone class gave the timezone name in canonical form... I don't
see why 

it shouldn't either?



$dt = new DateTimezone('america/chicago');

var_dump($dt->getName()); /* string(15) "america/chicago" */



vs. 



$dt = new DateTime();

var_dump($dt->getTimezone()->getName()); /* string(16)
"Australia/Sydney" */


[2011-03-10 07:16:23] scott...@php.net

$tz = implode('/', array_map('ucfirst', explode('/', $tz)));



No need to add a new function for this, and if the timezone is set by
your app 

then you should probably store it in the correct format.


[2011-03-10 07:16:21] scott...@php.net

$tz = implode('/', array_map('ucfirst', explode('/', $tz)));



No need to add a new function for this, and if the timezone is set by
your app 

then you should probably store it in the correct format.


[2011-03-09 23:28:25] giorgio dot liscio at email dot it

Description:

hi, it is needed a function that converts "europe/rome" in
"Europe/Rome"



for example the intl module (ICU) of php 5.3 does not accept
"europe/rome" as timezone, but only "Europe/Rome", with uppercase first
letters



thank you







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


Bug #54188 [Com]: php cannot load interbase/firebird module including pdo.

2011-03-11 Thread jacobswell4u at yahoo dot com
Edit report at http://bugs.php.net/bug.php?id=54188&edit=1

 ID: 54188
 Comment by: jacobswell4u at yahoo dot com
 Reported by:jacobswell4u at yahoo dot com
 Summary:php cannot load interbase/firebird module including
 pdo.
 Status: Feedback
 Type:   Bug
 Package:InterBase related
 Operating System:   win7 & winxp
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Yes, I have installed firebird 2.5. The firebird extension works fine
with php 

5.3.1. I have tested php 5.3.5 with php_interbase.dll which can be
downloaded from 

firebird-php groups.yahoo.com, and the server could not load the
extension dll. I 

believe the problem is in php 5.3.5.



And about the pdo extension. I do know the pdo is built-in. I could not
get 

php_pdo_firebird.dll from php.net, so I tested with the dll from php
5.3.1. and it 

gives error that php cannot find the php_pdo.dll. should I use new 

php_pdo_firebird.dll made for php 5.3.5 or can I use from php 5.3.1? We
have php 

5.3 and why is there big change between them?


Previous Comments:

[2011-03-08 05:40:24] paj...@php.net

You have to install fbclient 2.5, that's expected.



Pdo_firebird loads just fine, PDO is builtin in PHP, there is no need to
enable 

php_pdo.dll. Are you sure that you did not mix versions?


[2011-03-08 01:53:45] jacobswell4u at yahoo dot com

Description:

to load firebird module I changed php.ini



extension=php_interbase.dll

extension=php_pdo_firebird.dll



before you start php, you have to prepare dll files because PHP release
zip file 

does not have these dll any more. When starting, php gives two errors:



(I copied fbclient.dll from firebird 2.5 to php directory and Apache's
bin 

directory.)



1. cannot load php_interbase.dll.



2. cannot load php_pdo_firebird.dll becuase it requires php_pdo.dll. but
to me 

5.3.5 has pdo support in itself!



so I had to use the old 5.3.1 version.











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


[PHP-BUG] Bug #54227 [NEW]: function strtoupper

2011-03-11 Thread emersonnarede at gmail dot com
From: 
Operating system: Centos 5.5 in Apache 2.2.4 
PHP version:  5.3.5
Package:  Unknown/Other Function
Bug Type: Bug
Bug description:function strtoupper 

Description:

The function strtoupper is bugging in convert portuguese characters to
upper.



Test script:
---


Expected result:

EDUCAÇÃO

Actual result:
--
EDUCAçãO

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



Bug #47719 [Com]: SOAP-ERROR: Encoding: Violation of encoding rules

2011-03-11 Thread benjamin-richard at wanadoo dot fr
Edit report at http://bugs.php.net/bug.php?id=47719&edit=1

 ID: 47719
 Comment by: benjamin-richard at wanadoo dot fr
 Reported by:oxomichael at hotmail dot com
 Summary:SOAP-ERROR: Encoding: Violation of encoding rules
 Status: Feedback
 Type:   Bug
 Package:SOAP related
 Operating System:   Windows
 PHP Version:5.2.9
 Block user comment: N
 Private report: N

 New Comment:

Hi, 

did you find a solution to your problem ? i have the same on a PHP
5.3.3



Thanks


Previous Comments:

[2010-06-20 21:32:25] fel...@php.net

Please try using this snapshot:

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

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




[2009-03-19 16:04:01] oxomichael at hotmail dot com

Description:

I get an SOAP Error violation encoding 



>From Windows XP with WAMPSERVER PHP5.2.9-r1

>From Ubuntu 8.10 & PHP 5.2.6



>From Gentoo & PHP 5.2.8 (I have the error but i have the return from
webservice with LastResponse)





Works Fine on Ubunutu 8.0.4 LTS & PHP 5.2.4 (Production server)



The webservice i request wait for an string compose as "xml" et send
also a string as xml (see code example for what i send)



Soap request :



http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="https://webservices.infogreffe.fr/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>85000109166G0AICCACSWS494967938



Reproduce code:
---
Code give as information because i can't have any debug information from
webservice.



Code URL : http://oxomichael.serveftp.net/michael/infogreffe.txt





Expected result:

780308B04241494967938173802008-12-032008-11-2401PGPROCES
VERBAL D'ASSEMBLEE GENERALE
ORDINAIRE3CHANGEMENT
DE COMMISSAIRES AUX COMPTES TITULAIRE ET
SUPPLEANT750108B01601494967938867462008-09-262008-09-2501RARAPPORT6940107B0132849496793844762007-03-212007-02-190104STATUTS
CONSTITUTIFS162007-02-1902AAACTE1NOMINATION
DE DIRECTEUR
GENERAL2007-02-2703AAACTE1ATTESTATION
BANCAIRE2007-02-2704AAACTE1LISTE
DES
SOUSCRIPTEURS750108B01601494967938869042008-09-262008-09-2401PHPROCES
VERBAL D'ASSEMBLEE
MIXTE5CHANGEMENT
DE DATE D'EXERCICE SOCIALAU
31/12MODIFICATION(S)
STATUTAIRE(S)2008-09-240206STATUTS
A
JOUR17750108B0160149496793863382008-01-232007-11-160109STATUTS
APRES TRANSFERT DE
SIEGE2007-11-1602PAPROCES
VERBAL6AUGMENTATION
DE CAPITAL2007-11-1503PAPROCES
VERBAL6AUGMENTATION
DE
CAPITALMODIFICATION(S)
STATUTAIRE(S)2007-10-2904PAPROCES
VERBAL4TRANSFERT
DE SIEGE SOCIAL D'UN GREFFE EXTERIEURANCIEN SIEGE : 7
RUE BOULINEAU 94250 GENTILLY780308B04241494967938162612008-11-072008-10-090109STATUTS
APRES TRANSFERT DE
SIEGE182008-10-0902PHPROCES
VERBAL D'ASSEMBLEE
MIXTE23TRANSFERT
DE SIEGE SOCIAL D'UN GREFFE
EXTERIEURMODIFICATION(S)
STATUTAIRE(S)DEMISSION
DE DIRECTEUR
GENERALAUGMENTATION
DE CAPITAL750108B01601494967938810042008-09-092008-09-0801OEORDONNANCE2

Actual result:
--
Nothing, I get the soap encoding error 



SoapFault exception: [Client] SOAP-ERROR: Encoding: Violation of
encoding rules in infogreffe.php:81

Stack trace:

#0 [internal function]: SoapClient->__call('getProduitsWebS...', Array)

#1 infogreffe.php(81):
SoapClient->getProduitsWebServicesXML('






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


Bug #54188 [Fbk->Bgs]: php cannot load interbase/firebird module including pdo.

2011-03-11 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=54188&edit=1

 ID: 54188
 Updated by: paj...@php.net
 Reported by:jacobswell4u at yahoo dot com
 Summary:php cannot load interbase/firebird module including
 pdo.
-Status: Feedback
+Status: Bogus
 Type:   Bug
 Package:InterBase related
 Operating System:   win7 & winxp
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

5.3.1 did not have firebird so no, it can't have worked fine. Your
config is 

somehow broken (PATH or something along this line).


Previous Comments:

[2011-03-11 17:42:39] jacobswell4u at yahoo dot com

Yes, I have installed firebird 2.5. The firebird extension works fine
with php 

5.3.1. I have tested php 5.3.5 with php_interbase.dll which can be
downloaded from 

firebird-php groups.yahoo.com, and the server could not load the
extension dll. I 

believe the problem is in php 5.3.5.



And about the pdo extension. I do know the pdo is built-in. I could not
get 

php_pdo_firebird.dll from php.net, so I tested with the dll from php
5.3.1. and it 

gives error that php cannot find the php_pdo.dll. should I use new 

php_pdo_firebird.dll made for php 5.3.5 or can I use from php 5.3.1? We
have php 

5.3 and why is there big change between them?


[2011-03-08 05:40:24] paj...@php.net

You have to install fbclient 2.5, that's expected.



Pdo_firebird loads just fine, PDO is builtin in PHP, there is no need to
enable 

php_pdo.dll. Are you sure that you did not mix versions?


[2011-03-08 01:53:45] jacobswell4u at yahoo dot com

Description:

to load firebird module I changed php.ini



extension=php_interbase.dll

extension=php_pdo_firebird.dll



before you start php, you have to prepare dll files because PHP release
zip file 

does not have these dll any more. When starting, php gives two errors:



(I copied fbclient.dll from firebird 2.5 to php directory and Apache's
bin 

directory.)



1. cannot load php_interbase.dll.



2. cannot load php_pdo_firebird.dll becuase it requires php_pdo.dll. but
to me 

5.3.5 has pdo support in itself!



so I had to use the old 5.3.1 version.











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


Bug #54224 [Opn->Bgs]: Sum comutative operation fails with minus on front

2011-03-11 Thread scottmac
Edit report at http://bugs.php.net/bug.php?id=54224&edit=1

 ID: 54224
 Updated by: scott...@php.net
 Reported by:philip dot almeida at freedomson dot com
 Summary:Sum comutative operation fails with minus on front
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Math related
 Operating System:   Linux
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

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

If you would like to know more about "floats" and what IEEE
754 is, read this:
http://www.floating-point-gui.de/

Thank you for your interest in PHP.




Previous Comments:

[2011-03-11 12:31:04] philip dot almeida at freedomson dot com

Description:

Making a comutative sum operation the result does not return the
expected value.

Test script:
---
echo -6.3536+5+1.3536;

= -2.22044604925E-16



echo -6.3537+5+1.3537

= 0

Expected result:

Always 0

Actual result:
--
-2.22044604925E-16






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


[PHP-BUG] Bug #54229 [NEW]: call_user_func_array hangs script execution

2011-03-11 Thread dorin dot marcoci at gmail dot com
From: 
Operating system: Debian 6.0
PHP version:  5.3.5
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:call_user_func_array hangs script execution

Description:

After upgrading to v. 5.3.5 and executing code like in test script php
hangs.

Chrome browser says: (net::ERR_EMPTY_RESPONSE): Unknown error.

Hangs occurs when I raise an exception in database trigger.

Raised exception from database appear in logs.

But any error related to call_user_func_array are not presend in the logs.

When SQL statement executes without exeption, there is no hang.

In prior versions 5.2 i didn't meet such hangs.

Test script:
---
$this->Cursor = call_user_func_array('ibase_execute', $this->Params);

Expected result:

Run properly, without engine hangs

Actual result:
--
Chrome browser says: (net::ERR_EMPTY_RESPONSE): Unknown error.

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



[PHP-BUG] Bug #54230 [NEW]: stream_socket_accept leaks memory on SSL protocol using peer parameter

2011-03-11 Thread bas at baspeters dot com
From: 
Operating system: Linux, OSX
PHP version:  5.3.5
Package:  OpenSSL related
Bug Type: Bug
Bug description:stream_socket_accept leaks memory on SSL protocol using peer 
parameter

Description:

I encountered a memory leak issue when creating an SSL enabled socket
server in a long lived process. When an incoming listening socket is
accepted on either the SSL or TLS protocol, the &$peer passthrough variable
in the stream_socket_accept function causes a memory leak.



NOTE: The test script below needs a valid certificate.pem file to work!!

NOTE: The test script spawns a webserver to be reached on 127.0.0.1:

NOTE: Testing can be done in a browser by choosing appropriate protocol
(http/https) and perform regular page refreshes



Test matrix:

SSL=true, PEER=true   -> memory leak!

SSL=false, PEER=true  -> no memory leak

SSL=true, PEER=false  -> no memory leak

SSL=false, PEER=false -> no memory leak

Test script:
---
define('SSL', true);

define('PEER', true);



$context = stream_context_create();

stream_context_set_option($context, 'ssl', 'local_cert',
'certificate.pem');

stream_context_set_option($context, 'ssl', 'passphrase', 'password');

stream_context_set_option($context, 'ssl', 'allow_self_signed', true);



if(SSL) {

   $server = stream_socket_server("ssl://0.0.0.0:", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);

} else {

   $server = stream_socket_server("tcp://0.0.0.0:", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN);

}



while(true) {

   if(PEER) { $client = @stream_socket_accept($server, 2, $peer); } else {
$client = @stream_socket_accept($server, 2); }

   if($client === false) continue;

   @fwrite($client, "HTTP/1.1 200 OK\r\n\r\nMemory usage:
".memory_get_usage().' bytes');

   @fclose($client);

}

Expected result:

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Actual result:
--
Memory usage: 641368 bytes

Memory usage: 641560 bytes

Memory usage: 641752 bytes

Memory usage: 641944 bytes

Memory usage: 642232 bytes

Memory usage: 642424 bytes

Memory usage: 642616 bytes

Memory usage: 642808 bytes

Memory usage: 643000 bytes

Memory usage: 643192 bytes

Memory usage: 643384 bytes

Memory usage: 643576 bytes

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



Bug #54230 [Opn]: stream_socket_accept leaks memory on SSL protocol using peer parameter

2011-03-11 Thread bas at baspeters dot com
Edit report at http://bugs.php.net/bug.php?id=54230&edit=1

 ID: 54230
 User updated by:bas at baspeters dot com
 Reported by:bas at baspeters dot com
 Summary:stream_socket_accept leaks memory on SSL protocol
 using peer parameter
 Status: Open
 Type:   Bug
-Package:OpenSSL related
+Package:Sockets related
 Operating System:   Linux, OSX
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

For those who want to test but are unable to supply the required
certificate.pem file, here is a link:

http://www.baspeters.com/patches/certificate.pem

password is 'password' as stated in the test script.



I have changed the Package from 'OpenSSL' to 'Sockets related' because I
think it is a better match.


Previous Comments:

[2011-03-11 20:40:03] bas at baspeters dot com

Description:

I encountered a memory leak issue when creating an SSL enabled socket
server in a long lived process. When an incoming listening socket is
accepted on either the SSL or TLS protocol, the &$peer passthrough
variable in the stream_socket_accept function causes a memory leak.



NOTE: The test script below needs a valid certificate.pem file to
work!!

NOTE: The test script spawns a webserver to be reached on
127.0.0.1:

NOTE: Testing can be done in a browser by choosing appropriate protocol
(http/https) and perform regular page refreshes



Test matrix:

SSL=true, PEER=true   -> memory leak!

SSL=false, PEER=true  -> no memory leak

SSL=true, PEER=false  -> no memory leak

SSL=false, PEER=false -> no memory leak

Test script:
---
define('SSL', true);

define('PEER', true);



$context = stream_context_create();

stream_context_set_option($context, 'ssl', 'local_cert',
'certificate.pem');

stream_context_set_option($context, 'ssl', 'passphrase', 'password');

stream_context_set_option($context, 'ssl', 'allow_self_signed', true);



if(SSL) {

   $server = stream_socket_server("ssl://0.0.0.0:", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);

} else {

   $server = stream_socket_server("tcp://0.0.0.0:", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN);

}



while(true) {

   if(PEER) { $client = @stream_socket_accept($server, 2, $peer); } else
{ $client = @stream_socket_accept($server, 2); }

   if($client === false) continue;

   @fwrite($client, "HTTP/1.1 200 OK\r\n\r\nMemory usage:
".memory_get_usage().' bytes');

   @fclose($client);

}

Expected result:

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Actual result:
--
Memory usage: 641368 bytes

Memory usage: 641560 bytes

Memory usage: 641752 bytes

Memory usage: 641944 bytes

Memory usage: 642232 bytes

Memory usage: 642424 bytes

Memory usage: 642616 bytes

Memory usage: 642808 bytes

Memory usage: 643000 bytes

Memory usage: 643192 bytes

Memory usage: 643384 bytes

Memory usage: 643576 bytes






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


[PHP-BUG] Req #54231 [NEW]: Include SSL/TLS support to mail function

2011-03-11 Thread jfha73 at gmail dot com
From: 
Operating system: All
PHP version:  5.3.5
Package:  *Mail Related
Bug Type: Feature/Change Request
Bug description:Include SSL/TLS support to mail function

Description:

This will be a great feature,



Allow the mail function to be able to connect to a SMTP server that has SSL
or TLS enabled for added security so developers don't have to use openSSL
or something like that to open these ports to send emails through a secure
layer.

Expected result:

Be able to connect to a SMTP using a secure connection

Actual result:
--
None, I can only connect to SMTP (SSL/TLS) using openSSL

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



[PHP-BUG] Bug #54232 [NEW]: Crashes with magic method __set()

2011-03-11 Thread rantes dot javier at gmail dot com
From: 
Operating system: winxp
PHP version:  5.2.17
Package:  Compile Failure
Bug Type: Bug
Bug description:Crashes with magic method __set()

Description:

I'm developing an OOP FrameWork and i'm improving ActiveRecord. My AR class


extends from ArrayObject Class from PHP and when i try to set an AR Object
into 

another, mixing the _data array between normally vars and an AR, PHP
crushes and 

server crash.



If i do this:



class ActiveRecord extends ArrayObject{

  public function __set($name, $value) {

$this->_data[$name] = $value;

  }

}



class A extends ActiveRecord{

  public function __construct(){

  }

}



class B extends ActiveRecord{

  public function __construct(){

  }

}



$A = new A;

$B = new B;



$A->foo = 3; // everything alright, no crushes.

$B->var = 4; // everything alright, no crushes.



$B->A = $A; // Crush



When i tried this, the server goes down, but i figured out to use another
array 

for the AR objects apart from the $_data array and its works.



This works:





public function __set($name, $value) {

  if(is_object($value) and
strcmp(get_parent_class($value),'ActiveRecord')===0):

$this->_models[$name] = $value;

  else:

$this->_data[$name] = $value;

  endif;

}





So, why does it happens??


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



Bug #54232 [Opn->Fbk]: Crashes with magic method __set()

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54232&edit=1

 ID: 54232
 Updated by: fel...@php.net
 Reported by:rantes dot javier at gmail dot com
 Summary:Crashes with magic method __set()
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Compile Failure
 Operating System:   winxp
 PHP Version:5.2.17
 Block user comment: N
 Private report: N

 New Comment:

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.




Previous Comments:

[2011-03-11 22:07:53] rantes dot javier at gmail dot com

Description:

I'm developing an OOP FrameWork and i'm improving ActiveRecord. My AR
class 

extends from ArrayObject Class from PHP and when i try to set an AR
Object into 

another, mixing the _data array between normally vars and an AR, PHP
crushes and 

server crash.



If i do this:



class ActiveRecord extends ArrayObject{

  public function __set($name, $value) {

$this->_data[$name] = $value;

  }

}



class A extends ActiveRecord{

  public function __construct(){

  }

}



class B extends ActiveRecord{

  public function __construct(){

  }

}



$A = new A;

$B = new B;



$A->foo = 3; // everything alright, no crushes.

$B->var = 4; // everything alright, no crushes.



$B->A = $A; // Crush



When i tried this, the server goes down, but i figured out to use
another array 

for the AR objects apart from the $_data array and its works.



This works:





public function __set($name, $value) {

  if(is_object($value) and
strcmp(get_parent_class($value),'ActiveRecord')===0):

$this->_models[$name] = $value;

  else:

$this->_data[$name] = $value;

  endif;

}





So, why does it happens??







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


Bug #54232 [Fbk]: Crashes with magic method __set()

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54232&edit=1

 ID: 54232
 Updated by: fel...@php.net
 Reported by:rantes dot javier at gmail dot com
 Summary:Crashes with magic method __set()
 Status: Feedback
 Type:   Bug
 Package:Compile Failure
 Operating System:   winxp
 PHP Version:5.2.17
 Block user comment: N
 Private report: N

 New Comment:

Btw, try using PHP 5.3.6RC3 or svn version.


Previous Comments:

[2011-03-11 22:10:53] fel...@php.net

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.




[2011-03-11 22:07:53] rantes dot javier at gmail dot com

Description:

I'm developing an OOP FrameWork and i'm improving ActiveRecord. My AR
class 

extends from ArrayObject Class from PHP and when i try to set an AR
Object into 

another, mixing the _data array between normally vars and an AR, PHP
crushes and 

server crash.



If i do this:



class ActiveRecord extends ArrayObject{

  public function __set($name, $value) {

$this->_data[$name] = $value;

  }

}



class A extends ActiveRecord{

  public function __construct(){

  }

}



class B extends ActiveRecord{

  public function __construct(){

  }

}



$A = new A;

$B = new B;



$A->foo = 3; // everything alright, no crushes.

$B->var = 4; // everything alright, no crushes.



$B->A = $A; // Crush



When i tried this, the server goes down, but i figured out to use
another array 

for the AR objects apart from the $_data array and its works.



This works:





public function __set($name, $value) {

  if(is_object($value) and
strcmp(get_parent_class($value),'ActiveRecord')===0):

$this->_models[$name] = $value;

  else:

$this->_data[$name] = $value;

  endif;

}





So, why does it happens??







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


Bug #54232 [Fbk->Opn]: Crashes with magic method __set()

2011-03-11 Thread rantes dot javier at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54232&edit=1

 ID: 54232
 User updated by:rantes dot javier at gmail dot com
 Reported by:rantes dot javier at gmail dot com
 Summary:Crashes with magic method __set()
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:Compile Failure
 Operating System:   winxp
 PHP Version:5.2.17
 Block user comment: N
 Private report: N

 New Comment:

I can not use P.H.P. > 5.2.9 beecause the server is not mine and its a
paid 

server. I have to fix to this requirement.


Previous Comments:

[2011-03-11 22:12:34] fel...@php.net

Btw, try using PHP 5.3.6RC3 or svn version.


[2011-03-11 22:10:53] fel...@php.net

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.




[2011-03-11 22:07:53] rantes dot javier at gmail dot com

Description:

I'm developing an OOP FrameWork and i'm improving ActiveRecord. My AR
class 

extends from ArrayObject Class from PHP and when i try to set an AR
Object into 

another, mixing the _data array between normally vars and an AR, PHP
crushes and 

server crash.



If i do this:



class ActiveRecord extends ArrayObject{

  public function __set($name, $value) {

$this->_data[$name] = $value;

  }

}



class A extends ActiveRecord{

  public function __construct(){

  }

}



class B extends ActiveRecord{

  public function __construct(){

  }

}



$A = new A;

$B = new B;



$A->foo = 3; // everything alright, no crushes.

$B->var = 4; // everything alright, no crushes.



$B->A = $A; // Crush



When i tried this, the server goes down, but i figured out to use
another array 

for the AR objects apart from the $_data array and its works.



This works:





public function __set($name, $value) {

  if(is_object($value) and
strcmp(get_parent_class($value),'ActiveRecord')===0):

$this->_models[$name] = $value;

  else:

$this->_data[$name] = $value;

  endif;

}





So, why does it happens??







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


[PHP-BUG] Bug #54233 [NEW]: PHP Filter email doesn't work properly

2011-03-11 Thread flood at itnews-bg dot com
From: 
Operating system: Slackware 13x86_64
PHP version:  5.3.5
Package:  *General Issues
Bug Type: Bug
Bug description:PHP Filter email doesn't work properly

Description:

Hey,



It seems the filter function is not working some times.

You can see in the test script that the email is returned as a valid though
it's not quite.



Testing script:







Test script:
---


Expected result:

It should return a false boolean. This is not a valid email.

Actual result:
--
Returns an invalid email:

???a??S?a_?a??a???'this.is.a.test...@email.com





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



Bug #54233 [Opn]: PHP Filter email doesn't work properly

2011-03-11 Thread flood at itnews-bg dot com
Edit report at http://bugs.php.net/bug.php?id=54233&edit=1

 ID: 54233
 User updated by:flood at itnews-bg dot com
 Reported by:flood at itnews-bg dot com
 Summary:PHP Filter email doesn't work properly
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   Slackware 13x86_64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Hey,



It seems the filter function is not working some times.

You can see in the test script that the email is returned as a valid
though it's not quite.


Previous Comments:

[2011-03-11 22:43:36] flood at itnews-bg dot com

Description:

Hey,



It seems the filter function is not working some times.

You can see in the test script that the email is returned as a valid
though it's not quite.



Testing script:







Test script:
---


Expected result:

It should return a false boolean. This is not a valid email.

Actual result:
--
Returns an invalid email:

???a??S?a_?a??a???'this.is.a.test...@email.com










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


Bug #54198 [Opn->Asn]: apache2 reproducible crash datefmt_create( "en_US@calendar=BUDDHIST"...

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54198&edit=1

 ID: 54198
 Updated by: fel...@php.net
 Reported by:giorgio dot liscio at email dot it
 Summary:apache2 reproducible crash datefmt_create(
 "en_US@calendar=BUDDHIST"...
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:I18N and L10N related
 Operating System:   windows 7 x64
 PHP Version:5.3.5
-Assigned To:
+Assigned To:stas
 Block user comment: N
 Private report: N



Previous Comments:

[2011-03-08 22:24:56] giorgio dot liscio at email dot it

Description:

$fmt = datefmt_create( "en_US@calendar=BUDDHIST"
,\IntlDateFormatter::FULL, \IntlDateFormatter::FULL,
'America/Los_Angeles', \IntlDateFormatter::TRADITIONAL  ,"MM/dd/");

echo datefmt_format( $fmt , 0);



crashes on two computers (both win7 x64), so it does not depend by my
sys



if a gdb trace is needed i will try to dump it!



thank you







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


Bug #54227 [Opn->Bgs]: function strtoupper

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54227&edit=1

 ID: 54227
 Updated by: fel...@php.net
 Reported by:emersonnarede at gmail dot com
 Summary:function strtoupper
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   Centos 5.5 in Apache 2.2.4
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

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

Not a bug, use http://docs.php.net/mb-strtoupper


Previous Comments:

[2011-03-11 17:53:12] emersonnarede at gmail dot com

Description:

The function strtoupper is bugging in convert portuguese characters to
upper.



Test script:
---


Expected result:

EDUCAÇÃO

Actual result:
--
EDUCAçãO






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


Bug #53980 [Com]: On the Windows-version of PHP can not allocate more memory than 512 memory_limi

2011-03-11 Thread amarasatish at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53980&edit=1

 ID: 53980
 Comment by: amarasatish at gmail dot com
 Reported by:skibi82 at interia dot pl
 Summary:On the Windows-version of PHP can not allocate more
 memory than 512 memory_limi
 Status: Open
 Type:   Bug
 Package:PHP options/info functions
 Operating System:   Windows XP  SP3
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I am having a php file which parses the meta tags out of the html report
files and display them in a table. Until now it has wroked fine on PHP
5.2.4.4, now after installing the version 5.3.5, the page doesn't load
and give an error:



"PHP Fatal error:  Out of memory (allocated xx) (tried to allocate
xx

01 bytes) in File on line xx.". I start increasing the memory allocation
in php.ini almost upto 1000MB, but still the same error.



If i downgrade to PHP 5.2.4.4, its working again. What could the problem
be?



For some reason, the Test Script given here, gives the same error
message on version PHP 5.3.5, 5.2.4.4, 4.


Previous Comments:

[2011-02-10 11:04:50] skibi82 at interia dot pl

Description:

Fatal error: Out of memory (allocated 537919488) (tried to allocate
536870913 

bytes) 

zend_mm_heap corrupted



The error occurs regardless of the setting memory_limit



Test script:
---
http://bugs.php.net/bug.php?id=53980&edit=1


Bug #54232 [Opn->Fbk]: Crashes with magic method __set()

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54232&edit=1

 ID: 54232
 Updated by: fel...@php.net
 Reported by:rantes dot javier at gmail dot com
 Summary:Crashes with magic method __set()
-Status: Open
+Status: Feedback
 Type:   Bug
-Package:Compile Failure
+Package:Scripting Engine problem
 Operating System:   winxp
 PHP Version:5.2.17
 Block user comment: N
 Private report: N

 New Comment:

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.

I can't reproduce it.


Previous Comments:

[2011-03-11 22:19:39] rantes dot javier at gmail dot com

I can not use P.H.P. > 5.2.9 beecause the server is not mine and its a
paid 

server. I have to fix to this requirement.


[2011-03-11 22:12:34] fel...@php.net

Btw, try using PHP 5.3.6RC3 or svn version.


[2011-03-11 22:10:53] fel...@php.net

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.




[2011-03-11 22:07:53] rantes dot javier at gmail dot com

Description:

I'm developing an OOP FrameWork and i'm improving ActiveRecord. My AR
class 

extends from ArrayObject Class from PHP and when i try to set an AR
Object into 

another, mixing the _data array between normally vars and an AR, PHP
crushes and 

server crash.



If i do this:



class ActiveRecord extends ArrayObject{

  public function __set($name, $value) {

$this->_data[$name] = $value;

  }

}



class A extends ActiveRecord{

  public function __construct(){

  }

}



class B extends ActiveRecord{

  public function __construct(){

  }

}



$A = new A;

$B = new B;



$A->foo = 3; // everything alright, no crushes.

$B->var = 4; // everything alright, no crushes.



$B->A = $A; // Crush



When i tried this, the server goes down, but i figured out to use
another array 

for the AR objects apart from the $_data array and its works.



This works:





public function __set($name, $value) {

  if(is_object($value) and
strcmp(get_parent_class($value),'ActiveRecord')===0):

$this->_models[$name] = $value;

  else:

$this->_data[$name] = $value;

  endif;

}





So, why does it happens??







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


Bug #54229 [Opn->Fbk]: call_user_func_array hangs script execution

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54229&edit=1

 ID: 54229
 Updated by: fel...@php.net
 Reported by:dorin dot marcoci at gmail dot com
 Summary:call_user_func_array hangs script execution
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Debian 6.0
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

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 ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:

[2011-03-11 20:07:50] dorin dot marcoci at gmail dot com

Description:

After upgrading to v. 5.3.5 and executing code like in test script php
hangs.

Chrome browser says: (net::ERR_EMPTY_RESPONSE): Unknown error.

Hangs occurs when I raise an exception in database trigger.

Raised exception from database appear in logs.

But any error related to call_user_func_array are not presend in the
logs.

When SQL statement executes without exeption, there is no hang.

In prior versions 5.2 i didn't meet such hangs.

Test script:
---
$this->Cursor = call_user_func_array('ibase_execute', $this->Params);

Expected result:

Run properly, without engine hangs

Actual result:
--
Chrome browser says: (net::ERR_EMPTY_RESPONSE): Unknown error.






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


[PHP-BUG] Bug #54235 [NEW]: array_rand doesn't like the 31st value of an array

2011-03-11 Thread guenhwyvar dot 68781 at gmail dot com
From: 
Operating system: 
PHP version:  5.3.5
Package:  Arrays related
Bug Type: Bug
Bug description:array_rand doesn't like the 31st value of an array

Description:

There is an odd behavior with array_rand: if the array has 32 or more
values, then the 31st value is less likely to be "picked" than the others
(the more values the array has, the less it is noticeable).

This has been tested and confirmed on different versions of PHP, including
5.3.5 and 5.2.17.

Test script:
---
';

print_r($test);

echo '';

?>

Expected result:

A (more or less) equal distribution between all the values (with the
example given above, ~ 2,000 for each value).

Actual result:
--
Every time, the 31st value has been picked half what it "should" have been
(meaning, to continue with the same example, around 1,000 times for the
31st value, where for all the others it's approximatively between 1,900 and
2,200):

Array

(

[31] => 1006

[10] => 1886

…

[44] => 2152

)

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



Bug #54230 [Opn]: stream_socket_accept leaks memory on SSL protocol using peer parameter

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54230&edit=1

 ID: 54230
 Updated by: fel...@php.net
 Reported by:bas at baspeters dot com
 Summary:stream_socket_accept leaks memory on SSL protocol
 using peer parameter
 Status: Open
 Type:   Bug
 Package:Sockets related
 Operating System:   Linux, OSX
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I can't reproduce it. (OpenSSL 0.9.8g)



int(348020)

int(348236)

int(348236)

int(348236)

int(348236)

int(348236)

int(348236)

int(348236)

int(348236)

int(348236)

int(348236)


Previous Comments:

[2011-03-11 21:38:40] bas at baspeters dot com

For those who want to test but are unable to supply the required
certificate.pem file, here is a link:

http://www.baspeters.com/patches/certificate.pem

password is 'password' as stated in the test script.



I have changed the Package from 'OpenSSL' to 'Sockets related' because I
think it is a better match.


[2011-03-11 20:40:03] bas at baspeters dot com

Description:

I encountered a memory leak issue when creating an SSL enabled socket
server in a long lived process. When an incoming listening socket is
accepted on either the SSL or TLS protocol, the &$peer passthrough
variable in the stream_socket_accept function causes a memory leak.



NOTE: The test script below needs a valid certificate.pem file to
work!!

NOTE: The test script spawns a webserver to be reached on
127.0.0.1:

NOTE: Testing can be done in a browser by choosing appropriate protocol
(http/https) and perform regular page refreshes



Test matrix:

SSL=true, PEER=true   -> memory leak!

SSL=false, PEER=true  -> no memory leak

SSL=true, PEER=false  -> no memory leak

SSL=false, PEER=false -> no memory leak

Test script:
---
define('SSL', true);

define('PEER', true);



$context = stream_context_create();

stream_context_set_option($context, 'ssl', 'local_cert',
'certificate.pem');

stream_context_set_option($context, 'ssl', 'passphrase', 'password');

stream_context_set_option($context, 'ssl', 'allow_self_signed', true);



if(SSL) {

   $server = stream_socket_server("ssl://0.0.0.0:", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);

} else {

   $server = stream_socket_server("tcp://0.0.0.0:", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN);

}



while(true) {

   if(PEER) { $client = @stream_socket_accept($server, 2, $peer); } else
{ $client = @stream_socket_accept($server, 2); }

   if($client === false) continue;

   @fwrite($client, "HTTP/1.1 200 OK\r\n\r\nMemory usage:
".memory_get_usage().' bytes');

   @fclose($client);

}

Expected result:

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Memory usage: 641032 bytes

Actual result:
--
Memory usage: 641368 bytes

Memory usage: 641560 bytes

Memory usage: 641752 bytes

Memory usage: 641944 bytes

Memory usage: 642232 bytes

Memory usage: 642424 bytes

Memory usage: 642616 bytes

Memory usage: 642808 bytes

Memory usage: 643000 bytes

Memory usage: 643192 bytes

Memory usage: 643384 bytes

Memory usage: 643576 bytes






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


Bug #54235 [Opn->Bgs]: array_rand doesn't like the 31st value of an array

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54235&edit=1

 ID: 54235
 Updated by: fel...@php.net
 Reported by:guenhwyvar dot 68781 at gmail dot com
 Summary:array_rand doesn't like the 31st value of an array
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Arrays related
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

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

Thank you for your interest in PHP.

No bug here.


Previous Comments:

[2011-03-11 23:47:12] guenhwyvar dot 68781 at gmail dot com

Description:

There is an odd behavior with array_rand: if the array has 32 or more
values, then the 31st value is less likely to be "picked" than the
others (the more values the array has, the less it is noticeable).

This has been tested and confirmed on different versions of PHP,
including 5.3.5 and 5.2.17.

Test script:
---
';

print_r($test);

echo '';

?>

Expected result:

A (more or less) equal distribution between all the values (with the
example given above, ~ 2,000 for each value).

Actual result:
--
Every time, the 31st value has been picked half what it "should" have
been (meaning, to continue with the same example, around 1,000 times for
the 31st value, where for all the others it's approximatively between
1,900 and 2,200):

Array

(

[31] => 1006

[10] => 1886

…

[44] => 2152

)






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


Bug #54191 [Opn->Bgs]: Give me solution for a bug......

2011-03-11 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54191&edit=1

 ID: 54191
 Updated by: fel...@php.net
 Reported by:tejasmaster11 at gmail dot com
 Summary:Give me solution for a bug..
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:*Configuration Issues
 Operating System:   XP
 PHP Version:5.3.6RC2
 Block user comment: N
 Private report: N

 New Comment:

.


Previous Comments:

[2011-03-08 18:34:21] dtajchre...@php.net

This looks like the example off the ini_set page... you sure the page
you're 

running is exactly what's below? 



http://codepad.viper-7.com/z63S3W


[2011-03-08 13:23:21] tejasmaster11 at gmail dot com

Description:

---

>From manual page: http://www.php.net/function.ini-set#Examples

---



Test script:
---


Expected result:

1

Actual result:
--
11






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