Bug #60761 [Com]: zlib.output_compression fails on refresh

2012-05-20 Thread pierre at archlinux dot de
Edit report at https://bugs.php.net/bug.php?id=60761edit=1

 ID: 60761
 Comment by: pierre at archlinux dot de
 Reported by:valentiny510 at yahoo dot es
 Summary:zlib.output_compression fails on refresh
 Status: Closed
 Type:   Bug
 Package:*Compression related
 Operating System:   xp
 PHP Version:5.4.0RC5
 Assigned To:mike
 Block user comment: N
 Private report: N

 New Comment:

I just tested this with 5.4.4RC1. While output compression is now on for more 
than just one request, there is another drawback: I have several pools defined 
via fpm. One of them has php_flag[zlib.output_compression] = on.

Once the vhost using this pool is accessed output compression is turned on for 
all fpm pool and cannot be turned off. Even worse: 
ini_get('zlib.output_compression') still reports false.

If you then use the ob_gzhandler you get output handler 'ob_gzhandler' 
conflicts with 'zlib output compression'


Previous Comments:

[2012-05-15 07:47:47] m...@php.net

Should be fixed in 5.4 and master.


[2012-05-15 07:45:37] m...@php.net

Automatic comment on behalf of mike
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=0ad53bfd7da12a92a46c08e3fff579a15026b88b
Log: fix bug #60761 zlib.output_compression fails on refresh


[2012-05-12 13:42:53] pierre at archlinux dot de

I can still reproduce this bug on Arch Linux using PHP 5.4.3 (php-fpm). Which 
additional information do you guys need? It seems pretty obvious to me.


[2012-04-15 02:27:15] adunar at gmail dot com

The bug also happens with the cli-server SAPI (both Windows and Ubuntu).

Here are a few (bash) commands that will reproduce this bug (assumes 
zlib.output_compression = On in your php.ini)

echo ?php echo '---';  bug.php

php -S 127.0.0.1:  /dev/null 21 

curl --header Accept-Encoding: gzip http://localhost:/bug.php 2 
/dev/null | wc -m

curl --header Accept-Encoding: gzip http://localhost:/bug.php 2 
/dev/null | wc -m

# fg, then ctrl+c to kill php -S

If output_compression is working correctly, the two curl commands should print 
the same number (approx. 16). 

However with PHP 5.4, the second (and subsequent) curl commands print the size 
of the original uncompressed output (31).


[2012-04-14 23:56:24] adunar at gmail dot com

I am experiencing the same problem, using PHP 5.4.0 with the PHP-FPM 
SAPI on Ubuntu.

zlib appears to only compress the output for the first request from 
a particular worker process.

With the default settings it takes a few refreshes to run into the bug. 
To reproduce immediately, set pm.start_servers = 1 in php-fpm.conf.

Afterwards, running /etc/init.d/php5-fpm reload allows another 
request to be compressed before it stops working again.




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=60761


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


Bug #62069 [Asn]: binding wrong traits if they have same name methods

2012-05-20 Thread gron
Edit report at https://bugs.php.net/bug.php?id=62069edit=1

 ID: 62069
 Updated by: g...@php.net
 Reported by:larue...@php.net
 Summary:binding wrong traits if they have same name methods
 Status: Assigned
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.4.3
 Assigned To:dmitry
 Block user comment: N
 Private report: N

 New Comment:

@laruence it is intended behavior to have no fatal error in this case.
The method of the class has precedence and solves the conflict explicitly.

If the class does not define a method with that name, the conflict remains 
unsolved, and you will get an error.


Previous Comments:

[2012-05-20 04:53:35] larue...@php.net

@gron, the second example is try to description another bug of the first 
example, 
that is , if the class have a own defined same name as trait, no fatal error 
occurred, :)


[2012-05-19 13:55:05] g...@php.net

Hi Laruence:

The first example is a bug, indeed.

Why is the second example a bug?
To me it looks like the perfectly intended traits semantics, no?


[2012-05-19 06:44:30] larue...@php.net

and if the class have no own func method defination, the result will be:
?php
trait T1 {
public function func() {
echo From T1\n;
}
}

trait T2 {
public function func() {
echo From T2\n;
}
}

class Bar {
use T1 {
func as f1;
}
use T2 {
func as f2;
}
}

PHP Fatal error:  Trait method func has not been applied, because there are 
collisions with other trait methods on Bar in /tmp/1.php on line 21

this should also be a bug. thanks :)


[2012-05-19 06:40:54] larue...@php.net

Hi, dmitry, could you please look at this? thanks

the problem occurrs in zend_traits_merge_functions. in that function, it will 
unique the trait methods name. 

the fix will be a big change, since we should re-implemention the whole merge 
functions mechanism, maybe add the tarit name as a suffix to method name.

thanks


[2012-05-19 06:30:40] larue...@php.net

Description:

if a function binding more than two traits and they have same method name, the 
result is wrong.

Test script:
---
?php
trait T1 {
public function func() {
echo From T1\n;
}
}

trait T2 {
public function func() {
echo From T2\n;
}
}

class Bar {
public function func() {
echo From Bar\n;
}
use T1 {
func as f1;
}
use T2 {
func as f2;
}
}

$b = new Bar();
$b-f2();

Expected result:

From T2

Actual result:
--
From T1






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


Bug #43771 [Com]: validateOnParse validate() give difference results

2012-05-20 Thread it dot registrations at symphony-group dot co dot uk
Edit report at https://bugs.php.net/bug.php?id=43771edit=1

 ID: 43771
 Comment by: it dot registrations at symphony-group dot co dot uk
 Reported by:missingno at ifrance dot com
 Summary:validateOnParse  validate() give difference results
 Status: Not a bug
 Type:   Bug
 Package:DOM XML related
 Operating System:   Ubuntu 7.10
 PHP Version:5.3CVS-2008-01-06 (snap)
 Block user comment: N
 Private report: N

 New Comment:

I feel this is a bug, and it still exists as of PHP 5.3.8 on OS X 10.7.3 and 
PHP 
5.4.3 compiled on Fedora 15


Previous Comments:

[2008-01-23 11:24:48] rricha...@php.net

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

validation only works for XML data, so XHTML DOCTYPE needed.
Also, in order to use validateOnParse, you need to load via loadXML()


[2008-01-06 17:18:38] missingno at ifrance dot com

Description:

From what I understand, DOMDocument::validateOnParse() = TRUE  
DOMDocument::validate() should return the same list of errors for a given 
document.

But when dealing with HTML code, validate() seems to fail to deal with the DTD 
correctly.

Therefore, using validate()  validateOnParse gives different results.

I think that in the case of validate(), PHP calls libxml with options that make 
it think it will be dealing with XML code and thus, an XML DTD. So, once libxml 
loads the HTML DTD, it fails to parse it correctly and returns a bunch of 
errors.

(HTML  XML DTDs are similar, except that HTML ones allow for some more 
constructs like the '' operator in ELEMENT declarations)

Reproduce code:
---
?php
/* Note: removing the system identifier doesn't change the result,
 * except that errors in the DTD are caught immediately.
 * (My guess would be that libxml tries to fetch the DTD from the
 * system identifier instead of using a catalog for resolution) */
$markup = HTML
!DOCTYPE HTML PUBLIC
-//W3C//DTD HTML 4.0 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html
headtitleFoo/title/head
bodypBar/p/body
/html
HTML;

header('Content-Type: text/plain');
libxml_use_internal_errors(TRUE);

// First, using DOMDocument::validateOnParse.
libxml_clear_errors();
$dd1 = new DOMDocument();
$dd1-validateOnParse  = TRUE;

echo Using validateOnParse:\n;
$dd1-loadHTML($markup);
var_dump(libxml_get_errors());

echo \n\n;

// Now, using DOMDocument::validate() instead.
libxml_clear_errors();
$dd2 = new DOMDocument();
$dd2-validateOnParse  = FALSE;

echo Using validate():\n;
$dd2-loadHTML($markup);
$dd2-validate();
var_dump(libxml_get_errors());

?

Expected result:

Using validateOnParse:
array(0) {
}


Using validate():
array(0) {
}


Actual result:
--
Using validateOnParse:
array(0) {
}


Using validate():
array(3) {
  [0]=
  object(LibXMLError)#3 (6) {
[level]=
int(3)
[code]=
int(37)
[column]=
int(1)
[message]=
string(55) xmlParseEntityDecl: entity HTML.Version not terminated

[file]=
string(36) http://www.w3.org/TR/html4/loose.dtd;
[line]=
int(31)
  }
  [1]=
  object(LibXMLError)#4 (6) {
[level]=
int(3)
[code]=
int(60)
[column]=
int(1)
[message]=
string(37) Content error in the external subset

[file]=
string(36) http://www.w3.org/TR/html4/loose.dtd;
[line]=
int(31)
  }
  [2]=
  object(LibXMLError)#5 (6) {
[level]=
int(2)
[code]=
int(517)
[column]=
int(0)
[message]=
string(74) Could not load the external subset 
http://www.w3.org/TR/html4/loose.dtd;

[file]=
string(0) 
[line]=
int(0)
  }
}







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


Bug #62069 [Asn]: binding wrong traits if they have same name methods

2012-05-20 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62069edit=1

 ID: 62069
 Updated by: larue...@php.net
 Reported by:larue...@php.net
 Summary:binding wrong traits if they have same name methods
 Status: Assigned
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.4.3
 Assigned To:dmitry
 Block user comment: N
 Private report: N

 New Comment:

@gron, oh, I see, thanks.


Previous Comments:

[2012-05-20 07:19:52] g...@php.net

@laruence it is intended behavior to have no fatal error in this case.
The method of the class has precedence and solves the conflict explicitly.

If the class does not define a method with that name, the conflict remains 
unsolved, and you will get an error.


[2012-05-20 04:53:35] larue...@php.net

@gron, the second example is try to description another bug of the first 
example, 
that is , if the class have a own defined same name as trait, no fatal error 
occurred, :)


[2012-05-19 13:55:05] g...@php.net

Hi Laruence:

The first example is a bug, indeed.

Why is the second example a bug?
To me it looks like the perfectly intended traits semantics, no?


[2012-05-19 06:44:30] larue...@php.net

and if the class have no own func method defination, the result will be:
?php
trait T1 {
public function func() {
echo From T1\n;
}
}

trait T2 {
public function func() {
echo From T2\n;
}
}

class Bar {
use T1 {
func as f1;
}
use T2 {
func as f2;
}
}

PHP Fatal error:  Trait method func has not been applied, because there are 
collisions with other trait methods on Bar in /tmp/1.php on line 21

this should also be a bug. thanks :)


[2012-05-19 06:40:54] larue...@php.net

Hi, dmitry, could you please look at this? thanks

the problem occurrs in zend_traits_merge_functions. in that function, it will 
unique the trait methods name. 

the fix will be a big change, since we should re-implemention the whole merge 
functions mechanism, maybe add the tarit name as a suffix to method name.

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=62069


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


[PHP-BUG] Bug #62076 [NEW]: Global/namespace constants are not hoisted

2012-05-20 Thread phplists at stanvassilev dot com
From: 
Operating system: 
PHP version:  5.4.3
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:Global/namespace constants are not hoisted

Description:

const Declarations outside a class were introduced in PHP 5.3, and they
only 
support static compile-time expressions, unlike define().

Function and classes declarations are hoisted to the top of the file, so
you can 
call them before the line they are defined in. This doesn't happen 
with const, although it's expected as a matter of consistency. This leads
to 
the following odd problem: 

?php
namespace foo;

func(); // Warning, and prints NOT_HOISTED

const NOT_HOISTED = 123;

func(); // prints 123

function func()
{
echo NOT_HOISTED;
}


Please make const consistent with the rest of the language, and hoist it

together with function and class declarations.

Expected result:

To print 123 in both cases, no warning.

Actual result:
--
Referring to a const before the line it's declared in results in an error
and 
magical string casting (as if it doesn't exist).

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



Bug #62076 [Opn]: Global/namespace constants are not hoisted

2012-05-20 Thread phplists at stanvassilev dot com
Edit report at https://bugs.php.net/bug.php?id=62076edit=1

 ID: 62076
 User updated by:phplists at stanvassilev dot com
 Reported by:phplists at stanvassilev dot com
 Summary:Global/namespace constants are not hoisted
 Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

My full argument why const should be hoisted, while define() can't and 
shouldn't 
be:

const FOO = val; is a construct that doesn't depend on runtime conditions, much 
like class constants. It can't accept expressions, variables and can't be 
placed 
in conditional blocks, while define() is a function call that can accept 
variables and expressions and be placed in conditional blocks.

Therefore regardless of their opcode implementation, they are exposed in a 
fundamentally 
different way, and define() hoisting isn't expected while const hoisting is 
expected (as 
a static declaration, and similar to class const declaration, their position in 
the class DOES NOT matter).

Therefore I believe const should act like class constants, and not like 
define(), as this matches user expectations better.


Previous Comments:

[2012-05-20 10:28:28] phplists at stanvassilev dot com

Description:

const Declarations outside a class were introduced in PHP 5.3, and they only 
support static compile-time expressions, unlike define().

Function and classes declarations are hoisted to the top of the file, so you 
can 
call them before the line they are defined in. This doesn't happen 
with const, although it's expected as a matter of consistency. This leads to 
the following odd problem: 

?php
namespace foo;

func(); // Warning, and prints NOT_HOISTED

const NOT_HOISTED = 123;

func(); // prints 123

function func()
{
echo NOT_HOISTED;
}


Please make const consistent with the rest of the language, and hoist it 
together with function and class declarations.

Expected result:

To print 123 in both cases, no warning.

Actual result:
--
Referring to a const before the line it's declared in results in an error and 
magical string casting (as if it doesn't exist).






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


Bug #54547 [Com]: wrong equality of string numbers

2012-05-20 Thread kazuo at o-ishi dot jp
Edit report at https://bugs.php.net/bug.php?id=54547edit=1

 ID: 54547
 Comment by: kazuo at o-ishi dot jp
 Reported by:peter dot ritt at gmx dot net
 Summary:wrong equality of string numbers
 Status: Closed
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   linux
 PHP Version:5.3.6
 Assigned To:dmitry
 Block user comment: N
 Private report: N

 New Comment:

This change has a compatibility problem.

After this change,

 01234 == 1234
= TRUE (OK)

but 

 09223372036854775808 == 9223372036854775808
= FALSE

I think this behavior is not reasonable.


Previous Comments:

[2012-05-15 07:45:39] m...@php.net

Automatic comment on behalf of stas
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=9344bf193c6e35c8706923953f3e63bb01cc05ed
Log: fix bug #54547


[2012-05-14 18:03:49] s...@php.net

Automatic comment on behalf of stas
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=47db8a9aa19f6e17a1018becf9978315c79a1cb0
Log: fix bug #54547


[2012-05-13 21:51:39] s...@php.net

I've added Gustavo's patch to 5.4.


[2012-05-13 21:48:43] s...@php.net

Automatic comment on behalf of stas
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=9344bf193c6e35c8706923953f3e63bb01cc05ed
Log: fix bug #54547


[2012-04-18 08:23:12] hholz...@php.net

the dot matt dot kantor at gmail dot com: i stand corrected indeed




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=54547


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


[PHP-BUG] Bug #62078 [NEW]: Closure instantiation and chaining

2012-05-20 Thread dan dot lugg at gmail dot com
From: 
Operating system: 
PHP version:  5.4.3
Package:  Class/Object related
Bug Type: Bug
Bug description:Closure instantiation and chaining

Description:

When you instantiate a closure through the function(){} syntax, you
cannot chain 
the closure method bindTo() from the instantiation. While this is trivial,

considering static Closure::bind(), it seems inconsistent with efforts to
allow 
method invocation on instantiation of other objects.

Test script:
---
$function = (function(){ /* ... */ })-bindTo($object);

Expected result:

$function should contain the instantiated and re-bound closure.

Actual result:
--
Parse error: syntax error, unexpected '-' (T_OBJECT_OPERATOR)

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



Bug #62078 [Com]: Closure instantiation and chaining

2012-05-20 Thread dan dot lugg at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62078edit=1

 ID: 62078
 Comment by: dan dot lugg at gmail dot com
 Reported by:dan dot lugg at gmail dot com
 Summary:Closure instantiation and chaining
 Status: Open
 Type:   Bug
 Package:Class/Object related
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

I apologize if the bug category is not correct; there didn't appear to be a 
Syntax category or related.


Previous Comments:

[2012-05-20 17:34:36] dan dot lugg at gmail dot com

Description:

When you instantiate a closure through the function(){} syntax, you cannot 
chain 
the closure method bindTo() from the instantiation. While this is trivial, 
considering static Closure::bind(), it seems inconsistent with efforts to allow 
method invocation on instantiation of other objects.

Test script:
---
$function = (function(){ /* ... */ })-bindTo($object);

Expected result:

$function should contain the instantiated and re-bound closure.

Actual result:
--
Parse error: syntax error, unexpected '-' (T_OBJECT_OPERATOR)






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


Bug #62073 [Opn-Asn]: different ways of iterating over an SplMaxHeap result in different keys

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62073edit=1

 ID: 62073
 Updated by: fel...@php.net
 Reported by:mr_platelet+jin6vr at fastmail dot fm
 Summary:different ways of iterating over an SplMaxHeap
 result in different keys
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:SPL related
 Operating System:   Debian Linux 6.0.4
 PHP Version:5.3.13
-Assigned To:
+Assigned To:colder
 Block user comment: N
 Private report: N



Previous Comments:

[2012-05-19 16:50:20] mr_platelet+jin6vr at fastmail dot fm

Description:

If I use a foreach-loop to iterate over an SplMaxHeap,
the first key is 1.  If I use the key method, the
first key is 0.

Just in case it's relevant, this is the configure
command I used to compile PHP.  (Don't be misled by
the value for prefix; I'm using PHP 5.3.13, not
PHP 5.3.12.)

./configure  --prefix=/usr/local/php/5.3.12 --disable-cgi --with-
pgsql=shared,/usr --with-xmlrpc=shared --with-tidy=shared,/usr --with-
mssql=shared,/usr --with-sqlite=shared,/usr --with-snmp=shared,/usr --with-
xsl=shared,/usr --with-recode=shared,/usr --with-unixODBC=shared,/usr --with-
pspell=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config --with-
mysql=shared,/usr --with-mcrypt=shared,/usr --with-ldap-sasl=/usr --with-
ldap=shared,/usr --with-t1lib=shared,/usr --with-ttf=shared,/usr --enable-
intl=shared --with-pdo-firebird=shared,/usr --with-interbase=shared,/usr --with-
imap-ssl --with-freetype-dir=shared,/usr --with-png-dir=shared,/usr --with-xpm-
dir=shared,/usr/X11R6 --with-jpeg-dir=shared,/usr --with-gmp=shared,/usr --
enable-gd-native-ttf --with-gd=shared,/usr --with-zlib-dir=/usr --with-
enchant=shared,/usr --with-curl=shared,/usr --without-mm --with-mhash=yes --
enable-zip --enable-soap --with-openssl=/usr --with-kerberos=/usr --with-zlib --
with-libxml-dir=/usr --enable-wddx --enable-sockets --enable-shmop --with-pcre-
regex=/usr --with-onig=/usr --enable-mbstring --with-gettext --enable-ftp --
enable-exif --with-iconv --without-gdbm --with-db4 --enable-ctype --with-bz2 --
enable-bcmath --enable-sysvmsg --enable-sysvshm --enable-sysvsem --enable-
calendar --with-pic --disable-static --disable-rpath --with-regex=php --disable-
debug --enable-pcntl --with-readline

Test script:
---
?php
$heap = new SplMaxHeap;
$heap-insert(42);
foreach ($heap as $key = $value) {
  break;
}
var_dump($key);
var_dump($value);

$heap = new SplMaxHeap;
$heap-insert(42);
var_dump($heap-key());
var_dump($heap-current());

Expected result:

I expect to see 4 lines of output from the script,
and, among other things, I expect the third line to be
the same as the first line.

Actual result:
--
The script gives this output:

int(1)
int(42)
int(0)
int(42)

Note that the third line differs from
the first.






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


[PHP-BUG] Bug #62081 [NEW]: IntlDateFormatter constructor leaks memory when called twice

2012-05-20 Thread fel...@php.net
From: felipe
Operating system: Linux
PHP version:  Irrelevant
Package:  I18N and L10N related
Bug Type: Bug
Bug description:IntlDateFormatter constructor leaks memory when called twice

Description:

See below:

Test script:
---
?php

$x = new IntlDateFormatter(1,1,1,1,1);
$x-__construct(1,1,1,1,1);


Actual result:
--
[Sun May 20 16:32:34 2012]  Script:  '/home/felipe/dev/bug.php'
/home/felipe/dev/php5_3/ext/intl/dateformat/dateformat.c(149) :  Freeing
0x02D8A4C8 (2 bytes), script=/home/felipe/dev/bug.php
=== Total 1 memory leaks detected ===


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



[PHP-BUG] Bug #62083 [NEW]: grapheme_extract() memory leaks

2012-05-20 Thread fel...@php.net
From: felipe
Operating system: Linux
PHP version:  Irrelevant
Package:  I18N and L10N related
Bug Type: Bug
Bug description:grapheme_extract() memory leaks

Description:

See below:

Test script:
---
?php

$arr1 = array();
grapheme_extract(-1,-1,-1,-1,$arr1);



Actual result:
--
[Sun May 20 17:17:49 2012]  Script:  '/home/felipe/dev/bug.php'
/home/felipe/dev/php5_3/Zend/zend_vm_execute.h(20541) :  Freeing 0x02789DD0
(72 bytes), script=/home/felipe/dev/bug.php
/home/felipe/dev/php5_3/Zend/zend_API.c(961) : Actual location (location
was relayed)
Last leak repeated 1 time
=== Total 2 memory leaks detected ===


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



Req #61972 [Opn]: addchild treats text as a tag

2012-05-20 Thread crashyn at op dot pl
Edit report at https://bugs.php.net/bug.php?id=61972edit=1

 ID: 61972
 User updated by:crashyn at op dot pl
 Reported by:crashyn at op dot pl
 Summary:addchild treats text as a tag
 Status: Open
 Type:   Feature/Change Request
 Package:SimpleXML related
 Operating System:   Windows XP
 PHP Version:5.4.2
 Block user comment: N
 Private report: N

 New Comment:

?php
$xml_header = ?xml version='1.0' encoding='utf-8'?xml/;

$xml = new SimpleXMLElement($xml_header);
$xml-addChild(first_string,this is lt;mystringgt;);
$xml-addChild(second_string,this is lt; mystringgt;);
$xml-asXML(test.xml);
echo pre . $xml-first_string . br /;   // 'this is '
echo $xml-second_string . /pre;// 'this is  mystring'
?


Previous Comments:

[2012-05-16 20:55:00] riptide dot tempora at opinehub dot com

Can you provide a test script and its actual vs. expected output to show 
exactly what you mean?


[2012-05-07 21:09:58] crashyn at op dot pl

Description:

---
From manual page: http://www.php.net/simplexmlelement.addchild
---
addChild treats lt;my_stringgt; as a tag nd removes it completely







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


Bug #62071 [Opn]: CLI Programs Hang Forever

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62071edit=1

 ID: 62071
 Updated by: fel...@php.net
 Reported by:ewilde at bsmdevelopment dot com
 Summary:CLI Programs Hang Forever
 Status: Open
 Type:   Bug
 Package:Reproducible crash
 Operating System:   CentOS 5.8
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

I can't reproduce it.


Previous Comments:

[2012-05-19 14:44:36] ewilde at bsmdevelopment dot com

Description:

Scripts executed under the CLI never end.  For example, the following test 
script will run as long as you let it, until it is killed.  It doesn't appear 
to be looping, as it consumes no resources.  Rather, it appears to be blocked 
waiting for some signal that never happens.

Note that this may explain why the 5.4.3 build cannot be built with 
--enable-phar and why make install hangs forever at the end.

Build parms: ./configure --with-apxs2=/usr/share/httpd-2.4/bin/apxs --with-curl 
--with-gd --with-ldap --with-libxml-dir=/usr/local --with-mcrypt 
--with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config 
--with-openssl --with-pspell --with-unixODBC=/usr/local/unixODBC 
--enable-bcmath --disable-phar --enable-sockets


Test script:
---
#!/usr/bin/php
script language=php

  fwrite(STDOUT, This is a test\n);

/script


Expected result:

The CLI program exits.

Actual result:
--
The CLI program never exits.






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


Bug #62041 [Opn-Nab]: Fails when recursive group comes before reference

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62041edit=1

 ID: 62041
 Updated by: fel...@php.net
 Reported by:michael at squiloople dot com
 Summary:Fails when recursive group comes before reference
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:PCRE related
 Operating System:   Windows Vista
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

Not a PHP issue.
Assumption about bugs in pattern matching must be reported to http://pcre.org/

Thanks.


Previous Comments:

[2012-05-15 19:13:42] michael at squiloople dot com

Description:

When the recursive subpattern is captured after it is referenced:

(?2)?::(?((?1)(?:(?1)){0,4}):)?

It works fine. But when the capture comes before the reference it doesn't:

((?1)(?:(?1)){0,4})?::(?(?2):)?

The problem is the final : as other characters work fine. Replacing it with 
\: 
or [:] does not help.

Test script:
---
// Test 1
preg_match('/^(?([a-f0-9]{1,4})(?:(?1)){5}:|(?!(?:.*[a-f0-9]:){6,})(?2)?::(?((?1)(?:(?1)){0,4}):)?)(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?\.(?3)){3}$/iD',
 '0:0:0:0::0:255.255.255.255');

// Test 2
preg_match('/^(?([a-f0-9]{1,4})(?:(?1)){5}:|(?!(?:.*[a-f0-9]:){6,})((?1)(?:(?1)){0,4})?::(?(?2):)?)(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?\.(?3)){3}$/iD',
 '0:0:0:0::0:255.255.255.255');

// Test 3
preg_match('/^(?([a-f0-9]{1,4})(?:(?1)){5}:|(?!(?:.*[a-f0-9]:){6,})((?1)(?:(?1)){0,4})?::(?(?2)!)?)(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?\.(?3)){3}$/iD',
 '0:0:0:0::0!255.255.255.255');

Expected result:

// Test 1
int(1)

// Test 2
int(1)

// Test 3
int(1)

Actual result:
--
// Test 1
int(1)

// Test 2
int(0)

// Test 3
int(1)






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


Bug #62038 [Opn-Asn]: apache2 + fpm is incompatible with mod_cache, mod_mem_cache

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62038edit=1

 ID: 62038
 Updated by: fel...@php.net
 Reported by:Tamaraxo3 at gmail dot com
 Summary:apache2 + fpm is incompatible with mod_cache,
 mod_mem_cache
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:FPM related
 Operating System:   Linux
 PHP Version:5.3.13
-Assigned To:
+Assigned To:fat
 Block user comment: N
 Private report: N



Previous Comments:

[2012-05-15 15:43:21] Tamaraxo3 at gmail dot com

Description:

when you install apache2 and configure php5-fpm

and now so execute
a2enmod mem_cache

modul will be loaded

but apache cache didn't work with FPM

(all request will be handeled by FPM... none where use mem_cache)

Test script:
---
after setup try this

?php
 header('Cache-Control: public, must-revalidate, max-age=300, s-maxage=300');
 echo time();
?







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


Bug #62025 [Opn-Fbk]: __ss_family was changed on AIX 5.3

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62025edit=1

 ID: 62025
 Updated by: fel...@php.net
 Reported by:lior dot k at zend dot com
 Summary:__ss_family was changed on AIX 5.3
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Sockets related
 Operating System:   AIX
 PHP Version:5.4.3
-Assigned To:
+Assigned To:felipe
 Block user comment: N
 Private report: N

 New Comment:

I've pushed a fix to git, can you test it and provide a feedback? Thanks.


Previous Comments:

[2012-05-20 22:45:44] fel...@php.net

Automatic comment on behalf of felipe...@gmail.com
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=f3615bc6f7079e8e9c8940a80b011de1e01951d3
Log: - Fixed bug #62025 (__ss_family was changed on AIX 5.3)


[2012-05-20 22:45:43] fel...@php.net

Automatic comment on behalf of felipe...@gmail.com
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=ffe8303f24bd1db8af1e64e99c9f7edca4940d95
Log: - Fixed bug #62025 (__ss_family was changed on AIX 5.3)


[2012-05-14 14:13:50] lior dot k at zend dot com

That's __ss_family on AIX 5.1, on AIX 5.3 it's the same other OSes.


[2012-05-14 13:53:12] lior dot k at zend dot com

Setting OS to AIX.


[2012-05-14 13:51:29] lior dot k at zend dot com

Description:

Hi,

I had a problem building the sockets extension on AIX (tested with 5.4.0RC8, 
but the code didn't change 5.4.1 or 5.4.3).

The problem is that ss_family is called __ss_family on aix. The following small 
but ugly patch did the work, but probably should be applied in a more clean way.

diff -ruw php-5.4.0RC8.orig/ext/sockets/sockets.c 
php-5.4.0RC8/ext/sockets/sockets.c
--- php-5.4.0RC8.orig/ext/sockets/sockets.c 2012-01-01 15:15:04.0 
+0200
+++ php-5.4.0RC8/ext/sockets/sockets.c  2012-05-13 11:51:35.750746776 +0300
@@ -77,6 +77,9 @@
 # define IS_INVALID_SOCKET(a)  (a-bsd_socket  0)
 # define set_errno(a) (errno = a)
 # include php_sockets.h
+# ifdef _AIX
+#  define ss_family __ss_family
+# endif
 # if HAVE_IF_NAMETOINDEX
 #  include net/if.h
 # endif

Lior Kaplan
Zend Inc








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


Bug #61584 [Opn-Fbk]: when using readline_info to set line_buffer, it causes memory corruption

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=61584edit=1

 ID: 61584
 Updated by: fel...@php.net
 Reported by:osama dot sorour at eformations dot net
 Summary:when using readline_info to set line_buffer, it
 causes memory corruption
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Readline related
 Operating System:   Linux
 PHP Version:5.4.0
 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 ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:

[2012-03-31 19:08:23] osama dot sorour at eformations dot net

Description:

Using the function readline_info to set the property line_buffer performs a 
direct setting of readline rl_line_buffer. It works for short lived scripts but 
for longer ones, they start to crash randomly with sig violations.
The proper way for libreadline is to use rl_replace_line to set the line buffer.

In addition, readline_info does not allow you to set point and end 
properties 
that are needed when changing line_buffer.

I've included a patch that fixes the setting of line_buffer and adds the 
ability to set both point and end properties.

Test script:
---
None. Random crashes.

Expected result:

None.


Actual result:
--
None.






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


[PHP-BUG] Bug #62084 [NEW]: Segfault during inheritance check on method

2012-05-20 Thread victor dot kupriyanov at gmail dot com
From: 
Operating system: Any
PHP version:  5.4.3
Package:  *Compile Issues
Bug Type: Bug
Bug description:Segfault during inheritance check on method

Description:

When inherited method has different type hinting information for the method
parameters and E_STRICT error reporting level is set - PHP tries to report
method declaration incompatibility and segfaults on attempt to dereference
a null pointer.

Test script:
---
?php

class A {}

class B {
public function b(A $a) {}
}

class C extends B {
public function b($a) {}
}

$a = new C();

Expected result:

Valid message explaining that inherited method has a different signature.

Actual result:
--
$ php a.php 
Segmentation fault (core dumped)

...

(gdb) bt
#0  zend_get_function_declaration (fptr=0x0)
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3046
#1  0x005a2479 in do_inheritance_check_on_method (child=
0x77fc3558, parent=0x77fc3f18)
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3267
#2  0x005a2665 in do_inherit_method_check (
child_function_table=value optimized out, parent=value optimized
out, 
hash_key=value optimized out, child_ce=0x77fc3310)
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3288
#3  0x005d3cf1 in zend_hash_replace_checker_wrapper (target=
0x77fc3338, source=value optimized out, pCopyConstructor=
0x5a7bc0 do_inherit_method, size=240, pMergeSource=
0x5a2620 do_inherit_method_check, pParam=0x77fc3310)
at /usr/src/debug/php-5.4.3/Zend/zend_hash.c:878
#4  zend_hash_merge_ex (target=0x77fc3338, source=value optimized
out, 
pCopyConstructor=0x5a7bc0 do_inherit_method, size=240, pMergeSource=
0x5a2620 do_inherit_method_check, pParam=0x77fc3310)
at /usr/src/debug/php-5.4.3/Zend/zend_hash.c:892
#5  0x005a850b in zend_do_inheritance (ce=0x77fc3310,
parent_ce=
0x77fc2ff8) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3519
#6  0x005a962c in do_bind_inherited_class (
op_array=value optimized out, opline=value optimized out,
class_table=
0xdf4c30, parent_ce=0x77fc2ff8, compile_time=1 '\001')
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4569
#7  0x005a985a in zend_do_early_binding ()
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4626
#8  0x0058c1ca in zendparse ()
at /usr/src/debug/php-5.4.3/Zend/zend_language_parser.c:3547
#9  0x0058fa0d in compile_file (file_handle=0x7fffdec0, 
type=value optimized out) at Zend/zend_language_scanner.l:579
#10 0x7fffeb6d4042 in phar_compile_file (file_handle=0x7fffdec0,
type=
8) at /usr/src/debug/php-5.4.3/ext/phar/phar.c:3391
#11 0x71d8101d in xdebug_compile_file (
file_handle=value optimized out, type=value optimized out)
at /usr/src/debug/php-pecl-xdebug-2.2.0/xdebug-2.2.0/xdebug.c:1537
#12 0x005c70ca in zend_execute_scripts (type=8, retval=0x0,
file_count=
3) at /usr/src/debug/php-5.4.3/Zend/zend.c:1264
#13 0x00566cc3 in php_execute_script (primary_file=0x7fffdec0)
at /usr/src/debug/php-5.4.3/main/main.c:2473
#14 0x00672395 in do_cli (argc=2, argv=0x7fffe1f8)
at /usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:983
#15 0x00672cbc in main (argc=2, argv=0x7fffe1f8)
at /usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:1356

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62084edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62084r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62084r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62084r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62084r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62084r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62084r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62084r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62084r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62084r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62084r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62084r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62084r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62084r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62084r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62084r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62084r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62084r=isapi
Install GNU 

Bug #62084 [Opn-Fbk]: Segfault during inheritance check on method

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62084edit=1

 ID: 62084
 Updated by: fel...@php.net
 Reported by:victor dot kupriyanov at gmail dot com
 Summary:Segfault during inheritance check on method
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:*Compile Issues
 Operating System:   Any
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

I can't reproduce it. Try disabling the xdebug and testing it again.


Previous Comments:

[2012-05-21 02:27:31] victor dot kupriyanov at gmail dot com

Description:

When inherited method has different type hinting information for the method 
parameters and E_STRICT error reporting level is set - PHP tries to report 
method declaration incompatibility and segfaults on attempt to dereference a 
null pointer.

Test script:
---
?php

class A {}

class B {
public function b(A $a) {}
}

class C extends B {
public function b($a) {}
}

$a = new C();

Expected result:

Valid message explaining that inherited method has a different signature.

Actual result:
--
$ php a.php 
Segmentation fault (core dumped)

...

(gdb) bt
#0  zend_get_function_declaration (fptr=0x0)
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3046
#1  0x005a2479 in do_inheritance_check_on_method (child=
0x77fc3558, parent=0x77fc3f18)
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3267
#2  0x005a2665 in do_inherit_method_check (
child_function_table=value optimized out, parent=value optimized out, 
hash_key=value optimized out, child_ce=0x77fc3310)
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3288
#3  0x005d3cf1 in zend_hash_replace_checker_wrapper (target=
0x77fc3338, source=value optimized out, pCopyConstructor=
0x5a7bc0 do_inherit_method, size=240, pMergeSource=
0x5a2620 do_inherit_method_check, pParam=0x77fc3310)
at /usr/src/debug/php-5.4.3/Zend/zend_hash.c:878
#4  zend_hash_merge_ex (target=0x77fc3338, source=value optimized out, 
pCopyConstructor=0x5a7bc0 do_inherit_method, size=240, pMergeSource=
0x5a2620 do_inherit_method_check, pParam=0x77fc3310)
at /usr/src/debug/php-5.4.3/Zend/zend_hash.c:892
#5  0x005a850b in zend_do_inheritance (ce=0x77fc3310, parent_ce=
0x77fc2ff8) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3519
#6  0x005a962c in do_bind_inherited_class (
op_array=value optimized out, opline=value optimized out, class_table=
0xdf4c30, parent_ce=0x77fc2ff8, compile_time=1 '\001')
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4569
#7  0x005a985a in zend_do_early_binding ()
at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4626
#8  0x0058c1ca in zendparse ()
at /usr/src/debug/php-5.4.3/Zend/zend_language_parser.c:3547
#9  0x0058fa0d in compile_file (file_handle=0x7fffdec0, 
type=value optimized out) at Zend/zend_language_scanner.l:579
#10 0x7fffeb6d4042 in phar_compile_file (file_handle=0x7fffdec0, type=
8) at /usr/src/debug/php-5.4.3/ext/phar/phar.c:3391
#11 0x71d8101d in xdebug_compile_file (
file_handle=value optimized out, type=value optimized out)
at /usr/src/debug/php-pecl-xdebug-2.2.0/xdebug-2.2.0/xdebug.c:1537
#12 0x005c70ca in zend_execute_scripts (type=8, retval=0x0, file_count=
3) at /usr/src/debug/php-5.4.3/Zend/zend.c:1264
#13 0x00566cc3 in php_execute_script (primary_file=0x7fffdec0)
at /usr/src/debug/php-5.4.3/main/main.c:2473
#14 0x00672395 in do_cli (argc=2, argv=0x7fffe1f8)
at /usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:983
#15 0x00672cbc in main (argc=2, argv=0x7fffe1f8)
at /usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:1356






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


Bug #62084 [Fbk-Opn]: Segfault during inheritance check on method

2012-05-20 Thread victor dot kupriyanov at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62084edit=1

 ID: 62084
 User updated by:victor dot kupriyanov at gmail dot com
 Reported by:victor dot kupriyanov at gmail dot com
 Summary:Segfault during inheritance check on method
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Any
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

Ok, I disabled xdebug:

$ php -m
[PHP Modules]
apc
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
enchant
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
ldap
libxml
mbstring
mcrypt
mhash
mssql
mysql
mysqli
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
pspell
readline
recode
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]

Still got the same stacktrace:


$ gdb php
GNU gdb (GDB) Fedora (7.2-52.fc14)
...

(gdb) set args a.php
(gdb) r
Starting program: /usr/bin/php a.php
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffe89f9700 (LWP 6709)]
[Thread 0x7fffe89f9700 (LWP 6709) exited]

Program received signal SIGSEGV, Segmentation fault.
zend_get_function_declaration (fptr=0x0) at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:3046
3046if (fptr-op_array.fn_flags  ZEND_ACC_RETURN_REFERENCE) {
(gdb) bt
#0  zend_get_function_declaration (fptr=0x0) at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:3046
#1  0x005a2479 in do_inheritance_check_on_method (child=0x77fc05e0, 
parent=0x77fc1000) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3267
#2  0x005a2665 in do_inherit_method_check (child_function_table=value 
optimized out, parent=value optimized out, hash_key=value optimized out, 
child_ce=
0x77fc0398) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3288
#3  0x005d3cf1 in zend_hash_replace_checker_wrapper 
(target=0x77fc03c0, source=value optimized out, pCopyConstructor=0x5a7bc0 
do_inherit_method, size=240, 
pMergeSource=0x5a2620 do_inherit_method_check, pParam=0x77fc0398) at 
/usr/src/debug/php-5.4.3/Zend/zend_hash.c:878
#4  zend_hash_merge_ex (target=0x77fc03c0, source=value optimized out, 
pCopyConstructor=0x5a7bc0 do_inherit_method, size=240, pMergeSource=
0x5a2620 do_inherit_method_check, pParam=0x77fc0398) at 
/usr/src/debug/php-5.4.3/Zend/zend_hash.c:892
#5  0x005a850b in zend_do_inheritance (ce=0x77fc0398, 
parent_ce=0x77fc00e0) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3519
#6  0x005a962c in do_bind_inherited_class (op_array=value optimized 
out, opline=value optimized out, class_table=0xdf4c30, 
parent_ce=0x77fc00e0, 
compile_time=1 '\001') at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4569
#7  0x005a985a in zend_do_early_binding () at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:4626
#8  0x0058c1ca in zendparse () at /usr/src/debug/php-
5.4.3/Zend/zend_language_parser.c:3547
#9  0x0058fa0d in compile_file (file_handle=0x7fffdec0, type=value 
optimized out) at Zend/zend_language_scanner.l:579
#10 0x7fffeb906042 in phar_compile_file (file_handle=0x7fffdec0, 
type=8) 
at /usr/src/debug/php-5.4.3/ext/phar/phar.c:3391
#11 0x005c70ca in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /usr/src/debug/php-5.4.3/Zend/zend.c:1264
#12 0x00566cc3 in php_execute_script (primary_file=0x7fffdec0) at 
/usr/src/debug/php-5.4.3/main/main.c:2473
#13 0x00672395 in do_cli (argc=2, argv=0x7fffe1f8) at 
/usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:983
#14 0x00672cbc in main (argc=2, argv=0x7fffe1f8) at 
/usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:1356

I checked also on Windows build, and another Linux distribution with the same 
effect.


Previous Comments:

[2012-05-21 02:39:01] fel...@php.net

I can't reproduce it. Try disabling the xdebug and testing it again.


[2012-05-21 02:27:31] victor dot kupriyanov at gmail dot com

Description:

When inherited method has different type hinting information for the method 
parameters and E_STRICT error reporting level is set - PHP tries to report 
method declaration incompatibility and segfaults on attempt to dereference a 
null pointer.

Test script:
---
?php

class A {}

class B {
public function b(A $a) {}
}

class C extends B {
public function b($a) {}
}

$a = new C();

Expected result:

Valid message explaining that inherited method has a different signature.

Actual result:
--
$ php a.php 
Segmentation fault (core dumped)

...

(gdb) bt
#0  

Bug #62084 [Opn-Fbk]: Segfault during inheritance check on method

2012-05-20 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62084edit=1

 ID: 62084
 Updated by: fel...@php.net
 Reported by:victor dot kupriyanov at gmail dot com
 Summary:Segfault during inheritance check on method
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Any
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

Please try using this snapshot:

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

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




Previous Comments:

[2012-05-21 02:54:42] victor dot kupriyanov at gmail dot com

Ok, I disabled xdebug:

$ php -m
[PHP Modules]
apc
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
enchant
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
ldap
libxml
mbstring
mcrypt
mhash
mssql
mysql
mysqli
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
pspell
readline
recode
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]

Still got the same stacktrace:


$ gdb php
GNU gdb (GDB) Fedora (7.2-52.fc14)
...

(gdb) set args a.php
(gdb) r
Starting program: /usr/bin/php a.php
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffe89f9700 (LWP 6709)]
[Thread 0x7fffe89f9700 (LWP 6709) exited]

Program received signal SIGSEGV, Segmentation fault.
zend_get_function_declaration (fptr=0x0) at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:3046
3046if (fptr-op_array.fn_flags  ZEND_ACC_RETURN_REFERENCE) {
(gdb) bt
#0  zend_get_function_declaration (fptr=0x0) at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:3046
#1  0x005a2479 in do_inheritance_check_on_method (child=0x77fc05e0, 
parent=0x77fc1000) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3267
#2  0x005a2665 in do_inherit_method_check (child_function_table=value 
optimized out, parent=value optimized out, hash_key=value optimized out, 
child_ce=
0x77fc0398) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3288
#3  0x005d3cf1 in zend_hash_replace_checker_wrapper 
(target=0x77fc03c0, source=value optimized out, pCopyConstructor=0x5a7bc0 
do_inherit_method, size=240, 
pMergeSource=0x5a2620 do_inherit_method_check, pParam=0x77fc0398) at 
/usr/src/debug/php-5.4.3/Zend/zend_hash.c:878
#4  zend_hash_merge_ex (target=0x77fc03c0, source=value optimized out, 
pCopyConstructor=0x5a7bc0 do_inherit_method, size=240, pMergeSource=
0x5a2620 do_inherit_method_check, pParam=0x77fc0398) at 
/usr/src/debug/php-5.4.3/Zend/zend_hash.c:892
#5  0x005a850b in zend_do_inheritance (ce=0x77fc0398, 
parent_ce=0x77fc00e0) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3519
#6  0x005a962c in do_bind_inherited_class (op_array=value optimized 
out, opline=value optimized out, class_table=0xdf4c30, 
parent_ce=0x77fc00e0, 
compile_time=1 '\001') at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4569
#7  0x005a985a in zend_do_early_binding () at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:4626
#8  0x0058c1ca in zendparse () at /usr/src/debug/php-
5.4.3/Zend/zend_language_parser.c:3547
#9  0x0058fa0d in compile_file (file_handle=0x7fffdec0, type=value 
optimized out) at Zend/zend_language_scanner.l:579
#10 0x7fffeb906042 in phar_compile_file (file_handle=0x7fffdec0, 
type=8) 
at /usr/src/debug/php-5.4.3/ext/phar/phar.c:3391
#11 0x005c70ca in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /usr/src/debug/php-5.4.3/Zend/zend.c:1264
#12 0x00566cc3 in php_execute_script (primary_file=0x7fffdec0) at 
/usr/src/debug/php-5.4.3/main/main.c:2473
#13 0x00672395 in do_cli (argc=2, argv=0x7fffe1f8) at 
/usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:983
#14 0x00672cbc in main (argc=2, argv=0x7fffe1f8) at 
/usr/src/debug/php-5.4.3/sapi/cli/php_cli.c:1356

I checked also on Windows build, and another Linux distribution with the same 
effect.


[2012-05-21 02:39:01] fel...@php.net

I can't reproduce it. Try disabling the xdebug and testing it again.


[2012-05-21 02:27:31] victor dot kupriyanov at gmail dot com

Description:

When inherited method has different type hinting information for the method 
parameters and E_STRICT error reporting level is set - PHP tries to report 
method declaration incompatibility and segfaults on attempt to dereference a 
null pointer.

Test script:
---
?php

class A {}

class B {
public function b(A $a) {}
}

class C extends B {
public 

Bug #62084 [Fbk-Opn]: Segfault during inheritance check on method

2012-05-20 Thread victor dot kupriyanov at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62084edit=1

 ID: 62084
 User updated by:victor dot kupriyanov at gmail dot com
 Reported by:victor dot kupriyanov at gmail dot com
 Summary:Segfault during inheritance check on method
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Any
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

I can not reproduce the bug on custom build from the specified snapshot:


$ /tmp/php5.4/bin/php a.php
PHP Strict Standards:  Declaration of C::b() should be compatible with B::b(A 
$a) in /tmp/a.php on line 13

Strict Standards: Declaration of C::b() should be compatible with B::b(A $a) in 
/tmp/a.php on line 13
PHP Catchable fatal error:  Argument 1 passed to B::b() must be an instance of 
A, none given, called in /tmp/a.php on line 16 and defined in /tmp/a.php on 
line 
8

Catchable fatal error: Argument 1 passed to B::b() must be an instance of A, 
none given, called in /tmp/a.php on line 16 and defined in /tmp/a.php on line 8

$ /tmp/php5.4/bin/php -m
[PHP Modules]
apc
Core
ctype
date
dom
ereg
fileinfo
filter
hash
iconv
json
libxml
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter

[Zend Modules]

So you may assume it is fixed or invalid.


Previous Comments:

[2012-05-21 03:07:05] fel...@php.net

Please try using this snapshot:

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

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




[2012-05-21 02:54:42] victor dot kupriyanov at gmail dot com

Ok, I disabled xdebug:

$ php -m
[PHP Modules]
apc
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
enchant
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
ldap
libxml
mbstring
mcrypt
mhash
mssql
mysql
mysqli
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
pspell
readline
recode
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]

Still got the same stacktrace:


$ gdb php
GNU gdb (GDB) Fedora (7.2-52.fc14)
...

(gdb) set args a.php
(gdb) r
Starting program: /usr/bin/php a.php
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffe89f9700 (LWP 6709)]
[Thread 0x7fffe89f9700 (LWP 6709) exited]

Program received signal SIGSEGV, Segmentation fault.
zend_get_function_declaration (fptr=0x0) at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:3046
3046if (fptr-op_array.fn_flags  ZEND_ACC_RETURN_REFERENCE) {
(gdb) bt
#0  zend_get_function_declaration (fptr=0x0) at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:3046
#1  0x005a2479 in do_inheritance_check_on_method (child=0x77fc05e0, 
parent=0x77fc1000) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3267
#2  0x005a2665 in do_inherit_method_check (child_function_table=value 
optimized out, parent=value optimized out, hash_key=value optimized out, 
child_ce=
0x77fc0398) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3288
#3  0x005d3cf1 in zend_hash_replace_checker_wrapper 
(target=0x77fc03c0, source=value optimized out, pCopyConstructor=0x5a7bc0 
do_inherit_method, size=240, 
pMergeSource=0x5a2620 do_inherit_method_check, pParam=0x77fc0398) at 
/usr/src/debug/php-5.4.3/Zend/zend_hash.c:878
#4  zend_hash_merge_ex (target=0x77fc03c0, source=value optimized out, 
pCopyConstructor=0x5a7bc0 do_inherit_method, size=240, pMergeSource=
0x5a2620 do_inherit_method_check, pParam=0x77fc0398) at 
/usr/src/debug/php-5.4.3/Zend/zend_hash.c:892
#5  0x005a850b in zend_do_inheritance (ce=0x77fc0398, 
parent_ce=0x77fc00e0) at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:3519
#6  0x005a962c in do_bind_inherited_class (op_array=value optimized 
out, opline=value optimized out, class_table=0xdf4c30, 
parent_ce=0x77fc00e0, 
compile_time=1 '\001') at /usr/src/debug/php-5.4.3/Zend/zend_compile.c:4569
#7  0x005a985a in zend_do_early_binding () at /usr/src/debug/php-
5.4.3/Zend/zend_compile.c:4626
#8  0x0058c1ca in zendparse () at /usr/src/debug/php-
5.4.3/Zend/zend_language_parser.c:3547
#9  0x0058fa0d in compile_file (file_handle=0x7fffdec0, type=value 
optimized out) at Zend/zend_language_scanner.l:579
#10 0x7fffeb906042 in phar_compile_file (file_handle=0x7fffdec0, 
type=8) 
at /usr/src/debug/php-5.4.3/ext/phar/phar.c:3391
#11 0x005c70ca in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /usr/src/debug/php-5.4.3/Zend/zend.c:1264
#12 0x00566cc3 in php_execute_script (primary_file=0x7fffdec0) at 

[PHP-BUG] Bug #62085 [NEW]: file_get_contents a remote file by Curl wrapper will cause cpu Soaring

2012-05-20 Thread shengdong01 at 163 dot com
From: 
Operating system: linux
PHP version:  5.3.13
Package:  cURL related
Bug Type: Bug
Bug description:file_get_contents a remote file by Curl wrapper will cause cpu 
Soaring 

Description:

client script:
?php
   file_get_contents(http://localhost:8080/slow.php;);


server script

?php
/*slow.php*/
sleep(10);
echo this is slow.php;

Test script:
---
client script:
?php
   file_get_contents(http://localhost:8080/slow.php;);


server script

?php
/*slow.php*/
sleep(10);
echo this is slow.php;


Expected result:

the cpu idle is still high

Actual result:
--
the cpu idle is still high,not slow any more

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