#47894 [NEW]: Request: Support multi threading/multiple CPU cores

2009-04-04 Thread ryan14 at mail dot com
From: ryan14 at mail dot com
Operating system: Windows/Linux
PHP version:  5.3.0RC1
PHP Bug Type: Feature/Change Request
Bug description:  Request: Support multi threading/multiple CPU cores

Description:

PHP doesn't currently support Multi threading and multiple core CPU's. All
new CPU's have multiple cores like intel's quad core CPU which has 4 cores
and some motherboards have two CPU sockets so 2 quad core CPU's would mean
there would be 8 cores.
 PHP should support Multi threading and multiple core CPU's because it
will mean people won't need to have as many servers in their cluster,
because alot of CPU power is being wasted because PHP doesn't support Multi
threading and multiple core CPU's. 
 You can read more about it here:

http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html

So please PHP, the next version of PHP should support Multi threading and
multiple core CPU's. If you have to work with the mysql and apache teams
with this then please do it.

Can you pass on my feature request to the php team?

Thanks


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



#47880 [Asn]: Garbage Collector crashes

2009-04-04 Thread patric at zap dot lu
 ID:   47880
 User updated by:  patric at zap dot lu
 Reported By:  patric at zap dot lu
 Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: Debian Lenny
 PHP Version:  5.3.0RC1
 Assigned To:  dmitry
 New Comment:

Yes the last testcase created infinite recursion, nevertheless it
should not core dump but reach memory exhausted at the end?

I got a new testcase, I isolated the parts in the framework which
lead to the segfault.

Stripped it down to some weird chain of operations, which lead to
segfault.

This time no deep recursion, at a depth of 18 it begins to segfault.


The piece of code:

class bomb {
static function go($pDepth) {
if ($pDepth0)
 call_user_func_array(array('bomb', 'go'),array($pDepth-1));

 $backtrace = debug_backtrace(false);
 foreach ($backtrace as $k=$e) 
  foreach ($e['args'] as $kk=$arg)
   if (is_array($arg))
$backtrace[$k]['args'][$kk]= 'Foobar';  

 }
}

bomb::go(18);   

### GDB ###

Program terminated with signal 11, Segmentation fault.
[New process 25022]
#0  _zend_mm_free_int (heap=0x9eb81b8, p=0x9fe2da0) at
/blade/install/daemon/php/Zend/zend_alloc.c:1979
1979if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
(gdb) bt
#0  _zend_mm_free_int (heap=0x9eb81b8, p=0x9fe2da0) at
/blade/install/daemon/php/Zend/zend_alloc.c:1979
#1  0x0832114d in _zval_ptr_dtor (zval_ptr=0x9feb5bc) at
/blade/install/daemon/php/Zend/zend_variables.h:35
#2  0x08337c1e in zend_hash_destroy (ht=0x9fdfc44) at
/blade/install/daemon/php/Zend/zend_hash.c:526
#3  0x0832be75 in _zval_dtor_func (zvalue=0x9fe27c4) at
/blade/install/daemon/php/Zend/zend_variables.c:43
#4  0x0832114d in _zval_ptr_dtor (zval_ptr=0x9fdae88) at
/blade/install/daemon/php/Zend/zend_variables.h:35
#5  0x08337c1e in zend_hash_destroy (ht=0x9febac4) at
/blade/install/daemon/php/Zend/zend_hash.c:526
#6  0x0832be75 in _zval_dtor_func (zvalue=0x9fe0eb8) at
/blade/install/daemon/php/Zend/zend_variables.c:43
#7  0x0832114d in _zval_ptr_dtor (zval_ptr=0x9feb590) at
/blade/install/daemon/php/Zend/zend_variables.h:35
#8  0x08337c1e in zend_hash_destroy (ht=0x9fdf82c) at
/blade/install/daemon/php/Zend/zend_hash.c:526
#9  0x0832be75 in _zval_dtor_func (zvalue=0x9fdf1c0) at
/blade/install/daemon/php/Zend/zend_variables.c:43
#10 0x0832114d in _zval_ptr_dtor (zval_ptr=0xa0111c0) at
/blade/install/daemon/php/Zend/zend_variables.h:35
#11 0x0834e816 in zend_leave_helper_SPEC (execute_data=0x1) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:157
#12 0x08354b8e in execute (op_array=0x9fdd56c) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:104
#13 0x08321ab7 in zend_call_function (fci=0xbfe4521c,
fci_cache=0xbfe45240)
at /blade/install/daemon/php/Zend/zend_execute_API.c:936
#14 0x08269947 in zif_call_user_func_array (ht=2,
return_value=0x9fdefd0, return_value_ptr=0x0, this_ptr=0x0,
return_value_used=0)
at /blade/install/daemon/php/ext/standard/basic_functions.c:4745
#15 0x08376a59 in zend_do_fcall_common_helper_SPEC
(execute_data=0xa010ee8) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:313
#16 0x08354b8e in execute (op_array=0x9fdd56c) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:104
#17 0x08321ab7 in zend_call_function (fci=0xbfe4542c,
fci_cache=0xbfe45450)
at /blade/install/daemon/php/Zend/zend_execute_API.c:936
#18 0x08269947 in zif_call_user_func_array (ht=2,
return_value=0x9fdedc4, return_value_ptr=0x0, this_ptr=0x0,
return_value_used=0)
at /blade/install/daemon/php/ext/standard/basic_functions.c:4745
#19 0x08376a59 in zend_do_fcall_common_helper_SPEC
(execute_data=0xa010c78) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:313
#20 0x08354b8e in execute (op_array=0x9fdd56c) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:104
#21 0x08321ab7 in zend_call_function (fci=0xbfe4563c,
fci_cache=0xbfe45660)
at /blade/install/daemon/php/Zend/zend_execute_API.c:936
#22 0x08269947 in zif_call_user_func_array (ht=2,
return_value=0x9fdebb8, return_value_ptr=0x0, this_ptr=0x0,
return_value_used=0)
at /blade/install/daemon/php/ext/standard/basic_functions.c:4745
#23 0x08376a59 in zend_do_fcall_common_helper_SPEC
(execute_data=0xa010a08) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:313
#24 0x08354b8e in execute (op_array=0x9fdd56c) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:104
#25 0x08321ab7 in zend_call_function (fci=0xbfe4584c,
fci_cache=0xbfe45870)
at /blade/install/daemon/php/Zend/zend_execute_API.c:936
#26 0x08269947 in zif_call_user_func_array (ht=2,
return_value=0x9fde9ac, return_value_ptr=0x0, this_ptr=0x0,
return_value_used=0)
at /blade/install/daemon/php/ext/standard/basic_functions.c:4745
#27 0x08376a59 in zend_do_fcall_common_helper_SPEC
(execute_data=0xa010798) at
/blade/install/daemon/php/Zend/zend_vm_execute.h:313
#28 0x08354b8e in execute (op_array=0x9fdd56c) at

#47894 [Opn-Bgs]: Request: Support multi threading/multiple CPU cores

2009-04-04 Thread johannes
 ID:   47894
 Updated by:   johan...@php.net
 Reported By:  ryan14 at mail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Windows/Linux
 PHP Version:  5.3.0RC1
 New Comment:

PHP is made to run from a web server, there you usually serve multiple
requests in parallel - all cores used.

In PHP level multi-threading is barely needed, usually all threading is
needed for IO operations, but these can be solved by async connections
(as of 5.3 you have async query support with mysql for instance)

Adding full thread support just adds lots of new complexity and locking
issues and barely real wins in performance.


Previous Comments:


[2009-04-04 09:54:03] ryan14 at mail dot com

Description:

PHP doesn't currently support Multi threading and multiple core CPU's.
All new CPU's have multiple cores like intel's quad core CPU which has 4
cores and some motherboards have two CPU sockets so 2 quad core CPU's
would mean there would be 8 cores.
 PHP should support Multi threading and multiple core CPU's because it
will mean people won't need to have as many servers in their cluster,
because alot of CPU power is being wasted because PHP doesn't support
Multi threading and multiple core CPU's. 
 You can read more about it here:

http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html

So please PHP, the next version of PHP should support Multi threading
and multiple core CPU's. If you have to work with the mysql and apache
teams with this then please do it.

Can you pass on my feature request to the php team?

Thanks






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



#47893 [Opn-Ana]: CLI script with non-blocking STDIN terminates randomly

2009-04-04 Thread lbarnaud
 ID:   47893
 Updated by:   lbarn...@php.net
 Reported By:  jon at thesquareplanet dot com
-Status:   Open
+Status:   Analyzed
 Bug Type: Reproducible crash
 Operating System: Debian Lenny
 PHP Version:  5.2CVS-2009-04-03 (snap)
 New Comment:

This is reproducible with this script too:

?php
stream_set_blocking(STDIN, 0);
$str = str_repeat(a, 65535);
var_dump($str);
?

This is caused by STDOUT being non-blocking if your shell passes the
same descriptor for STDOUT and STDIN (the write fails with EAGAIN and
PHP aborts).

Running the same script with different STDIN/STDOUT does not reproduce
the problem, e.g.
php test.php /dev/null
or
php test.php /dev/null


Previous Comments:


[2009-04-03 23:18:55] jon at thesquareplanet dot com

A discussion of this bug can also be found at:
http://www.mail-archive.com/php-gene...@lists.php.net/msg118150.html



[2009-04-03 23:17:40] jon at thesquareplanet dot com

Description:

When setting STDIN to be non-blocking, and then running fread() on it,
the cli script suddenly terminates at a seemingly random point during
the reading. No error message is given.

Seemingly related bugs:
http://bugs.php.net/bug.php?id=25616 -- This is the same bug, but has
erroneously been labeled as a dupe of the one below
http://bugs.php.net/bug.php?id=25575 -- This bug describes a somewhat
similar, though not nearly identical, problem

These bugs are both set as last modified in 2003/2004, but the issue
remains unfixed.

Reproduce code:
---
?php
stream_set_blocking(STDIN, FALSE);
while (1) {
var_dump(fread(STDIN,1));
echo \n;;
}
?

Expected result:

A never-ending sequence of var_dumps of either an empty string or a
typed character

Actual result:
--
The expected output, but only for a short while, and then the script
terminates





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



#47684 [Opn]: file_get_contents Content-Length problem

2009-04-04 Thread lbarnaud
 ID:   47684
 Updated by:   lbarn...@php.net
 Reported By:  r-ser at yandex dot ru
 Status:   Open
 Bug Type: HTTP related
 Operating System: Linux 2.6.26
 PHP Version:  5.2.9
 New Comment:

This problem had been fixed in PHP 5.3 (#45540), could you please check
with PHP 5.3 ?


Previous Comments:


[2009-03-18 10:59:28] r-ser at yandex dot ru

/* this message is to change status.. =) */



[2009-03-17 19:55:06] r-ser at yandex dot ru

Add string
php_stream_context_set_option(context, http, method, (zval *)
GET);
Before 
stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options,
opened_path, context, --redirect_max, 0 STREAMS_CC TSRMLS_CC);
In ext/standard/http_fopen_wrapper.c
Solved problem.



[2009-03-17 16:13:21] r-ser at yandex dot ru

I can write this code as
$header = Content-type: multipart/form-data,
boundary=$boundary\r\nContent-Length: .strlen($data).\r\n;
But nothing is changed.
Becouse error is in _second_ request.

cat test.php

?php
$context  = stream_context_create(array('http' =
array('method'='POST', 'header'= 'Content-Length: 0', 'content' =
'')));
echo file_get_contents('http://localhost/1.php', false, $context);
?


cat 1.php

?php
header(Location: 2.php);
?


cat 2.php

?
echo Method: .$_SERVER['REQUEST_METHOD'].\n;
$headers = getallheaders();
foreach ($headers as $header = $value) echo $header: $value\n;
?


Note: 1.php and 2.php are located in root of webserver

if change http://localhost/1.php to http://localhost/2.php you can see
differents headers..
This works with Apache web server.
But not work with some elses, like lighttpd/1.5.0 /* like in example in
first message */



[2009-03-17 11:00:15] j...@php.net

Why are you not passing the content-length in there..? I mean, isn't
that the obvious error..? :)



[2009-03-17 00:15:55] r-ser at yandex dot ru

Description:

When use file_get_contents + stream_context_create to post file to web
server and the page in web server return redirect to another page
(location field in answer), then file_get_contents requested
redirected page with POST header without Content-Length: field in
request and server response HTTP/1.0 411 Length Required.
I think, it's two ways to fix problem
1) 'method' must be change to GET in requests to redirect pages.
2) Add 'Content-Length: 0' to next POST redirect requests

Reproduce code:
---
$argv[1] = image.jpg;
$boundary = AaB03x1234567890;
$type = mime_content_type($argv[1]);
$data = --$boundary\r\nContent-Disposition: form-data;
name=\fileupload\; filename=\.basename($argv[1]).\
Content-Type: .$type. \r\nContent-Transfer-Encoding:
binary\r\n\r\n.file_get_contents($argv[1]).\r\n--$boundary--;
$header = Content-type: multipart/form-data, boundary=$boundary;
$context  = stream_context_create(array('http' =
array('method'='POST', 'header'= $header, 'content' = $data)));
$result = file_get_contents('http://load.imageshack.us', false,
$context);
echo $result;

Expected result:

failed to open stream: HTTP request failed! HTTP/1.0 411 Length
Required

Actual result:
--
Normal redirected page





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



#47896 [NEW]: Cookie delete

2009-04-04 Thread G dot B dot Yahav at gmail dot com
From: G dot B dot Yahav at gmail dot com
Operating system: WINDOWS SERVER
PHP version:  5.2.9
PHP Bug Type: Unknown/Other Function
Bug description:  Cookie delete

Description:

Hey,
i got a problen about deleting cookie array.
when i use the code above with normal cookie, all work good, but when i
defined a cookie array i cannot delete it.

Reproduce code:
---
?php

// the cookie array name is PearServices_ClientSession

if( isset( $_COOKIE['PearServices_ClientSession'] ) )
{
foreach ( $_COOKIE['PearServices_ClientSession'] as $k 
= $v )
{
pearRegistry::DeleteCookie( 
PearServices_ClientSession[.$k.] );
}
}
// pearRegistry::deletecookie function

final static function DeleteCookie( $name )
{
setcookie( $name, , time() -3600 );
}
?

Expected result:

Cookie disappire

Actual result:
--
Cookie still in browser...

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



#47897 [NEW]: msvcr80.dll

2009-04-04 Thread anders dot e dot stenman at gmail dot com
From: anders dot e dot stenman at gmail dot com
Operating system: Windows Vista
PHP version:  5.2.9
PHP Bug Type: Dynamic loading
Bug description:  msvcr80.dll

Description:

Hello,

When I run php.exe or pear on my Windows Vista box I get a warning
about a missing msvcr80.dll. Is it possible to fix this?

Kind regards,
/Anders


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



#47897 [Opn-Fbk]: msvcr80.dll

2009-04-04 Thread pajoye
 ID:   47897
 Updated by:   paj...@php.net
 Reported By:  anders dot e dot stenman at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Dynamic loading
 Operating System: Windows Vista
 PHP Version:  5.2.9
 New Comment:

Which php version did you download and where?


Previous Comments:


[2009-04-04 20:54:49] anders dot e dot stenman at gmail dot com

Description:

Hello,

When I run php.exe or pear on my Windows Vista box I get a warning
about a missing msvcr80.dll. Is it possible to fix this?

Kind regards,
/Anders






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



#36066 [Com]: Allowing member variables in interfaces

2009-04-04 Thread alpha_centurion at hotmail dot com
 ID:   36066
 Comment by:   alpha_centurion at hotmail dot com
 Reported By:  pablobm at gmail dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Any
 PHP Version:  5.1.2
 New Comment:

I'd agree with this. Both from the perspective of people coming into
PHP from other languages and an OO purist, the capacity to define public
properties in interfaces is integral to their function.

Although there is an argument which could support using interfaces
purely for method signatures, it is more academic than practical and
typically ends with some idea of separating property-focused interfaces
from method-focused interfaces (facets of functionality).

The usage strategy is something that should be decided in the
implementation of software built on the language; the provision of the
base functionality seems a logical (and necessary) progression of the
language.


Previous Comments:


[2006-01-18 12:20:29] pablobm at gmail dot com

Description:

Maybe it's just me, but I think member variables should be allowed in
object interfaces.

My opinion is that this makes sense in PHP because it has proper
getters/setters.

Java allows mamber variables in interfaces for example, but, in its
case, that doesn't make much sense, since (last time I checked, in 1.4)
there are no proper getter/setter methods in Java as those found in
PHP5.

If I want an interface to define behaviour for a data structure that
holds information, I will have to include getMember() and setMember()
methods, not being able to use PHP5 getters/setters.






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