Bug #65088 [Fbk]: configure script (and compile) fails, perhaps due to BSD differences in SH

2013-06-22 Thread fa
Edit report at https://bugs.php.net/bug.php?id=65088edit=1

 ID: 65088
 Updated by: f...@php.net
 Reported by:stolen dot data dot net at gmail dot com
 Summary:configure script (and compile) fails, perhaps due to
 BSD differences in SH
 Status: Feedback
 Type:   Bug
 Package:Compile Failure
 Operating System:   OpenBSD 5.3 (possibly all BSDs)
 PHP Version:5.5.0
 Block user comment: N
 Private report: N

 New Comment:

Just tried this on:
OpenBSD puffy.lan 4.9 GENERIC#477 amd64

bash-4.1# /bin/sh
# /bin/sh
# cd /root/
# pwd
/root
# cd /usr/local
# pwd
/usr/local


Previous Comments:

[2013-06-22 22:50:08] ras...@php.net

So, a quick test on FreeBSD:

$ /bin/sh
$ cd /usr/local
$ pwd
/usr/local

That doesn't work on your machine?

We can't just remove the quotes there because it would break directory names 
with spaces and other shell-special characters in them. cd is a built-in in the 
shell and should support quoted literals. autoconf obviously relies on this 
being the case. Have you done something interesting to your /bin/sh on this box?


[2013-06-22 22:36:21] ras...@php.net

So basically autoconf generates a configure script that doesn't work on 
OpenBSD? 
That sounds a bit suspicious and I wonder why nobody else has reported it.

Anything special about your environment?

And can you reproduce just with just running the ./configure script with no 
args 
that comes with the php-5.5.0 tarball?

I just tested it again on FreeBSD 9.0 and it worked flawlessly, so it is not a 
generic BSD issue. It is either OpenBSD-specific or specific to your 
environment.


[2013-06-22 15:39:44] stolen dot data dot net at gmail dot com

No, rebuilding configure changed nothing. Already gave it a try.


[2013-06-22 03:23:54] ras...@php.net

Seems fine on freebsd. If you re-generate the configure script, does it work?

rm configure  ./buildconf --force


[2013-06-21 16:22:29] stolen dot data dot net at gmail dot com

Description:

This is a long-standing issue that dates back more than a year. I'm 
re-reporting 
it in hopes that it will finally get attention instead of being overlooked.

During ./configure, the following warnings - which later on cause the 
make/compilation phase to halt with errors - will show up:

./configure[21401]: cd: /usr/opt/php-5.5.0/ext/date - No such file or 
directory

...

./configure[56997]: cd: /usr/opt/php-5.5.0/ext/mbstring - No such file or 
directory
./configure[56997]: cd: /usr/opt/php-5.5.0/ext/mbstring - No such file or 
directory
./configure[56997]: cd: /usr/opt/php-5.5.0/ext/mbstring/libmbfl - No such 
file 
or directory

Backtracking from those line numbers we quickly find the problem, present at 
both 
lines 21381 and 56850:

ep_realdir=`(cd \$ep_dir\  pwd)`

This exact line is present numerous times in the configure script, but for some 
reason it fails on the three extension paths described above. It might be 
caused 
by the line just before that prepares $ep_dir using SED.

The quick'n'dirty solution is to simply unquote $ep_dir by removing the two \ 
in 
the subshell statement, but something proper would be preferred.



Also, no biggie, but there are some odd recurrences of inclusion paths showing 
up 
during compiling. Each line separated:

-I/usr/opt/php-5.5.0/ext/date/lib
-I/usr/opt/php-5.5.0/ext/date/lib
 -I/usr/opt/php-5.5.0/ext/ereg/regex
 -I/usr/local/include
 -I/usr/opt/php-5.5.0/ext/mbstring/oniguruma
 -I/usr/opt/php-5.5.0/ext/mbstring/oniguruma
-I/usr/opt/php-5.5.0/ext/mbstring/libmbfl
-I/usr/opt/php-5.5.0/ext/mbstring/libmbfl
-I/usr/opt/php-5.5.0/ext/mbstring/libmbfl/mbfl
 -I/usr/opt/php-5.5.0/ext/mbstring/libmbfl/mbfl

Test script:
---
./configure
make

Expected result:

No path failures.

Actual result:
--
Described above.






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


Bug #62303 [Opn]: ReflectionClass, getMethods(), getName() empty

2012-07-25 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62303edit=1

 ID: 62303
 Updated by: f...@php.net
 Reported by:v at roxori dot com
 Summary:ReflectionClass, getMethods(), getName() empty
 Status: Open
 Type:   Bug
 Package:Reflection related
 Operating System:   FreeBSD9
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

Cannot reproduce.

$ php -v
PHP 5.4.4 (cli) (built: Jun 28 2012 15:38:36)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

php testp.php
first
second


FreeBSD host.example.org 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 
07:46:30 
UTC 2012 r...@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64


Previous Comments:

[2012-06-13 08:06:38] v at roxori dot com

Another found that the index broken array, so that probably does not display a 
value.

PHP5.4.3  FreeBSD9
ReflectionMethod Object
(
[namei˜Ґ] = first
[class] = Foo
)
ReflectionMethod Object
(
[namei˜Ґ] = second
[class] = Foo
)

PHP5.4.3 Linux

ReflectionMethod Object
(
[name] = first
[class] = Foo
)
ReflectionMethod Object
(
[name] = second
[class] = Foo
)


[2012-06-12 22:51:40] ni...@php.net

I can't reproduce this: http://3v4l.org/6cvK8#v500

Seems to behave the same on all versions, with no change in between.

Maybe this is OS specific (or specific to something else in your env).


[2012-06-12 21:01:45] v at roxori dot com

Description:

After upgrading PHP to 5.4.3 no longer return the name of the method. 
Correspondingly, the library stopped working, namely Zend. Now the issue Fatal 
error: Uncaught exception 'Zend_Amf_Server_Exception' with message 'Duplicate 
method registered: Having sorted out, I realized that the code does not return 
the 
name of the method. In PHP 5.3 all was ok.

---
From manual page: http://www.php.net/reflectionclass.getname#refsect1-
reflectionclass.getname-description
---

Test script:
---
class Foo {

function first(){

}

function second(){

}
}

$foo = new Foo();

$reflect = new ReflectionClass($foo);

$props   = $reflect-getMethods();

foreach ($props as $prop) {
print $prop-getName() . \n;
}


Expected result:

first
second

Actual result:
--
(empty)






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


Bug #62634 [Opn]: Incorrect serialization with circular references

2012-07-25 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62634edit=1

 ID: 62634
 Updated by: f...@php.net
 Reported by:phplists at stanvassilev dot com
 Summary:Incorrect serialization with circular references
 Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Any
 PHP Version:5.4.5
 Block user comment: N
 Private report: N

 New Comment:

Maybe related to https://bugs.php.net/bug.php?id=62189


Previous Comments:

[2012-07-22 21:58:45] phplists at stanvassilev dot com

There's a small error in my code example, please replace this line:

$duplicate = unserialize(serialize($x));

With this line:

$duplicate = unserialize(serialize($original));


[2012-07-22 21:54:54] phplists at stanvassilev dot com

Description:

The documentation says references and circular references should serialize 
properly. I've found that serialize would first copy the referenced variable, 
before detecting the reference.

This not only doubles the serialized output, but produced incorrect copy when 
unserialized.

Test script:
---
$original = array('hello');
$original[] =  $original;

echo serialize($original);
// Output (notice the duplication):
// a:2:{i:0;s:5:hello;i:1;a:2:{i:0;s:5:hello;i:1;R:3;}}

$duplicate = unserialize(serialize($x));

// Now I modify both the original and the duplicate in an identical way.
// But I get different results, because the duplicate points to a copy of
// itself, instead of pointing to itself.

$original[0] = 'world';
$duplicate[0] = 'world';

var_dump($original);
// Produces (notice it says world both times, i.e. it points to itself):
// array(2) { [0]= string(5) world [1]= array(2) { [0]= string(5) world 
[1]= *RECURSION* } } 

var_dump($duplicate);
// Produces (notice the second time it says hello i.e. it's a copy):
// array(2) { [0]= string(5) world [1]= array(2) { [0]= string(5) hello 
[1]= *RECURSION* } }

Expected result:

There should be NO copies of hello left:

array(2) { [0]= string(5) world [1]= array(2) { [0]= string(5) world 
[1]= 
*RECURSION* } }

There should be NO duplication in the serialized output:

a:2:{i:0;s:5:hello;i:1;???;} (Fill-in the ??? appropriately :) )

Actual result:
--
A copy of hello is left:

array(2) { [0]= string(5) world [1]= array(2) { [0]= string(5) hello 
[1]= 
*RECURSION* } }

There is duplication in the serialized output:

a:2:{i:0;s:5:hello;i:1;a:2:{i:0;s:5:hello;i:1;R:3;}}






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


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

2012-07-25 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62076edit=1

 ID: 62076
 Updated by: f...@php.net
 Reported by:phplists at stanvassilev dot com
 Summary:Global/namespace constants are not hoisted
-Status: Open
+Status: Wont fix
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

You can still assign a define()d constant to const, so the argument is kind of 
moot imho. 

See example below:


?php
namespace foo;

func(); // Warning, and prints NOT_HOISTED

define('XXX', 'asdf.'.rand(1,9));

const NOT_HOISTED = XXX;

  

func(); // prints 123

function func()
{
echo NOT_HOISTED. . XXX.PHP_EOL;
}
?

which yields:

PHP Notice:  Use of undefined constant NOT_HOISTED - assumed 'NOT_HOISTED' in 
b62076.php on line 14
PHP Notice:  Use of undefined constant XXX - assumed 'XXX' in b62076.php on 
line 
14
NOT_HOISTED XXX
asdf.2 asdf.2


Previous Comments:

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

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.


[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 #62420 [Opn-Wfx]: Exception::__toString() creates message in wrong order if prev exception exists

2012-07-24 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62420edit=1

 ID: 62420
 Updated by: f...@php.net
 Reported by:bugs dot php at mohiva dot com
 Summary:Exception::__toString() creates message in wrong
 order if prev exception exists
-Status: Open
+Status: Wont fix
 Type:   Bug
 Package:*General Issues
 Operating System:   Gentoo Linux
 PHP Version:5.4.4
 Block user comment: N
 Private report: N

 New Comment:

While you are correct that it might be more logical to reverse the order, this 
isn't a huge problem.


Previous Comments:

[2012-06-26 11:56:09] bugs dot php at mohiva dot com

Description:

The method Exception::__toString() creates the message in the wrong order if a 
previous exception exists in the Exception object.

The message contains the message from the previous exception as first and then 
marked as next exception the message from the exception object itself. Normally 
the message from the current exception should be the first message followed by 
the previous message and so one.

Test script:
---
?php

try {
throw new Exception(Previous exception);
} catch (Exception $previous) {
$current = new Exception(Current exception, 0, $previous);

echo 'Previous:' . $current-getPrevious()-getMessage() . 'br /';
echo 'Current:' . $current-getMessage() . 'br /';
echo 'String:' . $current-__toString() . 'br /';
}


Expected result:

Previous: Previous exception
--
Current: Current exception
--
String: exception 'Exception' with message 'Current exception' in 
exception.php:4 Stack trace: #0 {main} Next exception 'Exception' with message 
'Previous exception' in exception.php:6 Stack trace: #0 {main}

Actual result:
--
Previous: Previous exception
--
Current: Current exception
--
String: exception 'Exception' with message 'Previous exception' in 
exception.php:4 Stack trace: #0 {main} Next exception 'Exception' with message 
'Current exception' in exception.php:6 Stack trace: #0 {main}






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


Req #62369 [Opn-Asn]: Segfault on json_encode(deeply_nested_array);

2012-07-24 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62369edit=1

 ID: 62369
 Updated by: f...@php.net
 Reported by:arjen at react dot com
 Summary:Segfault on json_encode(deeply_nested_array);
-Status: Open
+Status: Assigned
 Type:   Feature/Change Request
 Package:JSON related
 Operating System:   CENTOS
 PHP Version:5.4.4
-Assigned To:
+Assigned To:fa
 Block user comment: N
 Private report: N



Previous Comments:

[2012-06-25 06:10:51] larue...@php.net

change to FR: add a max_depth limitation to json_encode


[2012-06-21 08:01:41] larue...@php.net

stack overflow... it's kind of no bug...  anyway maybe we can introduce a new 
parameter `max_depth` to json_encode too.


[2012-06-20 09:10:38] arjen at react dot com

Description:

Trying to json_encode a 50.000 levels deep nested array causes a segfault.

Segfault occurs in PHP versions 5.2.0 - 5.2.17, 5.3.0 - 5.3.14, 5.4.0 - 5.4.4, 
see http://3v4l.org/uZOgV

Found while trying to construct a testcase for json_last_error() == 
JSON_ERROR_DEPTH

Test script:
---
?php

$array = array();

for ($i = 0; $i  5; $i++)
$array = array($array);

json_encode($array);

Expected result:

Correct result or 0 with json_last_error() == JSON_ERROR_DEPTH

Actual result:
--
#0  0x7fffed1e2d59 in json_determine_array_type (buf=0x7fffba50, 
val=0xfa5ea8, options=0) at /home/edwin/rpm/BUILD/php-5.3.13/ext/json/json.c:139
#1  json_encode_array (buf=0x7fffba50, val=0xfa5ea8, options=0) at 
/home/edwin/rpm/BUILD/php-5.3.13/ext/json/json.c:176
#2  php_json_encode (buf=0x7fffba50, val=0xfa5ea8, options=0) at 
/home/edwin/rpm/BUILD/php-5.3.13/ext/json/json.c:476
#3  0x7fffed1e32df in json_encode_array (buf=value optimized out, val=
value optimized out, options=value optimized out) at 
/home/edwin/rpm/BUILD/php-5.3.13/ext/json/json.c:258
#4  php_json_encode (buf=value optimized out, val=value optimized out, 
options=value optimized out) at /home/edwin/rpm/BUILD/php-
5.3.13/ext/json/json.c:476
#5  0x7fffed1e32df in json_encode_array (buf=value optimized out, val=
value optimized out, options=value optimized out) at 
/home/edwin/rpm/BUILD/php-5.3.13/ext/json/json.c:258
#6  php_json_encode (buf=value optimized out, val=value optimized out, 
options=value optimized out) at /home/edwin/rpm/BUILD/php-
5.3.13/ext/json/json.c:476
#7  0x7fffed1e32df in json_encode_array (buf=value optimized out, val=
value optimized out, options=value optimized out) at 
/home/edwin/rpm/BUILD/php-5.3.13/ext/json/json.c:258
#8  php_json_encode (buf=value optimized out, val=value optimized out, 
options=value optimized out) at /home/edwin/rpm/BUILD/php-
5.3.13/ext/json/json.c:476
#9  0x7fffed1e32df in json_encode_array (buf=value optimized out, val=
value optimized out, options=value optimized out) at 
/home/edwin/rpm/BUILD/php-5.3.13/ext/json/json.c:258
#10 php_json_encode (buf=value optimized out, val=value optimized out, 
options=value optimized out) at /home/edwin/rpm/BUILD/php-
5.3.13/ext/json/json.c:476
[line 9/10 repeated]






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


Req #62356 [Opn-Asn]: Add syslog support to mail.log (php_mail)

2012-07-24 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62356edit=1

 ID: 62356
 Updated by: f...@php.net
 Reported by:michael at orlitzky dot com
 Summary:Add syslog support to mail.log (php_mail)
-Status: Open
+Status: Assigned
 Type:   Feature/Change Request
 Package:Mail related
 PHP Version:5.4Git-2012-06-18 (Git)
-Assigned To:
+Assigned To:fa
 Block user comment: N
 Private report: N



Previous Comments:

[2012-06-18 18:50:11] michael at orlitzky dot com

Description:

The PHP error logs support logging to syslog. You simply set,

  error_log = syslog

in php.ini, and PHP handles the rest. The new mail.log setting does not support 
this, however, so it is difficult to consolidate your logs if you use syslog. 
Setting,

  mail.log = syslog

results in a file name 'syslog' in the current directory.








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


Req #62356 [Asn-Csd]: Add syslog support to mail.log (php_mail)

2012-07-24 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62356edit=1

 ID: 62356
 Updated by: f...@php.net
 Reported by:michael at orlitzky dot com
 Summary:Add syslog support to mail.log (php_mail)
-Status: Assigned
+Status: Closed
 Type:   Feature/Change Request
 Package:Mail related
 PHP Version:5.4Git-2012-06-18 (Git)
 Assigned To:fa
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5.4 and master - thanks for the patch!


Previous Comments:

[2012-06-18 18:50:11] michael at orlitzky dot com

Description:

The PHP error logs support logging to syslog. You simply set,

  error_log = syslog

in php.ini, and PHP handles the rest. The new mail.log setting does not support 
this, however, so it is difficult to consolidate your logs if you use syslog. 
Setting,

  mail.log = syslog

results in a file name 'syslog' in the current directory.








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


Bug #62616 [Opn]: ArrayIterator::count() from IteratorIterator instance gives Segmentation fault

2012-07-20 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62616edit=1

 ID: 62616
 Updated by: f...@php.net
 Reported by:zoeslam at gmail dot com
 Summary:ArrayIterator::count() from IteratorIterator
 instance gives Segmentation fault
 Status: Open
 Type:   Bug
 Package:SPL related
 Operating System:   Ubuntu 12.04
 PHP Version:5.4.5
 Block user comment: N
 Private report: N

 New Comment:

Reproducible on Debian wheezy with 5.4.0 and 5.4.5.


Previous Comments:

[2012-07-20 08:13:34] vanidlesky dot jr at gmail dot com

VanZCool


[2012-07-20 08:07:05] zoeslam at gmail dot com

Description:

The code explains all, no idea why it happens.

Verified on Ubuntu and Slackware, both on PHP 5.4.3, PHP 5.4.4, PHP 5.4.5.

Test script:
---
$ai = new ArrayIterator(array(0,1));

var_dump($ai-count());

$ii = new IteratorIterator($ai);

var_dump($ii-count());


Expected result:

int(2)
int(2)

Actual result:
--
int(2)
int(2)
Segmentation fault






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


Bug #62616 [Opn]: ArrayIterator::count() from IteratorIterator instance gives Segmentation fault

2012-07-20 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62616edit=1

 ID: 62616
 Updated by: f...@php.net
 Reported by:zoeslam at gmail dot com
 Summary:ArrayIterator::count() from IteratorIterator
 instance gives Segmentation fault
 Status: Open
 Type:   Bug
 Package:SPL related
 Operating System:   Ubuntu 12.04
 PHP Version:5.4.5
 Block user comment: N
 Private report: N

 New Comment:

BT

#0  0x7fdfaf4221d8 in ?? ()
#1  0x00594a41 in spl_dual_it_free (intern=0x7fdfaf53fa20) at 
/opt/src/php-5.4.5/ext/spl/spl_iterators.c:1585
#2  spl_dual_it_dtor (_object=0x7fdfaf53fa20, handle=optimized out) at 
/opt/src/php-5.4.5/ext/spl/spl_iterators.c:2237
#3  0x006a7b20 in zend_objects_store_del_ref_by_handle_ex (handle=2, 
handlers=optimized out) at /opt/src/php-5.4.5/Zend/zend_objects_API.c:206
#4  0x006a7b63 in zend_objects_store_del_ref (zobject=0x7fdfaf53f990) 
at 
/opt/src/php-5.4.5/Zend/zend_objects_API.c:172
#5  0x00674082 in _zval_dtor (zvalue=optimized out) at /opt/src/php-
5.4.5/Zend/zend_variables.h:35
#6  _zval_ptr_dtor (zval_ptr=0x7fdfaf53fb30) at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:438
#7  _zval_ptr_dtor (zval_ptr=0x7fdfaf53fb30) at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:427
#8  0x0068e28b in zend_hash_apply_deleter (ht=ht@entry=0xd34508, 
p=p@entry=0x7fdfaf53fb18) at /opt/src/php-5.4.5/Zend/zend_hash.c:650
#9  0x0068fdd1 in zend_hash_reverse_apply (ht=0xd34508, 
apply_func=apply_func@entry=0x673f10 zval_call_destructor) at /opt/src/php-
5.4.5/Zend/zend_hash.c:804
#10 0x0067438b in shutdown_destructors () at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:217
#11 0x006826c0 in zend_call_destructors () at /opt/src/php-
5.4.5/Zend/zend.c:925
#12 0x00624805 in php_request_shutdown (dummy=dummy@entry=0x0) at 
/opt/src/php-5.4.5/main/main.c:1723
#13 0x00726004 in do_cli (argc=2, argv=0x7fff5ea442f8) at /opt/src/php-
5.4.5/sapi/cli/php_cli.c:1174
#14 0x00428455 in main (argc=2, argv=0x7fff5ea442f8) at /opt/src/php-
5.4.5/sapi/cli/php_cli.c:1364


Previous Comments:

[2012-07-20 11:54:38] f...@php.net

Reproducible on Debian wheezy with 5.4.0 and 5.4.5.


[2012-07-20 08:13:34] vanidlesky dot jr at gmail dot com

VanZCool


[2012-07-20 08:07:05] zoeslam at gmail dot com

Description:

The code explains all, no idea why it happens.

Verified on Ubuntu and Slackware, both on PHP 5.4.3, PHP 5.4.4, PHP 5.4.5.

Test script:
---
$ai = new ArrayIterator(array(0,1));

var_dump($ai-count());

$ii = new IteratorIterator($ai);

var_dump($ii-count());


Expected result:

int(2)
int(2)

Actual result:
--
int(2)
int(2)
Segmentation fault






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


Bug #62616 [Opn-Ver]: ArrayIterator::count() from IteratorIterator instance gives Segmentation fault

2012-07-20 Thread fa
Edit report at https://bugs.php.net/bug.php?id=62616edit=1

 ID: 62616
 Updated by: f...@php.net
 Reported by:zoeslam at gmail dot com
 Summary:ArrayIterator::count() from IteratorIterator
 instance gives Segmentation fault
-Status: Open
+Status: Verified
 Type:   Bug
 Package:SPL related
 Operating System:   Ubuntu 12.04
 PHP Version:5.4.5
 Block user comment: N
 Private report: N



Previous Comments:

[2012-07-20 12:54:55] f...@php.net

BT

#0  0x7fdfaf4221d8 in ?? ()
#1  0x00594a41 in spl_dual_it_free (intern=0x7fdfaf53fa20) at 
/opt/src/php-5.4.5/ext/spl/spl_iterators.c:1585
#2  spl_dual_it_dtor (_object=0x7fdfaf53fa20, handle=optimized out) at 
/opt/src/php-5.4.5/ext/spl/spl_iterators.c:2237
#3  0x006a7b20 in zend_objects_store_del_ref_by_handle_ex (handle=2, 
handlers=optimized out) at /opt/src/php-5.4.5/Zend/zend_objects_API.c:206
#4  0x006a7b63 in zend_objects_store_del_ref (zobject=0x7fdfaf53f990) 
at 
/opt/src/php-5.4.5/Zend/zend_objects_API.c:172
#5  0x00674082 in _zval_dtor (zvalue=optimized out) at /opt/src/php-
5.4.5/Zend/zend_variables.h:35
#6  _zval_ptr_dtor (zval_ptr=0x7fdfaf53fb30) at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:438
#7  _zval_ptr_dtor (zval_ptr=0x7fdfaf53fb30) at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:427
#8  0x0068e28b in zend_hash_apply_deleter (ht=ht@entry=0xd34508, 
p=p@entry=0x7fdfaf53fb18) at /opt/src/php-5.4.5/Zend/zend_hash.c:650
#9  0x0068fdd1 in zend_hash_reverse_apply (ht=0xd34508, 
apply_func=apply_func@entry=0x673f10 zval_call_destructor) at /opt/src/php-
5.4.5/Zend/zend_hash.c:804
#10 0x0067438b in shutdown_destructors () at /opt/src/php-
5.4.5/Zend/zend_execute_API.c:217
#11 0x006826c0 in zend_call_destructors () at /opt/src/php-
5.4.5/Zend/zend.c:925
#12 0x00624805 in php_request_shutdown (dummy=dummy@entry=0x0) at 
/opt/src/php-5.4.5/main/main.c:1723
#13 0x00726004 in do_cli (argc=2, argv=0x7fff5ea442f8) at /opt/src/php-
5.4.5/sapi/cli/php_cli.c:1174
#14 0x00428455 in main (argc=2, argv=0x7fff5ea442f8) at /opt/src/php-
5.4.5/sapi/cli/php_cli.c:1364


[2012-07-20 11:54:38] f...@php.net

Reproducible on Debian wheezy with 5.4.0 and 5.4.5.


[2012-07-20 08:13:34] vanidlesky dot jr at gmail dot com

VanZCool


[2012-07-20 08:07:05] zoeslam at gmail dot com

Description:

The code explains all, no idea why it happens.

Verified on Ubuntu and Slackware, both on PHP 5.4.3, PHP 5.4.4, PHP 5.4.5.

Test script:
---
$ai = new ArrayIterator(array(0,1));

var_dump($ai-count());

$ii = new IteratorIterator($ai);

var_dump($ii-count());


Expected result:

int(2)
int(2)

Actual result:
--
int(2)
int(2)
Segmentation fault






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


Bug #60192 [Asn-Csd]: SegFault when Collator not constructed properly

2011-11-02 Thread fa
Edit report at https://bugs.php.net/bug.php?id=60192edit=1

 ID: 60192
 Updated by: f...@php.net
 Reported by:rodney dot rehm at medialize dot de
 Summary:SegFault when Collator not constructed properly
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:intl
 Operating System:   Mac OS X 10.7.2
 PHP Version:5.3.8
 Assigned To:fa
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-11-02 07:36:46] f...@php.net

Automatic comment from SVN on behalf of fa
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=318672
Log: Fix #60192 SegFault when Collator not constructed properly


[2011-11-01 15:28:51] rodney dot rehm at medialize dot de

Description:

If Collator is extended, but parent::__construct() not invoked, any call to 
sort() will end in a segmentation fault.

Test script:
---
?php

class Collator2 extends Collator {
public function __construct() {
// ommitting parent::__construct($someLocale);
}
}

$c = new Collator2();
$a = array('a', 'b');
$c-sort($a);

Expected result:

Some kind of Exception, E_ERROR or something. Anything but a SegFault.







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


Bug #60160 [Ana-Csd]: imagefill() doesn't work correctly for small images

2011-11-01 Thread fa
Edit report at https://bugs.php.net/bug.php?id=60160edit=1

 ID: 60160
 Updated by: f...@php.net
 Reported by:kieran at menor dot dk
 Summary:imagefill() doesn't work correctly for small images
-Status: Analyzed
+Status: Closed
 Type:   Bug
 Package:GD related
 Operating System:   Windows 7 x64, Debian 6 x64
 PHP Version:5.3.8
-Assigned To:
+Assigned To:fa
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-11-01 11:51:48] f...@php.net

Automatic comment from SVN on behalf of fa
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=318638
Log: Fixed #60160 and added a test for it


[2011-10-31 15:26:44] f...@php.net

The following patch has been added/updated:

Patch Name: bug60160.phpt
Revision:   1320074804
URL:
https://bugs.php.net/patch-display.php?bug=60160patch=bug60160.phptrevision=1320074804


[2011-10-31 15:19:15] f...@php.net

Related to https://bugs.php.net/51671 - that didn't get fixed completely, as 
can be seen in the test for #51671.


[2011-10-31 14:51:05] f...@php.net

The following patch has been added/updated:

Patch Name: fix-imagefill-for-images-smaller-than-4px-width
Revision:   1320072664
URL:
https://bugs.php.net/patch-display.php?bug=60160patch=fix-imagefill-for-images-smaller-than-4px-widthrevision=1320072664


[2011-10-28 17:39:06] kieran at menor dot dk

Workaround:

Use imagefilledrectangle() instead, alike so:

function imagefillfix($image, $x, $y, $color)
{
return imagefilledrectangle($image, $x, $y, imagesx($image) - 1, 
imagesy($image) - 1, $color);
}




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


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


Bug #60172 [Opn-Ana]: make fails

2011-10-31 Thread fa
Edit report at https://bugs.php.net/bug.php?id=60172edit=1

 ID: 60172
 Updated by: f...@php.net
 Reported by:martin at psinas dot com
 Summary:make fails
-Status: Open
+Status: Analyzed
 Type:   Bug
 Package:Compile Failure
 Operating System:   Ubuntu 10.04 / Apache2
 PHP Version:5.4SVN-2011-10-29 (snap)
 Block user comment: N
 Private report: N

 New Comment:

I could just reproduce that on Debian testing.

It seems the configure script in snaps fails to mention that you don't have 
bison/re2c installed.

So the configure says everything ok, but due to a missing (generated) 
zend_ini_parser.c you can't compile.

The check works for 5.4-HEAD.


Previous Comments:

[2011-10-29 22:55:35] martin at psinas dot com

Description:

I already have PHP installed, trying to upgrade to latest development version. 
I'm using Ubuntu 10.04 w/ Apache2.

Test script:
---
worm@worm-desktop:~$ wget http://snaps.php.net/php5.4-201110292230.tar.gz
worm@worm-desktop:~$ tar -xvzf php5.4-201110292230.tar.gz
worm@worm-desktop:~$ cd php5.4-201110292230
worm@worm-desktop:~/php5.4-201110292230$ ./configure
worm@worm-desktop:~/php5.4-201110292230$ sudo make

Actual result:
--
/php5.4-201110292230/ext/sqlite3/libsqlite 
-I/home/worm/php5.4-201110292230/TSRM 
-I/home/worm/php5.4-201110292230/Zend-I/usr/include -g -O2 -
fvisibility=hidden -DZEND_SIGNALS  -c /home/worm/php5.4-
201110292230/Zend/zend_ini_parser.c -o Zend/zend_ini_parser.lo 
cc: /home/worm/php5.4-201110292230/Zend/zend_ini_parser.c: No such file or 
directory
cc: no input files
make: *** [Zend/zend_ini_parser.lo] Error 1






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


Bug #55759 [Opn]: mem leak when use built-in server

2011-10-31 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55759edit=1

 ID: 55759
 Updated by: f...@php.net
 Reported by:larue...@php.net
 Summary:mem leak when use built-in server
 Status: Open
 Type:   Bug
 Package:Built-in web server
 PHP Version:5.4.0beta1
 Block user comment: N
 Private report: N

 New Comment:

Cannot reproduce on Debian testing with neither beta1 nor beta2


Previous Comments:

[2011-09-25 17:08:14] fel...@php.net

I can't reproduce it.


[2011-09-22 03:01:20] larue...@php.net

Description:

router.php
?php
  return FALSE;
?

a.php
?php
echo ll
?

./php -S -t .  router.php

then request  http://*/a.php

Expected result:

11

Actual result:
--
[Thu Sep 22 10:55:32 2011] 172.21.232.67:50662 [200]: /a.php
[Thu Sep 22 10:55:32 2011]  Script:  '-'
php-src/trunk/main/output.c(803) :  Freeing 0x2A95DDB200 (88 bytes), script=-
php-src/trunk/Zend/zend_alloc.c(2529) : Actual location (location was relayed)
[Thu Sep 22 10:55:32 2011]  Script:  '-'
php-src/trunk/main/output.c(804) :  Freeing 0x2A95DDB2B0 (23 bytes), script=-
[Thu Sep 22 10:55:32 2011]  Script:  '-'
php-src/trunk/main/output.c(809) :  Freeing 0x2A95DDB320 (8192 bytes), script=-
[Thu Sep 22 10:55:32 2011]  Script:  '-'
php-src/trunk/Zend/zend_stack.c(37) :  Freeing 0x2A95DDD378 (512 bytes), 
script=-
[Thu Sep 22 10:55:32 2011]  Script:  '-'
php-src/trunk/Zend/zend_stack.c(42) :  Freeing 0x2A95DDD5D0 (8 bytes), script=-






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


Bug #60176 [Opn-Fbk]: date + strtotime fails to calculate date

2011-10-31 Thread fa
Edit report at https://bugs.php.net/bug.php?id=60176edit=1

 ID: 60176
 Updated by: f...@php.net
 Reported by:sombra2eternity at gmail dot com
 Summary:date + strtotime fails to calculate date
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Date/time related
 Operating System:   Ubuntu
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

I can't reproduce this with PHP_5_3 HEAD.

Could you please check that your date.timezone is set correctly in your 
php.ini?

It could help to compare Y-m-d H:i:s output.


Previous Comments:

[2011-10-31 00:20:04] sombra2eternity at gmail dot com

Description:

Dont know if corrected in new versions but I cant actually upgrade so I write 
it here anyway to be sure its reported.

Strtotime/date fails to get the date in a simple test.

I think I found a bug:

echo date(Y-m-d,strtotime('2011-10-30')+86400);
//returns 2011-10-30 and should return 2011-10-31

desktop7@desktop7-desktop:~$ php -v
PHP 5.3.5-1ubuntu7.3 with Suhosin-Patch (cli) (built: Oct 13 2011 21:56:07) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Test script:
---
echo date(Y-m-d,strtotime('2011-10-30')+86400);

Expected result:

2011-10-31

Actual result:
--
2011-10-30






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


Bug #60160 [Opn-Ana]: imagefill() doesn't work correctly for small images

2011-10-31 Thread fa
Edit report at https://bugs.php.net/bug.php?id=60160edit=1

 ID: 60160
 Updated by: f...@php.net
 Reported by:kieran at menor dot dk
 Summary:imagefill() doesn't work correctly for small images
-Status: Open
+Status: Analyzed
 Type:   Bug
 Package:GD related
 Operating System:   Windows 7 x64, Debian 6 x64
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

Related to https://bugs.php.net/51671 - that didn't get fixed completely, as 
can be seen in the test for #51671.


Previous Comments:

[2011-10-31 14:51:05] f...@php.net

The following patch has been added/updated:

Patch Name: fix-imagefill-for-images-smaller-than-4px-width
Revision:   1320072664
URL:
https://bugs.php.net/patch-display.php?bug=60160patch=fix-imagefill-for-images-smaller-than-4px-widthrevision=1320072664


[2011-10-28 17:39:06] kieran at menor dot dk

Workaround:

Use imagefilledrectangle() instead, alike so:

function imagefillfix($image, $x, $y, $color)
{
return imagefilledrectangle($image, $x, $y, imagesx($image) - 1, 
imagesy($image) - 1, $color);
}


[2011-10-28 17:30:08] kieran at menor dot dk

Description:

imagefill() doesn't work correctly for images with a width lower than 4 pixels. 
Image height makes no difference.

Test script:
---
?php
header('Content-Type: image/png');
$im = imagecreatetruecolor(3, 3);
imagefill($im, 0, 0, imagecolorallocate($im, 255, 255, 255));
imagepng($im);
imagedestroy($im);

Expected result:

Completely white 3x3 pixels image expected.

Actual result:
--
Upper and left edge white, 2x2 black square in lower right corner.

http://caffie.net/broken.php






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


Bug #60176 [Opn-Bgs]: date + strtotime fails to calculate date

2011-10-31 Thread fa
Edit report at https://bugs.php.net/bug.php?id=60176edit=1

 ID: 60176
 Updated by: f...@php.net
 Reported by:sombra2eternity at gmail dot com
 Summary:date + strtotime fails to calculate date
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Date/time related
 Operating System:   Ubuntu
 PHP Version:5.4
 Block user comment: N
 Private report: N

 New Comment:

We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which do
not suffer from DST.

You do realize that there are indeed 24h between 2011-10-30 00:00:00 and 
2011-10-30 23:00:00, right?

This is when DST was adjusted.

Try your code with 2011-10-31 and you'll see 2011-11-01 as a result of adding 
24h.


Previous Comments:

[2011-10-31 14:37:58] sombra2eternity at gmail dot com

I just compiled: php5.4-201110311230

---
desktop7@desktop7-desktop:~/php5.4-201110311230/sapi/cli$ ./php -v
PHP 5.4.0RC1-dev (cli) (built: Oct 31 2011 15:21:08) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2011 Zend Technologies
---

desktop7@desktop7-desktop:~/php5.4-201110311230/sapi/cli$ ./php 
/var/www/strto.php
2011-10-30

CONTENT OF STRTO.PHP:
?php
date_default_timezone_set('Europe/Madrid');
echo date('Y-m-d',strtotime('2011-10-30')+86400);
?

Thanks for helping me


[2011-10-31 14:01:32] f...@php.net

I can't reproduce this with PHP_5_3 HEAD.

Could you please check that your date.timezone is set correctly in your 
php.ini?

It could help to compare Y-m-d H:i:s output.


[2011-10-31 00:20:04] sombra2eternity at gmail dot com

Description:

Dont know if corrected in new versions but I cant actually upgrade so I write 
it here anyway to be sure its reported.

Strtotime/date fails to get the date in a simple test.

I think I found a bug:

echo date(Y-m-d,strtotime('2011-10-30')+86400);
//returns 2011-10-30 and should return 2011-10-31

desktop7@desktop7-desktop:~$ php -v
PHP 5.3.5-1ubuntu7.3 with Suhosin-Patch (cli) (built: Oct 13 2011 21:56:07) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Test script:
---
echo date(Y-m-d,strtotime('2011-10-30')+86400);

Expected result:

2011-10-31

Actual result:
--
2011-10-30






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


Bug #60166 [Opn-Ana]: Locale::lookup() returns an empty string if the first arg is an empty array

2011-10-31 Thread fa
Edit report at https://bugs.php.net/bug.php?id=60166edit=1

 ID: 60166
 Updated by: f...@php.net
 Reported by:np dot viktorov at gmail dot com
 Summary:Locale::lookup() returns an empty string if the
 first arg is an empty array
-Status: Open
+Status: Analyzed
 Type:   Bug
 Package:intl
 Operating System:   Debian GNU/Linux 6.0.2 (squeeze)
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

RFC4647 (http://www.ietf.org/rfc/rfc4647.txt) states:

3.4.1.  Default Values

   Each application, protocol, or specification that uses lookup MUST
   define the defaulting behavior when no tag matches the language
   priority list.  What this action consists of strongly depends on how
   lookup is being applied.  Some examples of defaulting behavior
   include:

   o  return an item with no language tag or an item of a non-linguistic
  nature, such as an image or sound
   o  return a null string as the language tag value, in cases where the
  protocol permits the empty value (see, for example, xml:lang in
  [XML10])
   o  return a particular language tag designated for the operation
   o  return the language tag i-default (see [RFC2277])
   o  return an error condition or error message
   o  return a list of available languages for the user to select from

-
So this *might* be classified unexpected behavior instead of a bug.

The fix would probably be easy, PHP_5_3/ext/intl/locale_methods.c,1537 :

»···if( !hash_arr || zend_hash_num_elements( hash_arr ) == 0 ) {
»···»···RETURN_EMPTY_STRING();
»···}

But as I have no clue what this would break, I will not change this now.


Previous Comments:

[2011-10-29 11:29:11] np dot viktorov at gmail dot com

I forgot the INTL information.
According to phpinfo() the INTL version information is this:
 - version  1.1.0
 - ICU version  4.4.1


[2011-10-29 11:24:32] np dot viktorov at gmail dot com

Description:

Locale::lookup() will return an empty string if the first argument is an empty 
array() no matter that we have already set the default argument (argument #4)

Test script:
---
?php

$available = array();
$default = en;
$requested = eu-us;

$result = Locale::lookup($available, $requested, null, $default);

var_dump($result);

/*
if we create atleast one element, for example de it will work fine
*/

Expected result:

According to the documentation we should expect to get en because this is the 
default locale provided as the fourth argument. This doesn't happen.

Actual result:
--
The actual result is  (an empty string), not null, not false, just an empty 
string.






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


Bug #55121 [Fbk-Csd]: Segfault with multipart/form-data POST / 404 request

2011-07-26 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55121edit=1

 ID: 55121
 Updated by: f...@php.net
 Reported by:nbpo...@php.net
 Summary:Segfault with multipart/form-data POST / 404 request
-Status: Feedback
+Status: Closed
 Type:   Bug
 Package:Built-in web server
 Operating System:   Ubuntu 10.04.2 LTS (64-bit)
 PHP Version:5.4SVN-2011-07-03 (snap)
-Assigned To:moriyoshi
+Assigned To:fa
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-07-25 20:18:37] nbpo...@php.net

OK. I retested again just now with the latest snapshot on both OS X and Ubuntu. 
No 
segfaults anymore.


[2011-07-25 18:11:10] nbpo...@php.net

Tested latest snapshot on OS X. Same backtrace.


[2011-07-25 16:47:21] f...@php.net

Could you please try if this fix works on OS X as well?
Tested on debian stable.


[2011-07-25 16:45:42] f...@php.net

Automatic comment from SVN on behalf of fa
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=313677
Log: Fix #55121 Segfault with multipart/form-data POST


[2011-07-20 13:41:49] nbpo...@php.net

A similar segfault on OS X 10.6.7 can be caused using the original steps to 
reproduce:

$ curl --form a=b http://127.0.0.1:8000/file.php
$ curl http://127.0.0.1:8000/does_not_exist


Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0002011b0b30
0x00010024a3b5 in _zend_mm_free_int (heap=0x10100, p=0x1006651e0) at 
zend_alloc.c:2097
2097heap-size -= size;
(gdb) bt
#0  0x00010024a3b5 in _zend_mm_free_int (heap=0x10100, p=0x1006651e0) 
at 
zend_alloc.c:2097
#1  0x00010021e6af in destroy_uploaded_files_hash () at rfc1867.c:199
#2  0x00010021b252 in sapi_deactivate () at SAPI.c:535
#3  0x0001002fd61e in php_cli_server_send_error_page 
(server=0x7fff5fbfa730, 
client=0x100b4e6f0, status=404) at php_cli_server.c:1525
#4  0x0001002fb31e in php_cli_server_dispatch [inlined] () at 
/Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:1636
#5  0x0001002fb31e in php_cli_server_recv_event_read_request 
(server=0x7fff5fbfe970, client=0x1006651e0) at php_cli_server.c:1924
#6  0x0001002fcae5 in php_cli_server_do_event_for_each_fd_callback 
[inlined] 
() at /Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2010
#7  0x0001002fcae5 in php_cli_server_do_event_for_each_fd [inlined] () at 
php_cli_server.c:671
#8  0x0001002fcae5 in php_cli_server_poller_iter_on_active [inlined] () at 
/Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2046
#9  0x0001002fcae5 in php_cli_server_do_event_loop [inlined] () at 
/Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2036
#10 0x0001002fcae5 in do_cli_server (argc=4, argv=0x10) at 
php_cli_server.c:2147
#11 0x0001002f6aa4 in main (argc=1606415328, argv=0x7fff5fbff400) at 
php_cli.c:1359




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


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


Bug #55121 [Asn-Fbk]: Segfault with multipart/form-data POST / 404 request

2011-07-25 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55121edit=1

 ID: 55121
 Updated by: f...@php.net
 Reported by:nbpo...@php.net
 Summary:Segfault with multipart/form-data POST / 404 request
-Status: Assigned
+Status: Feedback
 Type:   Bug
 Package:Built-in web server
 Operating System:   Ubuntu 10.04.2 LTS (64-bit)
 PHP Version:5.4SVN-2011-07-03 (snap)
 Assigned To:   moriyoshi
 Block user comment: N
 Private report: N

 New Comment:

Could you please try if this fix works on OS X as well?
Tested on debian stable.


Previous Comments:

[2011-07-25 16:45:42] f...@php.net

Automatic comment from SVN on behalf of fa
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=313677
Log: Fix #55121 Segfault with multipart/form-data POST


[2011-07-20 13:41:49] nbpo...@php.net

A similar segfault on OS X 10.6.7 can be caused using the original steps to 
reproduce:

$ curl --form a=b http://127.0.0.1:8000/file.php
$ curl http://127.0.0.1:8000/does_not_exist


Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0002011b0b30
0x00010024a3b5 in _zend_mm_free_int (heap=0x10100, p=0x1006651e0) at 
zend_alloc.c:2097
2097heap-size -= size;
(gdb) bt
#0  0x00010024a3b5 in _zend_mm_free_int (heap=0x10100, p=0x1006651e0) 
at 
zend_alloc.c:2097
#1  0x00010021e6af in destroy_uploaded_files_hash () at rfc1867.c:199
#2  0x00010021b252 in sapi_deactivate () at SAPI.c:535
#3  0x0001002fd61e in php_cli_server_send_error_page 
(server=0x7fff5fbfa730, 
client=0x100b4e6f0, status=404) at php_cli_server.c:1525
#4  0x0001002fb31e in php_cli_server_dispatch [inlined] () at 
/Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:1636
#5  0x0001002fb31e in php_cli_server_recv_event_read_request 
(server=0x7fff5fbfe970, client=0x1006651e0) at php_cli_server.c:1924
#6  0x0001002fcae5 in php_cli_server_do_event_for_each_fd_callback 
[inlined] 
() at /Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2010
#7  0x0001002fcae5 in php_cli_server_do_event_for_each_fd [inlined] () at 
php_cli_server.c:671
#8  0x0001002fcae5 in php_cli_server_poller_iter_on_active [inlined] () at 
/Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2046
#9  0x0001002fcae5 in php_cli_server_do_event_loop [inlined] () at 
/Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2036
#10 0x0001002fcae5 in do_cli_server (argc=4, argv=0x10) at 
php_cli_server.c:2147
#11 0x0001002f6aa4 in main (argc=1606415328, argv=0x7fff5fbff400) at 
php_cli.c:1359


[2011-07-20 13:09:48] f...@php.net

I think the culprit lies in php_cli_server_client_populate_request_info
in the line
request_info-content_type = *val;
which doesn't terminate correctly at ; and reads
multipart/form-data; boundary=c1e04e412bff
instead of
multipart/form-data;


[2011-07-20 11:21:47] nbpo...@php.net

Hmm, previous test-case is no longer working for me either.

Try the following:

$ curl --form a=b  http://localhost:8000/file.php;
$ curl  http://localhost:8000/file2.php;
$ curl  http://localhost:8000/file2.php;
$ curl --form a=b  http://localhost:8000/file.php;

It results in a different segfault.


Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x8649170, size=40) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_alloc.c:1906
1906heap-cache[index] = best_fit-prev_free_block;
(gdb) bt
#0  _zend_mm_alloc_int (heap=0x8649170, size=40) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_alloc.c:1906
#1  0x082a79f0 in _ecalloc (nmemb=1, size=40) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_alloc.c:2556
#2  0x08275fc5 in multipart_buffer_new (content_type_dup=value optimized out, 
arg=0xb7fc42f8) at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/rfc1867.c:283
#3  rfc1867_post_handler (content_type_dup=value optimized out, 
arg=0xb7fc42f8) at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/rfc1867.c:749
#4  0x08273b46 in sapi_handle_post (arg=0xb7fc42f8) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/main/SAPI.c:182
#5  0x0827a628 in php_default_treat_data (arg=0, str=0x0, destArray=0x0) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/main/php_variables.c:330
#6  0x082792aa in php_auto_globals_create_post (name=0xb7ea9bf4 _POST, 
name_len=5) at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/php_variables.c:690
#7  0x082a7d45 in zend_auto_global_init (auto_global=0x86524b8) at 
/home/nbpoole

Bug #55238 [Opn]: Configure throws segfault with libc-client2007e

2011-07-25 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55238edit=1

 ID: 55238
 Updated by: f...@php.net
 Reported by:k dot joe at freemail dot hu
 Summary:Configure throws segfault with libc-client2007e
 Status: Open
 Type:   Bug
 Package:*Compile Issues
 Operating System:   Debian GNU/Linux 6.0.2
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Didn't throw a segfault for me (same debian+libc-client, only 32bit), instead 
(with trunk) I got this (configure exited with code 1):

checking for U8T_DECOMPOSE...
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is 
missing. This should not happen. Check config.log for additional information.

In config.log I have:

| #define HAVE_IMAP 1
| #define HAVE_NEW_MIME2TEXT 1
| /* end confdefs.h.  */
|
| #include c-client.h
|
| int
| main ()
| {
|
|  int i = U8T_CANONICAL;
|
|   ;
|   return 0;
| }
configure:49601: result:
configure:49606: error: utf8_mime2text() has new signature, but U8T_CANONICAL 
is missing. This should not happen. Check config.log for additional information.


Previous Comments:

[2011-07-19 06:54:00] k dot joe at freemail dot hu

/usr/src/php-5.3.7RC3/a# gdb conftest
This GDB was configured as x86_64-linux-gnu.
Reading symbols from /usr/src/php-5.3.7RC3/a/conftest...done.
(gdb) run
Starting program: /usr/src/php-5.3.7RC3/a/conftest
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x77b147b8 in utf8_to_mutf7 () from /usr/lib/libc-client.so.2007e
(gdb) bt
#0  0x77b147b8 in utf8_to_mutf7 () from /usr/lib/libc-client.so.2007e
#1  0x00400a3c in main () at configure:50618


[2011-07-19 06:27:37] k dot joe at freemail dot hu

Description:

Configure with imap throws segfaults into the underlying system (when testing 
with conftest files), but the configuring and compiling continues fine.


# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux 6.0.2 (squeeze)
Release:6.0.2
Codename:   squeeze

# uname -a
Linux titan-debian6 2.6.32-5-amd64 #1 SMP Tue Jun 14 09:42:28 UTC 2011 x86_64 
GNU/Linux

# dpkg -l | grep libc-client
ii  libc-client2007e8:2007e~dfsg-3.1
ii  libc-client2007e-dev8:2007e~dfsg-3.1


Tested PHP versions:

  PHP 5.3.3
  PHP 5.3.6
  PHP 5.3.7RC3
  PHP 5.4.0alpha2
  PHP 201107190830 (snapshot)


Test script:
---
simply run:

  ./configure --with-imap --with-imap-ssl --with-kerberos


Expected result:

Expecting failed configure or display an error.


Actual result:
--
reproducible dmesg output:

conftest[21201]: segfault at 1 ip 7fe3a8b8a7b8 sp 7f905ae0 error 4 
in libc-client.so.2007e.0[7fe3a8b48000+102000]


gdb output (don't have debug info):

# gdb -c core
This GDB was configured as x86_64-linux-gnu.
Core was generated by `./conftest'.
Program terminated with signal 11, Segmentation fault.
#0  0x7fe3a8b8a7b8 in ?? ()







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


Bug #55121 [Asn]: Segfault with multipart/form-data POST / 404 request

2011-07-20 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55121edit=1

 ID: 55121
 Updated by: f...@php.net
 Reported by:nbpo...@php.net
 Summary:Segfault with multipart/form-data POST / 404 request
 Status: Assigned
 Type:   Bug
 Package:Built-in web server
 Operating System:   Ubuntu 10.04.2 LTS (64-bit)
 PHP Version:5.4SVN-2011-07-03 (snap)
 Assigned To:   moriyoshi
 Block user comment: N
 Private report: N

 New Comment:

Just tried this on Debian testing and 5_4-HEAD and can't reproduce it.

$ curl --form a=b  http://localhost:8000/file.php;
$ curl  http://localhost:8000/file2.php;

[Wed Jul 20 12:50:05 2011] ::1:50522 POST /file.php - Request read
[Wed Jul 20 12:50:05 2011] ::1:50522 POST /file.php - Response sent 
successfully 
(200)
[Wed Jul 20 12:50:13 2011] ::1:50523 GET /file.txt - Request read
[Wed Jul 20 12:50:13 2011] ::1:50523 GET /file.txt - No such file or directory
[Wed Jul 20 12:50:13 2011] ::1:50523 GET /file.txt - Sending error page (404)


Previous Comments:

[2011-07-03 14:35:11] nbpo...@php.net

Description:

The built-in webserver repeatably segfaults for me when I send the following 
requests (in this order):

1. A multipart/form-data POST request
2. A GET request for a non-existent file

Test script:
---
Create an empty (0 byte) PHP file named file.php. Start the webserver from that 
file's directory. Then run the following commands:

curl --form a=b http://127.0.0.1:8000/file.php
curl http://127.0.0.1:8000/does_not_exist

Expected result:

Requests should be returned by the server without segfaulting.

Actual result:
--
After the second request has been made, I receive a segfault:

Program received signal SIGSEGV, Segmentation fault.
_zend_mm_free_int (heap=0xc91250, p=0xc889c8) at 
/home/nbpoole/php/php5.4-201107031630/Zend/zend_alloc.c:2100
2100if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
(gdb) bt
#0  _zend_mm_free_int (heap=0xc91250, p=0xc889c8) at 
/home/nbpoole/php/php5.4-201107031630/Zend/zend_alloc.c:2100
#1  0x006272f1 in destroy_uploaded_files_hash () at 
/home/nbpoole/php/php5.4-201107031630/main/rfc1867.c:199
#2  0x00625585 in sapi_deactivate () at 
/home/nbpoole/php/php5.4-201107031630/main/SAPI.c:533
#3  0x0071fe81 in php_cli_server_send_error_page (server=value 
optimized out, client=value optimized out, status=value optimized out)
at /home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:1524
#4  0x007207c9 in php_cli_server_begin_send_static (server=0xc89ba0, 
client=0xdfecf0) at 
/home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:1635
#5  php_cli_server_dispatch (server=0xc89ba0, client=0xdfecf0) at 
/home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:1747
#6  php_cli_server_recv_event_read_request (server=0xc89ba0, client=0xdfecf0) 
at /home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:1890
#7  0x007211ea in php_cli_server_do_event_for_each_fd_callback 
(_params=value optimized out, fd=value optimized out, event=value 
optimized out)
at /home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:1976
#8  0x0072185a in php_cli_server_poller_iter_on_active (argc=value 
optimized out, argv=value optimized out)
at /home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:670
#9  php_cli_server_do_event_for_each_fd (argc=value optimized out, 
argv=value optimized out) at 
/home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:2002
#10 php_cli_server_do_event_loop (argc=value optimized out, argv=value 
optimized out) at 
/home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:2012
#11 do_cli_server (argc=value optimized out, argv=value optimized out) at 
/home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli_server.c:2097
#12 0x0071a33e in main (argc=value optimized out, argv=value 
optimized out) at /home/nbpoole/php/php5.4-201107031630/sapi/cli/php_cli.c:1359







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


Bug #55121 [Asn]: Segfault with multipart/form-data POST / 404 request

2011-07-20 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55121edit=1

 ID: 55121
 Updated by: f...@php.net
 Reported by:nbpo...@php.net
 Summary:Segfault with multipart/form-data POST / 404 request
 Status: Assigned
 Type:   Bug
 Package:Built-in web server
 Operating System:   Ubuntu 10.04.2 LTS (64-bit)
 PHP Version:5.4SVN-2011-07-03 (snap)
 Assigned To:   moriyoshi
 Block user comment: N
 Private report: N

 New Comment:

I think the culprit lies in php_cli_server_client_populate_request_info
in the line
request_info-content_type = *val;
which doesn't terminate correctly at ; and reads
multipart/form-data; boundary=c1e04e412bff
instead of
multipart/form-data;


Previous Comments:

[2011-07-20 11:21:47] nbpo...@php.net

Hmm, previous test-case is no longer working for me either.

Try the following:

$ curl --form a=b  http://localhost:8000/file.php;
$ curl  http://localhost:8000/file2.php;
$ curl  http://localhost:8000/file2.php;
$ curl --form a=b  http://localhost:8000/file.php;

It results in a different segfault.


Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x8649170, size=40) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_alloc.c:1906
1906heap-cache[index] = best_fit-prev_free_block;
(gdb) bt
#0  _zend_mm_alloc_int (heap=0x8649170, size=40) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_alloc.c:1906
#1  0x082a79f0 in _ecalloc (nmemb=1, size=40) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_alloc.c:2556
#2  0x08275fc5 in multipart_buffer_new (content_type_dup=value optimized out, 
arg=0xb7fc42f8) at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/rfc1867.c:283
#3  rfc1867_post_handler (content_type_dup=value optimized out, 
arg=0xb7fc42f8) at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/rfc1867.c:749
#4  0x08273b46 in sapi_handle_post (arg=0xb7fc42f8) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/main/SAPI.c:182
#5  0x0827a628 in php_default_treat_data (arg=0, str=0x0, destArray=0x0) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/main/php_variables.c:330
#6  0x082792aa in php_auto_globals_create_post (name=0xb7ea9bf4 _POST, 
name_len=5) at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/php_variables.c:690
#7  0x082a7d45 in zend_auto_global_init (auto_global=0x86524b8) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_compile.c:6233
#8  0x082d564f in zend_hash_apply (ht=0x8649478, apply_func=0x82a7d20 
zend_auto_global_init) at /home/nbpoole/Desktop/php/php5.4-
201107201430/Zend/zend_hash.c:716
#9  0x082b523b in zend_activate_auto_globals () at 
/home/nbpoole/Desktop/php/php5.4-201107201430/Zend/zend_compile.c:6243
#10 0x0827a7df in php_hash_environment () at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/php_variables.c:650
#11 0x0826ba5d in php_request_startup () at /home/nbpoole/Desktop/php/php5.4-
201107201430/main/main.c:1493
#12 0x0836e610 in php_cli_server_dispatch_script (server=0x86443c0, 
client=0x872d900) at /home/nbpoole/Desktop/php/php5.4-
201107201430/sapi/cli/php_cli_server.c:1599
#13 0x0836e8f5 in php_cli_server_dispatch (server=0x86443c0, client=0x872d900) 
at /home/nbpoole/Desktop/php/php5.4-201107201430/sapi/cli/php_cli_server.c:1755
#14 php_cli_server_recv_event_read_request (server=0x86443c0, client=0x872d900) 
at /home/nbpoole/Desktop/php/php5.4-201107201430/sapi/cli/php_cli_server.c:1924
#15 0x0836f0ff in php_cli_server_do_event_for_each_fd_callback 
(_params=0xbfffe15c, fd=6, event=1) at /home/nbpoole/Desktop/php/php5.4-
201107201430/sapi/cli/php_cli_server.c:2015
#16 0x0836fbd7 in php_cli_server_poller_iter_on_active (argc=3, 
argv=0xb394) 
at /home/nbpoole/Desktop/php/php5.4-201107201430/sapi/cli/php_cli_server.c:671
#17 php_cli_server_do_event_for_each_fd (argc=3, argv=0xb394) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/sapi/cli/php_cli_server.c:2036
#18 php_cli_server_do_event_loop (argc=3, argv=0xb394) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/sapi/cli/php_cli_server.c:2046
#19 do_cli_server (argc=3, argv=0xb394) at /home/nbpoole/Desktop/php/php5.4-
201107201430/sapi/cli/php_cli_server.c:2147
#20 0x08368143 in main (argc=3, argv=0xb394) at 
/home/nbpoole/Desktop/php/php5.4-201107201430/sapi/cli/php_cli.c:1359

This was done with the latest 5.4 from snaps.


[2011-07-20 06:50:25] f...@php.net

Just tried this on Debian testing and 5_4-HEAD and can't reproduce it.

$ curl --form a=b  http://localhost:8000/file.php;
$ curl  http://localhost:8000/file2.php;

[Wed Jul 20 12:50:05 2011] ::1:50522 POST /file.php - Request read
[Wed Jul 20 12:50:05 2011] ::1:50522 POST /file.php - Response sent 
successfully 
(200)
[Wed Jul 20 12:50:13 2011] ::1:50523 

Bug #55073 [Opn]: PHP-CLI-webserver does not listen on ipv6 interfaces

2011-07-01 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55073edit=1

 ID: 55073
 Updated by: f...@php.net
 Reported by:f...@php.net
 Summary:PHP-CLI-webserver does not listen on ipv6 interfaces
 Status: Open
 Type:   Bug
 Package:Built-in web server
 Operating System:   any
 PHP Version:5.4SVN-2011-06-29 (SVN)
 Block user comment: N
 Private report: N

 New Comment:

If I made enough sense of what Pierre said on irc, this won't work unless 
php_filter_validate_ip is exposed via PHP_API - so I guess in short it means: 
not happening right now and for this bugfix.


Previous Comments:

[2011-06-29 18:23:30] s...@php.net

On #php.docs, yawk pointed out that the _php_filter_validate_ipv6() function in 
ext/filter/logical_filters.c might be useful for validation.


[2011-06-29 17:31:17] f...@php.net

Description:

./sapi/cli/php -S [::1]:3000 does not work as expected







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


Bug #55103 [Opn-Fbk]: Interfaces avoids Classes to exist

2011-07-01 Thread fa
Edit report at https://bugs.php.net/bug.php?id=55103edit=1

 ID: 55103
 Updated by: f...@php.net
 Reported by:imaggens at gmail dot com
 Summary:Interfaces avoids Classes to exist
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Class/Object related
 Operating System:   Windows 7
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

It seems to me your 2 code samples are identical, just one has output attached.
Where's the interface?

Please provide a *complete* sample, i.e. if your including one file make clear 
what's in both files, the one having a call to require and the one being 
required


Previous Comments:

[2011-07-01 10:07:08] imaggens at gmail dot com

Description:

First at all, one consideration about one of the informations provided in this 
form is the PHP version. I'm not using 5.3.6. I'm using 5.3.3, which is not 
listed. I f I chose earlier, the form won't submit.

I can be wrong, but I think this bug is not fixed in newer versions, because 
it's not a very common use.

The whole thing is, when interfaces and classes are in the same namespace AND 
in same file, the 'implements' breaks the execution of the 'extends'. See Code 
#1

As expected I can see Message from Second Class, without quotes.

But if I add a interface (see Code #2) I get a Fatal Error: Class 'Test\Zero' 
not found, when it could be expected the same result as before.

But why this is important, if the best practices are to develop by following an 
organized structure, with each class/interface in its own file?

The thing is, when DEVELOPING, this kind of organization is very useful, but if 
the code produced during development stage is a little library, if all the 
classes and interfaces are coded in one single file, only one call to 
require_once is needed, and the code execution is three times faster than when 
using an autoloader resource.

Note about CodePad's codes: I'd only saved the lines of code in this site, they 
don't work from it, due PHP versions. But all the tests I made was in machine 
with the configurations posted.

Test script:
---
[ Code #1 ]

http://codepad.org/pDOAiqBa

[ Code #2 ]

http://codepad.org/a42WgIT3

Expected result:

As said in Bug's Description, Message from Second Class, witout quotes.

Actual result:
--
With the first code, I can see the expected result.

With the second code, as I said, I see a Fatal Error. If the stack traces 
helps, here is it:

Fatal error: Class 'Test\Test\Zero' not found in C:\root\Test\Library.php on 
line 5
Call Stack
#   TimeMemory  FunctionLocation
1   0.0004  326896  {main}( )   ..\index.php:0
2   0.0018  334024  require_once( 'C:\root\Test\Framework.php' )
..\index.php:3
Dump $_GET
Dump $_POST






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


Bug #52890 [Opn-Fbk]: Exception not caught sometimes

2010-09-27 Thread fa
Edit report at http://bugs.php.net/bug.php?id=52890edit=1

 ID: 52890
 Updated by: f...@php.net
 Reported by:j dot henge-ernst at interexa dot de
 Summary:Exception not caught sometimes
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Linux
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

Please try to reproduce with PHP 5.3.3 from
http://www.php.net/downloads.php 

instead of Zend Server or file a bug report with Zend.


Previous Comments:

[2010-09-24 13:26:24] j dot henge-ernst at interexa dot de

We have tracked down the problem further using the Zend Code Tracer. It
shows that before the throw is executed several objects are freed and
there __destruct are called. After that the Execution stack seems to be
corrupt and the Exception is not caught on the expected place.

Improving the testscript and adopting these experience still don't yield
that problem. It seems that it only happens if the garbage collection?
is run at the same time. For one executing path the exception works, but
for another execution path it yields that error because additional
objects are created.



In the __destruct we free additional references to other object so we do
not have a memory problem in PHP 5.2.x



The __destruct now looks like and fixes the problem:



public function __destruct(){

if (version_compare(PHP_VERSION, '5.3.0', '=')) {

return;

}

$this-_invalidateFieldChanges();

$this-_objects = null;

$this-_data = null;

$this-_getfcache = null;

}



Url to the code traces:

http://entw.mainz.interexa.de/entw/hernst/phpbuild/phpbug52890-zend-code-trace-zsf.zip
(15MB)

File trace-0-15823-1-20100924.zsf has that error, file
trace-0-16180-1-20100924.zsf works as expected.

File trace-0-29017-1-20100924.zsf also does not catch an exception but
is simpler and has less references to other objects.



I will also provide the xml files of the trace if the export works in
the Zend Server.


[2010-09-20 07:28:47] j dot henge-ernst at interexa dot de

Description:

An Exception thrown is not caught by the corresponding catch block,
instead the global exception handler is invoked. That only happens on
one page during a long selenium test case. The bug is reproduceable with
the selenium test script, but stripping the code to a small example does
not result in an error. Will will add the stripped version of the code
which does not fail, but show the code.



The System is a 64bit Zend Server 5.3 CE on CentOS 5.5. The same code on
a Zend Server 5.2 CE does not have this problem. The problem also
occurred in PHP 5.3.2





In the example script $defer should be set to true but instead of
catching the excepetion in that block the global exception handler is
called.



A fix for this is currently to use bofre the throw:

if (version_compare(PHP_VERSION, '5.3.0', '=') 
version_compare(PHP_VERSION, '5.3.3', '=')) {

   set_exception_handler(create_function('$exception', 'return
$exception instanceof iwat_ui_controller_ObjectSaveDeferredException ?
true : userExceptionHandler($exception);'));

}

as the application behaves as expected, but that bug still exists.
Disabling all Zend modules has no effect

Test script:
---
try {

doSave();

} catch (iwat_ui_controller_ObjectSaveDeferredException $e) {

$defer = true;

} catch (IWATException $e) {

}



function doSave() {

throw new iwat_ui_controller_ObjectSaveDeferredException();

}







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


Bug #52064 [Fbk-Bgs]: while loop does not meet conditions

2010-06-14 Thread fa
Edit report at http://bugs.php.net/bug.php?id=52064edit=1

 ID:   52064
 Updated by:   f...@php.net
 Reported by:  developers at proneticas dot net
 Summary:  while loop does not meet conditions
-Status:   Feedback
+Status:   Bogus
 Type: Bug
 Package:  *General Issues
 Operating System: FreeBSD
 PHP Version:  5.3.2

 New Comment:

$ /opt/src/php-5.2.13/sapi/cli/php b52064.php

string(52) ProNeticas has released a visual rapid database desi



$ /opt/src/php-5.3.1/sapi/cli/php b52064.php

string(52) ProNeticas has released a visual rapid database desi



$ /usr/bin/php -v

PHP 5.2.6-1+lenny8 with Suhosin-Patch 0.9.6.2 (cli)[...]

$ /usr/bin/php b52064.php

string(52) ProNeticas has released a visual rapid database desi


Previous Comments:

[2010-06-13 00:57:51] developers at proneticas dot net

Well really any version of 5.2 was working correctly, but for the sake
of debugging, the last version of 5.2 installed was 5.2.12.


[2010-06-12 18:36:10] fel...@php.net

Which 5.2 release are you refering to?


[2010-06-12 12:51:58] developers at proneticas dot net

Description:

I am seeing a bug in PHP 5.3 where the WHILE LOOP is not meeting all of
the conditions. The same code was working great in PHP 5.2 but broke
after a PHP upgrade. I reviewed the PHP 5.3 change-log and nothing is
mentioned for changes in WHILE LOOP conditions.



Test script:
---
?php



function cutTextPer($string, $setlength) {

$rlength = $setlength;

if($rlengthstrlen($string)){

while (($string{$rlength} != '.')  ($rlength  0)) {

$rlength--;

}

if ($rlength== 0) {

return substr($string, 0, $setlength);

} else {

return substr($string, 0, $rlength).'.';

}

}else {

return $string;

}

}



$mstr = 'ProNeticas has released a visual rapid database design tool.
This allows you to generate online programs in rapid time, without any
programming.';



print cutTextPer( (String)$mstr, 52);



?



[OUTPUT IN PHP 5.2]

ProNeticas has released a visual rapid database design tool.



[OUTPUT IN PHP 5.3]

ProNeticas has released a visual rapid database de



Expected result:

ProNeticas has released a visual rapid database design tool.

Actual result:
--
ProNeticas has released a visual rapid database de






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


Bug #51969 [Opn-Fbk]: fwrite returns 1 when trying to write to a locked file

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51969edit=1

 ID:   51969
 Updated by:   f...@php.net
 Reported by:  scarduzio at gmail dot com
 Summary:  fwrite returns 1 when trying to write to a locked file
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Filesystem function related
 Operating System: Windows 7 x86
 PHP Version:  5.3.2

 New Comment:

From the manual:

It is also possible to add LOCK_NB as a bitmask to one of the above
operations if you don't want flock() to block while locking. (not
supported on Windows)



Then again path /cache/lockable.txt doesn't look like windows - so
what OS are you using?



And while I know that's possibly not directly related to your problem -
please clarify.


Previous Comments:

[2010-06-01 23:45:32] scarduzio at gmail dot com

Description:

When I try to write any length string with fwrite using a file handle I
previously 

locked with flock, fwrite is of course unable to write, but will return


unexplicable value 1 instead of false.

Test script:
---
/*

   Run two instances of this script in a rapid sequence

*/



$fp1 = fopen(/cache/lockable.txt,w);

if(flock($fp1, LOCK_EX | LOCK_NB)){

echo locked fp1\n;

sleep(20);

}else{

$res = fwrite($fp1, ABCDE);

if(false === $res){

   echo failed the write\n;   

}

echo I managed! fwrite returned: ; print_r($res);

}

Expected result:

I expect to read failed to write when a second instance of the script
is run, 

since fwrite should return false as documentation says when fwrite is
not able to 

write.

Actual result:
--
fwrite returns integer 1.






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


Bug #51912 [Opn-Bgs]: system(): Unable to fork

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51912edit=1

 ID:   51912
 Updated by:   f...@php.net
 Reported by:  z0ned at hotmail dot com
 Summary:  system(): Unable to fork
-Status:   Open
+Status:   Bogus
 Type: Bug
 Package:  Program Execution
 Operating System: Ubuntu Linux 10.04LTS Lucid
 PHP Version:  5.3.2

 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to Open.
Again, thank you for your continued support of PHP.

PHP 5.3.2-1ubuntu4.2 is the Ubuntu version of PHP.

Please try the release from php.net, the current svn snapshot or report
bugs to Ubuntu.


Previous Comments:

[2010-05-26 01:47:59] z0ned at hotmail dot com

/etc/php5/cli/php.ini has:

safe_mode = Off

disable_functions =


[2010-05-26 01:19:52] z0ned at hotmail dot com

Description:

On an Ubuntu 10.04LTS Lucid system with PHP 5.3.2-1ubuntu4.2



Running from the command line: php some_script.php



Calling within: system('/usr/bin/php a_script.php');



Getting:



PHP Warning:  system(): Unable to fork [/usr/bin/php a_script.php] in
/path/to/some_script.php on line 258



I've seen plenty of bug reports for Windows users but this is under
Linux and I don't see any open reports for Linux.



Expected result:

On a different Ubuntu 9.10 Karmic system with PHP 5.2.10-2ubuntu6.4, the
same code works fine, e.g. a_script.php is executed and the output is
displayed.



Actual result:
--
The script specified in the system() call is not executed and no output
is displayed, just the Unable to fork warning.








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


Bug #51969 [Opn]: fwrite returns 1 when trying to write to a locked file

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51969edit=1

 ID:   51969
 Updated by:   f...@php.net
 Reported by:  scarduzio at gmail dot com
 Summary:  fwrite returns 1 when trying to write to a locked file
 Status:   Open
 Type: Bug
 Package:  Filesystem function related
 Operating System: Windows 7 x86
 PHP Version:  5.3.2

 New Comment:

Ah, ok, thank you for the clarification.



Tried to reproduce now, indeed fwrite in the else clause ignores the
flock() - but then again you already checked if there is a lock, that is
exactly why you are in the else code path, so I'm not exactly sure how
flock *should* behave ...



Trying to open the locked file gives a windows warning that the file is
indeed locked, though.



Same result with PHP 5.3.2 (cli) on Debian lenny, btw - minus the
warning on accessing the file directly.


Previous Comments:

[2010-06-10 12:26:50] scarduzio at gmail dot com

Hi, thanks for replying.



The OS in use is Windows 7 x86 genuine with all windows updates. 

The path with forward slash that I use in my code is unix style because
I 

noticed 

PHP always translates it correctly into C:\cache\lockable.txt, and
it's always 

been fine. Also this time, the file is always found.



About the manual line stating LOCK_NB bitmask is not supported: as
evinced from 

my tests, including this one, the use of LOCK_NB is behaving perfectly
since it 

detects file is locked, and executes my else.



I also do not think LOCK_NB is the core of this problem since I could
split this 

script in two (one with the flock+sleep and the other with the else
content) 

and reproduce the same bug.



I later tested this in linux environment, fwrite will return 5 (not 1).
Which is 

still funny, since writing in a locked file should in my opinion return
false.



I look forward for your further analysis.

BR,



Simone


[2010-06-10 12:04:33] f...@php.net

From the manual:

It is also possible to add LOCK_NB as a bitmask to one of the above
operations if you don't want flock() to block while locking. (not
supported on Windows)



Then again path /cache/lockable.txt doesn't look like windows - so
what OS are you using?



And while I know that's possibly not directly related to your problem -
please clarify.


[2010-06-01 23:45:32] scarduzio at gmail dot com

Description:

When I try to write any length string with fwrite using a file handle I
previously 

locked with flock, fwrite is of course unable to write, but will return


unexplicable value 1 instead of false.

Test script:
---
/*

   Run two instances of this script in a rapid sequence

*/



$fp1 = fopen(/cache/lockable.txt,w);

if(flock($fp1, LOCK_EX | LOCK_NB)){

echo locked fp1\n;

sleep(20);

}else{

$res = fwrite($fp1, ABCDE);

if(false === $res){

   echo failed the write\n;   

}

echo I managed! fwrite returned: ; print_r($res);

}

Expected result:

I expect to read failed to write when a second instance of the script
is run, 

since fwrite should return false as documentation says when fwrite is
not able to 

write.

Actual result:
--
fwrite returns integer 1.






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


Bug #52040 [Opn-Fbk]: Fatal error (undefined function) not reported when php within html tag's attr

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=52040edit=1

 ID:   52040
 Updated by:   f...@php.net
 Reported by:  michal_musial at o2 dot pl
 Summary:  Fatal error (undefined function) not reported when php
   within html tag's attr
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Windows 7 Ultimate (any?)
 PHP Version:  5.3.2

 New Comment:

Can't reproduce with the VC9 build of 5.3.2 from windows.php.net in CLI
mode.

Are you sure you have no special php.ini settings (like auto_prepend) or
anything related to output buffering?



This really looks like a configuration issue at first glance.


Previous Comments:

[2010-06-10 16:48:23] michal_musial at o2 dot pl

Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache
2.2.13.

Same problem.


[2010-06-10 16:41:49] michal_musial at o2 dot pl

Description:

PHP does not print Fatal error when an undefined function is called from
within a 

html tag's attribute.

Error is saved to php error log if one is specified in php.ini, but
there's 

nothing being printed. Execution ends at the line preceding the line
containing 

the undefined function.

Test script:
---
pp1/p

p class=?php echo bogus(); ?p2/p

pp3/p

Expected result:

pp1/p 

p class=br /

bFatal error/b:  Call to undefined function bogus() in 

bE:\_webroot\localhost\test.php/b on line b3/bbr / 

Actual result:
--
pp1/p 






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


Bug #52040 [Opn-Fbk]: Fatal error (undefined function) not reported when php within html tag's attr

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=52040edit=1

 ID:   52040
 Updated by:   f...@php.net
 Reported by:  michal_musial at o2 dot pl
 Summary:  Fatal error (undefined function) not reported when php
   within html tag's attr
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Windows 7 Ultimate (any?)
 PHP Version:  5.3.2

 New Comment:

Please try
http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC9-x86.zip
with the php.ini-production and try to reproduce


Previous Comments:

[2010-06-10 17:13:33] michal_musial at o2 dot pl

I'm no expert in php config, so it's entirely possible.

Have a look at my config:

http://mmusial.nazwa.pl/php.ini


[2010-06-10 17:07:10] f...@php.net

Can't reproduce with the VC9 build of 5.3.2 from windows.php.net in CLI
mode.

Are you sure you have no special php.ini settings (like auto_prepend) or
anything related to output buffering?



This really looks like a configuration issue at first glance.


[2010-06-10 16:48:23] michal_musial at o2 dot pl

Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache
2.2.13.

Same problem.


[2010-06-10 16:41:49] michal_musial at o2 dot pl

Description:

PHP does not print Fatal error when an undefined function is called from
within a 

html tag's attribute.

Error is saved to php error log if one is specified in php.ini, but
there's 

nothing being printed. Execution ends at the line preceding the line
containing 

the undefined function.

Test script:
---
pp1/p

p class=?php echo bogus(); ?p2/p

pp3/p

Expected result:

pp1/p 

p class=br /

bFatal error/b:  Call to undefined function bogus() in 

bE:\_webroot\localhost\test.php/b on line b3/bbr / 

Actual result:
--
pp1/p 






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


Bug-Req #51440 [Opn-Wfx]: request extend echo print sentences

2010-03-30 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51440edit=1

 ID:   51440
 Updated by:   f...@php.net
 Reported by:  datamine dot maramirezc at gmail dot com
 Summary:  request extend echo print sentences
-Status:   Open
+Status:   Wont fix
-Type: Bug
+Type: Feature/Change Request
 Package:  Output Control
 Operating System: any
 PHP Version:  Irrelevant

 New Comment:

This is not Pascal.


Previous Comments:

[2010-03-30 19:55:31] datamine dot maramirezc at gmail dot com

Description:

This is a request. 

Please, add iprintln/i and iecholn/i sentences.



Instead of writing this bseveral times/b:



pre

print whatever\n;

echo whatever\n;

/pre



We could use a more compact:



pre

println whatever;

echoln whatever;

/pre





It's useful when the program outputs a single string for a H.T.M.L.
single line.

This way, it's easier to debug the H.T.M.L. code generated.



Thanks.









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


Req #51442 [Opn-Wfx]: is_writable is confusing, should NOT check if the file exists or not

2010-03-30 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51442edit=1

 ID:   51442
 Updated by:   f...@php.net
 Reported by:  mr dot mosch at gmail dot com
 Summary:  is_writable is confusing, should NOT check if the file
   exists or not
-Status:   Open
+Status:   Wont fix
 Type: Feature/Change Request
 Package:  *Directory/Filesystem functions
 Operating System: Linux
 PHP Version:  5.2.13

 New Comment:

This would be quite a BC break, won't happen.


Previous Comments:

[2010-03-30 20:56:16] mr dot mosch at gmail dot com

Description:

If i want to check if the file is writeable even if it not exists, if
have to write an complicated function. if the behavior would change both
cases, file exists and file does not exists would be handled in 1 line
of code.



This is not a test script, should only show up the thing.



// Acutal behavior:

if (is_writeable('/tmp/NOT_EXISTING')) // returns false



// Better behavior:

if (is_writeable('/tmp/NOT_EXISTING')) // returns true



// Actual workaround:

if (is_writeable('/tmp/NOT_EXISTING') ||
(file_exists('/tmp/NOT_EXISTING') === false 
is_writeable(pathinfo('/tmp/NOT_EXISTING', PATHINFO_DIRNAME))) // return
true









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


Bug #51397 [Opn-Ver]: Math calculation bug

2010-03-26 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51397edit=1

 ID:   51397
 Updated by:   f...@php.net
 Reported by:  emanuel dot dejanu at humaninfo dot ro
 Summary:  Math calculation bug
-Status:   Open
+Status:   Verified
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: FREEBSD  LINUX
 PHP Version:  5.2.13

 New Comment:

Verified with 5.2.13 on Debian (default configure)



Verified in the Debian 5.2.6+lenny4 PHP (just for completeness)



Correct result with 5.3.2 on Gentoo


Previous Comments:

[2010-03-26 08:20:19] emanuel dot dejanu at humaninfo dot ro

Description:



I have used the code from the test script on my development machine
(Windows Professional 7 32bit) with php 5.2.12 and is working correctly
but when I have deployed on my production machine that is FreeBSD 6.3
32bit with the same php version 5.2.12 is giving wrong results
(-2147483593). I also run this on other production machine that is
RedHat 5 32bit with php 5.2.6 and is also giving wrong results
(-2147483593).



I can not test with php 5.2.13 on production machines (virtual
hosting).

On windows is giving the correctly result (754303898) with PHP 5.2.12
and PHP 5.3.1. I am running in 32bit platform on all machines.



---



PHP_INT_SIZE: 4



System = FreeBSD somehost.com 6.3-RELEASE FreeBSD 6.3-RELEASE #6: Wed
Oc

t 21 09:32:42 MDT 2009 r...@fc:/usr/src/sys/i386/compile/VKERN i386

Build Date = Mar  3 2010 12:51:00

Configure Command =  './configure'  '--with-layout=GNU'
'--with-config-file-sca

n-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml'
'--with-libxml-dir=/

usr/local' '--enable-reflection' '--program-prefix=' '--enable-fastcgi'
'--with-

apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL'
'--prefix=/

usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/'
'--build=i386-

portbld-freebsd6.3'

Server API = Command Line Interface

Virtual Directory Support = disabled

Configuration File (php.ini) Path = /usr/local/etc

Loaded Configuration File = /usr/local/etc/php.ini

Scan this dir for additional .ini files = /usr/local/etc/php

additional .ini files parsed = /usr/local/etc/php/extensions.ini



PHP API = 20041225

PHP Extension = 20060613

Zend Extension = 220060519

Debug Build = no





Test script:
---
function myhash($key) {

$h = 5381;

$l = strlen($key);

for($i = 0; $i  $l; ++$i) {

$h = (($h  5) + $h) ^ ord($key[$i]);

}

return $h;

}

$h = myhash('CL6.1.7');

if ($h != 754303898)

echo bug\n;

echo $h . \n;



Expected result:

754303898



Actual result:
--
bug

-2147483593






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


Req #51296 [Opn-Wfx]: HTML PAGE BUILDER..

2010-03-14 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51296edit=1

 ID:   51296
 Updated by:   f...@php.net
 Reported by:  jmcglashan at live dot com dot au
 Summary:  HTML PAGE BUILDER..
-Status:   Open
+Status:   Wont fix
 Type: Feature/Change Request
 Package:  Output Control
 Operating System: Apache
 PHP Version:  Irrelevant

 New Comment:

Feel free to write an extension or PEAR package to handle that.


Previous Comments:

[2010-03-14 08:52:11] jmcglashan at live dot com dot au

Double text


[2010-03-14 08:50:31] jmcglashan at live dot com dot au

Description:

I think we should be able to create our html elements using an internal
PHP 

class...



Sample script: http://jamesm.com.au/php_class/html.php

Test script:
---
http://jamesm.com.au/php_class/html.php

Expected result:

To get the output I have in my page.

Actual result:
--
Errors -- Not tested because I know they don't exist --






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


Req #51296 [Wfx-Bgs]: HTML PAGE BUILDER..

2010-03-14 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51296edit=1

 ID:   51296
 Updated by:   f...@php.net
 Reported by:  jmcglashan at live dot com dot au
 Summary:  HTML PAGE BUILDER..
-Status:   Wont fix
+Status:   Bogus
 Type: Feature/Change Request
 Package:  Output Control
 Operating System: Apache
 PHP Version:  Irrelevant



Previous Comments:

[2010-03-14 15:08:15] f...@php.net

Feel free to write an extension or PEAR package to handle that.


[2010-03-14 08:52:11] jmcglashan at live dot com dot au

Double text


[2010-03-14 08:50:31] jmcglashan at live dot com dot au

Description:

I think we should be able to create our html elements using an internal
PHP 

class...



Sample script: http://jamesm.com.au/php_class/html.php

Test script:
---
http://jamesm.com.au/php_class/html.php

Expected result:

To get the output I have in my page.

Actual result:
--
Errors -- Not tested because I know they don't exist --






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


Req #33891 [Opn-Bgs]: make array a traversable

2010-03-13 Thread fa
Edit report at http://bugs.php.net/bug.php?id=33891edit=1

 ID:   33891
 Updated by:   f...@php.net
 Reported by:  marcos dot neves at gmail dot com
 Summary:  make array a traversable
-Status:   Open
+Status:   Bogus
 Type: Feature/Change Request
-Package:  Feature/Change Request
+Package:  *General Issues
 Operating System: any
 PHP Version:  5.1.0b3

 New Comment:

Please try 5.3.2 or 5.2.13.


Previous Comments:

[2010-03-13 18:08:24] wrzasq at gmail dot com

It should also expose interfaces ArrayAccess and Countable. It's very
frustrating when you use type hinting to force iterable structures or
array-like accessible and it comes out that you can't pass array
themselves.


[2005-07-27 22:14:08] marcos dot neves at gmail dot com

Description:

Traversable is an internal interface that says I can be used in a
foreach. Since array can be used too, would be nice if array be
accepted internally in parameters that expect traversable.

Reproduce code:
---
?



function acceptArray(array $t) {

echo \n.__FUNCTION__.\n;

foreach($t as $k=$v) {

echo $k=$v\n;

}

}



function acceptTraversable(Traversable $t) {

echo \n.__FUNCTION__.\n;

foreach($t as $k=$v) {

echo $k=$v\n;

}

}



$test = array(is, array, traversable, too, ?);





acceptArray($test); // ok



acceptTraversable(new ArrayIterator($test)); // ok



acceptTraversable($test); // would be nice



?

Expected result:

acceptTraversable($test); shoud accept an array, since it's too a
Traversable structure(can be used in a foreach).

Actual result:
--
Fatal error: Argument 1 must be an object of class Traversable






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


#51168 [Bgs]: Userland Cyclic Reference with Nested DateTime are not garbage collected

2010-03-01 Thread fa
 ID:   51168
 Updated by:   f...@php.net
 Reported By:  kontakt at beberlei dot de
 Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Linux/Ubuntu
 PHP Version:  5.3.1
 New Comment:

Uhm, original bug seemed to be MacOS X only - now this reads
Linux/Ubuntu - further testing needed I think.


Previous Comments:


[2010-02-28 16:46:51] j...@php.net

Ok. 



[2010-02-27 16:49:35] kontakt at beberlei dot de

Sorry it seems this is a duplicate of
http://bugs.php.net/bug.php?id=49700



[2010-02-27 16:45:34] kontakt at beberlei dot de

Description:

When one of the participants of a cyclic reference holds a reference to
a DateTime instance, the GC seems to be unable to do its job.

NOTE: Even without a DateTime reference memory keeps increasing slowly
but steadily. This is not the case as soon as either $a-b = $b or $b-a
= $a is commented out, i.e. the cyclic reference is removed. So even
though the GC seems to work almost perfectly (without a DateTime
reference), a small leak remains.

The leakage also occurs with PDO, however not with other php internal
objects.

Reproduce code:
---
class A {
  public $b;
  public $ref;
  function __construct() {
$this-ref = new DateTime; // large leak. comment out for small
leak.
  }
}

class B {
  public $a;
}


for ($i=1; $i=20; ++$i) {
  $a = new A;
  $b = new B;
  $a-b = $b; // comment out to avoid any leakage, with or without
DateTime, doesnt matter.
  $b-a = $a; // comment out to avoid any leakage, with or without
DateTime, doesnt matter.

  if ($i % 1 == 0) {
gc_collect_cycles();
printf('- Memory usage after %d iterations: %2.2f MB' .PHP_EOL,
$i, memory_get_usage() / 1024 / 1024);
  }
}


Expected result:

- Memory usage after 1 iterations: 0.79 MB
- Memory usage after 2 iterations: 0.79 MB
- Memory usage after 3 iterations: 0.79 MB
- Memory usage after 4 iterations: 0.79 MB
- Memory usage after 5 iterations: 0.79 MB
- Memory usage after 6 iterations: 0.79 MB
- Memory usage after 7 iterations: 0.79 MB
- Memory usage after 8 iterations: 0.79 MB
- Memory usage after 9 iterations: 0.79 MB
- Memory usage after 10 iterations: 0.79 MB



Actual result:
--
- Memory usage after 1 iterations: 4.53 MB
- Memory usage after 2 iterations: 8.38 MB
- Memory usage after 3 iterations: 12.15 MB
- Memory usage after 4 iterations: 15.90 MB
- Memory usage after 5 iterations: 19.65 MB
- Memory usage after 6 iterations: 23.40 MB
- Memory usage after 7 iterations: 27.15 MB
- Memory usage after 8 iterations: 30.90 MB
- Memory usage after 9 iterations: 34.65 MB
- Memory usage after 10 iterations: 38.41 MB







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



#50404 [Opn-Fbk]: can't use mail

2009-12-09 Thread fa
 ID:   50404
 Updated by:   f...@php.net
 Reported By:  larry_mintz at primus dot ca
-Status:   Open
+Status:   Feedback
-Bug Type: Feature/Change Request
+Bug Type: *Mail Related
 Operating System: Windows XP
 PHP Version:  5.3.1
 New Comment:

From your error message it seems like you're using XAMPP's PHP - so I'd
suggest retrying with the version from http://windows.php.net.

Mail server logfile would be helpful as well.


Previous Comments:


[2009-12-08 00:48:49] larry_mintz at primus dot ca

Description:

In testing mail() I get the following error:

Warning: mail() [function.mail]: SMTP server response: 501
Syntactically invalid HELO argument(s) in C:\XAMPP\htdocs\mailtest.php
on line 2

Observations:
[1] Firewall is turned off
[2] I am behind a router.

Here is test driver:
?php 
mail('old_ c...@primus.ca', 'feedback', 'its good',NULL);
echo PTest/P;
?


Reproduce code:
---
---
From manual page: function.mail
---


Expected result:

that mail() should run

Actual result:
--
it doesn't See abover






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



#50430 [Opn-Bgs]: array_key_position

2009-12-09 Thread fa
 ID:   50430
 Updated by:   f...@php.net
 Reported By:  james at calminferno dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: All
 PHP Version:  5.3.1
 New Comment:

As you already explained, it's chaining 2 already built-in functions,
both array-related. Doesn't look like another function is needed here.


Previous Comments:


[2009-12-09 18:30:58] james at calminferno dot net

Description:

Create a single function called array_key_position that returns the
array position of a key. Basically turning array_search( $key,
array_keys( $my_assoc_array ) ) into a single function that returns the
key position or false if doesn't exist.






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



#50370 [Opn-Csd]: 64bit libtdsodbc.so crash because of malloc 4 byte missing

2009-12-04 Thread fa
 ID:   50370
 Updated by:   f...@php.net
 Reported By:  nalply at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: ODBC related
 Operating System: Debian Lenny amd64
 PHP Version:  5.2.6
 New Comment:

Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

Fixed in 5.2.7 - only place to report this would be Debian then.


Previous Comments:


[2009-12-04 09:47:05] freddy77 at gmail dot com

PHP 5.2.6 is the problem, in php_odbc_includes.h a len is declared as
SDWORD which is only 32-bit while should be 64-bit (SQLLEN).



[2009-12-03 08:41:30] nalply at gmail dot com

The link does not work (it is too long). Use this instead:
http://bit.ly/7e028s



[2009-12-03 08:39:52] nalply at gmail dot com

Description:

I have a page which reproducibly overwrites non alloc'd memory (a write
of 8 bytes instead of 4 bytes at the end of the range). It is caused by
the call odbc_fetch_object() and the bad write in libtdsodbc.so.

For more details see:
http://serverfault.com/questions/90100/64bit-unixodbc-and-freetds-a-bug-in-libtdsodbc-so,
there is a valgrind output.

It crashes in the Apache module only. The PHP command line with Suhosin
reports a canary mismatch.

Note, it is version 5.2.6-1+lenny4, that's what Debian Lenny has
installed, and not 5.2.11, because the form forced me to enter this
version. I won't upgrade my PHP to a newer version. Take this bug report
or leave it.

It is not sure whether the bug is in PHP ODBC or in TDS ODBC, so I am
going to report this bug thrice: here and there and with Debian.

Reproduce code:
---
#!/usr/bin/php5
?php

$conn = odbc_connect(dsn, user, password);
$query = odbc_exec($conn, SELECT 'alpha' test);

echo Before odbc_fetch_object(); query=$query\n; flush();
if ($query) $row = odbc_fetch_object($query);
echo After odbc_fetch_row();\n; flush();
echo Result= . $row-test . \n;

?some static text


Expected result:

Before odbc_fetch_object(); query=Resource id #5
After odbc_fetch_row();
Result=alpha
some static text
ALERT - canary mismatch on efree() - heap overflow detected (attacker
'REMOTE_ADDR not set', file 'unknown')

Actual result:
--
Before odbc_fetch_object(); query=Resource id #5
After odbc_fetch_row();
Result=alpha
some static text






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



#50323 [Opn]: No ability to connect to database named 't;', no chance to escape semicolon

2009-11-29 Thread fa
 ID:   50323
 Updated by:   f...@php.net
 Reported By:  winner5 at interia dot pl
 Status:   Open
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.3.1
 New Comment:

IBTB (In before the bogus):

http://xkcd.com/327/


Previous Comments:


[2009-11-29 14:09:18] alfredorj at walla dot com

Why do you don't go to see if I'm on the corner?
This bug is not a bug! Who does make a database with ; chars?
You are a really loser.



[2009-11-29 13:25:13] winner5 at interia dot pl

Description:

There is no way to escape semicolon in dsn to be treated like a char,
not as a separator.

Reproduce code:
---
?php
 $pdo = new PDO('mysql:host=localhost;dbname=t\\;', 'user', 'pass');
?

Expected result:

Successfully established connection

Actual result:
--
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[42000] [1049] Unknown database 't\'' in ./index.php:1
Stack trace:
#0 ./index.php(1): PDO-__construct('mysql:host=loca...', 'user',
'pass')
#1 {main}
  thrown in ./index.php on line 1






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



#50323 [Opn]: No ability to connect to database named 't;', no chance to escape semicolon

2009-11-29 Thread fa
 ID:   50323
 Updated by:   f...@php.net
 Reported By:  winner5 at interia dot pl
 Status:   Open
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.3.1
 New Comment:

Yes, I'm terribly sorry.

To be more on-topic then, afaik SQLite doesn't even allow ';' as part
of either database or table name, so I was under the impression mysql
wasn't either.

Verified on 5.2.6-1+lenny3

Problem seems to lie somewhere in ext/pdo/pdo_dbh.c in dbh_constructor
fwiw.


Previous Comments:


[2009-11-29 21:29:20] kelt3we at gmail dot com

This is by no means a proper way to provide feedback to a bug report,
even if the user's claim is wrong. Next time remember this is not a
humor site ;-)



[2009-11-29 14:51:23] f...@php.net

IBTB (In before the bogus):

http://xkcd.com/327/



[2009-11-29 14:09:18] alfredorj at walla dot com

Why do you don't go to see if I'm on the corner?
This bug is not a bug! Who does make a database with ; chars?
You are a really loser.



[2009-11-29 13:25:13] winner5 at interia dot pl

Description:

There is no way to escape semicolon in dsn to be treated like a char,
not as a separator.

Reproduce code:
---
?php
 $pdo = new PDO('mysql:host=localhost;dbname=t\\;', 'user', 'pass');
?

Expected result:

Successfully established connection

Actual result:
--
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[42000] [1049] Unknown database 't\'' in ./index.php:1
Stack trace:
#0 ./index.php(1): PDO-__construct('mysql:host=loca...', 'user',
'pass')
#1 {main}
  thrown in ./index.php on line 1






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



#50287 [Opn-Bgs]: DON'T WORK

2009-11-24 Thread fa
 ID:   50287
 Updated by:   f...@php.net
 Reported By:  jkitterman at ccsd1 dot k12 dot wy dot us
-Status:   Open
+Status:   Bogus
 Bug Type: PHAR related
 Operating System: WINDOZE 95
 PHP Version:  5.3SVN-2009-11-24 (snap)
 New Comment:

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

Thank you for your interest in PHP.




Previous Comments:


[2009-11-24 20:10:45] jkitterman at ccsd1 dot k12 dot wy dot us

Description:

IT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORK

Reproduce code:
---
IT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORK

Expected result:

IT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORK

Actual result:
--
IT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T WORKIT DON'T
WORKIT DON'T WORKIT DON'T WORK





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



#50194 [Opn]: With some fonts, letters are overlapped with imagettftext

2009-11-20 Thread fa
 ID:   50194
 Updated by:   f...@php.net
 Reported By:  stanislav at ww9 dot ru
 Status:   Open
 Bug Type: GD related
 Operating System: Windows
 PHP Version:  5.2.11
 New Comment:

Reproduced with PHP5.3.1RC3 on Ubuntu LTS

I tend to blame the font.


Previous Comments:


[2009-11-16 20:55:55] stanislav at ww9 dot ru

Description:

Just wanted to write a text on an image with tranperent image and got 
strange result. Writing text on an image using some true type fonts
like this one http://ww9.ru/zeferinotwo.ttf causes letters to overlap
each other like here http://ww9.ru/test.php

Reproduce code:
---
// Set the content-type
header('Content-type: image/png');

// Create the image
//$im = imagecreatefromjpeg('./user/images/tpls/headbg.jpg');
$im = imagecreatetruecolor(400, 100);

// Create some colors
$background = imagecolorallocatealpha($im, 60, 60, 60, 127);
$black = imagecolorallocate($im, 0, 0, 0);


imagealphablending($im, false);

imagefilledrectangle($im, 0, 0, 399, 99, $background);

// The text to draw
$text = 'Tesing ... ';
// Replace path by your own font path
$font = './zeferinotwo.ttf';

// Add the text
imagettftext($im, 40, 0, 10, 40, $black, $font, $text);

imagesavealpha($im, true);
imagepng($im);
imagedestroy($im);

Expected result:

The text Tesing ... written on an image

Actual result:
--
http://ww9.ru/test.php





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



#50194 [Asn]: With some fonts, letters are overlapped with imagettftext

2009-11-20 Thread fa
 ID:   50194
 Updated by:   f...@php.net
 Reported By:  stanislav at ww9 dot ru
 Status:   Assigned
 Bug Type: GD related
 Operating System: Windows
 PHP Version:  5.2.11
 Assigned To:  pajoye
 New Comment:

It works with 5.2.6-1+lenny3 from Debian.

Broken as well in 5.3.1 (php.net) on Debian lenny


Previous Comments:


[2009-11-20 11:35:32] paj...@php.net

I have to try them :)



[2009-11-20 11:34:02] f...@php.net

Reproduced with PHP5.3.1RC3 on Ubuntu LTS

I tend to blame the font.



[2009-11-16 20:55:55] stanislav at ww9 dot ru

Description:

Just wanted to write a text on an image with tranperent image and got 
strange result. Writing text on an image using some true type fonts
like this one http://ww9.ru/zeferinotwo.ttf causes letters to overlap
each other like here http://ww9.ru/test.php

Reproduce code:
---
// Set the content-type
header('Content-type: image/png');

// Create the image
//$im = imagecreatefromjpeg('./user/images/tpls/headbg.jpg');
$im = imagecreatetruecolor(400, 100);

// Create some colors
$background = imagecolorallocatealpha($im, 60, 60, 60, 127);
$black = imagecolorallocate($im, 0, 0, 0);


imagealphablending($im, false);

imagefilledrectangle($im, 0, 0, 399, 99, $background);

// The text to draw
$text = 'Tesing ... ';
// Replace path by your own font path
$font = './zeferinotwo.ttf';

// Add the text
imagettftext($im, 40, 0, 10, 40, $black, $font, $text);

imagesavealpha($im, true);
imagepng($im);
imagedestroy($im);

Expected result:

The text Tesing ... written on an image

Actual result:
--
http://ww9.ru/test.php





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



#50141 [Opn]: folders inside a zip archive are not displayed

2009-11-11 Thread fa
 ID:   50141
 Updated by:   f...@php.net
 Reported By:  samantha86 at web dot de
 Status:   Open
 Bug Type: Zip Related
 Operating System: windows (xp and 7)
 PHP Version:  5.3.0
 New Comment:

Addendum:
if I change
  $zip-addDir(PATH./example, /example);
to
  $zip-addDir(PATH./example, example);
I can avoid this in 5.2.6 (debian php), 5.3.0 and 5.3.1RC3
and get:
example/x.ini


Previous Comments:


[2009-11-11 09:40:21] samantha86 at web dot de

oh sorry that piece: /languages);
was too much, it is not in my orignal code. just a copy and paste
error.



[2009-11-11 09:38:54] samantha86 at web dot de

yes, this folder includes some other folders, which can be seen when
using a linux machine.

the structure should look like this:

myzipfile.zip
   |_ /admin
   |_ /core
   |_ ...some othe folders...
   |_ config.php
   |_ ...some other files in the root of the zipfile...

the code i use to add the directories/files it looks exactly like
this:

?php
...
//for the directories:
$zip-addDir(PATH./admin, /admin);
$zip-addDir(PATH./core, /core);/languages);
...
for the files:
$zip-addFile(PATH./backup/files/config.php, config.php);
$zip-addFile(PATH./backup/files/index.php, index.php);
...
?



[2009-11-10 23:47:13] f...@php.net

If I open your zip file with 7-ZIP instead of the integrated windows
zip tool, there's a folder with a weird name.

Might be just a blank space, might be a null byte.
But in that folder I see many folders:
admin / backup / core / installation / and some more

Can you please verify that your generated subfolder name is not just
incorrectly set?



[2009-11-10 20:03:02] samantha86 at web dot de

here is some example code, an already generated zip file can be
downloaded at my demoserver
http://steffisgarten.bplaced.net/chillyCMS/admin/tools.site.php?tool=backup
username: admin, pw: demo
maybe this can save you some time.

?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}

$zip=new Zipper();
if ($zip-open($file_dest, ZIPARCHIVE::CREATE)) {
$zip-addDir(PATH./example, /example);
} else {
echo error;
}
?



[2009-11-10 19:31:27] paj...@php.net

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.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/50141

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



#50141 [Opn-Fbk]: folders inside a zip archive are not displayed

2009-11-10 Thread fa
 ID:   50141
 Updated by:   f...@php.net
 Reported By:  samantha86 at web dot de
-Status:   Open
+Status:   Feedback
 Bug Type: Zip Related
 Operating System: windows (xp and 7)
 PHP Version:  5.3.0
 New Comment:

If I open your zip file with 7-ZIP instead of the integrated windows
zip tool, there's a folder with a weird name.

Might be just a blank space, might be a null byte.
But in that folder I see many folders:
admin / backup / core / installation / and some more

Can you please verify that your generated subfolder name is not just
incorrectly set?


Previous Comments:


[2009-11-10 20:03:02] samantha86 at web dot de

here is some example code, an already generated zip file can be
downloaded at my demoserver
http://steffisgarten.bplaced.net/chillyCMS/admin/tools.site.php?tool=backup
username: admin, pw: demo
maybe this can save you some time.

?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}

$zip=new Zipper();
if ($zip-open($file_dest, ZIPARCHIVE::CREATE)) {
$zip-addDir(PATH./example, /example);
} else {
echo error;
}
?



[2009-11-10 19:31:27] paj...@php.net

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.





[2009-11-10 19:26:28] samantha86 at web dot de

Description:

hi,

i have a problem with files generated/altered via the ziparchive
class.
my problem is the same as Bug #39714, but i have been using php 5.3.0
instead of 5.2.x

i use to use ubuntu linux and i have NO problem there with extracting
the zip files. it does not matter on what server the zip files are
generated, windows or linux, it depends on the client where i try to
open one of these zip files.

the code for the zipfile generation looks like this:



Reproduce code:
---
?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}
?

Expected result:

i'd like to receive a zipfile where i can see the files, but also the
directories wit the included files that are generated in a deeper
recursion of the function

Actual result:
--
under windows i only see the files that are in the root of the zip
archive, under ubuntu linux everything is ok.


thank you in advance for sacrificing your time





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



#50142 [Opn]: parse_ini_file() constants not used correctly

2009-11-10 Thread fa
 ID:   50142
 Updated by:   f...@php.net
 Reported By:  jparneodo at yahoo dot fr
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: Ubuntu
 PHP Version:  5.2.11
 New Comment:

What PHP version gave you your expected result?

With 5.2.6 I get this last line:
ONE=1 TWO=2.1 THREE=bug.TWO ONE

With 5.3.1-RC I get this:
ONE=1 TWO=2.1 THREE=bug.2.1 1

With 5.2.11 I get this:
ONE=1 TWO=2.1 THREE=bug.TWO ONE


Previous Comments:


[2009-11-10 19:44:38] jparneodo at yahoo dot fr

Description:

Item THREE has bad value.

Input file /tmp/jp.ini:

[CONSTANT]
ONE = 1
TWO = 2. ONE
THREE = bug. TWO ONE


Reproduce code:
---
?php
var_dump($ini1=parse_ini_file('/tmp/jp.ini',true));
define('ONE',$ini1['CONSTANT']['ONE']);
echo sprintf(ONE=%s\n,ONE);

var_dump($ini2=parse_ini_file('/tmp/jp.ini',true));
define('TWO',$ini2['CONSTANT']['TWO']);
echo sprintf(ONE=%s TWO=%s\n,ONE,TWO);

var_dump($ini3=parse_ini_file('/tmp/jp.ini',true));
define('THREE',$ini3['CONSTANT']['THREE']);
echo sprintf(ONE=%s TWO=%s THREE=%s\n,ONE,TWO,THREE);


Expected result:

array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.2.1
  }
}
ONE=1 TWO=2.1 THREE=bug.2.1


Actual result:
--
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1 THREE=c.TWO ONE






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



#50108 [Fbk-Bgs]: PHP crashs while using list() function

2009-11-10 Thread fa
 ID:   50108
 Updated by:   f...@php.net
 Reported By:  fernando dot nemec at gmail dot com
-Status:   Feedback
+Status:   Bogus
 Bug Type: Reproducible crash
 Operating System: Fedora Core 5
 PHP Version:  5.2.11
 New Comment:

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

Thank you for your interest in PHP.




Previous Comments:


[2009-11-09 14:43:26] fernando dot nemec at gmail dot com

Sorry! my mistake.



[2009-11-07 21:20:58] 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.

I can't reproduce it.



[2009-11-07 00:23:32] fernando dot nemec at gmail dot com

Just fixing the summary.



[2009-11-07 00:20:35] fernando dot nemec at gmail dot com

Description:

PHP crashs on incorrectly use of list() function. If list has more
arguments than the input array has elements, then PHP crashs and prints
the message File size limit exceeded. 



Reproduce code:
---
?

# this code was test only in command line
# the interpreter never reach line 7
$foobar = Array( 1);
list( $foo , $bar ) = array_values( $foobar ) ;
print foobar\n ;

?

Expected result:

foobar

Actual result:
--
File size limit exceeded





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



#50082 [Opn-Bgs]: Incorrect test vector CFB/OFB results for Blowfish encryption

2009-11-10 Thread fa
 ID:   50082
 Updated by:   f...@php.net
 Reported By:  gslin at pixnet dot tw
-Status:   Open
+Status:   Bogus
 Bug Type: mcrypt related
 Operating System: FreeBSD 7.2-RELEASE i386
 PHP Version:  5.2.11
 New Comment:

Hello,
this is not a bug in PHP.

cfb/ofb in mcrypt is 8bit by default (see
http://mcrypt.hellug.gr/lib/mcrypt.3.html)

the data given on your link (http://www.schneier.com/code/vectors.txt)
clearly states 64bit cfb/ofb.

Another version of your test script:
?php

$iv = pack('H*', 'FEDCBA9876543210');
printf(iv: %s\n, bin2hex($iv));
$k = pack('H*', '0123456789ABCDEFF0E1D2C3B4A59687');
printf(key: %s\n, bin2hex($k));
$data = pack('H*',
'37363534333231204E6F77206973207468652074696D6520666F722000');
printf(data:(%d) '%s'\n, strlen($data), $data);
printf(data:(%d) '%s'\n, strlen(bin2hex($data)), bin2hex($data));
$cbc = mcrypt_cbc('blowfish', $k, $data, MCRYPT_ENCRYPT, $iv);
printf(cbc: %s\n, bin2hex($cbc));
$cfb = mcrypt_cfb('blowfish', $k, $data, MCRYPT_ENCRYPT, $iv);
printf(cfb: %s\n, bin2hex($cfb));
$ofb = mcrypt_ofb('blowfish', $k, $data, MCRYPT_ENCRYPT, $iv);
printf(ofb: %s\n, bin2hex($ofb));

$td = mcrypt_module_open('blowfish', '', 'ncfb', '');
mcrypt_generic_init($td, $k, $iv);
$x = mcrypt_generic($td, $data);
printf(ncfb: %s\n, bin2hex($x));
$td = mcrypt_module_open('blowfish', '', 'nofb', '');
mcrypt_generic_init($td, $k, $iv);
$x = mcrypt_generic($td, $data);
printf(nofb: %s\n, bin2hex($x));

and the output:
iv: fedcba9876543210
key: 0123456789abcdeff0e1d2c3b4a59687
data:(29) '7654321 Now is the time for '
data:(58) '37363534333231204e6f77206973207468652074696d6520666f722000'
cbc: 6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc
cfb: e7bb1fc3073eb8314b378689fab0b1160244415d4d017fce0d9b4cb2fa
ofb: e7e246a97576bf3da1236575443e0c46bcdb2638fe825603f561ffe6aa
ncfb: e73214a2822139caf26ecf6d2eb9e76e3da3de04d1517200519d57a6c3
nofb: e73214a2822139ca62b343cc5b65587310dd908d0c241b2263c2cf80da


Previous Comments:


[2009-11-04 23:10:21] gslin at pixnet dot tw

Description:

Incorrect results for CFB/OFB Blowfish test vectors
(http://www.schneier.com/code/vectors.txt).

Reproduce code:
---
?php

$iv = pack('H*', 'FEDCBA9876543210');
printf(iv: %s\n, bin2hex($iv));
$k = pack('H*', '0123456789ABCDEFF0E1D2C3B4A59687');
printf(key: %s\n, bin2hex($k));
$data = pack('H*',
'37363534333231204E6F77206973207468652074696D6520666F722000');
printf(data: %s\n, bin2hex($data));
$cbc = mcrypt_cbc('blowfish', $k, $data, MCRYPT_ENCRYPT, $iv);
printf(cbc: %s\n, bin2hex($cbc));
$cfb = mcrypt_cfb('blowfish', $k, $data, MCRYPT_ENCRYPT, $iv);
printf(cfb: %s\n, bin2hex($cfb));
$ofb = mcrypt_cfb('blowfish', $k, $data, MCRYPT_ENCRYPT, $iv);
printf(ofb: %s\n, bin2hex($ofb));

Expected result:

iv: fedcba9876543210
key: 0123456789abcdeff0e1d2c3b4a59687
data: 37363534333231204e6f77206973207468652074696d6520666f722000
cbc: 6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc
cfb: e73214a2822139caf26ecf6d2eb9e76e3da3de04d1517200519d57a6c3
ofb: e73214a2822139ca62b343cc5b65587310dd908d0c241b2263c2cf80da

Actual result:
--
iv: fedcba9876543210
key: 0123456789abcdeff0e1d2c3b4a59687
data: 37363534333231204e6f77206973207468652074696d6520666f722000
cbc: 6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc
cfb: e7bb1fc3073eb8314b378689fab0b1160244415d4d017fce0d9b4cb2fa
ofb: e7bb1fc3073eb8314b378689fab0b1160244415d4d017fce0d9b4cb2fa





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



#49759 [Opn-Fbk]: socket_read() fails to return empty string

2009-10-03 Thread fa
 ID:   49759
 Updated by:   f...@php.net
 Reported By:  chmod3 at googlemail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Sockets related
 Operating System: WinVista  FreeBSD
 PHP Version:  5.3.0
 New Comment:

I think your example code makes no sense.

When I change it a bit, it works as expected (Did you check PHP_BINARY
READ vs. PHP_NORMAL_READ?)

?php
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$connection = socket_connect($socket, 'news.giganews.com', 119);

do {
  $recv = '';
  echo //START READ\n;
  $recv = socket_read($socket, 1 );
  var_dump($recv);
  echo END READ\n\n;

} while($recv != ''  $recv !== false  $recv != \n);

echo 'OUTPUT';
?


I do agree that the docs could be clarified.


Previous Comments:


[2009-10-03 12:42:42] chmod3 at googlemail dot com

Description:

According to documentation:

Note: socket_read() returns a zero length string () when there is no
more data to read.

This does not seem to be the case on my installations:
PHP 5.3.0 WinVista
PHP 5.2.11 WinVista
PHP 5.2.11 FreeBSD
PHP 5.2.10 WinVista
PHP 5.2.9 WinVista

socket_read() just hangs.

Reproduce code:
---
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$connection = socket_connect($socket, 'news.giganews.com', 119);

$response = '';
do {
  $recv = '';
  echo START READ\n;
  $recv = socket_read($socket, 512);
  echo END READ\n;
  var_dump($recv);
  if($recv != '') {
$response .= $recv;
  }
} while($recv != '');

echo 'OUTPUT: ' . $reply;

Expected result:

START READ
END READ
string(23) 200 News.GigaNews.Com

START READ
END READ
OUTPUT: 200 News.GigaNews.Com

Actual result:
--
START READ
END READ
string(23) 200 News.GigaNews.Com

START READ





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



#49741 [Opn]: I have a problem create a phar file on my system

2009-10-03 Thread fa
 ID:   49741
 Updated by:   f...@php.net
 Reported By:  admin at sulehosting dot co dot za
 Status:   Open
 Bug Type: PHAR related
 Operating System: open suse 11.1
 PHP Version:  5.3.0
 New Comment:

Could you please verify that writing to /tmp works at all (for example
file_put_contents() in the same script) and also say if it's 32bit or
64bit


Previous Comments:


[2009-10-02 11:59:35] admin at sulehosting dot co dot za

I tried setting phar.readonly to false, I no longer get the exception
but there is still no phar created on the specified directory.



[2009-10-02 11:37:40] sjo...@php.net

Thank you for your bug report.

Please try setting phar.readonly to false. Does this solve the problem?



[2009-10-01 20:57:16] admin at sulehosting dot co dot za

Description:

I am trying to create a phar file, following examples from the php.net
http://us.php.net/manual/en/phar.using.object.php



Reproduce code:
---
?php
$phar = new Phar(/tmp/first.phar,0,first.phar);
$phar['hello.txt'] = 'hello world';
?

and 

?php
$phar = new Phar(/tmp/first.phar);
$phar['hello.txt'] = 'hello world';
?


Expected result:

I expect a phar file to be created in the tmp directory,

Actual result:
--
UnexpectedValueException: creating archive /tmp/first.phar disabled
by INI setting in /srv/www/htdocs/PHAR/test_phar.php on line 2

Call Stack:
0.0003 323772   1. {main}()
/srv/www/htdocs/PHAR/test_phar.php:0
0.0003 328724   2. Phar-__construct()
/srv/www/htdocs/PHAR/test_phar.php:2

php --ri Phar

Phar

Phar: PHP Archive support = enabled
Phar EXT version = 2.0.0-dev
Phar API version = 1.1.1
CVS revision = $Revision: 1.370.2.62 $
Phar-based phar archives = enabled
Tar-based phar archives = enabled
ZIP-based phar archives = enabled
gzip compression = enabled
bzip2 compression = enabled
OpenSSL support = enabled


Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive = Local Value = Master Value
phar.readonly = On = On
phar.require_hash = On = On
phar.cache_list = no value = no value






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



#49755 [Opn]: iterator_to_array nukes DirectoryIterator

2009-10-02 Thread fa
 ID:   49755
 Updated by:   f...@php.net
 Reported By:  sala...@php.net
 Status:   Open
 Bug Type: SPL related
 Operating System: OS X
 PHP Version:  5.3.0
 New Comment:

Not 5.3.0 only, also reproducable on a
PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2


Previous Comments:


[2009-10-02 19:02:20] sala...@php.net

Description:

When converting a DirectoryIterator instance into an array using
iterator_to_array, the array items appear to be converted to basic
DirectoryIterator instances with none of the file information intact.
The same does not appear to occur for other related classes
(FilesystemIterator, RecursiveDirectoryIterator).

Reproduce code:
---
?php

echo DirectoryIterator:\n;
$dit = new DirectoryIterator(dirname(__FILE__));
$ait = iterator_to_array($dit);
foreach ($ait as $file) {
var_dump($file-getFilename());
}

echo RecursiveDirectoryIterator:\n;
$rdit = new RecursiveDirectoryIterator(dirname(__FILE__));
$ait = iterator_to_array($rdit);
foreach ($ait as $file) {
var_dump($file-getFilename());
}

?

Expected result:

DirectoryIterator:
string(1) .
string(2) ..
string(7) bug.php
RecursiveDirectoryIterator:
string(7) bug.php


Actual result:
--
DirectoryIterator:
string(0) 
string(0) 
string(0) 
RecursiveDirectoryIterator:
string(7) bug.php






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



#49752 [Opn]: reference maintained across different loops

2009-10-02 Thread fa
 ID:   49752
 Updated by:   f...@php.net
 Reported By:  stevew at amainhobbies dot com
 Status:   Open
 Bug Type: Variables related
 Operating System: Win32 / Linux
 PHP Version:  5.2.11
 New Comment:

This has been like this since at least 5.1.6 (just tested) and also in
5.3.0.


Previous Comments:


[2009-10-02 18:24:18] stevew at amainhobbies dot com

Description:

I don't expect the $total in the second foreach to still be a reference
to the last item from the previous foreach.



Reproduce code:
---
?php
  $totals = array(array('class' = 'Foo', 'value' = '1'),
  array('class' = 'Test', 'value' = '2'),
  array('class' = 'Bar', 'value' = '3'));

   foreach ($totals as $total) {
   switch ($total['class']) {
 case 'Test':
$total['value'] *= 2;
break;
  default:
break;
}
  }

  foreach ($totals as $total) {
echo $total['class'] . ' : ' . $total['value'] . \n;
  }
?


Expected result:

Foo : 1
Test : 4
Bar : 3


Actual result:
--
Foo : 1
Test : 4
Test : 4






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



#49750 [Opn-Fbk]: feof return true even this should not happen

2009-10-02 Thread fa
 ID:   49750
 Updated by:   f...@php.net
 Reported By:  donauinsel at hotmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Sockets related
 Operating System: Windows 2003
 PHP Version:  5.2.11
 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.

I don't really get what you mean.
The only reference to end of data I could find in the RFC 821 is:

end of mail data indication
  A special sequence of characters that indicates the end of the
  mail data.  In particular, the five characters carriage return,
  line feed, period, carriage return, line feed, in that order.

But I can't make the connection to feof.

Could you please elaborate and also give example output of your
mailserver (and version, etc.)
Your code snippet gives me this:
string(52) 220 X.X. ESMTP Postfix (Debian/GNU)



Previous Comments:


[2009-10-02 15:30:43] donauinsel at hotmail dot com

Description:

Any SMTP Class may return end-of-data



Reproduce code:
---
?php
$fp = fsockopen('localhost', 25, $errno, $errstr, 10);
if (!$fp) {
echo $errstr ($errno)br /\n;
} else {
  if(!feof($fp)) {
  echo fgets($fp, 100);  
  }  
}
fclose($fp);
?







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



#49700 [Opn]: memory leaks in php_date.c if garbage collector is enabled

2009-10-02 Thread fa
 ID:   49700
 Updated by:   f...@php.net
 Reported By:  indey...@php.net
 Status:   Open
 Bug Type: Date/time related
 Operating System: Mac OS X 10.6.1
 PHP Version:  5.3SVN-2009-09-28 (SVN)
 New Comment:

Probably Mac OS only...

Couldn't reproduce with latest snap (php5.3-200910022030) on Linux x86
without running into a memory_limit of 512 MB with CLI


Previous Comments:


[2009-09-28 17:25:28] indey...@php.net

Description:

If garbage-collector is enabled and large quantity of DateTime objects
is created, php reports memory leaks

Reproduce code:
---
?php

gc_enable();

$objs = array();
foreach (range(1,2) as $i) {
$objs[$i] = new DateTime();
}


Expected result:

DONE

Actual result:
--
DONE
[Mon Sep 28 21:23:24 2009]  Script:  '_mem_test.php'
/Users/indy/Documents/Sources/_mine/php5/ext/date/php_date.c(1137) : 
Freeing 0x106340068 (79 bytes), script=_mem_test.php
Last leak repeated 39993 times
[Mon Sep 28 21:23:24 2009]  Script:  '_mem_test.php'
/Users/indy/Documents/Sources/_mine/php5/ext/date/php_date.c(2088) : 
Freeing 0x106340118 (32 bytes), script=_mem_test.php
Last leak repeated 39993 times
[Mon Sep 28 21:23:24 2009]  Script:  '_mem_test.php'
/Users/indy/Documents/Sources/_mine/php5/ext/date/php_date.c(2091) : 
Freeing 0x106340198 (14 bytes), script=_mem_test.php
Last leak repeated 39993 times
[Mon Sep 28 21:23:24 2009]  Script:  '_mem_test.php'
/Users/indy/Documents/Sources/_mine/php5/ext/date/php_date.c(2078) : 
Freeing 0x106340208 (32 bytes), script=_mem_test.php
Last leak repeated 39993 times
[Mon Sep 28 21:23:24 2009]  Script:  '_mem_test.php'
/Users/indy/Documents/Sources/_mine/php5/ext/date/php_date.c(2084) : 
Freeing 0x106340338 (32 bytes), script=_mem_test.php
Last leak repeated 39993 times
=== Total 199970 memory leaks detected ===






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



#49729 [Opn]: Segfault in PHP 5.3 inside preg_replace

2009-10-01 Thread fa
 ID:   49729
 Updated by:   f...@php.net
 Reported By:  kendallb at amainhobbies dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: Mac OS 10.6.1
 PHP Version:  5.3.0
 New Comment:

Not reproducible on Linux x86, so maybe Mac only.


Previous Comments:


[2009-10-01 02:00:38] kendallb at amainhobbies dot com

Description:

The following code causes a crash in PHP 5.3.0 (or 5.2.10) as supplied
by Zend Studio 7. It also causes a crash in PHP 5.3.0 as compiled by
MacPorts, so it appears to be a generic bug. 

Reproduce code:
---
?php
/**
 * Cause a segfault in PHP 5.3.0
 */

$html = 
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!  
THIS IS A BUNCH OF BULLSHIT!!!   THIS IS A BUNCH OF BULLSHIT!!!
  THIS IS A BUNCH OF 

#48164 [Opn-Fbk]: Script stops during a while

2009-05-06 Thread fa
 ID:   48164
 Updated by:   f...@php.net
 Reported By:  uvealonso at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Performance problem
 Operating System: Linux
 PHP Version:  5.2.9
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to Open.

Thank you for your interest in PHP.


I really think we need even a rough description what func_modify()
does. From your description it could be a single complicated task or
something with thousands of iterations


Previous Comments:


[2009-05-06 13:01:00] uvealonso at gmail dot com

Description:

Sometimes, the script stops 10 secs after the start, and others, it
doesn't stop and complete the operations...

I have tested with the same data and parameters, and sometimes, it
stops 10 secs after the script starts.

max_execution_time is 50

Reproduce code:
---
print start;

while ($a){
func_modify($a); //Here is a function that modifies $a
}

print end;

Expected result:

start
end

Actual result:
--
sometimes:
start

or

start
end





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



#48163 [Fbk]: FILTER_CALLBACK generates strange results

2009-05-06 Thread fa
 ID:   48163
 Updated by:   f...@php.net
 Reported By:  redaction at nuxwin dot com
 Status:   Feedback
 Bug Type: Filter related
 Operating System: debian
 PHP Version:  5.2.9
 New Comment:

works fine for me with 5.2.9 release and CLI


Previous Comments:


[2009-05-06 13:40:06] j...@php.net

Please try using this CVS snapshot:

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

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

Works fine for me..



[2009-05-06 11:50:29] redaction at nuxwin dot com

excuse, :

Actual result:
preArray
(
[0] =
#65533;#65533;#65533;)#65533;#65533;#65533;#65533;#65533;#65533;
)
/pre



[2009-05-06 11:48:36] redaction at nuxwin dot com

Description:

HI all,

When I apply a one trim callback via filter, I get an erroneous result
on the display.

Sorry , i'm french...

Reproduce code:
---
$_SERVER['REMOTE_ADDR'] = '80.10.20.30  ';

$remote_addr_list = explode(',', $_SERVER['REMOTE_ADDR']);
filter_var_array(array('remote_addr_list' = $remote_addr_list),
array('remote_addr_list' = array('filter' = FILTER_CALLBACK,
'options' = 'trim','flags'=
FILTER_REQUIRE_ARRAY|FILTER_FORCE_ARRAY)));

I has this result :

echo 'pre';
print_r($remote_addr_list);
echo '/pre';


Expected result:

Array
(
[0] = 80.10.20.30
)

Actual result:
--
Array
(
[0] =
#65533;#65533;#65533;)#65533;#65533;#65533;#65533;#65533;#65533;
)





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



#48167 [Fbk]: undefined function checkdnsrr()

2009-05-06 Thread fa
 ID:   48167
 Updated by:   f...@php.net
 Reported By:  frew dot robert at gmail dot com
 Status:   Feedback
 Bug Type: *Network Functions
 Operating System: Linux
 PHP Version:  5.3.0RC1
 New Comment:

That's not mentioned in the documentation, shouldn't this be converted
to a documentation bug then?


Previous Comments:


[2009-05-06 16:41:58] scott...@php.net

This function is only available if the configure script can find bind
on your system.

If you look at your config.log you'll probably find that its missing.



[2009-05-06 16:32:48] frew dot robert at gmail dot com

Description:

When using function checkdnsrr(), I get a Fatal error: Call to
undefined function checkdnsrr() in test.php.

You can view this error live at http://www.mxxm.com/test.php.



Reproduce code:
---
?
$ip = $_SERVER['REMOTE_ADDR'];
if (checkdnsrr($ip, MX)) {
echo 'Yes';
} else {
echo 'No';
}
?

Expected result:

True or false.

Actual result:
--
Fatal error: Call to undefined function checkdnsrr()





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



#48170 [Opn-Fbk]: Array key differentiates between unicode and binary strings

2009-05-06 Thread fa
 ID:   48170
 Updated by:   f...@php.net
 Reported By:  rodrigosouzadossantos at gmai dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *Unicode Issues
 Operating System: Debian Lenny
 PHP Version:  6CVS-2009-05-06 (snap)
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to Open.

Thank you for your interest in PHP.


Works for me with CVS HEAD on Debian lenny.
Are you sure the input from Postgres is not to blame?

Code:
-
$result[ 'app1' ] = 'app value';
$result[ 'app2' ] = 'some value';

print_r( $result );

var_dump( $result[ 'app1' ] );
var_dump( $result[ b'app1' ] );

Result:
---
Array
(
[app1] = app value
[app2] = some value
)
unicode(9) app value
NULL
 


Previous Comments:


[2009-05-06 18:00:14] rodrigosouzadossantos at gmai dot com

Description:

I have a array that is populated with result query from a Postgres. The
keys of array are the field name and the value are the field value. Like
this:

Array
(
[app1] = app value
[app2] = some value
)

Reproduce code:
---
$result[ 'app1' ] = 'app value';
$result[ 'app2' ] = 'some value';

print_r( $result );

var_dump( $result[ 'app1' ] );

Expected result:

string(9) app value


Actual result:
--
NULL


The result of var_dump is correct when is puts a 'b' (binary) before
string, like:

var_dump( $result[ b'app1' ] );

Is it the expected behavior?





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



#48164 [Fbk]: Script stops during a while

2009-05-06 Thread fa
 ID:   48164
 Updated by:   f...@php.net
 Reported By:  uvealonso at gmail dot com
 Status:   Feedback
 Bug Type: Performance problem
 Operating System: Linux
 PHP Version:  5.2.9
 New Comment:

Can't reproduce with 5.2.9 CLI, could you provide some more details
about distribution, sapi, etc?
Or maybe test them on CLI?

(f...@debian):(~/code/src) $ time ./php-5.2.9/sapi/cli/php
~/tmp/while_48164-2.php  FOO2

real0m15.011s
user0m0.120s
sys 0m14.893s
(f...@debian):(~/code/src) $ time ./php-5.2.9/sapi/cli/php
~/tmp/while_48164.php  FOO

real0m15.020s
user0m0.160s
sys 0m14.749s

== FOO ==
START AT: 1241598435.2784
== FOO2 ==
START AT: 1241598254.2014

== FOO ==
END AT: 15.04053116
== FOO2 ==
END AT: 15.02145767


Previous Comments:


[2009-05-06 19:49:40] uvealonso at gmail dot com

Ok, I give you this 2 codes:


First:
/
$tiempo1=microtime(true);
print START AT: .$tiempo1.br;

//DO IT 15 SECONDS
while((microtime(true)-$tiempo1)15){
//PRINT EVERY STEP
print STEP: .(microtime(true)-$tiempo1).br;
}

//IT MUST END 15 SECS AFTER THE START
print brEND AT: .(microtime(true)-$tiempo1);



Second:
//
$tm1=microtime(true);
print START AT: .$tm1.br;
$t=0;

//DO IT 15 SECONDS
while((microtime(true)-$tm1)15){

//PRINT STEPS OF 0.1 SECS
if ((microtime(true)-$tm1)-$t0.1){
print STEP: .(microtime(true)-$tm).br;
$t=microtime(true)-$tm1;
}
}

//IT MUST END 15 SECS AFTER THE START
print brEND AT: .(microtime(true)-$tm1);




The 2 scripts must stop inmediately after 15 secs.
The first works fine, but 2º stops after 10 seconds...

You cant test it here:
First example:
http://www.4mula1.es/libraries/pruebas/timeout-test-1.php
Second example:
http://www.4mula1.es/libraries/pruebas/timeout-test-2.php



PS: They have exactly the same code that I have wrote in this comment.



[2009-05-06 13:36:47] f...@php.net

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to Open.

Thank you for your interest in PHP.


I really think we need even a rough description what func_modify()
does. From your description it could be a single complicated task or
something with thousands of iterations



[2009-05-06 13:01:00] uvealonso at gmail dot com

Description:

Sometimes, the script stops 10 secs after the start, and others, it
doesn't stop and complete the operations...

I have tested with the same data and parameters, and sometimes, it
stops 10 secs after the script starts.

max_execution_time is 50

Reproduce code:
---
print start;

while ($a){
func_modify($a); //Here is a function that modifies $a
}

print end;

Expected result:

start
end

Actual result:
--
sometimes:
start

or

start
end





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



#48153 [Opn-Ver]: php segfault in pcre function match

2009-05-05 Thread fa
 ID:   48153
 Updated by:   f...@php.net
 Reported By:  raul dot gigea at directmedia dot de
-Status:   Open
+Status:   Verified
 Bug Type: Reproducible crash
 Operating System: FreeBSD 7.1-RELEASE-p4
 PHP Version:  5.2CVS-2009-05-05 (snap)
 New Comment:

verified with FreeBSD 7.1-RELEASE-p4 and current snapshot:
Segmentation fault: 11 (core dumped)
Although I didn't examine the coredump in detail


HEAD works fine


Previous Comments:


[2009-05-05 16:22:03] raul dot gigea at directmedia dot de

Description:

Hi, i mananged to reproduce this bug on various clean FreeBSD systems 
with php version 5.2.9, than compiled todays cvs snapshot version and 
the bug is still reproducible. 

Memory limit was 128MB which should be more than enough for the code 
that produced the crash.

Stacksize was 64MB. ( ulimit -s )

5.2.6 works fine. Also, disabling mhash extension fixes the problem.

Reducing pcre.recursion_limit and pcre.backtrack_limit in php.ini also

fixes the problem, but creates a new one, because the preg_replace 
function doesn't produce the expected results any more. ( They have to

be reduced to about 50, so that the segfault doesn't occur ) 

Details follow.

Configure Line: ./configure --with-mhash
List of modules: 

List of Modules:
./sapi/cli/php -m
[PHP Modules]
ctype
date
dom
filter
hash
iconv
json
libxml
mhash
pcre
PDO
pdo_sqlite
posix
Reflection
session
SimpleXML
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter

[Zend Modules]


Reproduce code:
---
$contents = 'd' . str_repeat('a', 1900) . 'b';
$contents = preg_replace('/d(a)+b/', '', $contents);


Expected result:

$contents should be empty.

Actual result:
--
segmentation fault (core dumped)  ./sapi/cli/php ~/test.php

-
Backtrace
-

... starts with 1400 times the same call to match ... ( stack overflow

)
#1400 0x0808e030 in match (eptr=0x28923db9 'a' repeats 200 times...,

ecode=0x28a1666d _, mstart=0x28923db8 d, 'a' repeats 199 
times..., offset_top=2, md=0xbfbfcc30, ims=0, eptrb=0x0, flags=0, 
rdepth=0) at /usr/home/raul/php-snapshot/php5.2-
200905051430/ext/pcre/pcrelib/pcre_exec.c:720
#1401 0x0809b118 in php_pcre_exec (argument_re=0x28a16640, 
extra_data=0xbfbfcd80, subject=0x28923db8 d, 'a' repeats 199 
times..., length=1902, start_offset=0, options=0, offsets=0x2892253c,

offsetcount=6)
at /usr/home/raul/php-snapshot/php5.2-
200905051430/ext/pcre/pcrelib/pcre_exec.c:4895
#1402 0x080a10e6 in php_pcre_replace_impl (pce=0x28a15d40, 
subject=0x28923db8 d, 'a' repeats 199 times..., subject_len=1902, 
replace_val=0x28921db4, is_callable_replace=0, result_len=0xbfbfcf04, 
limit=-1, replace_count=0x0) at /usr/home/raul/php-
snapshot/php5.2-200905051430/ext/pcre/php_pcre.c:1045
#1403 0x080a0e86 in php_pcre_replace (regex=0x28923d80 /d(a)+b/, 
regex_len=8, subject=0x28923db8 d, 'a' repeats 199 times..., 
subject_len=1902, replace_val=0x28921db4, is_callable_replace=0, 
result_len=0xbfbfcf04, limit=-1, replace_count=0x0) at 
/usr/home/raul/php-snapshot/php5.2-
200905051430/ext/pcre/php_pcre.c:955
---Type return to continue, or q return to quit---
#1404 0x080a1d66 in php_replace_in_subject (regex=0x28921e2c, 
replace=0x28921db4, subject=0x28917a60, result_len=0xbfbfcf04, limit=-
1, is_callable_replace=0 '\0', replace_count=0x0)
at /usr/home/raul/php-snapshot/php5.2-
200905051430/ext/pcre/php_pcre.c:1272
#1405 0x080a2684 in preg_replace_impl (ht=3, return_value=0x28923378, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
is_callable_replace=0 '\0')
at /usr/home/raul/php-snapshot/php5.2-
200905051430/ext/pcre/php_pcre.c:1370
#1406 0x080a2735 in zif_preg_replace (ht=3, return_value=0x28923378, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at 
/usr/home/raul/php-snapshot/php5.2-
200905051430/ext/pcre/php_pcre.c:1386
#1407 0x083373d0 in zend_do_fcall_common_helper_SPEC 
(execute_data=0xbfbfd128) at zend_vm_execute.h:200
#1408 0x0833cff9 in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0xbfbfd128) at zend_vm_execute.h:1739
#1409 0x08336f22 in execute (op_array=0x28922580) at 
zend_vm_execute.h:92
#1410 0x08311592 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /usr/home/raul/php-snapshot/php5.2-
200905051430/Zend/zend.c:1134
#1411 0x082bd926 in php_execute_script (primary_file=0xbfbfe7d4) at 
/usr/home/raul/php-snapshot/php5.2-200905051430/main/main.c:2025
#1412 0x08390d62 in main (argc=2, argv=0xbfbfe8bc) at 
/usr/home/raul/php-snapshot/php5.2-
200905051430/sapi/cli/php_cli.c:1162

-
The match function recursively calls itself until stack overflow:
-

#1400 0x0808e030 in match (eptr=0x28923db9 'a' repeats 200 times...,

ecode=0x28a1666d _, mstart=0x28923db8 d, 

#48134 [Fbk-Opn]: php crash after a few days (backtrace attached)

2009-05-05 Thread fa
 ID:   48134
 Updated by:   f...@php.net
 Reported By:  jimbobpalmer at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: Gentoo
 PHP Version:  5.2.9


Previous Comments:


[2009-05-05 13:54:51] jimbobpalmer at gmail dot com

I've rebuilt php with the debug flag so that the next backtrace is more
useful.

Please can you change the status of this bug to open. Thanks.



[2009-05-05 13:33:19] jimbobpalmer at gmail dot com

backtrace from coredump:

#0  0xb7612052 in apply_config () from
/usr/lib/apache2/modules/libphp5.so
#1  0xb76114af in ?? () from /usr/lib/apache2/modules/libphp5.so
#2  0x08987108 in ?? ()
#3  0x0ad8b230 in ?? ()
#4  0xb76107c0 in ?? () from /usr/lib/apache2/modules/libphp5.so
#5  0x08063c00 in __ctype_toupper_...@plt ()
#6  0x0aa8b098 in ?? ()
#7  0x0aa8b060 in ?? ()
#8  0xa42b8188 in ?? ()
#9  0xb7d0dff4 in ?? () from /usr/lib/libapr-1.so.0
#10 0x08987108 in ?? ()
#11 0x0ad8b180 in ?? ()
#12 0x0ad8b198 in ?? ()
#13 0xb7cf7c1f in apr_table_setn () from /usr/lib/libapr-1.so.0
#14 0x0807a127 in ap_run_handler ()
#15 0x0807d4b1 in ap_invoke_handler ()
#16 0x080887e6 in ap_process_request ()
#17 0x080857d8 in ?? ()
#18 0x0aa89428 in ?? ()
#19 0x0004 in ?? ()
#20 0x0aa89428 in ?? ()
#21 0x in ?? ()

I can't supply the coredump due to policy reasons, but I can run more
commands if you need me to with gdb.



[2009-05-05 13:31:15] jimbobpalmer at gmail dot com

With 5.2.9:

[Tue May  5 15:03:32 2009] pid 27627 mod_backtrace backtrace for sig 11
(thread pid 27627)
[Tue May  5 15:03:32 2009] pid 27627 mod_backtrace main() is at
8066050
/usr/lib/apache2/modules/mod_backtrace.so[0xb7ae2a9a]
/usr/sbin/apache2(ap_run_fatal_exception+0x3f)[0x80827ef]
/usr/sbin/apache2[0x8082be8]
[0xb7ef8400]
/usr/lib/apache2/modules/libphp5.so[0xb76114af]
/usr/sbin/apache2(ap_run_handler+0x57)[0x807a127]
/usr/sbin/apache2(ap_invoke_handler+0x91)[0x807d4b1]
/usr/sbin/apache2(ap_process_request+0x196)[0x80887e6]
/usr/sbin/apache2[0x80857d8]
/usr/sbin/apache2(ap_run_process_connection+0x57)[0x80814b7]
/usr/sbin/apache2[0x808e6ac]
/usr/lib/libapr-1.so.0[0xb7d08e8e]
/lib/libpthread.so.0[0xb7c9519b]
/lib/libc.so.6(clone+0x5e)[0xb7c1986e]
[Tue May  5 15:03:32 2009] pid 27627 mod_backtrace end of backtrace



[2009-05-03 12:33:59] j...@php.net

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to Open.
Again, thank you for your continued support of PHP.





[2009-05-03 11:03:52] jimbobpalmer at gmail dot com

Description:

5.2.8-pl2-gentoo, I can't upgrade atm. No crashes for a few days, then
logs, like this one:

Backtrace:

pid 19488 mod_backtrace main() is at 8066050
/usr/lib/apache2/modules/mod_backtrace.so[0xb7b7aa9a]
/usr/sbin/apache2(ap_run_fatal_exception+0x3f)[0x80827ef]
/usr/sbin/apache2[0x8082be8]
[0xb7f67400]
/usr/lib/apache2/modules/libphp5.so[0xb78407cf]
/usr/sbin/apache2(ap_run_handler+0x57)[0x807a127]
/usr/sbin/apache2(ap_invoke_handler+0x91)[0x807d4b1]
/usr/sbin/apache2(ap_process_request+0x196)[0x80887e6]
/usr/sbin/apache2[0x80857d8]
/usr/sbin/apache2(ap_run_process_connection+0x57)[0x80814b7]
/usr/sbin/apache2[0x808e6ac]
/usr/lib/libapr-1.so.0[0xb7d77e8e]
/lib/libpthread.so.0[0xb7d0419b]
/lib/libc.so.6(clone+0x5e)[0xb7c8886e]

I have to restart Apache.






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



#47691 [Opn-Ver]: strtr bug. Not replace unicode values from array, in binary string.

2009-05-05 Thread fa
 ID:   47691
 Updated by:   f...@php.net
 Reported By:  strike at true-vision dot net
-Status:   Open
+Status:   Verified
 Bug Type: Strings related
 Operating System: Fedora 8.0
 PHP Version:  6CVS-2009-03-17 (snap)
 New Comment:

Verified on Debian lenny:

(f...@debian):(~/code/src/php6) $ ~/local/php6/bin/php
~/tmp/strtr_47691.php
string(3) AAA
array(1) {
  [uAAA]=
  unicode(3) BBB
}
string(3) AAA

Seems to be ok on FreeBSD 7.1:

(f...@freebsd):(/usr/home/fa/code/php6) $ ~/local/test/bin/php
~/tmp/strtr_47691.php
string(3) AAA
array(1) {
  [AAA]=
  string(3) BBB
}
string(3) BBB


Previous Comments:


[2009-03-18 14:09:20] strike at true-vision dot net

Description:

Found bug in function strtr...
Not replace unicode values from array, in binary string.

Reproduce code:
---
?php
$a = (binary)AAA; // In my code I use file_get_contents
// function retrun binary value
$b = array(AAA = BBB);
$c = strtr($a, $b);
var_dump($a);
var_dump($b);
var_dump($c);
?

Expected result:

string(3) AAA 
array(1) { [uAAA]= unicode(3) BBB } 
string(3) BBB 

Actual result:
--
string(3) AAA 
array(1) { [uAAA]= unicode(3) BBB } 
string(3) AAA



[2009-03-17 14:22:09] strike at true-vision dot net

Description:

Found bug in function strtr...
Not replace unicode values from array, in binary string.

Reproduce code:
---
php
$a = (binary)AAA; // In my code I use file_get_contents
// function retrun finary value
$b = array(AAA = BBB);
$c = strtr($a, $b);
var_dump($a);
var_dump($b);
var_dump($c);
?

Expected result:

string(3) AAA 
array(1) { [uAAA]= unicode(3) BBB } 
string(3) AAA 

Actual result:
--
This is bug ?





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



#48149 [Opn-Ver]: Cannot make interval parts larger than 9999.

2009-05-04 Thread fa
 ID:   48149
 Updated by:   f...@php.net
 Reported By:  lists at reptiliannature dot org
-Status:   Open
+Status:   Verified
 Bug Type: Date/time related
 Operating System: ALL
 PHP Version:  5.3.0RC1
 New Comment:

Still present in 5.3.0RC2


Previous Comments:


[2009-05-04 21:20:13] lists at reptiliannature dot org

Description:

This bug seems to be identical to http://bugs.php.net/bug.php?id=45545
which was marked closed.

It appears than when part of the interval is greater than  the
DateInterval throws an exception.

DateInterval::__construct(): Unknown or bad format (PT1M);

This happens with years, days, hours, minutes, and seconds

Reproduce code:
---
$i = 900;
while ($i) {
try {
$di = new DateInterval('PT' . $i . 'M');
}
catch (exception $e) {
var_dump($i);
echo $e-getMessage();
break;
}
$i++;
}

Expected result:

I would expect to have a DateInterval object with interval ('PT1000M')
or greater.

Actual result:
--
DateInterval::__construct(): Unknown or bad format (PT1M);





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



#48095 [Opn-Ver]: Load RDF Format Error

2009-04-28 Thread fa
 ID:   48095
 Updated by:   f...@php.net
 Reported By:  pigo_chu at hotmail dot com
-Status:   Open
+Status:   Verified
 Bug Type: *XML functions
 Operating System: win32 only - Windows XP SP3
 PHP Version:  5.2.9
 New Comment:

The URL mentioned passes http://www.w3.org/RDF/Validator/ as of now.
5.2.9 on Linux reads it correctly,
5.2.9-2 on XP / SP3 yields this result:

PHP Warning:  simplexml_load_file(): input conversion failed due to
input error, bytes 0xA1 0xFE 0xA6 0xCC in D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file(): input conversion failed due to
input error, bytes 0xA1 0xFE 0xA6 0xCC in D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file(): encoder
errorhttp://www.nownews.com/rss/realtime.rdf:79: parser error :
Premature end of data in tag title line 79 in D:\code\48095.php on line
2
PHP Warning:  simplexml_load_file():
title#31933;#23376;#25512;#34214; in D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file():^ in
D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file():
http://www.nownews.com/rss/realtime.rdf:79: parser error : Premature end
of data in tag item line 77 in D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file():
title#31933;#23376;#25512;#34214; in D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file():^ in
D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file():
http://www.nownews.com/rss/realtime.rdf:79: parser error : Premature end
of data in tag RDF line 2 in D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file():
title#31933;#23376;#25512;#34214; in D:\code\48095.php on line 2
PHP Warning:  simplexml_load_file():^ in
D:\code\48095.php on line 2


Previous Comments:


[2009-04-28 03:25:07] pigo_chu at hotmail dot com

Description:

The url http://www.nownews.com/rss/realtime.rdf is rdf document
Use any xml function(simplexml or domdocument) to load the url
On Linux PHP 5.2.9 is ok
On Windows XP SP3 has error

Reproduce code:
---
$doc = simplexml_load_file('http://www.nownews.com/rss/realtime.rdf');
var_dump($doc);



Expected result:

output is 'false'






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



#48029 [Fbk-Csd]: require function fails with fatal error

2009-04-21 Thread fa
 ID:   48029
 Updated by:   f...@php.net
 Reported By:  info at rkphoto dot co dot uk
-Status:   Feedback
+Status:   Closed
 Bug Type: Scripting Engine problem
 Operating System: Mac OS X
 PHP Version:  5.3.0RC1
 New Comment:

Closing this bug then.


Previous Comments:


[2009-04-20 23:32:48] info at rkphoto dot co dot uk

Err - Sorry, jumped in too soon there, Looks like it now works as 
advertised - Thanks for your help!



[2009-04-20 22:46:48] info at rkphoto dot co dot uk

No, same thing with PHP 5.3.0RC2-dev



[2009-04-20 18:23:44] j...@php.net

Please try using this CVS snapshot:

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

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





[2009-04-20 18:20:19] info at rkphoto dot co dot uk

Description:

The require function produces a fatal error or expects arguments that 
have been removed from previous versions of the 'included' functions

Reproduce code:
---
Calling code:

?php require('includes/mainMenu2.php'); ?
html
  head/head
  body?php mainMenu(); ?/body
/html

Test Code in mainMenu2.php:

function mainMenu() {
echo 'mainMenu() called';
}


Expected result:

mainMenu() called

Actual result:
--
Warning: require(includes/mainMenu2.php) [function.require]: failed to

open stream: No such file or directory in 
/Library/WebServer/Documents/rk/require2.php on line 1

Fatal error: require() [function.require]: Failed opening required 
'includes/mainMenu2.php' (include_path='.:/usr/local/lib/php') in 
/Library/WebServer/Documents/rk/require2.php on line 1


This was the second incarnation of the problem - the first time I was 
working with mainMenu,php, and calling mainMenu() with one argument. I

had the same error as above, but later this morphed into the error 
below after it dropped the fatal  error and just decided to object to 
the argument change instead.

Warning: Missing argument 1 for mainMenu(), called in 
/Library/WebServer/Documents/rk/require.php on line 4 and defined in 
/Library/WebServer/Documents/rk/includes/mainMenu.php on line 2

Matching the arguments stops this error message, but produces 
truncated html as the view source shows: 

html
  head/head
  body










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



#44876 [Opn-WFx]: stripslashes() removes backslashes in wrong cases

2008-05-02 Thread fa
 ID:   44876
 Updated by:   [EMAIL PROTECTED]
 Reported By:  c dot onogol at gmail dot com
-Status:   Open
+Status:   Wont fix
 Bug Type: Scripting Engine problem
 Operating System: Windows NT
 PHP Version:  5.2.5
 New Comment:

This is expected behaviour and has always been this way.


Previous Comments:


[2008-04-30 21:16:17] c dot onogol at gmail dot com

Description:

stripslashes is supposed to remove backslashes added by addslashes():
from the doc:
   stripslashes — Un-quote string quoted with addslashes()
   addslashes — Quote string with slashes


stripslashes return values from the documentation:
Returns a string with backslashes stripped off. (\' becomes ' and so
on.) Double backslashes (\\) are made into a single backslash (\).

The problem is that it removes single backslashes that are not escaping
any quotes/slashes.
For example, this one \ that one should stay the same after running
stripslashes(), but it actually is stripping the backslash, so the end
result of stripslashes(this one \ that one) is this one that one.

the backslash in this one \ that one is part of the original text and
is not a backslash addslashes() would add.










Reproduce code:
---
?
$str = this one \ should stay. it\'s a \test\;
$str = stripslashes($str);
var_dump($str);
?

Expected result:

string(37) this one \ should stay. it's a test

Actual result:
--
string(36) this one should stay. it's a test





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



#44893 [Opn-Fbk]: gzfile

2008-05-02 Thread fa
 ID:   44893
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sworddragon2 at aol dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Zlib Related
 Operating System: Windows XP Professional SP3
 PHP Version:  5.2.6
 New Comment:

Couldn't reproduce on Win XP SP2 with php-5.2.6-Win32.zip


Previous Comments:


[2008-05-02 16:31:23] sworddragon2 at aol dot com

Description:

If im trying to use the function gzfile() to a compressed file, that
includes just a picture, the function don't read the complete file. On
this reproduce, the function stops after the End Transmission Block.

Reproduce code:
---
$file=fopen(smiley1.gif,rb);
$picture=fread($file,filesize(smiley1.gif));
fclose($file);
$file=gzopen(smiley1.gz,w);
gzwrite($file,$picture);
gzclose($file);
$file=gzfile(smiley1.gz);
print_r($file);

Expected result:

I expect to see all arrays until the end of the file.

Actual result:
--
With gzfile, i got just the array [0] with the content GIF89a





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



#44879 [Opn-Csd]: redundant php_mysql.dll

2008-05-02 Thread fa
 ID:   44879
 Updated by:   [EMAIL PROTECTED]
 Reported By:  agreenhi at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: *Configuration Issues
 Operating System: Windows XP
 PHP Version:  5.2.5
 New Comment:

Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

Fixed in 5.2.6


Previous Comments:


[2008-05-01 08:15:54] agreenhi at gmail dot com

Description:

The line:
extension=php_mysql.dll
appears twice. Once in the dynamic extentions section, and once again
in the [PHP_MYSQL] section. This occured after using the windows
installer.

Expected result:

PHP to start.

Actual result:
--
This appears to hang PHP in the start-up process with the error that
MySQL is already open.
When the second extension=php_mysql.dll is removed all is good!





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



#44865 [Opn-Bgs]: max_file_size produces no error

2008-05-02 Thread fa
 ID:   44865
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jahajee dot com at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: linux
 PHP Version:  4.4.8
 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.

Please see http://php.net/manual/en/features.file-upload.errors.php -
this looks like what you need.


Previous Comments:


[2008-04-29 23:38:40] jahajee dot com at gmail dot com

Description:

I'm using optional file upload form with max file upload size of 200 Kb
.Error check by backend script is done and error reported till the Max
file size is 2 Mb (PHP max file size setting) .Since after that if the
file size increases no file is actually send and hence the form is
processed without any warning to the user. For example if the user
uploads file of 1.6 Mb say then he gets an error that the file size is
more than 200 Kb but if the uploaded file size is 2.3Mb no file is
uploaded and the whole form processed without any error.
Saw the same in other discussions but of no help .Can't use the GET
method as the upload file is optional in the form.
Jahajee

Expected result:

Expects to warn the user even if the file size is more than 2Mb(PHP Max
file size setting)

Actual result:
--
No error reported and file processed without the uploaded file





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