Req #62800 [Com]: Creating/modifying/deleting files in PHP

2012-08-12 Thread reeze dot xia at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62800&edit=1

 ID: 62800
 Comment by: reeze dot xia at gmail dot com
 Reported by:brandonskypimenta at gmail dot com
 Summary:Creating/modifying/deleting files in PHP
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:Newest version of PHP
 Block user comment: N
 Private report: N

 New Comment:

Maybe this is helpful to you:
http://en.wikipedia.org/wiki/RTFM

OK, here is some funtions you might want:
http://php.net/file_put_contents
http://php.net/unlink


Previous Comments:

[2012-08-12 07:28:21] brandonskypimenta at gmail dot com

All text in this bug is copyrighted by Brandon Sky, released under CC-BY 3.0.


[2012-08-12 07:25:39] anon at anon dot anon

>© 2013
Did you just copyright your inability to read documentation?


[2012-08-12 01:32:49] brandonskypimenta at gmail dot com

fixed php version


[2012-08-12 01:31:05] brandonskypimenta at gmail dot com

fixed title


[2012-08-12 01:29:43] brandonskypimenta at gmail dot com

Description:

Any way to create files, delete files, modify files in PHP using these commands?

create_file creates a file.
modify_file edits a file's text.
delete_file immediately deletes a file. WARNING: Deletion will be permanent!
-
© 2013

Test script:
---








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


Bug #47284 [Nab]: Args disappear from exception stack trace (works in 5.3)

2012-08-12 Thread thekid
Edit report at https://bugs.php.net/bug.php?id=47284&edit=1

 ID: 47284
 Updated by: the...@php.net
 Reported by:the...@php.net
 Summary:Args disappear from exception stack trace (works in
 5.3)
 Status: Not a bug
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   *
 PHP Version:5.2CVS-2009-04-25
 Block user comment: N
 Private report: N

 New Comment:

> Unfortunately you are not using a current version of PHP 

Three years ago when I reported this, I was:)


Previous Comments:

[2012-08-10 16:26:37] larue...@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-02-09 21:23:45] the...@php.net

Doesn't help, I tried PHP 5.2 from CVS, which yields the same result:

== php -v ==
PHP 5.2.9RC2-dev (cli) (built: Feb  9 2009 08:46:53) (DEBUG)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

== Results ==
array(1) {
  [0]=>
  array(4) {
["file"]=>
string(17) "Command line code"
["line"]=>
int(1)
["function"]=>
string(5) "raise"
["args"]=>
array(2) {
  [0]=>
  string(3) "Arg"
  [1]=>
  string(5) "Cause"
}
  }
}
array(1) {
  [0]=>
  array(3) {
["file"]=>
string(17) "Command line code"
["line"]=>
int(1)
["function"]=>
string(5) "raise"
  }
}


[2009-02-02 22:38:33] the...@php.net

Description:

Exception's stacktraces miss the "args" key in certain situations (whereas 
debug_backtrace() will report them).

Reproduce code:
---
php -r 'class Chained extends Exception { function __construct($message, 
$cause) { parent::__construct($message); $this->cause= $cause; }} function 
raise($message, $cause) { throw new Chained($message, new Exception($cause)); } 
try { raise("Arg", "Cause"); } catch (Exception $e) { var_dump($e->getTrace(), 
$e->cause->getTrace()); }'

Expected result:

Twice this:

array(1) {
  [0]=>
  array(4) {
["file"]=>
string(17) "Command line code"
["line"]=>
int(1)
["function"]=>
string(5) "raise"
["args"]=>
array(2) {
  [0]=>
  &string(3) "Arg"
  [1]=>
  &string(5) "Cause"
}
  }
}


Actual result:
--
array(1) {
  [0]=>
  array(4) {
["file"]=>
string(17) "Command line code"
["line"]=>
int(1)
["function"]=>
string(5) "raise"
["args"]=>
array(2) {
  [0]=>
  string(3) "Arg"
  [1]=>
  string(5) "Cause"
}
  }
}
array(1) {
  [0]=>
  array(3) {
["file"]=>
string(17) "Command line code"
["line"]=>
int(1)
["function"]=>
string(5) "raise"
  }
}

The second array is missing the "args" key. In PHP 5.3, it's present.






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


Bug #46439 [Com]: file upload implementation is flawed

2012-08-12 Thread kristo at waher dot net
Edit report at https://bugs.php.net/bug.php?id=46439&edit=1

 ID: 46439
 Comment by: kristo at waher dot net
 Reported by:tom at punkave dot com
 Summary:file upload implementation is flawed
 Status: Open
 Type:   Bug
 Package:cURL related
 Operating System:   *
 PHP Version:5.*, 6CVS (2009-01-21)
 Block user comment: N
 Private report: N

 New Comment:

What if you are not actually trying to send a file and it's instead a POST 
value 
that starts with an @? What if you take user values from a website form and 
submit these values with post to another service and user writes '@config.php' 
to one of the form values? Problem here is that cURL in PHP treats the POST 
array the exact same way, any value could be a link to a file, which creates a 
huge loophole or a lot of extra work for you to filter through all POST values 
to make sure they are not pointers to files when used with cURL.

In fact, it is not possible to even make a POST request at the moment with cURL 
if one of the POST values starts with an @. There's no regular expression 
check, 
no formatting you'd have to follow, just a single (very common) character. What 
if you want to send Twitter handle and user writes @kristovaher?

In fact, it is so bad that you cannot even escape the character with \@, cURL 
will submit it without unescaping it. And if you don't have any control about 
the API on the other side (that would unescape it themselves), cannot make that 
POST request! You cannot make a POST API request to Twitter that is a reply to 
another user, for example.

I just wish PHP developers had the foresight to implement something like 
CURLOPT_FILEFIELDS in cURL, it's insane amount of double-validation I have to 
do 
in my API - that doesn't upload any files - at the moment just because of this 
potential security loophole. I love PHP, but these implementations are 
sometimes 
such a headache.


Previous Comments:

[2012-01-17 21:40:50] gmblar+php at gmail dot com

There is no function to escape the "@" in the CURLOPT_POSTFIELDS array and in 
this example 
its not possible to remove or replace the "@".

$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL=> 'http://www.example.com/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => array(
'username' => 'foobar',
// Users may have strange passwords. Should be transfered as text.
'password' => '@/etc/hosts',
// Upload image.
'picture'  => '@/var/www/avatars/foobar.jpg'
)
));
curl_exec($curl);
curl_close($curl);


My suggestion is to escape the password in this escape with \@ and then thread 
as text.


[2009-05-03 21:04:44] paj...@php.net

tbd


[2009-01-21 20:08:07] tom at punkave dot com

htmlencode() won't escape @. Neither will htmlentities(). it's a security bug 
that no amount of reasonable prudence on the part of programmers who haven't 
read this particular bug report will address. And there is no reason why 
programmers would expect that filtering input would be necessary when they are 
passing individual fields to a function that ought to be ready to escape them 
(and in fact does, apart from the leading @ thing).

The documentation needs to be fixed at a minimum. It would be a much better 
idea to get rid of the broken behavior. The @ prefix is a bad idea (what if I 
want to pass @?) and with the current lack of documentation it's a security 
hole.

This needs to be patched or at least documented.


[2009-01-21 19:56:56] j...@php.net

It's security hole only if you don't filter the input..


[2008-10-31 19:18:36] tom at punkave dot com

Description:

PHP's cURL wrapper implements HTTP POST file uploads as follows:

curl_setopt($curl_handle, CURLOPT_POST, 1);
$args['file'] = '@/path/to/file';
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $args);

When ext/curl/interface.c sees that $args is an array and not a query-encoded 
string, it switches to a branch that uses CURLOPT_HTTPPOST rather than 
CURLOPT_POST. The code then checks for an '@' prefix in the value of every 
field. When an '@' is spotted, that particular field is treated as a file to be 
uploaded rather than a value to be sent as-is.

This implementation and the associated documentation have the following 
problems which are best described together for clarity's sake:

1. The fact that passing an array of arguments will trigger multipart/form-data 
is not documented. The documentation implies that you can use a query-encoded 
string or an array intercha

Bug #62744 [Opn]: dangling pointers made by zend_disable_class

2012-08-12 Thread felipe
Edit report at https://bugs.php.net/bug.php?id=62744&edit=1

 ID: 62744
 Updated by: fel...@php.net
 Reported by:larue...@php.net
 Summary:dangling pointers made by zend_disable_class
 Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.3.15
-Assigned To:
+Assigned To:laruence
 Block user comment: N
 Private report: N

 New Comment:

Have it been already fixed?


Previous Comments:

[2012-08-04 03:27:39] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=03a1fcabf31210d3f304bfacf5096ce43c2b8f93
Log: Fixed bug #62744 (dangling pointers made by zend_disable_class)


[2012-08-04 03:24:36] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=03a1fcabf31210d3f304bfacf5096ce43c2b8f93
Log: Fixed bug #62744 (dangling pointers made by zend_disable_class)


[2012-08-04 02:41:52] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=03a1fcabf31210d3f304bfacf5096ce43c2b8f93
Log: Fixed bug #62744 (dangling pointers made by zend_disable_class)


[2012-08-04 02:29:16] larue...@php.net

Description:

this bug is found by digging bug #62737

Extensions use zend_register_internal_class to register class, and they often 
preserved the return value and reuse that pointer instead of search in class 
table 
when that class will be used.

but when user specific disable_classes in php.ini

zend_disable_class will delete the corresponding class entry, then make the 
pointer which is preserved by extension become a wild pointer.

http://lxr.php.net/xref/PHP_5_3/Zend/zend_API.c#2348

Test script:
---
similar as #62733

Expected result:

none

Actual result:
--
none






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


[PHP-BUG] Bug #62803 [NEW]: nextRowset not returning false

2012-08-12 Thread jspringer at telebarbados dot com
From: jspringer at telebarbados dot com
Operating system: Windows Server 2008
PHP version:  5.3.15
Package:  PDO related
Bug Type: Bug
Bug description:nextRowset not returning false

Description:

---
>From manual page: http://www.php.net/pdostatement.nextrowset#refsect1-
pdostatement.nextrowset-seealso
---
nextRowset is not returning false. The code below causes an exception in
the 
fetchAll line because it is trying to access a result set does not exist.

$r=0
$qy = "CALL getAllInfo()";
$istmt = $con->prepare($qy);
if ($istmt->execute())
{
$outcome = self::SUCCESS;
do 
{   
  $result[$r] = $istmt->fetchAll(PDO::FETCH_ASSOC);
  $r++;
}
while($istmt->nextRowset());
}

Test script:
---
$r=0
$qy = "CALL getAllInfo()";
$istmt = $con->prepare($qy);
if ($istmt->execute())
{
$outcome = self::SUCCESS;
do 
{   
  $result[$r] = $istmt->fetchAll(PDO::FETCH_ASSOC);
  $r++;
}
while($istmt->nextRowset());
}

Expected result:

Clean exit with all possible resultsets in the result array.

Actual result:
--
exception 'PDOException' with message 'SQLSTATE[HY000]: General error'

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



Bug #62794 [Opn->Nab]: print_r with debug_backtrace overwrites member variable

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62794&edit=1

 ID: 62794
 Updated by: larue...@php.net
 Reported by:burakg at torreycommerce dot com
 Summary:print_r with debug_backtrace overwrites member
 variable
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:MySQLi related
 Operating System:   CentOS 6.3
 PHP Version:5.3.15
 Block user comment: N
 Private report: N

 New Comment:

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

when you print_r the mysqli object, it will can a static method of mysql , 
which 
also be considered as a operation,  if it was executed successful, then empty 
error info will be set.

following method act the same :

class Db extends mysqli {
function f() {
$this->query("select");
var_dump($this->error);
print_r($this, true);
var_dump($this->error);
}
}


Previous Comments:

[2012-08-10 20:43:12] burakg at torreycommerce dot com

Description:

Calling print_r(debug_backtrace()) from a method of a class that inherits from 
mysqli overwrites the error member variable. Calling debug_backtrace() on its 
own 
doesn't seem to cause any problems, but when combined with print_r, this 
problem 
results.

Test script:
---
query("select");
var_dump($this->error);
print_r(debug_backtrace(), true);
var_dump($this->error);
}
}

$db = new Db("host", "user", "password", "database");
$db->f();

Expected result:

string(146) "You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near '' at 
line 1"
string(146) "You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near '' at 
line 1"

Actual result:
--
string(146) "You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near '' at 
line 1"
string(0) ""






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


Bug #62763 [Ver->Csd]: register_shutdown_function and extending class

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62763&edit=1

 ID: 62763
 Updated by: larue...@php.net
 Reported by:valentiny510 at yahoo dot es
 Summary:register_shutdown_function and extending class
-Status: Verified
+Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   XP
 PHP Version:5.4.5
-Assigned To:
+Assigned To:laruence
 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:

[2012-08-12 12:55:28] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=4970926e4543c15e16b0c047d85dddfb4c09b581
Log: Fixed bug #62763 (register_shutdown_function and extending class)


[2012-08-07 04:52:39] valentiny510 at yahoo dot es

P.S. 2 :D Sorry.
The errors...

[07-Aug-2012 05:39:51 UTC] PHP Warning:  (Registered shutdown functions) Unable 
to call test1::shutdown() - function does not exist in Unknown on line 0

[07-Aug-2012 05:39:51 UTC] PHP Warning:  (Registered shutdown functions) Unable 
to call test2::shutdown() - function does not exist in Unknown on line 0

are shown when the function "shutdown" is private.

If I "exit" it crush the server but if I "echo" the result is

Shutdown
Shutdown
test2::__destruct

Now.. why it output twice when I dont even called parent::__construct ?

If I add an empty __construct function to the child the output is

test2::__destruct
Shutdown

Note also the called order...


[2012-08-07 02:10:36] valentiny510 at yahoo dot es

Oh yes, sorry, the function called was just "shut" not "shutdown", sorry for 
that, the test script was writed with some hurry on the web, it was not copied 
from the actual script, Thank you Aharvey.


[2012-08-07 01:33:19] ahar...@php.net

I get the following error with a debug build of the current 5.4 tree (Linux, 
x86):

adam@eden:~$ php /tmp/test.php
Shutdown
test2::__destruct/home/adam/trees/php-src/5.4/Zend/zend_hash.c(551) : 
ht=0xb6731b50 is being destroyed

I had to alter the script slightly to make it run; what I ended up using was:




The backtrace at the point of the consistency check:


Breakpoint 1, zend_hash_destroy (ht=0xb6fb2b1c) at /home/adam/trees/php-
src/5.4/Zend/zend_hash.c:551
551 IS_CONSISTENT(ht);
(gdb) bt
#0  zend_hash_destroy (ht=0xb6fb2b1c) at /home/adam/trees/php-
src/5.4/Zend/zend_hash.c:551
#1  0x084218d5 in php_free_shutdown_functions () at /home/adam/trees/php-
src/5.4/ext/standard/basic_functions.c:5043
#2  0x0842188f in php_call_shutdown_functions () at /home/adam/trees/php-
src/5.4/ext/standard/basic_functions.c:5034
#3  0x0853a400 in php_request_shutdown (dummy=0x0) at /home/adam/trees/php-
src/5.4/main/main.c:1718
#4  0x086d3408 in do_cli (argc=2, argv=0xb3a4) at /home/adam/trees/php-
src/5.4/sapi/cli/php_cli.c:1171
#5  0x086d3c03 in main (argc=2, argv=0xb3a4) at /home/adam/trees/php-
src/5.4/sapi/cli/php_cli.c:1364


[2012-08-06 22:53:16] valentiny510 at yahoo dot es

P.S. The functions both "exit" and with "echo" I got this errors:

[06-Aug-2012 23:48:50 UTC] PHP Warning:  (Registered shutdown functions) Unable 
to call test1::shutdown() - function does not exist in Unknown on line 0

[06-Aug-2012 23:48:50 UTC] PHP Warning:  (Registered shutdown functions) Unable 
to call test2::shutdown() - function does not exist in Unknown on line 0




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


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


Bug #62803 [Opn]: nextRowset not returning false

2012-08-12 Thread jackspr at hotmail dot com
Edit report at https://bugs.php.net/bug.php?id=62803&edit=1

 ID: 62803
 User updated by:jackspr at hotmail dot com
 Reported by:jackspr at hotmail dot com
 Summary:nextRowset not returning false
 Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   Windows Server 2008
 PHP Version:5.3.15
 Block user comment: N
 Private report: N

 New Comment:

update


Previous Comments:

[2012-08-12 16:06:11] jackspr at hotmail dot com

Description:

---
>From manual page: http://www.php.net/pdostatement.nextrowset#refsect1-
pdostatement.nextrowset-seealso
---
nextRowset is not returning false. The code below causes an exception in the 
fetchAll line because it is trying to access a result set does not exist.

$r=0
$qy = "CALL getAllInfo()";
$istmt = $con->prepare($qy);
if ($istmt->execute())
{
$outcome = self::SUCCESS;
do 
{   
  $result[$r] = $istmt->fetchAll(PDO::FETCH_ASSOC);
  $r++;
}
while($istmt->nextRowset());
}

Test script:
---
$r=0
$qy = "CALL getAllInfo()";
$istmt = $con->prepare($qy);
if ($istmt->execute())
{
$outcome = self::SUCCESS;
do 
{   
  $result[$r] = $istmt->fetchAll(PDO::FETCH_ASSOC);
  $r++;
}
while($istmt->nextRowset());
}

Expected result:

Clean exit with all possible resultsets in the result array.

Actual result:
--
exception 'PDOException' with message 'SQLSTATE[HY000]: General error'






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


Bug #62763 [Csd]: register_shutdown_function and extending class

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62763&edit=1

 ID: 62763
 Updated by: larue...@php.net
 Reported by:valentiny510 at yahoo dot es
 Summary:register_shutdown_function and extending class
 Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   XP
 PHP Version:5.4.5
 Assigned To:laruence
 Block user comment: N
 Private report: N

 New Comment:

the fix is only fix the crash or "hash inconsistent" warning.  but leaves a 
memleak. 

but IMO it's the proper way for this.


Previous Comments:

[2012-08-12 12:57:16] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=4970926e4543c15e16b0c047d85dddfb4c09b581
Log: Fixed bug #62763 (register_shutdown_function and extending class)


[2012-08-12 12:56:50] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=4970926e4543c15e16b0c047d85dddfb4c09b581
Log: Fixed bug #62763 (register_shutdown_function and extending class)


[2012-08-12 12:55:33] larue...@php.net

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.




[2012-08-12 12:55:28] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=4970926e4543c15e16b0c047d85dddfb4c09b581
Log: Fixed bug #62763 (register_shutdown_function and extending class)


[2012-08-07 04:52:39] valentiny510 at yahoo dot es

P.S. 2 :D Sorry.
The errors...

[07-Aug-2012 05:39:51 UTC] PHP Warning:  (Registered shutdown functions) Unable 
to call test1::shutdown() - function does not exist in Unknown on line 0

[07-Aug-2012 05:39:51 UTC] PHP Warning:  (Registered shutdown functions) Unable 
to call test2::shutdown() - function does not exist in Unknown on line 0

are shown when the function "shutdown" is private.

If I "exit" it crush the server but if I "echo" the result is

Shutdown
Shutdown
test2::__destruct

Now.. why it output twice when I dont even called parent::__construct ?

If I add an empty __construct function to the child the output is

test2::__destruct
Shutdown

Note also the called order...




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


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


Req #62799 [Opn]: Parallel array processing

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62799&edit=1

 ID: 62799
 Updated by: larue...@php.net
 Reported by:info at ludwig-gramberg dot de
 Summary:Parallel array processing
 Status: Open
 Type:   Feature/Change Request
 Package:Arrays related
 Operating System:   Any
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

do you mean something like array_map?  
http://us2.php.net/manual/en/function.array-walk.php


Previous Comments:

[2012-08-11 19:50:54] info at ludwig-gramberg dot de

Description:

Idea: an easy to use parallel processing function for arrays (or any iterable 
data structure).

Example:



Now $arr would contain the following: [6, 7, 8, 9].
The values are written back to $arr. The parameter is called by reference.

Also a array_parallel_reduce would be nice.

Test script:
---
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });

Expected result:

[6, 7, 8, 9]







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


Req #62799 [Opn]: Parallel array processing

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62799&edit=1

 ID: 62799
 Updated by: larue...@php.net
 Reported by:info at ludwig-gramberg dot de
 Summary:Parallel array processing
 Status: Open
 Type:   Feature/Change Request
 Package:Arrays related
 Operating System:   Any
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

s ,array_map,array_walk,  :)


Previous Comments:

[2012-08-12 13:01:01] larue...@php.net

do you mean something like array_map?  
http://us2.php.net/manual/en/function.array-walk.php


[2012-08-11 19:50:54] info at ludwig-gramberg dot de

Description:

Idea: an easy to use parallel processing function for arrays (or any iterable 
data structure).

Example:



Now $arr would contain the following: [6, 7, 8, 9].
The values are written back to $arr. The parameter is called by reference.

Also a array_parallel_reduce would be nice.

Test script:
---
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });

Expected result:

[6, 7, 8, 9]







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


Req #62800 [Com]: Creating/modifying/deleting files in PHP

2012-08-12 Thread anon at anon dot anon
Edit report at https://bugs.php.net/bug.php?id=62800&edit=1

 ID: 62800
 Comment by: anon at anon dot anon
 Reported by:brandonskypimenta at gmail dot com
 Summary:Creating/modifying/deleting files in PHP
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:Newest version of PHP
 Block user comment: N
 Private report: N

 New Comment:

>© 2013
Did you just copyright your inability to read documentation?


Previous Comments:

[2012-08-12 01:32:49] brandonskypimenta at gmail dot com

fixed php version


[2012-08-12 01:31:05] brandonskypimenta at gmail dot com

fixed title


[2012-08-12 01:29:43] brandonskypimenta at gmail dot com

Description:

Any way to create files, delete files, modify files in PHP using these commands?

create_file creates a file.
modify_file edits a file's text.
delete_file immediately deletes a file. WARNING: Deletion will be permanent!
-
© 2013

Test script:
---








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


Bug #62744 [Asn->Csd]: dangling pointers made by zend_disable_class

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62744&edit=1

 ID: 62744
 Updated by: larue...@php.net
 Reported by:larue...@php.net
 Summary:dangling pointers made by zend_disable_class
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 PHP Version:5.3.15
 Assigned To:laruence
 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:

[2012-08-11 20:34:03] fel...@php.net

Have it been already fixed?


[2012-08-04 03:27:39] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=03a1fcabf31210d3f304bfacf5096ce43c2b8f93
Log: Fixed bug #62744 (dangling pointers made by zend_disable_class)


[2012-08-04 03:24:36] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=03a1fcabf31210d3f304bfacf5096ce43c2b8f93
Log: Fixed bug #62744 (dangling pointers made by zend_disable_class)


[2012-08-04 02:41:52] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=03a1fcabf31210d3f304bfacf5096ce43c2b8f93
Log: Fixed bug #62744 (dangling pointers made by zend_disable_class)


[2012-08-04 02:29:16] larue...@php.net

Description:

this bug is found by digging bug #62737

Extensions use zend_register_internal_class to register class, and they often 
preserved the return value and reuse that pointer instead of search in class 
table 
when that class will be used.

but when user specific disable_classes in php.ini

zend_disable_class will delete the corresponding class entry, then make the 
pointer which is preserved by extension become a wild pointer.

http://lxr.php.net/xref/PHP_5_3/Zend/zend_API.c#2348

Test script:
---
similar as #62733

Expected result:

none

Actual result:
--
none






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


Req #62800 [Opn->Nab]: Creating/modifying/deleting files in PHP

2012-08-12 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=62800&edit=1

 ID: 62800
 Updated by: ni...@php.net
 Reported by:brandonskypimenta at gmail dot com
 Summary:Creating/modifying/deleting files in PHP
-Status: Open
+Status: Not a bug
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:Newest version of PHP
 Block user comment: N
 Private report: N

 New Comment:

PHP already has numerous functions for these purposes.

See http://php.net/filesystem for a list.


Previous Comments:

[2012-08-12 08:00:55] reeze dot xia at gmail dot com

Maybe this is helpful to you:
http://en.wikipedia.org/wiki/RTFM

OK, here is some funtions you might want:
http://php.net/file_put_contents
http://php.net/unlink


[2012-08-12 07:28:21] brandonskypimenta at gmail dot com

All text in this bug is copyrighted by Brandon Sky, released under CC-BY 3.0.


[2012-08-12 07:25:39] anon at anon dot anon

>© 2013
Did you just copyright your inability to read documentation?


[2012-08-12 01:32:49] brandonskypimenta at gmail dot com

fixed php version


[2012-08-12 01:31:05] brandonskypimenta at gmail dot com

fixed title




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


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


Req #62797 [Opn->Nab]: Add a CLI parameter to override php.ini settings for a web server instance

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62797&edit=1

 ID: 62797
 Updated by: larue...@php.net
 Reported by:mathias at qiwi dot be
 Summary:Add a CLI parameter to override php.ini settings for
 a web server instance
-Status: Open
+Status: Not a bug
 Type:   Feature/Change Request
 Package:Built-in web server
 Operating System:   OS X 10.8
 PHP Version:5.4.6RC1
 Block user comment: N
 Private report: N

 New Comment:

php54 -d include_patch=".:/foo/bar:/baz/qux"   -S localhost:8000


Previous Comments:

[2012-08-11 11:13:29] mathias at qiwi dot be

Description:

During development, it can be useful to override certain php.ini settings for 
specific server instances (using the PHP built-in web server).

Of course, it’s possible to edit `php.ini` every time this is needed, (or use 
`ini_set` in the PHP code where applicable), but for small changes it would be 
very useful to just be able to specify the setting and its value as a command 
line argument/value pair.

For example, to start a test server with a custom `include_path` setting 
(without overriding `php.ini` or changing the existing PHP code by adding 
`ini_set()` calls):

php -S localhost:8000 --set "include_path=.:/foo/bar:/baz/qux"

The syntax is just an example. Perhaps you’d prefer to do it a bit 
differently, 
and allow people to point to a project-specific `php.ini` file:

php -S localhost:8000 --ini "./project.ini"

However, I’d strongly prefer the first solution.







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


Req #62800 [Com]: Creating/modifying/deleting files in PHP

2012-08-12 Thread brandonskypimenta at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62800&edit=1

 ID: 62800
 Comment by: brandonskypimenta at gmail dot com
 Reported by:brandonskypimenta at gmail dot com
 Summary:Creating/modifying/deleting files in PHP
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:Newest version of PHP
 Block user comment: N
 Private report: N

 New Comment:

All text in this bug is copyrighted by Brandon Sky, released under CC-BY 3.0.


Previous Comments:

[2012-08-12 07:25:39] anon at anon dot anon

>© 2013
Did you just copyright your inability to read documentation?


[2012-08-12 01:32:49] brandonskypimenta at gmail dot com

fixed php version


[2012-08-12 01:31:05] brandonskypimenta at gmail dot com

fixed title


[2012-08-12 01:29:43] brandonskypimenta at gmail dot com

Description:

Any way to create files, delete files, modify files in PHP using these commands?

create_file creates a file.
modify_file edits a file's text.
delete_file immediately deletes a file. WARNING: Deletion will be permanent!
-
© 2013

Test script:
---








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


Bug #62358 [Com]: Segfault when using traits a lot

2012-08-12 Thread maciej dot sz at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62358&edit=1

 ID: 62358
 Comment by: maciej dot sz at gmail dot com
 Reported by:maciej dot sz at gmail dot com
 Summary:Segfault when using traits a lot
 Status: Feedback
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Linux 3.2.0-25-generic Ubuntu
 PHP Version:5.4.4
 Block user comment: N
 Private report: N

 New Comment:

Another crash, this time in newest 5.4.6RC1 :


Program received signal SIGSEGV, Segmentation fault.
0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
3059size_t name_len = strlen(fptr->common.function_name);
(gdb) bt
#0  0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
#1  0x0094f37b in do_inheritance_check_on_method (child=0x1ba67c0, 
parent=0x1b6d2b8)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3263
#2  0x0094f531 in do_inherit_method_check 
(child_function_table=0x1ba8970, parent=0x1b6d2b8, 
hash_key=0x7fff9dd0, child_ce=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3288
#3  0x00988bf0 in zend_hash_replace_checker_wrapper (target=0x1ba8970, 
source_data=0x1b6d2b8, 
p=0x1b79630, pParam=0x1ba8948, merge_checker_func=0x94f4aa 
)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:878
#4  0x00988c71 in zend_hash_merge_ex (target=0x1ba8970, 
source=0x1b64378, 
pCopyConstructor=0x94ddb3 , size=240, 
pMergeSource=0x94f4aa , pParam=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:892
#5  0x009507df in zend_do_inheritance (ce=0x1ba8948, 
parent_ce=0x1b64350)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3519
#6  0x009540a7 in do_bind_inherited_class (op_array=0x1ba5b10, 
opline=0x1bb74b0, 
class_table=0x126ee70, parent_ce=0x1b64350, compile_time=0 '\000')
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:4570
#7  0x009b742a in ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER 
(execute_data=0x77f95e70)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:936
#8  0x009b4122 in execute (op_array=0x1ba5b10)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#9  0x0096381c in zend_call_function (fci=0x7fffa410, 
fci_cache=0x7fffa460)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_execute_API.c:958
#10 0x00717021 in zim_reflection_method_invokeArgs (ht=2, 
return_value=0x1ba72f8, 
return_value_ptr=0x0, this_ptr=0x1b26ed0, return_value_used=1)
at /home/maciek/Downloads/php-5.4.6RC1/ext/reflection/php_reflection.c:3024
#11 0x009b5838 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:642
#12 0x009b66dc in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:752
#13 0x009b4122 in execute (op_array=0x7095e050)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#14 0x00976ca1 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend.c:1289
#15 0x008e90aa in php_execute_script (primary_file=0x7fffcdd0)
at /home/maciek/Downloads/php-5.4.6RC1/main/main.c:2473
#16 0x00abf8c1 in do_cli (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:988
#17 0x00ac09fa in main (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:1364


Previous Comments:

[2012-06-19 09:02:11] maciej dot sz at gmail dot com

Thank you for the response. I've compiled the snapshot (201206190730) and I got 
segfault with same BT, only this time it occured earlier in the script.

Maybe it is worth mentioning, that I was not able to reproduce the crash with 
small scripts (including only few files). The bug occurs when I use traits with 
large frameworks: PHPUnit or Zend Framework.


[2012-06-18 23:52:10] fel...@php.net

Please try using this snapshot:

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

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




[2012-06-18 20:23:49] maciej dot sz at gmail dot com

Description:

While using traits PHP crashes a lot. This does not seem to be related to any 
certain piece of code, becouse I just have to add a dummy declaration like
$tmp = '';
and the script runs normally.


For example I just wrote code sim

Bug #54940 [Opn->Nab]: Corrupt JPEG data: 200 extraneous bytes before marker 0xc4

2012-08-12 Thread pajoye
Edit report at https://bugs.php.net/bug.php?id=54940&edit=1

 ID: 54940
 Updated by: paj...@php.net
 Reported by:php at maisqi dot com
 Summary:Corrupt JPEG data: 200 extraneous bytes before
 marker 0xc4
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:GD related
 Operating System:   Windows XP 32
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

.


Previous Comments:

[2012-08-03 11:20:49] php at maisqi dot com

As with bug 39918, this can be solved with:
   ini_set ('gd.jpeg_ignore_warning', 1);
Please close this entry. Sorry for the bogus.


[2011-08-07 18:13:41] php at maisqi dot com

Hello? Anyone?


[2011-05-27 14:13:59] php at maisqi dot com

Here's the JPEG: http://www.maisqi.com/954.jpg


[2011-05-27 14:10:34] php at maisqi dot com

Description:

I noticed that imagecreatefromjpeg() failed loading some JPEGs. I thought the 
files were corrupt, but then I successfully opened them on The Gimp.
I noticed that if I opened one of those files on The Gimp and just saved it 
(without doing any modifications), imagecreatefromjpeg() would open the saved 
file with no problems.

So, It's clear that some JPEGs are a little different from the others and that 
The Gimp fixes them on saving.

imagecreatefromjpeg() issues the following warnings:

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, 
libjpeg: recoverable error: Corrupt JPEG data: 200 extraneous bytes before 
marker 0xc4 in exp.php on line 3

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '954.jpg' is not 
a valid JPEG file in exp.php on line 3



PS: I've found bug 39918 similar to this. The problems seam to be related but 
not the same. The first warnings looks like issued by a lower level function 
and states that the error is recoverable.

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


Req #62799 [Opn]: Parallel array processing

2012-08-12 Thread info at ludwig-gramberg dot de
Edit report at https://bugs.php.net/bug.php?id=62799&edit=1

 ID: 62799
 User updated by:info at ludwig-gramberg dot de
 Reported by:info at ludwig-gramberg dot de
 Summary:Parallel array processing
 Status: Open
 Type:   Feature/Change Request
 Package:Arrays related
 Operating System:   Any
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

yes, array_walk, map and so on could all be done in parallel, which would be 
very 
interesting speedwise


Previous Comments:

[2012-08-12 13:01:35] larue...@php.net

s ,array_map,array_walk,  :)


[2012-08-12 13:01:01] larue...@php.net

do you mean something like array_map?  
http://us2.php.net/manual/en/function.array-walk.php


[2012-08-11 19:50:54] info at ludwig-gramberg dot de

Description:

Idea: an easy to use parallel processing function for arrays (or any iterable 
data structure).

Example:



Now $arr would contain the following: [6, 7, 8, 9].
The values are written back to $arr. The parameter is called by reference.

Also a array_parallel_reduce would be nice.

Test script:
---
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });

Expected result:

[6, 7, 8, 9]







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


Bug #48771 [Csd]: rename() between drives error: No error

2012-08-12 Thread pajoye
Edit report at https://bugs.php.net/bug.php?id=48771&edit=1

 ID: 48771
 Updated by: paj...@php.net
 Reported by:bugs at thundercall dot dk
 Summary:rename() between drives error: No error
 Status: Closed
 Type:   Bug
 Package:Filesystem function related
 Operating System:   win32 only - Windows XP
 PHP Version:5.3CVS-2009-07-02 (snap)
 Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

@luizael dot batista at gmail dot com

Please print out the content of:

dirname(__FILE__)."/modulos/".$name

and paste it here. Whether you use variables or not is not relevant but what is 
in the variables.


Previous Comments:

[2012-08-02 19:25:16] luizael dot batista at gmail dot com

hello, when using the rename so 
-->rename(dirname(__FILE__)."/modulos/oldfolder",dirname(__FILE__)."/modulos/newfolder");
 works correctly , 

when I add a variable  triggers an alert stating that the volume syntax is 
incorrect :
rename(dirname(__FILE__)."/modulos/oldfolder",dirname(__FILE__)."/modulos/".$name);
how do I fix this?


[2011-06-12 15:32:17] paj...@php.net

@tijs_maas at hotmail dot com

Please use a simple:

rename($path1, $path2); as reproduce script, nothing else. That's all this bug 
is 
about :)


[2011-06-12 15:27:05] tijs_maas at hotmail dot com

I don't know if i am right but i think i also notice this bug. I do not even 
use 
absolute paths.

I could use this function wrong or it is the bug, it sais: No error on line 19

 $pathtothisfolder = explode("/", str_replace(array('//', 
'\\'),'/',dirname(__FILE__)));

$pathtoUpperParent = "";
for( $i = 0; $i < count($pathtothisfolder) - 2; $i++ ) {
$pathtoUpperParent .= $pathtothisfolder[$i]."/";
}
$rootname = trim($pathtoUpperParent, versieDirPath());

$parents = count(explode("/", $rootname)) + 2;
$parentpath = "";
while ($parents > 0 ) {
$parentpath .= "../";
$parents --;
}

// voer de rename operatie uit
rename($parentpath.$_GET['versie']."/", $parentpath."sdfsdf/" );

The paths i use are without drives, am I also affected by this bug?


[2010-09-06 13:00:51] ahar...@php.net

Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=303070
Log: Per Pierre's e-mail, add a note that the fix for bug #48771 made 
cross-drive
renames work in Windows.


[2009-07-06 09:09:33] paj...@php.net

This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.






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


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


Bug #62358 [Com]: Segfault when using traits a lot

2012-08-12 Thread maciej dot sz at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62358&edit=1

 ID: 62358
 Comment by: maciej dot sz at gmail dot com
 Reported by:maciej dot sz at gmail dot com
 Summary:Segfault when using traits a lot
 Status: Feedback
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Linux 3.2.0-25-generic Ubuntu
 PHP Version:5.4.4
 Block user comment: N
 Private report: N

 New Comment:

This a very serious bug that stops deploying software to production. Can anyone 
tell me why the status has been changed to Feedback?


Previous Comments:

[2012-08-12 12:21:54] maciej dot sz at gmail dot com

Another crash, this time in newest 5.4.6RC1 :


Program received signal SIGSEGV, Segmentation fault.
0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
3059size_t name_len = strlen(fptr->common.function_name);
(gdb) bt
#0  0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
#1  0x0094f37b in do_inheritance_check_on_method (child=0x1ba67c0, 
parent=0x1b6d2b8)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3263
#2  0x0094f531 in do_inherit_method_check 
(child_function_table=0x1ba8970, parent=0x1b6d2b8, 
hash_key=0x7fff9dd0, child_ce=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3288
#3  0x00988bf0 in zend_hash_replace_checker_wrapper (target=0x1ba8970, 
source_data=0x1b6d2b8, 
p=0x1b79630, pParam=0x1ba8948, merge_checker_func=0x94f4aa 
)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:878
#4  0x00988c71 in zend_hash_merge_ex (target=0x1ba8970, 
source=0x1b64378, 
pCopyConstructor=0x94ddb3 , size=240, 
pMergeSource=0x94f4aa , pParam=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:892
#5  0x009507df in zend_do_inheritance (ce=0x1ba8948, 
parent_ce=0x1b64350)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3519
#6  0x009540a7 in do_bind_inherited_class (op_array=0x1ba5b10, 
opline=0x1bb74b0, 
class_table=0x126ee70, parent_ce=0x1b64350, compile_time=0 '\000')
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:4570
#7  0x009b742a in ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER 
(execute_data=0x77f95e70)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:936
#8  0x009b4122 in execute (op_array=0x1ba5b10)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#9  0x0096381c in zend_call_function (fci=0x7fffa410, 
fci_cache=0x7fffa460)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_execute_API.c:958
#10 0x00717021 in zim_reflection_method_invokeArgs (ht=2, 
return_value=0x1ba72f8, 
return_value_ptr=0x0, this_ptr=0x1b26ed0, return_value_used=1)
at /home/maciek/Downloads/php-5.4.6RC1/ext/reflection/php_reflection.c:3024
#11 0x009b5838 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:642
#12 0x009b66dc in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:752
#13 0x009b4122 in execute (op_array=0x7095e050)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#14 0x00976ca1 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend.c:1289
#15 0x008e90aa in php_execute_script (primary_file=0x7fffcdd0)
at /home/maciek/Downloads/php-5.4.6RC1/main/main.c:2473
#16 0x00abf8c1 in do_cli (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:988
#17 0x00ac09fa in main (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:1364


[2012-06-19 09:02:11] maciej dot sz at gmail dot com

Thank you for the response. I've compiled the snapshot (201206190730) and I got 
segfault with same BT, only this time it occured earlier in the script.

Maybe it is worth mentioning, that I was not able to reproduce the crash with 
small scripts (including only few files). The bug occurs when I use traits with 
large frameworks: PHPUnit or Zend Framework.


[2012-06-18 23:52:10] fel...@php.net

Please try using this snapshot:

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

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




[2012-06-18 20:23:49] maciej dot sz at gmail dot

Bug #62792 [Opn->Nab]: number_format with largue numbers is broken

2012-08-12 Thread aharvey
Edit report at https://bugs.php.net/bug.php?id=62792&edit=1

 ID: 62792
 Updated by: ahar...@php.net
 Reported by:brodanoel at gmail dot com
 Summary:number_format with largue numbers is broken
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Strings related
 Operating System:   Red Hat
 PHP Version:5.3.15
 Block user comment: N
 Private report: N

 New Comment:

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

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

Thank you for your interest in PHP.




Previous Comments:

[2012-08-10 13:39:25] brodanoel at gmail dot com

Description:

Using the number_format function with largue numbers, the value returned is the 
real + 1

Test script:
---
number_format(999, 0, '', '.')

Expected result:

9.999.999.999.999.999.999

Actual result:
--
10.000.000.000.000.000.000






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


Req #50110 [Com]: Static (File Scope) Variables

2012-08-12 Thread youdontneedme at o2 dot pl
Edit report at https://bugs.php.net/bug.php?id=50110&edit=1

 ID: 50110
 Comment by: youdontneedme at o2 dot pl
 Reported by:n8grndr1087 at optonline dot net
 Summary:Static (File Scope) Variables
 Status: Open
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   *
 PHP Version:*
 Block user comment: N
 Private report: N

 New Comment:

There is no information about such usage in documentation. (well, maybe that's 
why it does not work)

But if such usage is not documented why syntax:

static $age = 18;

is *valid* outside class?

I agree, this should have same consequences as in C lang.


Previous Comments:

[2009-11-07 18:19:38] n8grndr1087 at optonline dot net

This feature would also be useful for static (file scope) functions as well.


[2009-11-07 05:07:19] n8grndr1087 at optonline dot net

Description:

Global variables should be able to be declared 'static'.
Static globals, like in C, would only be accessible from the current file's 
scope. This would be a good way to protect internal variables used behind the 
scenes in a particular file. 

If there is any effective way to protect variables that I overlooked, outside 
of PHP classes, let me know. I understand that the possibility of this depends 
on how the include/file processing mechanism works.

Reproduce code:
---
myvar.inc: 


test.php: 
';
set_myvar(0);
$myvar = 1;
echo get_myvar();
?>

Expected result:

1
0

Actual result:
--
1
1






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


Bug #62328 [Opn->Csd]: implementing __toString and a cast to string fails

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62328&edit=1

 ID: 62328
 Updated by: larue...@php.net
 Reported by:jordan dot raub at dataxltd dot com
 Summary:implementing __toString and a cast to string fails
-Status: Open
+Status: Closed
 Type:   Bug
 Package:SimpleXML related
 Operating System:   Linux
 PHP Version:5.4.4
-Assigned To:
+Assigned To:laruence
 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:

[2012-08-12 04:00:08] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=7b307fb930e6cf328993dee4b060f6f823c39d24
Log: Fixed bug #62328 (implementing __toString and a cast to string fails)


[2012-08-12 03:49:53] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=7b307fb930e6cf328993dee4b060f6f823c39d24
Log: Fixed bug #62328 (implementing __toString and a cast to string fails)


[2012-08-10 10:17:10] leight at gmail dot com

This is caused by a built-in classes cast_object function being called when it 
exists, before falling back to alternative methods of converting to a string.

I have added a pull request that fixes the issue.

https://github.com/php/php-src/pull/157


[2012-06-14 19:13:55] jordan dot raub at dataxltd dot com

Oops! Accidentally switched the expected and actual results...


[2012-06-14 19:11:31] jordan dot raub at dataxltd dot com

Description:

I would expect casting to a string to have the same result as calling the 
__toString() function on extending a SimpleXMLElement object. 
I've tested this against

PHP 5.3.3-7+squeeze13 with Suhosin-Patch (cli) (built: Jun 10 2012 07:31:32) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with XCache v1.3.0, Copyright (c) 2005-2009, by mOo
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

and 

PHP 5.4.4 (cli) (built: Jun 14 2012 11:50:02) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

and 


PHP 5.3.14 (cli) (built: Jun 14 2012 11:49:39) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies


Test script:
---
');
$xml->tag = "you're it!";

echo "\nno cast\n";
echo $xml;
echo "\ncast\n";
echo (string) $xml;
echo "\nexplicit call\n";
echo $xml->__toString();
echo "\n";
var_dump((string) $xml);
var_dump($xml->__toString());


Expected result:

no cast
stringification
cast

explicit call
stringification
string(0) ""
string(15) "stringification"


Actual result:
--
no cast
stringification
cast
stringification
explicit call
stringification
string(15) "stringification"
string(15) "stringification"







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


[PHP-BUG] Req #62800 [NEW]: Create files, delete files, modify files

2012-08-12 Thread brandonskypimenta at gmail dot com
From: brandonskypimenta at gmail dot com
Operating system: all
PHP version:  Irrelevant
Package:  *General Issues
Bug Type: Feature/Change Request
Bug description:Create files, delete files, modify files

Description:

Any way to create files, delete files, modify files in PHP using these
commands?

create_file creates a file.
modify_file edits a file's text.
delete_file immediately deletes a file. WARNING: Deletion will be
permanent!
-
© 2013

Test script:
---



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



Req #62800 [Opn]: Creating/modifying/deleting files in PHP

2012-08-12 Thread brandonskypimenta at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62800&edit=1

 ID: 62800
 User updated by:brandonskypimenta at gmail dot com
 Reported by:brandonskypimenta at gmail dot com
-Summary:Create files, delete files, modify files
+Summary:Creating/modifying/deleting files in PHP
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

fixed title


Previous Comments:

[2012-08-12 01:29:43] brandonskypimenta at gmail dot com

Description:

Any way to create files, delete files, modify files in PHP using these commands?

create_file creates a file.
modify_file edits a file's text.
delete_file immediately deletes a file. WARNING: Deletion will be permanent!
-
© 2013

Test script:
---








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


Req #62800 [Opn]: Creating/modifying/deleting files in PHP

2012-08-12 Thread brandonskypimenta at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62800&edit=1

 ID: 62800
 User updated by:brandonskypimenta at gmail dot com
 Reported by:brandonskypimenta at gmail dot com
 Summary:Creating/modifying/deleting files in PHP
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
-PHP Version:Irrelevant
+PHP Version:Newest version of PHP
 Block user comment: N
 Private report: N

 New Comment:

fixed php version


Previous Comments:

[2012-08-12 01:31:05] brandonskypimenta at gmail dot com

fixed title


[2012-08-12 01:29:43] brandonskypimenta at gmail dot com

Description:

Any way to create files, delete files, modify files in PHP using these commands?

create_file creates a file.
modify_file edits a file's text.
delete_file immediately deletes a file. WARNING: Deletion will be permanent!
-
© 2013

Test script:
---








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


[PHP-BUG] Bug #62795 [NEW]: Zip extension version not defined

2012-08-12 Thread admin at yqed dot com
From: admin at yqed dot com
Operating system: CentOS 6 64bits
PHP version:  5.3.15
Package:  Zip Related
Bug Type: Bug
Bug description:Zip extension version not defined

Description:

Running the "php -i" command in a terminal displays the following
information for 
zip extension:
Zip => enabled
Extension Version => $Id$
Zip version => 1.11.0
Libzip version => 0.10.1

For some reason, the extension version is reported as $Id$.


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



[PHP-BUG] Req #62799 [NEW]: Parallel array processing

2012-08-12 Thread info at ludwig-gramberg dot de
From: info at ludwig-gramberg dot de
Operating system: Any
PHP version:  Irrelevant
Package:  Arrays related
Bug Type: Feature/Change Request
Bug description:Parallel array processing

Description:

Idea: an easy to use parallel processing function for arrays (or any
iterable 
data structure).

Example:



Now $arr would contain the following: [6, 7, 8, 9].
The values are written back to $arr. The parameter is called by reference.

Also a array_parallel_reduce would be nice.

Test script:
---
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });

Expected result:

[6, 7, 8, 9]


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



[PHP-BUG] Req #62797 [NEW]: Add a CLI parameter to override php.ini settings for a web server instance

2012-08-12 Thread mathias at qiwi dot be
From: mathias at qiwi dot be
Operating system: OS X 10.8
PHP version:  5.4.6RC1
Package:  Built-in web server
Bug Type: Feature/Change Request
Bug description:Add a CLI parameter to override php.ini settings for a web 
server instance

Description:

During development, it can be useful to override certain php.ini settings
for 
specific server instances (using the PHP built-in web server).

Of course, it’s possible to edit `php.ini` every time this is needed, (or
use 
`ini_set` in the PHP code where applicable), but for small changes it would
be 
very useful to just be able to specify the setting and its value as a
command 
line argument/value pair.

For example, to start a test server with a custom `include_path` setting 
(without overriding `php.ini` or changing the existing PHP code by adding 
`ini_set()` calls):

php -S localhost:8000 --set "include_path=.:/foo/bar:/baz/qux"

The syntax is just an example. Perhaps you’d prefer to do it a bit
differently, 
and allow people to point to a project-specific `php.ini` file:

php -S localhost:8000 --ini "./project.ini"

However, I’d strongly prefer the first solution.


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



[PHP-BUG] Bug #62794 [NEW]: print_r with debug_backtrace overwrites member variable

2012-08-12 Thread burakg at torreycommerce dot com
From: burakg at torreycommerce dot com
Operating system: CentOS 6.3
PHP version:  5.3.15
Package:  MySQLi related
Bug Type: Bug
Bug description:print_r with debug_backtrace overwrites member variable

Description:

Calling print_r(debug_backtrace()) from a method of a class that inherits
from 
mysqli overwrites the error member variable. Calling debug_backtrace() on
its own 
doesn't seem to cause any problems, but when combined with print_r, this
problem 
results.

Test script:
---
query("select");
var_dump($this->error);
print_r(debug_backtrace(), true);
var_dump($this->error);
}
}

$db = new Db("host", "user", "password", "database");
$db->f();

Expected result:

string(146) "You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near
'' at 
line 1"
string(146) "You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near
'' at 
line 1"

Actual result:
--
string(146) "You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near
'' at 
line 1"
string(0) ""

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



Req #54555 [Opn->Wfx]: Late static binding effect for __NAMESPACE__

2012-08-12 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=54555&edit=1

 ID: 54555
 Updated by: ni...@php.net
 Reported by:dinamic at gmail dot com
 Summary:Late static binding effect for __NAMESPACE__
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   Linux
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

The __FOO__ style constants are compile-time scalars. They don't resolve at 
runtime and also don't have any kind of late binding behavior. E.g. if you use 
__CLASS__ it will also be the class name of the class it occurred in, not the 
name of some inheriting class.

Instead you could for example get the namespace using

(new ReflectionClass($this))->getNamespaceName()

In static code (without $this) you could also use get_called_class and take 
everything until the last slash.


Previous Comments:

[2011-04-18 09:15:54] dinamic at gmail dot com

Description:

I've been chilling around with the latest PHP features and noticed that there 
is 
something missing - there is no way to get the current namespace if inheriting 
some implementation, which limit us on some implementations.

For example, we have an abstract class in one namespace and adapter for the 
very 
same class in another namespace. If we try to use the __NAMESPACE__ within the 
abstract class, it uses its own one and not the one of the inheriting class. 
I've 
checked the documentation to find some notes on this one to no avail.

Test script:
---
getNamespace());
}

Expected result:

nikola@nikola-pc:~$ php test2.php 
string(13) "SomeNamespace\Adapters"


Actual result:
--
nikola@nikola-pc:~$ php test2.php 
string(13) "SomeNamespace"







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


Req #39962 [Opn->Wfx]: Suggestion: SUBSTR_ADD Function

2012-08-12 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=39962&edit=1

 ID: 39962
 Updated by: ni...@php.net
 Reported by:pjoe444 at hotmail dot com
 Summary:Suggestion: SUBSTR_ADD Function
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
 Package:*General Issues
 PHP Version:5.2.0
 Block user comment: N
 Private report: N

 New Comment:

Closing this, as it can be easily done with substr_replace() already:

$var = substr_replace($var, ':', 2, 0);

Doesn't make much sense to add an extra function for this.


Previous Comments:

[2011-08-23 15:37:55] datib...@php.net

The following patch has been added/updated:

Patch Name: substr_insert.patch
Revision:   1314113875
URL:
https://bugs.php.net/patch-display.php?bug=39962&patch=substr_insert.patch&revision=1314113875


[2011-08-23 14:28:57] ar...@php.net

substr_replace() already provides this when the length argument is 0.


[2011-08-23 14:08:50] datib...@php.net

The following patch has been added/updated:

Patch Name: substr_insert.patch
Revision:   1314108530
URL:
https://bugs.php.net/patch-display.php?bug=39962&patch=substr_insert.patch&revision=1314108530


[2011-08-23 14:05:14] datib...@php.net

The following patch has been added/updated:

Patch Name: substr_insert.patch
Revision:   1314108314
URL:
https://bugs.php.net/patch-display.php?bug=39962&patch=substr_insert.patch&revision=1314108314


[2006-12-27 14:55:17] pjoe444 at hotmail dot com

( SUBTRACTION, on the other hand, does work simply enough with the current 
system:
with SUBSTR_REPLACE being able to replace a character with an empty string "" )




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


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


Req #60319 [Opn->Wfx]: PHP shorthand syntax

2012-08-12 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=60319&edit=1

 ID: 60319
 Updated by: ni...@php.net
 Reported by:deepakbalanimail at gmail dot com
 Summary:PHP shorthand syntax
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
 Package:*General Issues
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

PHP already has 


[2011-11-17 13:27:16] deepakbalanimail at gmail dot com

Description:

This is feature request:-

PHP needs a more efficient shorthand syntax. PHP already has the shorthand 
syntax for  = . 

But this thing will become nightmare when we want to use some flow control.







In this example we have to mix both type of syntax. So we need to make  
capable to process decision instructions.








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


Req #9654 [Opn->Csd]: Add is_type() function

2012-08-12 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=9654&edit=1

 ID: 9654
 Updated by: ni...@php.net
 Reported by:adam at cryptocomm dot com
 Summary:Add is_type() function
-Status: Open
+Status: Closed
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   *
 PHP Version:*
-Assigned To:
+Assigned To:nikic
 Block user comment: N
 Private report: N

 New Comment:

Closing this as PHP already has gettype() for a long, long time and that 
function can be used for this.

http://de.php.net/gettype


Previous Comments:

[2012-05-19 13:36:13] zyss at mail dot zp dot ua

Why not to write your own?

Note, however, that PHP is slow as mud so even a single function call costs 
much and it's usually much faster to use native functions for type checking (if 
you're concerned about the speed).

Also it's quite easy to mistype a type :) so using native functions is a 
preferred option as to me.

http://www.example.com/";, "r");
echo 'res($f): ', is_type($f, 'res') ? 'Y' : 'N', "\n";
echo 'resource($f): ', is_type($f, 'resource') ? 'Y' : 'N', "\n";
fclose($f);

echo 'string("abc"): ', is_type('abc', 'string') ? 'Y' : 'N', "\n";
echo 'object(stdClass): ', is_type(new stdClass(), 'object') ? 'Y' : 'N', "\n";
echo 'array([1, 2, 3]): ', is_type(array(1, 2, 3), 'array') ? 'Y' : 'N', "\n";
echo 'callable(Closure): ', is_type(function() { }, 'callable') ? 'Y' : 'N', 
"\n";
echo 'bool(true): ', is_type(true, 'bool') ? 'Y' : 'N', "\n";
echo 'boolean(true): ', is_type(true, 'boolean') ? 'Y' : 'N', "\n";
echo 'dir(__DIR__): ', is_type(__DIR__, 'dir') ? 'Y' : 'N', "\n";
echo 'file(__FILE__): ', is_type(__FILE__, 'file') ? 'Y' : 'N', "\n";
echo 'readable(__FILE__): ', is_type(__FILE__, 'readable') ? 'Y' : 'N', "\n";
echo 'writable(__FILE__): ', is_type(__FILE__, 'writable') ? 'Y' : 'N', "\n";
echo 'writeable(__FILE__): ', is_type(__FILE__, 'writeable') ? 'Y' : 'N', "\n";

$php = $_SERVER['argv'][0];
echo 'exec($php): ', is_type($php, 'exec') ? 'Y' : 'N', "\n";
echo 'executable($php): ', is_type($php, 'executable') ? 'Y' : 'N', "\n";

$link = __FILE__ . '.symlink';
if (function_exists('symlink'))
  @symlink(__FILE__, $link);
echo 'link($link): ', is_type($link, 'link') ? 'Y' : 'N', "\n";
@unlink($link);

$upl = @$_FILES['file']['tmp_name'];
echo 'uploaded(__FILE__): ', is_type(__FILE__, 'uploaded') ? 'Y' : 'N', "\n";
echo 'uploaded_file(__FILE__): ', is_type(__FILE__, 'uploaded_file') ? 'Y' : 
'N', "\n";

$client = new 
SoapClient('http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl', 
array('exceptions' => 0));
$result = $client->SomeFunction();
echo 'soap_fault($result): ', is_type($result, 'soap_fault') ? 'Y' : 'N', "\n";


[2001-03-09 09:57:24] adam at cryptocomm dot com

It would be much more clean and
quick to consolidate all the "is"
functions into like is_type($variable, "int")
and have it return the true or false
based on if the value of $variable is
the datatype you specified as the second
paramter. This makes more sense to
me then having like 20 is_whatever functions.





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


Req #60355 [Opn->Nab]: namespace wide and specific constant

2012-08-12 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=60355&edit=1

 ID: 60355
 Updated by: ni...@php.net
 Reported by:matty023 at gmail dot com
 Summary:namespace wide and specific constant
-Status: Open
+Status: Not a bug
 Type:   Feature/Change Request
 Package:*General Issues
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

There is already a language construct to define constants in a namespace:

namespace Bar;
const FOO = 'bar';

Yes, `const` also works outside a class ;)

define() is a function taking a constant name, so it (just like all other 
functions accepting constant/function/class names) needs a fully-qualified 
name. So if you want to define a namespace constant with define() (instead of 
`const`) you have to provide the full name:

define('Bar\FOO', 'bar');


Previous Comments:

[2011-11-22 07:54:45] matty023 at gmail dot com

Description:

It would be great if define() wasn't global throughout the whole app and 
contained inside the namespace to prevent collisions.

It could also be feasible to create a new type of constant that is available 
throughout an entire namespace;

define : Defines a named constant
= Global constant throughout execution

const  : Class Constants
= It is possible to define constant values on a per-class basis remaining the 
same and unchangeable. Constants differ from normal variables in that you don't 
use the $ symbol to declare or use them. 


?? : namespace wide global
nsdefine
nsconst
also accessible via \my\namespace\MYCONSTANT
= It is possible to define constant values on a per-namespace basis remaining 
the same and unchangeable. Namespace Constants differ from normal variables in 
that you don't use the $ symbol to declare or use them. 







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


Bug #62795 [Opn->Csd]: Zip extension version not defined

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62795&edit=1

 ID: 62795
 Updated by: larue...@php.net
 Reported by:admin at yqed dot com
 Summary:Zip extension version not defined
-Status: Open
+Status: Closed
 Type:   Bug
 Package:Zip Related
 Operating System:   CentOS 6 64bits
 PHP Version:5.3.15
-Assigned To:
+Assigned To:laruence
 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:

[2012-08-11 07:57:20] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=e1180b4f1aea83ee5dc7f62832a10056e0f62f18
Log: Fixed bug #62795 (Zip extension version not defined)


[2012-08-11 07:56:55] larue...@php.net

Automatic comment on behalf of laruence
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=e1180b4f1aea83ee5dc7f62832a10056e0f62f18
Log: Fixed bug #62795 (Zip extension version not defined)


[2012-08-11 02:59:41] admin at yqed dot com

Description:

Running the "php -i" command in a terminal displays the following information 
for 
zip extension:
Zip => enabled
Extension Version => $Id$
Zip version => 1.11.0
Libzip version => 0.10.1

For some reason, the extension version is reported as $Id$.







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


Bug #62358 [Fbk->Opn]: Segfault when using traits a lot

2012-08-12 Thread aharvey
Edit report at https://bugs.php.net/bug.php?id=62358&edit=1

 ID: 62358
 Updated by: ahar...@php.net
 Reported by:maciej dot sz at gmail dot com
 Summary:Segfault when using traits a lot
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Linux 3.2.0-25-generic Ubuntu
 PHP Version:5.4.4
 Block user comment: N
 Private report: N

 New Comment:

It should have been set back to Open when you responded.


Previous Comments:

[2012-08-12 12:25:52] maciej dot sz at gmail dot com

This a very serious bug that stops deploying software to production. Can anyone 
tell me why the status has been changed to Feedback?


[2012-08-12 12:21:54] maciej dot sz at gmail dot com

Another crash, this time in newest 5.4.6RC1 :


Program received signal SIGSEGV, Segmentation fault.
0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
3059size_t name_len = strlen(fptr->common.function_name);
(gdb) bt
#0  0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
#1  0x0094f37b in do_inheritance_check_on_method (child=0x1ba67c0, 
parent=0x1b6d2b8)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3263
#2  0x0094f531 in do_inherit_method_check 
(child_function_table=0x1ba8970, parent=0x1b6d2b8, 
hash_key=0x7fff9dd0, child_ce=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3288
#3  0x00988bf0 in zend_hash_replace_checker_wrapper (target=0x1ba8970, 
source_data=0x1b6d2b8, 
p=0x1b79630, pParam=0x1ba8948, merge_checker_func=0x94f4aa 
)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:878
#4  0x00988c71 in zend_hash_merge_ex (target=0x1ba8970, 
source=0x1b64378, 
pCopyConstructor=0x94ddb3 , size=240, 
pMergeSource=0x94f4aa , pParam=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:892
#5  0x009507df in zend_do_inheritance (ce=0x1ba8948, 
parent_ce=0x1b64350)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3519
#6  0x009540a7 in do_bind_inherited_class (op_array=0x1ba5b10, 
opline=0x1bb74b0, 
class_table=0x126ee70, parent_ce=0x1b64350, compile_time=0 '\000')
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:4570
#7  0x009b742a in ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER 
(execute_data=0x77f95e70)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:936
#8  0x009b4122 in execute (op_array=0x1ba5b10)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#9  0x0096381c in zend_call_function (fci=0x7fffa410, 
fci_cache=0x7fffa460)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_execute_API.c:958
#10 0x00717021 in zim_reflection_method_invokeArgs (ht=2, 
return_value=0x1ba72f8, 
return_value_ptr=0x0, this_ptr=0x1b26ed0, return_value_used=1)
at /home/maciek/Downloads/php-5.4.6RC1/ext/reflection/php_reflection.c:3024
#11 0x009b5838 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:642
#12 0x009b66dc in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:752
#13 0x009b4122 in execute (op_array=0x7095e050)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#14 0x00976ca1 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend.c:1289
#15 0x008e90aa in php_execute_script (primary_file=0x7fffcdd0)
at /home/maciek/Downloads/php-5.4.6RC1/main/main.c:2473
#16 0x00abf8c1 in do_cli (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:988
#17 0x00ac09fa in main (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:1364


[2012-06-19 09:02:11] maciej dot sz at gmail dot com

Thank you for the response. I've compiled the snapshot (201206190730) and I got 
segfault with same BT, only this time it occured earlier in the script.

Maybe it is worth mentioning, that I was not able to reproduce the crash with 
small scripts (including only few files). The bug occurs when I use traits with 
large frameworks: PHPUnit or Zend Framework.


[2012-06-18 23:52:10] fel...@php.net

Please try using this snapshot:

  http://snaps.php.net/p

Bug #62444 [Opn->Asn]: Handle leak in is_readable

2012-08-12 Thread pajoye
Edit report at https://bugs.php.net/bug.php?id=62444&edit=1

 ID: 62444
 Updated by: paj...@php.net
 Reported by:sergio dot nalin at gmail dot com
 Summary:Handle leak in is_readable
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:Filesystem function related
 Operating System:   Win 7 64bit
 PHP Version:5.3.14
-Assigned To:
+Assigned To:pajoye
 Block user comment: N
 Private report: N



Previous Comments:

[2012-07-26 17:24:41] mr_pain at operamail dot com

Memory leak confirmed for the following configurations:

PHP vc9 5.3.15, thread safe version + Apache Httpd 2.4.2 + Win XP SP3 
PHP vc9 5.4.5,  thread safe version + Apache Httpd 2.4.2 + Win XP SP3 

Running Test script:

for($i=0; $i<100;$i++) {
  is_readable("c:\\temp");
}

PHP vc9 5.4.5 tested on WAMP stacks:


XAMPP USB Lite 1.8.0(Windows XP SP3)
Uniform Server 8.5.8-Coral  (Windows XP SP3)

For details see:
http://forum.uniformserver.com/index.php?showtopic=2627&hl=

Windows 7 SP1 and Windows Server 2008 R2 (both is 64-bit OS)

I agree with above comment, it makes running PHP on a Windows production server 
impractical.


[2012-07-25 22:26:05] smiles_indonesia at yahoo dot co dot id

It seems happened since introduction of php 5.3.0. If you see in the changelogs:

http://www.php.net/ChangeLog-5.php

Added support for ACL (is_writable, is_readable, reports now correct results) 
on Windows. (Pierre, Venkat Raman Don, Kanwaljeet Singla)

This issue is very critical, because it makes php running on windows production 
server impractical / unusable...

My quad xeon box becomes very slow after some days, the ram usage is 
mysteriously increased (httpd process usage still remains the same, I thought 
handle consumes kernel spaces)...

If your webserver servers 1 million request, then there will be about 1 million 
handle opened... Usual application only consumes 20 to 2000 handles...


[2012-06-29 00:10:17] sergio dot nalin at gmail dot com

Description:

PHP vc9 5.3.14, thread safe version + Apache Httpd 2.2.22 + Win 7/Win Server 
2008 
R2

Each time is_readable in invoked, it leaves an open handle in the httpd process.



Test script:
---
for($i=0; $i<100;$i++) {
  is_readable("c:\\temp");
}

NOTE: the folder/file must exist for the leak to happen.

Expected result:

No leaked handles

Actual result:
--
100 leaked handles






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


Bug #62358 [Opn]: Segfault when using traits a lot

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62358&edit=1

 ID: 62358
 Updated by: larue...@php.net
 Reported by:maciej dot sz at gmail dot com
 Summary:Segfault when using traits a lot
 Status: Open
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Linux 3.2.0-25-generic Ubuntu
 PHP Version:5.4.4
-Assigned To:
+Assigned To:laruence
 Block user comment: N
 Private report: N

 New Comment:

could you give us a reproduce script?

seems you are using reflection in your scripts. (assign to myself, then I can 
get 
your feedback as soon as possible)


Previous Comments:

[2012-08-13 01:17:51] ahar...@php.net

It should have been set back to Open when you responded.


[2012-08-12 12:25:52] maciej dot sz at gmail dot com

This a very serious bug that stops deploying software to production. Can anyone 
tell me why the status has been changed to Feedback?


[2012-08-12 12:21:54] maciej dot sz at gmail dot com

Another crash, this time in newest 5.4.6RC1 :


Program received signal SIGSEGV, Segmentation fault.
0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
3059size_t name_len = strlen(fptr->common.function_name);
(gdb) bt
#0  0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
#1  0x0094f37b in do_inheritance_check_on_method (child=0x1ba67c0, 
parent=0x1b6d2b8)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3263
#2  0x0094f531 in do_inherit_method_check 
(child_function_table=0x1ba8970, parent=0x1b6d2b8, 
hash_key=0x7fff9dd0, child_ce=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3288
#3  0x00988bf0 in zend_hash_replace_checker_wrapper (target=0x1ba8970, 
source_data=0x1b6d2b8, 
p=0x1b79630, pParam=0x1ba8948, merge_checker_func=0x94f4aa 
)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:878
#4  0x00988c71 in zend_hash_merge_ex (target=0x1ba8970, 
source=0x1b64378, 
pCopyConstructor=0x94ddb3 , size=240, 
pMergeSource=0x94f4aa , pParam=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:892
#5  0x009507df in zend_do_inheritance (ce=0x1ba8948, 
parent_ce=0x1b64350)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3519
#6  0x009540a7 in do_bind_inherited_class (op_array=0x1ba5b10, 
opline=0x1bb74b0, 
class_table=0x126ee70, parent_ce=0x1b64350, compile_time=0 '\000')
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:4570
#7  0x009b742a in ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER 
(execute_data=0x77f95e70)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:936
#8  0x009b4122 in execute (op_array=0x1ba5b10)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#9  0x0096381c in zend_call_function (fci=0x7fffa410, 
fci_cache=0x7fffa460)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_execute_API.c:958
#10 0x00717021 in zim_reflection_method_invokeArgs (ht=2, 
return_value=0x1ba72f8, 
return_value_ptr=0x0, this_ptr=0x1b26ed0, return_value_used=1)
at /home/maciek/Downloads/php-5.4.6RC1/ext/reflection/php_reflection.c:3024
#11 0x009b5838 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:642
#12 0x009b66dc in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:752
#13 0x009b4122 in execute (op_array=0x7095e050)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#14 0x00976ca1 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend.c:1289
#15 0x008e90aa in php_execute_script (primary_file=0x7fffcdd0)
at /home/maciek/Downloads/php-5.4.6RC1/main/main.c:2473
#16 0x00abf8c1 in do_cli (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:988
#17 0x00ac09fa in main (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:1364


[2012-06-19 09:02:11] maciej dot sz at gmail dot com

Thank you for the response. I've compiled the snapshot (201206190730) and I got 
segfault with same BT, only this time it occured earlier in the script.

Maybe it is worth mentioning, that I was not able to reproduce the crash with 
s

Bug #62358 [Asn]: Segfault when using traits a lot

2012-08-12 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=62358&edit=1

 ID: 62358
 Updated by: larue...@php.net
 Reported by:maciej dot sz at gmail dot com
 Summary:Segfault when using traits a lot
 Status: Assigned
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Linux 3.2.0-25-generic Ubuntu
 PHP Version:5.4.4
 Assigned To:laruence
 Block user comment: N
 Private report: N

 New Comment:

and btw: could you please print the fptr in your bt out? maybe it will be help, 
like:

gdb > f0
gdb > p *fptr


Previous Comments:

[2012-08-13 06:34:06] larue...@php.net

could you give us a reproduce script?

seems you are using reflection in your scripts. (assign to myself, then I can 
get 
your feedback as soon as possible)


[2012-08-13 01:17:51] ahar...@php.net

It should have been set back to Open when you responded.


[2012-08-12 12:25:52] maciej dot sz at gmail dot com

This a very serious bug that stops deploying software to production. Can anyone 
tell me why the status has been changed to Feedback?


[2012-08-12 12:21:54] maciej dot sz at gmail dot com

Another crash, this time in newest 5.4.6RC1 :


Program received signal SIGSEGV, Segmentation fault.
0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
3059size_t name_len = strlen(fptr->common.function_name);
(gdb) bt
#0  0x0094e409 in zend_get_function_declaration (fptr=0x1b5e240)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3059
#1  0x0094f37b in do_inheritance_check_on_method (child=0x1ba67c0, 
parent=0x1b6d2b8)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3263
#2  0x0094f531 in do_inherit_method_check 
(child_function_table=0x1ba8970, parent=0x1b6d2b8, 
hash_key=0x7fff9dd0, child_ce=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3288
#3  0x00988bf0 in zend_hash_replace_checker_wrapper (target=0x1ba8970, 
source_data=0x1b6d2b8, 
p=0x1b79630, pParam=0x1ba8948, merge_checker_func=0x94f4aa 
)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:878
#4  0x00988c71 in zend_hash_merge_ex (target=0x1ba8970, 
source=0x1b64378, 
pCopyConstructor=0x94ddb3 , size=240, 
pMergeSource=0x94f4aa , pParam=0x1ba8948)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_hash.c:892
#5  0x009507df in zend_do_inheritance (ce=0x1ba8948, 
parent_ce=0x1b64350)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:3519
#6  0x009540a7 in do_bind_inherited_class (op_array=0x1ba5b10, 
opline=0x1bb74b0, 
class_table=0x126ee70, parent_ce=0x1b64350, compile_time=0 '\000')
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_compile.c:4570
#7  0x009b742a in ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER 
(execute_data=0x77f95e70)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:936
#8  0x009b4122 in execute (op_array=0x1ba5b10)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#9  0x0096381c in zend_call_function (fci=0x7fffa410, 
fci_cache=0x7fffa460)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_execute_API.c:958
#10 0x00717021 in zim_reflection_method_invokeArgs (ht=2, 
return_value=0x1ba72f8, 
return_value_ptr=0x0, this_ptr=0x1b26ed0, return_value_used=1)
at /home/maciek/Downloads/php-5.4.6RC1/ext/reflection/php_reflection.c:3024
#11 0x009b5838 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:642
#12 0x009b66dc in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0x77f94728)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:752
#13 0x009b4122 in execute (op_array=0x7095e050)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend_vm_execute.h:410
#14 0x00976ca1 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
at /home/maciek/Downloads/php-5.4.6RC1/Zend/zend.c:1289
#15 0x008e90aa in php_execute_script (primary_file=0x7fffcdd0)
at /home/maciek/Downloads/php-5.4.6RC1/main/main.c:2473
#16 0x00abf8c1 in do_cli (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:988
#17 0x00ac09fa in main (argc=6, argv=0x7fffe1b8)
at /home/maciek/Downloads/php-5.4.6RC1/sapi/cli/php_cli.c:1364


[2012-06-19 09:02:11] maciej dot sz at gmail dot com

Thank you for the response.