Bug #60457 [Opn->Csd]: gc_zval_possible_root SIGSEGV

2013-08-30 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=60457&edit=1

 ID: 60457
 Updated by: maar...@php.net
 Reported by:Sjon at hortensius dot net
 Summary:gc_zval_possible_root SIGSEGV
-Status: Open
+Status: Closed
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Linux
 PHP Version:5.3.8
-Assigned To:
+Assigned To:maarten
 Block user comment: N
 Private report: N

 New Comment:

Fixed in related issue :)


Previous Comments:

[2012-01-27 13:19:23] no at snaxor dot com

It appears that the bug #60701 referenced by Sjon at hortensius dot net was the 
responsible for the crashes in my application.


[2012-01-20 13:37:39] sjon at hortensius dot net

This bug has been solved in a more specific bug which includes a patch: 
https://bugs.php.net/bug.php?id=60701


[2012-01-04 08:26:51] Sjon at hortensius dot net

For anyone interested, this bug is not related to a single class, but we have 
worked around, and seen this bug occur again, in many different places.

I have also been reproducing this in 5.3.6 / 5.3.5 / 5.3.4 and 5.3.3


[2012-01-04 07:31:07] no at snaxor dot com

I may be bumping into this one as well, Similarly, I cannot provide a script to 
reproduce it since it happens in a project with many classes, but I'll see if I 
can narrow it down and create one. 

It is very inconsistent. It will die one the same page but with different data 
it will be fine. What seems to be sparking it in my case is Smarty, with lots 
of 
sub-template files. The content is rendered correctly, but during Smarty's 
cleanup is when it dies.

It is trigger-able via php command line or apache module. 

gc_disable() doesn't unfortunately have any effect.

PHP Version: 5.3.8 on OSX.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x003dca9fd2f1
0x000100359618 in gc_zval_possible_root ()
(gdb) bt
#0  0x000100359618 in gc_zval_possible_root ()
#1  0x00010034a765 in zend_hash_destroy ()
#2  0x00010035c86c in zend_object_std_dtor ()
#3  0x00010035c4f8 in zend_objects_free_object_storage ()
#4  0x00010035faae in zend_objects_store_del_ref_by_handle_ex ()
#5  0x00010035fb64 in zend_objects_store_del_ref ()
#6  0x000100334e2d in _zval_ptr_dtor ()
#7  0x00010034a765 in zend_hash_destroy ()
#8  0x00010033f1b0 in _zval_dtor_func ()
#9  0x000100334e2d in _zval_ptr_dtor ()
#10 0x00010034a765 in zend_hash_destroy ()
#11 0x00010035c86c in zend_object_std_dtor ()
#12 0x00010035c4f8 in zend_objects_free_object_storage ()
#13 0x00010035f6eb in zend_objects_store_free_object_storage ()
#14 0x000100337750 in shutdown_executor ()
#15 0x00010033feae in zend_deactivate ()
#16 0x0001002f08b1 in php_request_shutdown ()
#17 0x0001003ba366 in main ()
#18 0x000110ec in start ()


[2011-12-12 15:58:33] Sjon at hortensius dot net

I am afraid not, gc_disable() doesn't solve this segfault unfortunately




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


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


Bug #55219 [Ver->Wfx]: Segmentation fault with Serializable Object on self-reference

2013-08-30 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=55219&edit=1

 ID: 55219
 Updated by: maar...@php.net
 Reported by:garic dot suess+php at gmail dot com
 Summary:Segmentation fault with Serializable Object on
 self-reference
-Status: Verified
+Status: Wont fix
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Ubuntu Linux 10.10 x64
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

Fixed in 5.4.0, see http://3v4l.org/XuJmX

PHP 5.3 is end of life per March 2013 ( http://php.net/releases/5_3_20.php ), 
so you should upgrade to 5.4. Given that the issue is 2 years old, you might 
just as well already have. ;)


Previous Comments:

[2011-11-14 14:53:14] errebi at gmail dot com

I can reproduce it on PHP 5.2.11, but the result is quite different. (one more 
itaration)


object(Test)#1 (2) {
  ["member"]=>
  object(Test)#1 (2) {
["member"]=>
*RECURSION*
["message"]=>
string(8) "original"
  }
  ["message"]=>
  string(8) "original"
}
Segmentation fault



Hope could help


[2011-07-17 08:23:58] fel...@php.net

On 5.4 and trunk works because the r299770 change (Added support for object 
references in recursive serialize() calls. FR #36424)


[2011-07-17 07:48:36] fel...@php.net

I can reproduce it only in 5.3 branch. It's due a stack call overflow.


[2011-07-16 23:46:29] garic dot suess+php at gmail dot com

Description:

---
>From manual page: http://www.php.net/class.serializable
---

When a Serializable object contains a reference to it self a Segmentation fault 
is caused.

I first encountered this in 5.3.3, then found a binary package for 5.3.5 for my 
distribution. Finally I compiled my own 5.3.6. The segmentation fault persists 
in 
all three versions.

If the Serializable interface is removed the code works fine. 

Although the fault is reproducible, I found encountered other self-reference 
scenarios where it is not triggered, making this very unpredictable.

Test script:
---
class Test implements Serializable {
public $member, $message;

function __construct($message) {
$this->message = $message;
}

function serialize() {
return serialize(array($this->message, $this->member));
}

function unserialize($serialized) {
list($this->message, $this->member) = unserialize($serialized); 
}
}

$constructed = new Test("original");
$constructed->member = $constructed; //References to self (in this example 
pointless, but technically legal)
var_dump($constructed);
$transported = unserialize(serialize($constructed)); // Segmentation fault.

Expected result:

Clean exit..

Actual result:
--
object(Test)#1 (2) {
  ["member"]=>
  *RECURSION*
  ["message"]=>
  string(8) "original"
}
Segmentation fault







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


Req #40526 [Opn->Csd]: asXML() function formatting

2013-05-29 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=40526&edit=1

 ID: 40526
 Updated by: maar...@php.net
 Reported by:edboy002 at gmail dot com
 Summary:asXML() function formatting
-Status: Open
+Status: Closed
 Type:   Feature/Change Request
 Package:SimpleXML related
 Operating System:   Windows XP
 PHP Version:5.2.1
-Assigned To:
+Assigned To:maarten
 Block user comment: N
 Private report: N

 New Comment:

There are alternatives for formatting and this isn't really the responsibility 
of the asXML() method.


Previous Comments:

[2011-03-22 23:36:28] tom at samplonius dot org

The toXML() method doesn't need formatting, as you can use the XML_Beautifier 
module in PEARK, or if you prefer the DOM output method, create a DOM object, 
and then use the simplexml_import_dom() function to make it accessible in 
SimpleXML.  Then you can access the XML either via DOM or via SimpleXML.


[2007-02-17 20:42:42] edboy002 at gmail dot com

Description:

I was outputting a SimpleXML document into an XML file, and it came out as a 
full string. Will there be support for formatting the output, like in DOM?

Reproduce code:
---
$dom->asXML($ext); # Is there a way to format this like in DOM?

Expected result:


  blah
  


Actual result:
--
blah






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


Req #7006 [Opn->Csd]: preg_replace ( string pattern, array replacement, string subject );

2013-05-29 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=7006&edit=1

 ID: 7006
 Updated by: maar...@php.net
 Reported by:joel dot jacobson at mobigym dot se
 Summary:preg_replace ( string pattern, array replacement,
 string subject );
-Status: Open
+Status: Closed
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   Linux 2.4.0-test7
 PHP Version:4.0.2
-Assigned To:
+Assigned To:maarten
 Block user comment: N
 Private report: N

 New Comment:

Numerous alternatives available:
- str_replace() if no regex needed
- use array_fill() to pass an array
- use a callback as demonstrated above
etc. etc.


Previous Comments:

[2011-01-02 05:32:58] gmblar+php at gmail dot com

%col%%col%%col%';
$htmlDoc = preg_replace_callback('/%col%/', function($item) use(&$tvPrograms) {
return array_shift($tvPrograms);
}, $data);
print $htmlDoc;

?>


# Result:
SimpsonsSouthparkDisney Time


[2010-08-07 01:46:47] johan...@php.net

.


[2002-06-08 10:06:49] bigredlinux at yahoo dot com

I meant to say "pass it an array of matches and an array of replacements"


[2002-06-08 10:06:14] bigredlinux at yahoo dot com

First of all, using preg_replace here is a sin!  You should be using 
str_replace, and if you were using str_replace you would not have to worry, 
since it has this feature.  But, assuming that you did need to match a regular 
expression, well, then just do array_fill for your search and pass it an array 
of matches and an array of keys and you will be good to go.  So no, you don't 
really need this feature.


[2000-10-04 02:52:34] joel dot jacobson at mobigym dot se

''If pattern is an array and replacement is a string; then this replacement 
string is used for every value of pattern. The converse would not make sense, 
though.'' (http://www.php.net/manual/function.preg-replace.php)

I don't agree. The converse is a feature that I would like to be available.

Have a look at the following example:
%col%%col%%col%';
$htmlDoc = preg_replace ( '/%col%/', $tvPrograms, $data );
print $htmlDoc;
?>

This will not work. But wouldn't it be nice if it did?
That is, replace match number n with $tvPrograms[n] in $data.

Thanks in advance for any comments.
Best regards, Joel Jacobson





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


Req #42116 [Opn->Csd]: Safe eval()

2013-05-29 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=42116&edit=1

 ID: 42116
 Updated by: maar...@php.net
 Reported by:kripper3 at hotmail dot com
 Summary:Safe eval()
-Status: Open
+Status: Closed
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   Irrelevant
 PHP Version:5.2.3
-Assigned To:
+Assigned To:maarten
 Block user comment: N
 Private report: N

 New Comment:

Whitelisting is always safer than blacklisting, so you should add a specific 
whitelist.

Instead of writing a whitelist for this specific usage (i.e. arethmetic), you'd 
just as well grab a specific parser made for the job. :)


Previous Comments:

[2011-11-23 13:37:45] zyss at mail dot zp dot ua

You should use arithmetic expressions parser instead of using eval() for such 
purposes, IMHO.

There are tons of such parsers for PHP and nothing prevents you from writing 
your own.

Exposing eval() to users is a very bad thing whatever filters are there.


[2007-07-26 20:56:47] kripper3 at hotmail dot com

Description:

eval($code) makes it possible to execute PHP code.
It becames usefull when $code is provided dynamically (by the user of the 
application).
For example, in order to compute a math expression provided by the user via a 
Web Interface.
A lot of applications are using eval() this way.
The problem is that eval() is not safe, and makes it possible to inject code.
For example, instead of providing a math expression, I could provide code for 
listing files, get the content of the scripts and obtain hardcoded passwords.
On http://www.php.net/manual/en/function.eval.php#75389 someone proposed a 
parser to detect disallowed PHP functions, but since the evaled code can be 
very flexible (ie. "$a = 'un' . 'link'; $a('')"), it seems the solution 
must be implemented in the engine.
In other words, there should be a secure sandbox eval() function, let's say 
"save_eval()".

I guess this could be difficult to implement.
Besides, the definition of "save" may be subjective.

I would define "save" as, at least, to not allow someone to do I/O operations 
(ie. read/write files, access URL's, etc.) and not access the applications code 
space (ie. change $GLOBALS, $_SESSION, $_SERVER, etc).

To day, to use eval() implies a security risk in almost any app. that uses this 
function. Besides, we are missing a BIG RED WARNING BOX in the documentation 
page to inform our PHP users. Therefore, it is a social bug.

Related "Bug":

http://bugs.php.net/bug.php?id=40722&edit=2

IMO, it's no serious answer, since OS privileges cannot avoid reading passwords 
in PHP scripts or inyecting:

$_SESSION['isAdmin'] = 'ok...let_me_hack_your_php_app')

Reproduce code:
---
eval()

or

save_eval()


Expected result:

ERROR: Evaled code cannot execute function ''

Actual result:
--
Irrelevant.






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


Req #17617 [Opn->Wfx]: levenshtein() param for faster return

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=17617&edit=1

 ID: 17617
 Updated by: maar...@php.net
 Reported by:gonfidentschal at hotmail dot com
 Summary:levenshtein() param for faster return
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   all
 PHP Version:4.1.2
 Block user comment: N
 Private report: N

 New Comment:

No response in 11 years, so safe to conclude that there's little interest in 
this feature. Also a very good change issue starter also has moved on (other 
project / chosen better algorithm).


Previous Comments:

[2002-06-05 18:33:57] gonfidentschal at hotmail dot com

in my case, i want to find strings that are similar to a given one. so a lev() 
return of >2 means i throw that string away. 

maybe another param to levenshtein() could help speed up the function, in that 
it could return when the 3rd mismatch was found. it would not have to do it's 
job to the end.

anyway, i'm surprised how fast it is already. :)

greetings
fab








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


Req #15232 [Opn->NoF]: Need a possibility to compare two references

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=15232&edit=1

 ID: 15232
 Updated by: maar...@php.net
 Reported by:flying at dom dot natm dot ru
 Summary:Need a possibility to compare two references
-Status: Open
+Status: No Feedback
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   All
 PHP Version:4.0.6
 Block user comment: N
 Private report: N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.




Previous Comments:

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

For scalar values, this is impossible. And you probably don't want this either, 
because $a and $b might actually point to the same value (e.g. due to compiler 
optimization)

For objects you could use the equality operator (===). For example:
$a = new mynumber(5);
$b = new mynumber(5);

echo $a === $b;


[2002-01-26 06:18:25] flying at dom dot natm dot ru

 PHP have no possiblity to find, if two references points to the same actual 
variable, but sometimes it is necesary.

Short example:

$a = 5;
$b = 5;
$a_ref1 = &$a;
$a_ref2 = &$a;
$b_ref = &$b;

 PHP needs a function (or operator) which will return TRUE, when comparing 
$a_ref1 and $a_ref2, but FALSE, if comparing $a_ref1 and $b_ref.





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


Req #17565 [Opn->Wfx]: optional ORDER parameter for range()

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=17565&edit=1

 ID: 17565
 Updated by: maar...@php.net
 Reported by:bigredlinux at yahoo dot com
 Summary:optional ORDER parameter for range()
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Linux
 PHP Version:4.2.1
 Block user comment: N
 Private report: N

 New Comment:

Just add an if condition for your business rules where you expect an empty 
array.


Previous Comments:

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

range() now has that option since 5.0, though it will still assume the step 
size 
is negative when the start value is higher than the end value.


[2002-06-02 05:52:40] bigredlinux at yahoo dot com

The range() function has the ability to generate a range from one number (or 
character) to another.  It states in the documentation that if the first number 
(character) is greater than the second, it creates a decreasing range.  
However, the problem is, sometimes you don't want it to switch range order, so 
it would be nice to have a third parameter which states the direction or states 
whether you want it to auto flip.  Hence, if I did

range(9, 0, ASC)

it would generate an empty array...

or prehaps I could do

range(9, 0, false)

for not autoflipping.





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


Req #14896 [Opn->Wfx]: Multi threaded support

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=14896&edit=1

 ID: 14896
 Updated by: maar...@php.net
 Reported by:alan_k at akbkhome dot com
 Summary:Multi threaded support
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   All
 PHP Version:4.0CVS-2002-01-06
 Block user comment: N
 Private report: N

 New Comment:

Language won't support this feature.


Previous Comments:

[2002-01-06 20:23:10] alan_k at akbkhome dot com

Couldnt find it in the database so I thought I better add it.

$id = thread_create(function_or_object_method);
thread_stop($id);

* especially so that global vars etc. are available in the other threads.. - 
without resorting to shm + pcntl

similar to perl?/pike/python etc.

This would be useful for PHP-GTK apps. (albeit not essential) 
- although Its one of those be-carefull features :)





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


Req #19245 [Opn->Wfx]: Alter error message for execution time exceeded

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=19245&edit=1

 ID: 19245
 Updated by: maar...@php.net
 Reported by:t_o_m_ at yahoo dot com
 Summary:Alter error message for execution time exceeded
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   All
 PHP Version:4.2.2
 Block user comment: N
 Private report: N

 New Comment:

You can view your access logs to see which request caused the timeout. And if 
you conclude you're waiting on sql, you can watch the slow query log (or even 
always keep an eye on slow queries)

As there are other logs available, no need to add 1 arbitrary (debugging might 
depend on others) variable to this message...


Previous Comments:

[2002-09-05 06:49:08] t_o_m_ at yahoo dot com

I have the log_errors and error_log set in my php.ini.
However when I look through it I see lines like:

[05-Sep-2002 10:03:31] PHP Fatal error:  Maximum execution time of 30 seconds 
exceeded in E:\intranet\reports\db.inc on line 9

This file is includeded in many other files, and from this error it is not 
possible to tell which the including file was. In my case the including file 
contains an over complex sql statement, the include file (db.inc) just runs it.

Would it be possible for this error message to have $_SERVER['PHP_SELF'] in it?





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


Req #18675 [Opn->Wfx]: aborting scripts when user hits "stop" in browser

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=18675&edit=1

 ID: 18675
 Updated by: maar...@php.net
 Reported by:radu dot rendec at ines dot ro
 Summary:aborting scripts when user hits "stop" in browser
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   any
 PHP Version:4.2.2
 Block user comment: N
 Private report: N

 New Comment:

This is no safeguard against buggy code.

For instance, for your example: all I have to do to keep your server bussy is 
to keep open a few connections... B)


Previous Comments:

[2002-07-31 12:23:15] radu dot rendec at ines dot ro

The default behavior, as reported in the documentation, is to abort scripts 
with the ABORTED flag on _when the script tries to output something_. This may 
lead to a security issue.

Suppose that a malicious (or dummy) user of a shared web hosting system makes a 
dead loop in a script and no output is produced inside that loop. Moreover, the 
script makes some system calls inside that loop so the time limit counter is 
slowly incremented (or even not incremented at all). So the time limit 
protection won't work, and neither the ABORTED flag protection (because no 
output is made inside the loop).

If a remote user tries to access the broken script via the browser and hits the 
stop button, the script will run on the server for ever, causing serious load. 
If more users try to access the broken script (or the same user tries to access 
it more times), the server will have a huge load and will soon be unusable.

I suggest the default behavior be to abort the execution of the script as soon 
as the connection is aborted.





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


Req #19607 [Opn->Wfx]: Fourth argument for htmlentities()

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=19607&edit=1

 ID: 19607
 Updated by: maar...@php.net
 Reported by:marcel_normann at gmx dot net
 Summary:Fourth argument for htmlentities()
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   all
 PHP Version:4CVS-2002-09-26
 Block user comment: N
 Private report: N

 New Comment:

No response in 11 years, so safe to conclude that there's little interest in 
this feature. Also a very good change issue starter also has moved on (other 
project / workaround like str_replace whitelisted chars afterwards).


Previous Comments:

[2002-09-26 01:56:36] marcel_normann at gmx dot net

Htmlentities() schould have a fourth argument where you can add chars that will 
not be translated.

For example  will return 
"Umläütß", but  
will respond "Umläütß".





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


Req #20799 [Opn->Wfx]: Able to call function when reaching a certain line in a certain file

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=20799&edit=1

 ID: 20799
 Updated by: maar...@php.net
 Reported by:powerblade at mail dot dk
 Summary:Able to call function when reaching a certain line
 in a certain file
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   Windows XP
 PHP Version:4.2.3
 Block user comment: N
 Private report: N

 New Comment:

No response in 11 years, bad idea (application framework should offer proper 
hooks), and also outdated since PHP 5 offers full OO features.


Previous Comments:

[2002-12-03 15:43:38] powerblade at mail dot dk

The reason i need this feature is when people wants to make "hacks" for 
scripts. Then they often modify the scripts a bit, and add lines everywhere in 
the script. If you then distribute the hack, you need to tell them where in the 
script they add the lines. The problem is they already have other hacks 
installed, so it doesn't look the same. So i thought of a trigger_line() 
function. load the function with a parameter of filename, line number and 
function to run, then when it reaches that file/line it runs the function, to 
do what it needs to do. Then it's easy to have a bunch of hacks to a script, 
without modifying the code. This would be very very usefull. 





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


Req #21379 [Opn->Wfx]: Add integer to pop and unshift

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=21379&edit=1

 ID: 21379
 Updated by: maar...@php.net
 Reported by:c dot greenNOSP at Mits dot uq dot edu dot au
 Summary:Add integer to pop and unshift
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   RH 7.3
 PHP Version:4.3.0
 Block user comment: N
 Private report: N

 New Comment:

array_slice() does what you want. :)


Previous Comments:

[2003-01-02 22:10:03] c dot greenNOSP at Mits dot uq dot edu dot au

It would be nice if pop and unshift had an optional integer argument.  This 
would be useful for retreiving or removing the first or last n elements of an 
array.  

If the default is left as 1, then no current code will be affected, and the 
functions would be extended in an intuitive way.

Cheerio,

Cameron Green





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


Req #21594 [Opn->Wfx]: import construct

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=21594&edit=1

 ID: 21594
 Updated by: maar...@php.net
 Reported by:tazio at nur dot it
 Summary:import construct
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   all
 PHP Version:4.3.0
 Block user comment: N
 Private report: N

 New Comment:

It's 10 years later now, and now we've got namespaces and more OO features.


Previous Comments:

[2003-01-12 06:05:27] tazio at nur dot it

could be interesting for OOP a java like import construct importing a selected 
file with syntax
import "path/to/my_file.php";
which is the same of include / require
but also
import "path/to/my_lib/*";
that should import all php files in the directory.






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


Req #17279 [Opn->Wfx]: array_recurse_safe()

2013-07-12 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=17279&edit=1

 ID: 17279
 Updated by: maar...@php.net
 Reported by:tomat at lenderlabdot dot com
 Summary:array_recurse_safe()
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
-Package:Feature/Change Request
+Package:*General Issues
 Operating System:   All
 PHP Version:4.1.2
 Block user comment: N
 Private report: N

 New Comment:

Related issue already fixed this problem.


Previous Comments:

[2002-05-16 18:09:50] tomat at lenderlabdot dot com

Will solve problems like:

http://bugs.php.net/bug.php?id=16064

This code doesn't work, but I don't know enough C to write it right.  It would 
work if PHP had a method for determining if two variables are the same 
reference. (unless there is one that I haven't found...)



Also, the usage of unset() is improper here, but I left it in for simplicity.





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


Req #54739 [Opn->Wfx]: array_filter: optional parameter for max_items

2013-07-18 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=54739&edit=1

 ID: 54739
 Updated by: maar...@php.net
 Reported by:ajcoon at gmail dot com
 Summary:array_filter: optional parameter for max_items
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
 Package:Arrays related
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

So this is a hint to increase performance. You're probably much better off when 
filtering much closer by the logic which gathers the data (i.e. ORDER BY .. 
LIMIT).

Also, some sort of slipper slope, one might argue a (sometimes micro) 
optimization when adding this parameter to a lot of array functions, and I 
don't think it all added parameters, documentation and edge cases are worth it.


Previous Comments:

[2011-05-15 22:48:34] ajcoon at gmail dot com

Description:

Per this discussion on StackOverflow, I would like to recommend an additional, 
optional parameter be supported in `array_filter`.  The parameter, named 
`max_items` (or similar) would be expected as an integer value >0, and used to 
return a max of `n` matching items in the search array.  This is useful in the 
case where sort order is non-deterministic and the number of desired items is 
low relative to the length of the search array.

Related discussion:

http://stackoverflow.com/questions/6010872/getting-a-value-from-an-array-in-php

Test script:
---
$objects = array_filter($myArray, function($item){ return $item->id == 91 }, 1);

Expected result:

Expect `array_filter` to stop searching for additional matches once it reaches 
`max_items` number of matches.







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


Bug #60701 [Dup->Csd]: __toString() which stores $this reference triggers segfault (with fix!)

2012-04-26 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=60701&edit=1

 ID: 60701
 Updated by: maar...@php.net
 Reported by:daan at react dot com
 Summary:__toString() which stores $this reference triggers
 segfault (with fix!)
-Status: Duplicate
+Status: Closed
 Type:   Bug
 Package:Reproducible crash
 Operating System:   CentOS
 PHP Version:5.3.8
 Assigned To:dmitry
 Block user comment: N
 Private report: N

 New Comment:

Fixed in 5.3.11 / 5.4.1 (see #61165 for revisions and tests)


Previous Comments:

[2012-04-26 12:34:40] paj...@php.net

Duplicate of #61165


[2012-04-26 12:33:03] maar...@php.net

So this issue is apparently fixed thanks to 
https://bugs.php.net/bug.php?id=61165 (which is actually a dupe of 60701 all 
along) ?


[2012-04-26 12:18:10] arjen at react dot com

5.3.10/5.4.0 fixed original testcase; see http://3v4l.org/sc0mQ
5.3.11/5.4.1 fixed modified testcase; see http://3v4l.org/iYBMZ

Please close this issue and mark as fixed!


[2012-04-02 09:53:08] arjen at react dot com

5.3.10 fixed the attached testcase, a more simple test now fails.

a = $this;
return 'waa?';
}
}

$a = new A;
echo trim($a);
echo trim($a->a);

Results:
5.3.0 - 5.3.9   waa?1
5.3.10 waa? Warning: trim() expects parameter 1 to be string, unknown given in 
/home/deployer/public_html/php/tmp/ba8096acaf18c52bc12e38619634c25b on line 14
5.4.0 Segmentationfault


[2012-03-26 09:05:57] s...@php.net

OK, I think I know what may be going on here. What you're getting as $this in 
toString() is not a real $object but a copy what was generated by 
SEPARATE_ZVAL_IF_NOT_REF() in parse_arg_object_to_string(). If you save this 
copy, there might be trouble since it'd be destroyed by writeobj and later 
cleanup of the function arguments. However, the patch proposed doesn't seem to 
solve the problem completely since $this->test variable is still corrupted in 
this scenario...




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


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


Bug #61797 [Opn->Fbk]: DOMNode::appendChild doesn't increment refcount

2012-04-26 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=61797&edit=1

 ID: 61797
 Updated by: maar...@php.net
 Reported by:kuba dot brecka at gmail dot com
 Summary:DOMNode::appendChild doesn't increment refcount
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:DOM XML related
 Operating System:   Windows, Linux
 PHP Version:5.4.0
 Block user comment: N
 Private report: N

 New Comment:

Shouldn't you just use registerNodeClass() ?

See http://3v4l.org/E88Nk for a modified script


Previous Comments:

[2012-04-21 10:37:03] kuba dot brecka at gmail dot com

Description:

When I create a DOM element and I add it via DOMDocument->appendChild, it seems 
that the refcount to that object is not increased. This causes the appended 
child 
to be deallocated if there are no other references. It also causes some funky 
behaviour, because the freed object can still be accesssed (doesn't) crash, but 
it seems to be of different type. Don't know the cause, maybe the memory gets 
either reused to create another object.

I created a simple test case that proves and reproduces this buggy behaviour, 
AFAIK all PHP versions are affected, I tested 5.4.0 on Windows.

Test script:
---
class MyElement extends DOMElement { }

// #1 - okay
$dom = new DOMDocument();
$e = new MyElement("e");
$dom->appendChild($e);
echo get_class($dom->childNodes->item(0)) . "\n";

// #2 - wrong
$dom = new DOMDocument();
$dom->appendChild(new MyElement("e"));
echo get_class($dom->childNodes->item(0)) . "\n";

// #3 - wrong
$dom = new DOMDocument();
$e = new MyElement("e");
$dom->appendChild($e);
$e = null;
echo get_class($dom->childNodes->item(0)) . "\n";


Expected result:

MyElement
MyElement
MyElement


Actual result:
--
MyElement
DOMElement
DOMElement







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


Bug #61928 [Opn->Nab]: Instanciate object for aliased class

2012-05-07 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=61928&edit=1

 ID: 61928
 Updated by: maar...@php.net
 Reported by:olav at fwt dot no
 Summary:Instanciate object for aliased class
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Class/Object related
 Operating System:   Linux 3.3.4
 PHP Version:5.3.12
 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

This isn't a bug, see Example 3 @ 
http://www.php.net/manual/en/language.namespaces.importing.php and the note 
"Importing is performed at compile-time, and so does not affect dynamic class, 
function or constant names."

So your code is referencing Foo in the root namespace, which is the documented 
behavior.


Previous Comments:

[2012-05-03 19:01:09] olav at fwt dot no

It seems this problem is not related to the use keyword but imported 
items in general:

file: test2.php

https://bugs.php.net/bug.php?id=61928&edit=1


Req #62043 [Opn]: new operator

2012-05-18 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=62043&edit=1

 ID: 62043
 Updated by: maar...@php.net
 Reported by:piotrekz5 at wp dot pl
 Summary:new operator
 Status: Open
 Type:   Feature/Change Request
 Package:PHP options/info functions
 Operating System:   any
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Code

https://bugs.php.net/bug.php?id=62043

$var1 = null;
$var2 = null;
$var3 = $var1 ?: $var2; //$var3==null
$var4 = $var1 ?: 'default1'; //$var4=='default1'
$var5 = $var1 ?: $var2 ?: 'default2'; //$var5=='default2'
$var6 = $var2 ?: $var3 ?: $var4 ?: 'default3'; //$var6=='default1' since the 
first non-null value is $var4=='default1'

var_dump($var1, $var2, $var3, $var4, $var5, $var6);



Already outputs the following on all >= 5.3.0 versions (tested with 
5.3.0-5.3.13, 5.4.0-5.4.3) :

NULL
NULL
NULL
string(8) "default1"
string(8) "default2"
string(8) "default1"

(see http://3v4l.org/rKOqU )

So the ?: operator matches your proposed behaviour.


Previous Comments:

[2012-05-16 06:09:03] reeze dot xia at gmail dot com

Do you mean this operator?

$a = $a ?: "default value");

http://www.php.net/manual/en/language.operators.comparison.php#language.operators.
comparison.ternary


[2012-05-16 00:31:03] phpmpan at mpan dot pl

 BEGIN CODE 
function ifNull($var, $value, $null = NULL) {
return ($var !== $null)? $var : $value;
}
- END CODE -

Or even simpler to use and, unlike previous, working fine with undefined 
variables:

 BEGIN CODE 
function unNull(&$var, $value, $null = NULL) {
if ($var === $null) {
$var = $value;
}
return $var;
}
- END CODE -

If we drop the last argument even multiple operands version can be achieved:
 BEGIN CODE 
function nonNull() {
return array_reduce(func_get_args(), function(&$a, $e) {
return ($a === NULL && $e !== NULL)? $e : $a;
});
}
- END CODE -
Any reason to not do this in userland?


[2012-05-15 23:23:20] piotrekz5 at wp dot pl

Description:

Hi,
Let's implement a new operator - '??' (used in c#).

The ?? operator is called the null-coalescing operator and is used to define a 
default value. It returns the left-hand operand if the operand is not null; 
otherwise it returns the right operand.


Test script:
---
example:
$var1 = null;
$var2 = null;
$var3 = $var1 ?? $var2; //$var3==null
$var4 = $var1 ?? 'default1'; //$var4=='default1'
$var5 = $var1 ?? $var2 ?? 'default2'; //$var5=='default2'
$var6 = $var2 ?? $var3 ?? $var4 ?? 'default3'; //$var6=='default1' since the 
first non-null value is $var4=='default1'







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


Req #62043 [Opn->Nab]: new operator

2012-05-18 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=62043&edit=1

 ID: 62043
 Updated by: maar...@php.net
 Reported by:piotrekz5 at wp dot pl
 Summary:new operator
-Status: Open
+Status: Not a bug
 Type:   Feature/Change Request
 Package:PHP options/info functions
 Operating System:   any
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

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

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




Previous Comments:

[2012-05-18 14:43:41] maar...@php.net

Code

https://bugs.php.net/bug.php?id=62043

$var1 = null;
$var2 = null;
$var3 = $var1 ?: $var2; //$var3==null
$var4 = $var1 ?: 'default1'; //$var4=='default1'
$var5 = $var1 ?: $var2 ?: 'default2'; //$var5=='default2'
$var6 = $var2 ?: $var3 ?: $var4 ?: 'default3'; //$var6=='default1' since the 
first non-null value is $var4=='default1'

var_dump($var1, $var2, $var3, $var4, $var5, $var6);



Already outputs the following on all >= 5.3.0 versions (tested with 
5.3.0-5.3.13, 5.4.0-5.4.3) :

NULL
NULL
NULL
string(8) "default1"
string(8) "default2"
string(8) "default1"

(see http://3v4l.org/rKOqU )

So the ?: operator matches your proposed behaviour.


[2012-05-16 06:09:03] reeze dot xia at gmail dot com

Do you mean this operator?

$a = $a ?: "default value");

http://www.php.net/manual/en/language.operators.comparison.php#language.operators.
comparison.ternary


[2012-05-16 00:31:03] phpmpan at mpan dot pl

 BEGIN CODE 
function ifNull($var, $value, $null = NULL) {
return ($var !== $null)? $var : $value;
}
- END CODE -

Or even simpler to use and, unlike previous, working fine with undefined 
variables:

 BEGIN CODE 
function unNull(&$var, $value, $null = NULL) {
if ($var === $null) {
$var = $value;
}
return $var;
}
- END CODE -

If we drop the last argument even multiple operands version can be achieved:
 BEGIN CODE 
function nonNull() {
return array_reduce(func_get_args(), function(&$a, $e) {
return ($a === NULL && $e !== NULL)? $e : $a;
});
}
- END CODE -
Any reason to not do this in userland?


[2012-05-15 23:23:20] piotrekz5 at wp dot pl

Description:

Hi,
Let's implement a new operator - '??' (used in c#).

The ?? operator is called the null-coalescing operator and is used to define a 
default value. It returns the left-hand operand if the operand is not null; 
otherwise it returns the right operand.


Test script:
---
example:
$var1 = null;
$var2 = null;
$var3 = $var1 ?? $var2; //$var3==null
$var4 = $var1 ?? 'default1'; //$var4=='default1'
$var5 = $var1 ?? $var2 ?? 'default2'; //$var5=='default2'
$var6 = $var2 ?? $var3 ?? $var4 ?? 'default3'; //$var6=='default1' since the 
first non-null value is $var4=='default1'







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


Bug #62115 [Opn->Nab]: Issue with method array_diff_assoc

2012-05-24 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=62115&edit=1

 ID: 62115
 Updated by: maar...@php.net
 Reported by:patttern at gmail dot com
 Summary:Issue with method array_diff_assoc
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Arrays related
 Operating System:   All
 PHP Version:5.4.3
 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

See the answer by arjen at react dot com.

The array_diff* methods aren't recursive. So you probably won't want to use 
them for multidimensional arrays, and thus it's an improvement that >= 5.4.0 
warns you.


Previous Comments:

[2012-05-23 13:38:56] arjen at react dot com

http://nl3.php.net/array_diff_assoc

"Two values from key => value pairs are considered equal only if (string) 
$elem1 === (string) $elem2 . In other words a strict check 
takes place so the string representations must be the same."

and 

"Note: This function only checks one dimension of a n-dimensional array. Of 
course you can check deeper dimensions by using, for 
example, array_diff_assoc($array1[0], $array2[0]);."

So values are casted to string for comparision.

The array-elements are casted to string, which results in "array". The 
following example returns no difference between the two arrays, 
while this is clearly not the case: http://3v4l.org/1LX4W#v540

Without notices, both arrays would look the same.  Notices are generated since 
5.4.0, which is a good solution IMO.


[2012-05-23 05:29:56] patttern at gmail dot com

Description:

While executing method array_diff_assoc error appears "Notice: Array to string 
conversion".
The output of script:
array(2) { ["one"]=> array(2) { ["param1"]=> string(23) "First Parameter for 
One" ["param2"]=> string(24) "Second Parameter for One" } ["two"]=> array(2) { 
["param1"]=> string(23) "First Parameter for Two" ["param2"]=> string(24) 
"Second Parameter for Two" } }
string(3) "two"
array(2) { ["param1"]=> string(23) "First Parameter for Two" ["param2"]=> 
string(24) "Second Parameter for Two" }
array(1) { ["two"]=> array(2) { ["param1"]=> string(23) "First Parameter for 
Two" ["param2"]=> string(24) "Second Parameter for Two" } }
Notice: Array to string conversion in /usr/web/data/test_array_diff.php on line 
14 Notice: Array to string conversion in /usr/web/data/test_array_diff.php on 
line 14 array(1) { ["one"]=> array(2) { ["param1"]=> string(23) "First 
Parameter 
for One" ["param2"]=> string(24) "Second Parameter for One" } }

What is wrong?

Test script:
---
 array ('param1' => 'First Parameter for One', 'param2' => 
'Second Parameter for One'),
'two' => array ('param1' => 'First Parameter for Two', 'param2' => 
'Second Parameter for Two')
);
$packages_from = $source_packages;
var_dump($packages_from); echo "\n";
$package_key = 'two';
var_dump($package_key); echo "\n";
$package_value = $source_packages[$package_key];
var_dump($package_value); echo "\n";
$packages_to = array($package_key => $package_value);
var_dump($packages_to); echo "\n";
$result_packages = array_diff_assoc($packages_from, $packages_to);
var_dump($result_packages); echo "\n";
?>







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


Bug #62236 [Opn->Fbk]: Hardcoded path /usr/local/bin/php

2012-06-15 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=62236&edit=1

 ID: 62236
 Updated by: maar...@php.net
 Reported by:max dot antonoff at gmail dot com
 Summary:Hardcoded path /usr/local/bin/php
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:CGI/CLI related
 Operating System:   Linux
 PHP Version:5.4.4RC2
 Block user comment: N
 Private report: N

 New Comment:

Max, could you please try/test the above hint?


Previous Comments:

[2012-06-11 12:59:53] Sjon at hortensius dot net

/usr/bin/pear is a simple script that determines which PHP binary to use. It 
should be easy to debug this yourself, I think an incorrect $PHP_PEAR_PHP_BIN 
might cause this for example


[2012-06-05 20:04:05] max dot antonoff at gmail dot com

Description:

max 23:58:24  php-src $ pear list-all
exec: 28: /usr/local/bin/php: not found
max 23:58:15  php-src $ php -v
PHP 5.4.4-RC2 (cli) (built: Jun  5 2012 23:48:00) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
max 23:58:29  php-src $ which php ; which pear; php -i |grep configure
/home/max/local/bin/php
/home/max/local/bin/pear
Configure Command =>  './configure'  '--prefix=/home/max/local' 
'--enable-proxy' 
'--disable-cgi' '--with-mysqli' '--enable-fpm' '--with-fpm-user=max' '--with-
fpm-group=max' '--with-config-file-path=/home/max/local/etc/php.ini' '--with-
config-file-scan-dir=/home/max/local/etc/php.d' '--enable-sigchild' '--disable-
ipv6' '--with-openssl' '--with-pcre-regex' '--with-zlib' '--enable-bcmath' '--
with-bz2' '--with-curl' '--with-curlwrappers' '--enable-exif' '--enable-ftp' '--
with-gd' '--enable-gd-native-ttf' '--with-mhash' '--enable-mbstring' '--with-
mcrypt' '--with-mysql' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--
enable-pcntl' '--with-pdo-mysql' '--enable-shmop' '--enable-soap' '--enable-
sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-
wddx' '--with-xsl' '--enable-zip' '--enable-mysqlnd' '--with-
pear=/home/max/local/PEAR' '--with-jpeg-dir' '--with-png-dir' '--enable-intl'


Test script:
---
max 23:58:24  php-src $ pear list-all


Expected result:

list of packages

Actual result:
--
exec: 28: /usr/local/bin/php: not found






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


Bug #62236 [Opn->Nab]: Hardcoded path /usr/local/bin/php

2012-06-18 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=62236&edit=1

 ID: 62236
 Updated by: maar...@php.net
 Reported by:max dot antonoff at gmail dot com
 Summary:Hardcoded path /usr/local/bin/php
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:CGI/CLI related
 Operating System:   Linux
 PHP Version:5.4.4
 Block user comment: N
 Private report: N

 New Comment:

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

Thank you for your interest in PHP.




Previous Comments:

[2012-06-15 14:58:06] max dot antonoff at gmail dot com

Seems fixed: 

which php; which pear; php -v; php -i |grep configure; pear list-all |grep 
XML_svg2image 

/home/max/local/bin/php
/home/max/local/bin/pear
PHP 5.4.4 (cli) (built: Jun 15 2012 18:47:49) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
Configure Command =>  './configure'  '--prefix=/home/max/local' '--disable-cgi' 
'--with-pear=/home/max/local/PEAR'
pear/XML_svg2image 0.2.0Converts a svg  
file to a png/jpeg image.


[2012-06-15 11:37:29] maar...@php.net

Max, could you please try/test the above hint?


[2012-06-11 12:59:53] Sjon at hortensius dot net

/usr/bin/pear is a simple script that determines which PHP binary to use. It 
should be easy to debug this yourself, I think an incorrect $PHP_PEAR_PHP_BIN 
might cause this for example


[2012-06-05 20:04:05] max dot antonoff at gmail dot com

Description:

max 23:58:24  php-src $ pear list-all
exec: 28: /usr/local/bin/php: not found
max 23:58:15  php-src $ php -v
PHP 5.4.4-RC2 (cli) (built: Jun  5 2012 23:48:00) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
max 23:58:29  php-src $ which php ; which pear; php -i |grep configure
/home/max/local/bin/php
/home/max/local/bin/pear
Configure Command =>  './configure'  '--prefix=/home/max/local' 
'--enable-proxy' 
'--disable-cgi' '--with-mysqli' '--enable-fpm' '--with-fpm-user=max' '--with-
fpm-group=max' '--with-config-file-path=/home/max/local/etc/php.ini' '--with-
config-file-scan-dir=/home/max/local/etc/php.d' '--enable-sigchild' '--disable-
ipv6' '--with-openssl' '--with-pcre-regex' '--with-zlib' '--enable-bcmath' '--
with-bz2' '--with-curl' '--with-curlwrappers' '--enable-exif' '--enable-ftp' '--
with-gd' '--enable-gd-native-ttf' '--with-mhash' '--enable-mbstring' '--with-
mcrypt' '--with-mysql' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--
enable-pcntl' '--with-pdo-mysql' '--enable-shmop' '--enable-soap' '--enable-
sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-
wddx' '--with-xsl' '--enable-zip' '--enable-mysqlnd' '--with-
pear=/home/max/local/PEAR' '--with-jpeg-dir' '--with-png-dir' '--enable-intl'


Test script:
---
max 23:58:24  php-src $ pear list-all


Expected result:

list of packages

Actual result:
--
exec: 28: /usr/local/bin/php: not found






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


Bug #62086 [Opn->Nab]: header() in 404 error page

2012-06-25 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=62086&edit=1

 ID: 62086
 Updated by: maar...@php.net
 Reported by:dave dot kimble at gmx dot com
 Summary:header() in 404 error page
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Other web server
 Operating System:   Win 7 Ult 32
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

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

Thank you for your interest in PHP.




Previous Comments:

[2012-05-22 07:25:46] dave dot kimble at gmx dot com

OK, I can confirm this is not a PHP bug, but an IQWebFTPServer bug:
IQ doesn't pre-process error pages.
Thanks.
CLOSED


[2012-05-21 08:39:45] anon at anon dot anon

It looks like your error page is not configured to be interpreted as PHP, so 
everything from  is interpreted by the browser as a single HTML 
tag. Also the URL in your exit statement should be passed through 
htmlspecialchars to avoid an XSS vulnerability.


[2012-05-21 07:14:02] dave dot kimble at gmx dot com

Description:

I am trying to redirect all external links to pages in 
http://www.***.org.au/dave.kimble/ 
to http://www.davekimble.org.au/ 
by using header() in 404 error page.
Fastream IQWebFTPServer v11.5.5R possibly implicated.

If header() follows echo(), I expect error "headers already written".
Adding echo statements to debug, the output either doesn't appear, or after 
 output is the remaining script itself. 

Same problem with PHP 5.4.0

Test script:
---
Must be set in web server as Error Page 404

http://www.davekimble.org.au'.$restofuri );
exit('Redirecting you to http://www.davekimble.org.au'.$restofuri);
}
echo ($uri . ' not found');
?>


Expected result:

a) Browser URL: http://test-domain.com/dave.kimble/index.htm
   should return page http://www.davekimble.org.au/index.htm 
b) Browser URL: http://test-domain.com/.xxx
   should return "/.xxx not found"

Actual result:
--
a) Browser URL: http://test-domain.com/dave.kimble/index.htm
   returns blank page and response status 404
b) Browser URL: http://test-domain.com/.xxx
   returns '); ?> 
   which is the tail end of the script !






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


Bug #18556 [Asn]: Setting locale to 'tr_TR' lowercases class names

2012-07-03 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=18556&edit=1

 ID: 18556
 Updated by: maar...@php.net
 Reported by:spud at nothingness dot org
 Summary:Setting locale to 'tr_TR' lowercases class names
 Status: Assigned
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Linux (RedHat 7.2)
 PHP Version:5CVS, 4CVS (2005-10-04)
 Assigned To:dmitry
 Block user comment: N
 Private report: N

 New Comment:

Appears to be fixed since >= 5.4.0
See http://3v4l.org/lahi5 for proof:
---
Output for 5.4.0 - 5.4.4
Instantiating an infoBlob with a lowercase iFooInstantiating an 
InfoBlob with an uppercase IFoo

Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.14
Instantiating an infoBlob with a lowercase iFooInstantiating an 
InfoBlob with an uppercase I Fatal error: Class 'InfoBlob' not found in 
/in/lahi5 on line 25
Process exited with code 255.
---
 Can't find it in the changelogs though.


Previous Comments:

[2012-07-03 09:02:01] shevegen at gmail dot com

There are other languages one could use, other than PHP.


[2012-07-02 11:42:50] bobx at bob dot com

hahaha yeah PHP is garbage


[2012-05-15 20:54:08] inet dot alper at gmail dot com

https://github.com/php/php-src/pull/79
this patch does not break other locales, check it out.


[2012-05-05 15:33:55] wim at powerassist dot nl

Sorry, I was to quick to comment. I see that there's an internal mailing going 
on.


[2012-05-04 19:10:58] wim at powerassist dot nl

Why is this bug still not fixed? Not only class names are affected but function 
names aswell:






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


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


Bug #62536 [Opn->Nab]: file uploads MAX_FILE_SIZE doesn't work as described

2012-07-13 Thread maarten
Edit report at https://bugs.php.net/bug.php?id=62536&edit=1

 ID: 62536
 Updated by: maar...@php.net
 Reported by:danny at tibibi dot com
 Summary:file uploads MAX_FILE_SIZE doesn't work as described
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   Windows Server 2008
 PHP Version:5.4.4
 Block user comment: N
 Private report: N

 New Comment:

As explained above, not a PHP bug, merely a client feature made up by PHP and 
ignored by browsers.


Previous Comments:

[2012-07-13 09:26:19] Sjon at hortensius dot net

If you read the link I posted, you'll see that PHP _also_ checks for the 
defined 
MAX_FILE_SIZE and behaves the same as it would with max_upload_size @ini.

So: PHP checks this too, but the client-side advantage isn't implemented in any 
browser (which is also described here: https://bugs.php.net/bug.php?id=40387)


[2012-07-12 17:15:01] danny at tibibi dot com

Thanks for your comment.

If php doesn't do anything with the variable, then why is it php returns error 
"2" in the $_FILES array when I set that variable, and upload a file that is 
smaller than the max_upload_size in the .ini file but larger than the 
MAX_FILE_SIZE variable I post?


[2012-07-12 13:57:07] Sjon at hortensius dot net

This feature is meant for clients (eg. browsers), but it seems your browser 
doesn't implement this feature. PHP doesn't do anything with this variable

More info @
http://stackoverflow.com/questions/1381364/max-file-size-in-php-whats-the-point


[2012-07-11 17:10:07] danny at tibibi dot com

Description:

The documentation for handling file uploads, 
http://us3.php.net/manual/en/features.file-upload.post-method.php states that 
when declaring a hidden field named MAX_FILE_SIZE, if the file submitted is 
larger, then the user will not have to wait longer to be told that the file was 
too large.












Actual result:
--
The complete file gets uploaded however big it is, and the result shows: 2

This confirms that MAX_FILE_SIZE worked, and the file was too large, but it did 
not stop processing the request after 100 bytes were processed.






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


#25876 [Com]: session_start(): Failed to initialize storage module

2005-06-13 Thread maarten at students dot ch
 ID:   25876
 Comment by:   maarten at students dot ch
 Reported By:  golden at riscom dot com
 Status:   No Feedback
 Bug Type: Session related
 Operating System: freebsd 4.8
 PHP Version:  4.3.9-4.3.10
 Assigned To:  sniper
 New Comment:

PHP Version 4.3.10, Linux srv1-2 2.4.19 #2 SMP Tue Dec 3 15:16:08 CET
2002 i686, Apache

Same Problem over here. It came out of nowhere and sporadically
appears.


Previous Comments:


[2005-06-08 14:58:58] tech at c64-wiki dot de

I added the following line near the beginning of my PHP code:

ini_set("session.save_handler", "files");

I have not seen the bug again after that, so far (clicked around like
an idiot and everything worked fine). Which does not mean a lot, of
course, due to the extremely random nature of that bug.

Can anybody else confirm that this workaround works (or maybe not)? If
it does "solve" the problem, the root cause may seem to be that PHP
sometimes takes the wrong session handler (not the one which is defined
in PHP.INI, which is "files" as well (while the error message seems to
indicate "user"?)).

Best regards, Klaus



[2005-06-08 14:18:42] tech at c64-wiki dot de

Same problem here as described by "gul_murjani at yahoo dot com". PHP
4.3.10 is the version in use (phpinfo() can be seen at
http://www.c64-wiki.de/test.php). I tried to change  session.save_path
to a different path (by adding a php_value line into .htaccess), made
the new directory world-writeable and verified that the session files
do indeed appear there. They do appear there, and there's plenty of
space for that directoty available (about 1GB, should be 'nuff for a
few of these session files with <100 bytes each). And the bug still
appears at extremely random intervals!

Best regards, Klaus



[2005-05-22 12:06:42] dmih at in-solve dot ru

Please someone in PHP team confirm that you are reading from this bug
(it has 'No Feedback' status).
Or may be we are writing for ourselves here?



[2005-05-21 14:30:13] gul_murjani at yahoo dot com

Hi,

I'm experiencing this problem in at least 2 sites.

Since it's a error that appears in random, I wrote a simple script to
try and reproduce the error. This is the script:




All it does is invoke "session_start()" and use one session variable.
It then reloads itself every 10 seconds. On HOSTMANIL.ORG and
HOSTMANIL.NET, the error comes up. But there is no pattern at all.
Sometimes out of 20 refreshes, there's an error, half the time. If the
error comes up, I have to do a manual refresh. I notice that the
session variable is not destroyed at all. It continues counting from
where it stopped. 

The problem is at one point in HOSTMANILA.ORG, it kept on coming up
every 2 auto refreshes (and I do an F5). But now, it's was good for 45
straign auto refreshes before the error came up. That's how random the
error is.

I do a lot of programming, mostly in PHP but I'm not "deep" technical.
So I'm not sure if I'm missing something.

I'm running the scripts on 5 sites. These are all on different servers
although all of them are from shared hosting services using cPanel /
WHM.
http://www.hostmanila.org/test.php
http://www.hostmanila.biz/test.php
http://www.hostmanila.net/test.php
http://www.vcdpix.com/test.php
http://www.smokedbangus.com/test.php

So far, it's only happened on HOSTMANILA.ORG and HOSTMANILA.NET.

Here's the rundown on each site:
HOSTMANILA.ORG (error)
Linux 2.4.30-gator_r1
Apache 1.3.33 (Unix)
PERL 5.8.4
PHP 4.3.11
cPanel 9.9.9-STABLE 15

HOSTMANILA.BIZ (fine)
Linux 2.4.30-1-s5
Apache 1.3.33 (Unix)
PERL 5.8.3
PHP 4.3.11
cPanel 10.2.0-RELEASE 82

HOSTMANILA.NET (error)
Linux 2.4.26-grsec
Apache 1.3.33 (Unix)
PERL 5.8.0
PHP 4.3.11
cPanel 10.0.0-RELEASE 7

VCDPIX.COM (fine)
Linux 2.4.20-24.9
Apache 1.3.33 (Unix)
PERL 5.8.1
PHP 4.3.9
cPanel 10.0.0-RELEASE 7

SMOKEDBANGUS.COM (fine)
Linux 2.4.20-20.7smp
Apache 1.3.33 (Unix)
PERL 5.8.4
PHP 4.3.10
cPanel 10.0.0-CURRENT 107

I can't imagine developing anything in PHP without making use of
session_start() so I hope the issue is resolved.


Regards,

Gul
hostmanila.com



[2005-05-21 01:24:55] jspec at bellsouth dot net

I have now experienced this beast with a completely different hosting
company.  They are both running 4.3.10 - is this fixed in 4.3.11?



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

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


#27548 [NEW]: Php crashes when i want to store more then 1 var in $this->menu

2004-03-10 Thread maarten at servicez dot org
From: maarten at servicez dot org
Operating system: WinXP
PHP version:  4.3.4
PHP Bug Type: Reproducible crash
Bug description:  Php crashes when i want to store more then 1 var in $this->menu

Description:

I have a class making a menu List for my website.

It retrieves information out of a mysql database and then stores this
information in menuItem objects.



Then when i want to order and move with some items i have a problem with
one array. PHP sometimes shows the page, sometimes it doesn't.



It is only when the variable has the name: menu

ANY other name is allowed and the script is just working fine.



It's line 52 of the script @ servertjuh.nl



When i ran php with --enabled-debug i got this:

FATAL:  erealloc():  Unable to allocate 1685227521 bytes





Reproduce code:
---
http://www.servertjuh.nl/external/menuServer.class.phps

Expected result:

To put $val in $this->menu[]

Actual result:
--
an popup of windows with:



In PHP Script Interpreter is een fout opgetreden en moet worden
afgesloten. Onze excuses voor dit ongemak.



That means that PHP Script Interpreter has caused a fault.

-- 
Edit bug report at http://bugs.php.net/?id=27548&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27548&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27548&r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=27548&r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=27548&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27548&r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=27548&r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=27548&r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=27548&r=support
Expected behavior:  http://bugs.php.net/fix.php?id=27548&r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=27548&r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=27548&r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=27548&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27548&r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=27548&r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=27548&r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=27548&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27548&r=float


#27548 [Fbk->Opn]: Php crashes when i want to store more then 1 var in $this->menu

2004-03-10 Thread maarten at servicez dot org
 ID:   27548
 User updated by:  maarten at servicez dot org
 Reported By:  maarten at servicez dot org
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: WinXP
 PHP Version:  4.3.4
 New Comment:

I am afraid that isn't possible because the script is using an database
to load it's items and it's a part of a bigger site.



Any ideas?


Previous Comments:


[2004-03-10 08:45:56] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.



[2004-03-10 08:41:37] maarten at servicez dot org

Description:

I have a class making a menu List for my website.

It retrieves information out of a mysql database and then stores this
information in menuItem objects.



Then when i want to order and move with some items i have a problem
with one array. PHP sometimes shows the page, sometimes it doesn't.



It is only when the variable has the name: menu

ANY other name is allowed and the script is just working fine.



It's line 52 of the script @ servertjuh.nl



When i ran php with --enabled-debug i got this:

FATAL:  erealloc():  Unable to allocate 1685227521 bytes





Reproduce code:
---
http://www.servertjuh.nl/external/menuServer.class.phps

Expected result:

To put $val in $this->menu[]

Actual result:
--
an popup of windows with:



In PHP Script Interpreter is een fout opgetreden en moet worden
afgesloten. Onze excuses voor dit ongemak.



That means that PHP Script Interpreter has caused a fault.





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


#27548 [Bgs]: Php crashes when i want to store more then 1 var in $this->menu

2004-03-10 Thread maarten at servicez dot org
 ID:   27548
 User updated by:  maarten at servicez dot org
 Reported By:  maarten at servicez dot org
 Status:   Bogus
 Bug Type: Reproducible crash
 Operating System: WinXP
 PHP Version:  4.3.4
 New Comment:

How is that possible when the script executes in less then 1 secs..it's
not like it's taking a long time or something


Previous Comments:


[2004-03-10 13:24:15] [EMAIL PROTECTED]

You run out of memory, of course it fails. (fix your script..)





[2004-03-10 08:49:14] maarten at servicez dot org

I am afraid that isn't possible because the script is using an database
to load it's items and it's a part of a bigger site.



Any ideas?



[2004-03-10 08:45:56] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

----

[2004-03-10 08:41:37] maarten at servicez dot org

Description:

I have a class making a menu List for my website.

It retrieves information out of a mysql database and then stores this
information in menuItem objects.



Then when i want to order and move with some items i have a problem
with one array. PHP sometimes shows the page, sometimes it doesn't.



It is only when the variable has the name: menu

ANY other name is allowed and the script is just working fine.



It's line 52 of the script @ servertjuh.nl



When i ran php with --enabled-debug i got this:

FATAL:  erealloc():  Unable to allocate 1685227521 bytes





Reproduce code:
---
http://www.servertjuh.nl/external/menuServer.class.phps

Expected result:

To put $val in $this->menu[]

Actual result:
--
an popup of windows with:



In PHP Script Interpreter is een fout opgetreden en moet worden
afgesloten. Onze excuses voor dit ongemak.



That means that PHP Script Interpreter has caused a fault.





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


[PHP-BUG] Req #61209 [NEW]: configurable shell for exec in linux (not always sh)

2012-02-29 Thread maarten at ba dot be
From: 
Operating system: linux
PHP version:  Irrelevant
Package:  Program Execution
Bug Type: Feature/Change Request
Bug description:configurable shell for exec in linux (not always sh)

Description:

i can understand that you can't use the $SHELL variable, because likely
under apache it'll be /sbin/nologin anyway.

however, using always sh can be quite irritating when you're trying to make
something and install it on a production environment, when finding out that
sh is not the shell you're wanting to have. for a while now we've just
changed the sh symlink to the shell we want, but now (for this particular
machine) we can't workaround like this.

you can't always workaround by just putting /bin/shell before your command,
especially if you're using shell constructs...

interesting would be a exec_shell=/bin/sh variable, which could then be
used by the various program execution functions (for me in particular exec)


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



Bug #53294 [Fbk->Csd]: DateTime->setTimezone() very slow far future dates

2012-03-22 Thread maarten at react dot com
Edit report at https://bugs.php.net/bug.php?id=53294&edit=1

 ID: 53294
 User updated by:maarten at react dot com
 Reported by:maarten at react dot com
 Summary:DateTime->setTimezone() very slow far future dates
-Status: Feedback
+Status: Closed
 Type:   Bug
 Package:Date/time related
 Operating System:   64 bit Centos
 PHP Version:5.2.14
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

I confirmed it was already fixed in 5.3.6, and a 3rd person (php dot net at 
doppy dot nl) confirmed it for 5.3.10, so issue is resolved. :)


Previous Comments:

[2012-03-21 16:48:21] php dot net at doppy dot nl

Seems to be fixed for me as well.



PHP 5.3.10-1ubuntu2 with Suhosin-Patch (cli) (built: Mar  5 2012 18:27:21)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

on 64bit.


[2011-07-25 14:36:07] maarten at react dot com

Tested in 5.3.6, and appears to be fixed.

$date = new DateTime('@'.(int)(PHP_INT_MAX / 2));
now takes less than 1ms. :)


[2011-01-22 08:52:50] s...@php.net

Please try using this snapshot:

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

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




[2010-11-11 13:55:30] maarten at react dot com

Description:

DateTime->setTimezone() is very slow on dates in the far future (or history), 
and the time needed isnt monotonic for greater dates.

ie. setTimezone() on a DateTime(PHP_INT_MAX) /* 64 bit max */ takes 0.05 
seconds, but takes 250 whole seconds for PHP_INT_MAX/2 .

Using the $timezone parameter of the DateTime constructor is always fast though.

Test script:
---
$start = microtime(1);
$date = new DateTime('@'.(PHP_INT_MAX));
//  $date = new DateTime('@'.(int)(PHP_INT_MAX / 2));
$date->setTimezone(new DateTimeZone('Europe/Amsterdam'));

echo microtime(1) - $start;

Expected result:

A faster change of the timezone; performance equal to using the constructor 
parameter







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


[PHP-BUG] Bug #63071 [NEW]: func_get_args loses byref information

2012-09-12 Thread maarten at ba dot be
From: maarten at ba dot be
Operating system: all
PHP version:  5.3.16
Package:  Unknown/Other Function
Bug Type: Bug
Bug description:func_get_args loses byref information

Description:

i'm writing code that invokes "hooks" with byref parameters.

but the generalized hook functions lose the byref information due to
func_get_args being a copy (but not exact), thus call_user_func_array()
(which needs to have references in it's array) can't work.

see shortened example below:

Test script:
---
$foo = "foo";
$bar = "bar";
function func_a(&$a, $b) {
  $a = $b;
};
function c() {
  $args = func_get_args();
  call_user_func_array("func_a", $args);
};
c(&$foo, $bar);
var_dump($foo);

Expected result:

i expected for $foo to have 'bar'

Actual result:
--
$foo is still 'foo', and a warning is generated

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



Bug #63071 [Com]: func_get_args loses byref information

2012-09-12 Thread maarten at ba dot be
Edit report at https://bugs.php.net/bug.php?id=63071&edit=1

 ID: 63071
 Comment by: maarten at ba dot be
 Reported by:maarten at ba dot be
 Summary:func_get_args loses byref information
 Status: Not a bug
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   all
 PHP Version:5.3.16
 Block user comment: N
 Private report: N

 New Comment:

"This function returns a copy of the passed arguments only, ..."

from the same page.

thus an array. it's just that this copied array loses it's byref value for one 
of the elements in the array...

this makes it impossible to have a hook system where you can also modify a 
parameter because it's byref


Previous Comments:

[2012-09-12 11:15:12] larue...@php.net

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

"Returns an array in which each element is a copy of the corresponding member 
of 
the current user-defined function's argument list."

http://us2.php.net/manual/en/function.func-get-args.php

--------
[2012-09-12 11:00:08] maarten at ba dot be

Description:

i'm writing code that invokes "hooks" with byref parameters.

but the generalized hook functions lose the byref information due to 
func_get_args being a copy (but not exact), thus call_user_func_array() (which 
needs to have references in it's array) can't work.

see shortened example below:

Test script:
---
$foo = "foo";
$bar = "bar";
function func_a(&$a, $b) {
  $a = $b;
};
function c() {
  $args = func_get_args();
  call_user_func_array("func_a", $args);
};
c(&$foo, $bar);
var_dump($foo);

Expected result:

i expected for $foo to have 'bar'

Actual result:
--
$foo is still 'foo', and a warning is generated






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


Bug #63071 [Com]: func_get_args loses byref information

2012-09-14 Thread maarten at ba dot be
Edit report at https://bugs.php.net/bug.php?id=63071&edit=1

 ID: 63071
 Comment by: maarten at ba dot be
 Reported by:maarten at ba dot be
 Summary:func_get_args loses byref information
 Status: Not a bug
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   all
 PHP Version:5.3.16
 Block user comment: N
 Private report: N

 New Comment:

actually, i found a second valid use case for this oversight:

function array_set(&$a, $indexes, &$value) {
  $res = FALSE;
  if (count($indexes) == 0) {
$a =& $value;
return $res;
  }
  $i = array_shift($indexes);
  if (!isset($a[$i])) {
$a[$i] = array();
$res = TRUE;
  }
  return array_set($a[$i], $indexes, $value) || $res;
}

function set_config() {
  global $config;
  $args = func_get_args();
  $value = array_pop($args);
  return array_set($config, $args, $value);
}

global $config;
$config = array(
  'user' => array(
'name' => '',
  )
);
set_config('user', 'name', 'FName LName');
var_dump($config);


the way i see it, there are 2 possibilities, really:

A) func_get_args should keep references for references
==> one could argue that byref parameters in the call is a stupid idea

B) functions that are declared with byref parameters should be greedy and force 
the variables to be a reference, if they must be (and where they come from), 
and that is what should force one argument to be byref in a func_get_args, even 
if it wasn't like this.
==> this way, you can safely have no use for byref parameters anymore.


Previous Comments:
--------
[2012-09-12 15:18:19] maarten at ba dot be

"This function returns a copy of the passed arguments only, ..."

from the same page.

thus an array. it's just that this copied array loses it's byref value for one 
of the elements in the array...

this makes it impossible to have a hook system where you can also modify a 
parameter because it's byref


[2012-09-12 11:15:12] larue...@php.net

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

"Returns an array in which each element is a copy of the corresponding member 
of 
the current user-defined function's argument list."

http://us2.php.net/manual/en/function.func-get-args.php


[2012-09-12 11:00:08] maarten at ba dot be

Description:

i'm writing code that invokes "hooks" with byref parameters.

but the generalized hook functions lose the byref information due to 
func_get_args being a copy (but not exact), thus call_user_func_array() (which 
needs to have references in it's array) can't work.

see shortened example below:

Test script:
---
$foo = "foo";
$bar = "bar";
function func_a(&$a, $b) {
  $a = $b;
};
function c() {
  $args = func_get_args();
  call_user_func_array("func_a", $args);
};
c(&$foo, $bar);
var_dump($foo);

Expected result:

i expected for $foo to have 'bar'

Actual result:
--
$foo is still 'foo', and a warning is generated






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


#47285 [Com]: strtotime() still leaks memory

2009-02-13 Thread maarten at vivesta dot com
 ID:   47285
 Comment by:   maarten at vivesta dot com
 Reported By:  danger at FreeBSD dot org
 Status:   No Feedback
 Bug Type: Date/time related
 Operating System: FreeBSD
 PHP Version:  5.2.8
 New Comment:

I have the same problem:

PHP 5.2.9RC2-dev (cli) (built: Feb 12 2009 15:10:25)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

On FreeBSD 6.3. Built PHP without FreeBSD patches, just downloaded 
latest and did "cd php5.2-200902121330", "./configure", "make" and 
"./sapi/cli/php"

http://cvsweb.freebsd.org/ports/lang/php5/files.

Verified that the above PHP version still leaks memory, slower but
still.



[2009-02-03 22:15:18] j...@php.net

Please try using this CVS snapshot:

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

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





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

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



#47285 [Com]: strtotime() still leaks memory

2009-02-17 Thread maarten at vivesta dot com
 ID:   47285
 Comment by:   maarten at vivesta dot com
 Reported By:  danger at FreeBSD dot org
 Status:   Feedback
 Bug Type: Date/time related
 Operating System: FreeBSD
 PHP Version:  5.2.8
 Assigned To:  derick
 New Comment:

Ok, I've sent you login details to a testmachine by e-mail.


Previous Comments:


[2009-02-15 12:54:34] der...@php.net

Please send me account details (by email), as I still can't reproduce
this.



[2009-02-13 11:02:06] maarten at vivesta dot com

I have the same problem:

PHP 5.2.9RC2-dev (cli) (built: Feb 12 2009 15:10:25)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

On FreeBSD 6.3. Built PHP without FreeBSD patches, just downloaded 
latest and did "cd php5.2-200902121330", "./configure", "make" and 
"./sapi/cli/php"

http://cvsweb.freebsd.org/ports/lang/php5/files.

Verified that the above PHP version still leaks memory, slower but
still.



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

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



#47285 [Com]: strtotime() still leaks memory

2009-02-27 Thread maarten at vivesta dot com
 ID:   47285
 Comment by:   maarten at vivesta dot com
 Reported By:  danger at FreeBSD dot org
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: FreeBSD
 PHP Version:  5.2.8
 Assigned To:  derick
 New Comment:

Same here. I've added a date_default_timezone_set() before using 
strtotime() and it removed the error but not the leak.


Previous Comments:


[2009-02-27 13:53:29] danger at FreeBSD dot org

I tried to run my script with php -d error_reporting=E_STRICT test.php
and been receiving this error until I stopped the script:

Strict Standards: strtotime(): It is not safe to rely on the system's
timezone settings. Please use the date.timezone setting, the TZ
environment variable or the date_default_timezone_set() function. In
case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We selected
'Europe/Berlin' for 'CET/1.0/no DST' instead in /root/test.php on line
10



[2009-02-27 13:25:37] danger at FreeBSD dot org

Hey there,

I have tried to build a stock php-5.2.9 (no FreeBSD patches or anything
else) with ./configure && make. 

When I run my test script as this:
r...@[temp /var/ports/distfiles/php-5.2.9]# sapi/cli/php
/root/test.php

No modified php.ini is being used, no additional extensions are being
loaded. I can still verify that it leaks.



[2009-02-27 11:44:35] der...@php.net

I am not forgetting about this, but at the moment just really occupied.
Just as a quick question, this is the *stock* PHP without any ports
patches, also, if you set the error level to also show e_Strict
messages, do you see anything? Also, do you have the date.timezone
setting made in PHP.ini?



[2009-02-27 10:41:02] danger at FreeBSD dot org

verified to still leak with:

r...@[temp /basejail/usr/ports/lang/php5]# php -v
PHP 5.2.9 (cli) (built: Feb 27 2009 11:36:57)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies



[2009-02-23 08:59:23] danger at FreeBSD dot org

Any news on this? I checked the box and it seems like you logged only
once for a few seconds almost a week ago



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

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



#47643 [Com]: array_diff() takes over 3000 times longer than php 5.2.4

2010-02-17 Thread maarten at talkin dot nl
 ID:   47643
 Comment by:   maarten at talkin dot nl
 Reported By:  viper7 at viper-7 dot com
 Status:   Assigned
 Bug Type: Performance problem
 Operating System: *
 PHP Version:  5.*, 6CVS (2009-04-13)
 Assigned To:  felipe
 New Comment:

Why dont you only reset ptr if (behavior & DIFF_ASSOC) ?


Previous Comments:


[2010-01-17 12:09:15] emiel dot bruijntjes at copernica dot com

This bug is now open for 10 months. Are you still working on this?



[2009-07-09 20:38:20] j...@php.net

As Dmitry's noted, this is side-effect your fix caused.



[2009-07-01 15:32:01] dmi...@php.net

The problems occurs because of "bad" patch for bug #42838.

The diff algorithm sorts arrays using qsort and then assumes that they
are sorted correctly. But in case of user compaison function it can't be
guaranteed. Thus in ext/standard/tests/array/bug42838.phpt
key_compare_func() can't sort array correctly because expressions (0 <
'a') and (0 > 'a') both false ('a' is interpreted as a number 0).

It should be fixed in some way



[2009-06-30 15:22:24] der...@php.net

Dmitry, could you have a look? I have no idea why this occurs.



[2009-06-30 15:19:43] viper7 at viper-7 dot com

I've tracked down the change that broke things, this is it. but the
exact reason is beyond me heh. Hopefully this helps.

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.51&r2=1.308.2.21.2.52&pathrev=PHP_5_2



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

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



Bug #47285 [Com]: strtotime() still leaks memory

2010-03-11 Thread maarten at vivesta dot com
Edit report at http://bugs.php.net/bug.php?id=47285&edit=1

 ID:   47285
 Comment by:   maarten at vivesta dot com
 Reported by:  danger at FreeBSD dot org
 Summary:  strtotime() still leaks memory
 Status:   Assigned
 Type: Bug
 Package:  Date/time related
 Operating System: *
 PHP Version:  5.2 (SVN-2009-0-02)
 Assigned To:  derick

 New Comment:

I've built PHP 5.2 from SVN (r.296066) from scratch on vanilla Debian
Lenny and 

ran valgrind on this problem. Here is the output: 



$ valgrind --leak-check=full ./sapi/cli/php -n -r
'strtotime("now",time());'

==21329== Memcheck, a memory error detector.

==21329== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.

==21329== Using LibVEX rev 1854, a library for dynamic binary
translation.

==21329== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.

==21329== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation


framework.

==21329== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.

==21329== For more details, rerun with: -v

==21329==

==21329==

==21329== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 27 from
1)

==21329== malloc/free: in use at exit: 76 bytes in 4 blocks.

==21329== malloc/free: 7,796 allocs, 7,792 frees, 1,305,337 bytes
allocated.

==21329== For counts of detected errors, rerun with: -v

==21329== searching for pointers to 4 not-freed blocks.

==21329== checked 429,556 bytes.

==21329==

==21329== 76 (48 direct, 28 indirect) bytes in 1 blocks are definitely
lost in 

loss record 4 of 4

==21329==at 0x4021E22: calloc (vg_replace_malloc.c:397)

==21329==by 0x809DDAA: timelib_tzinfo_ctor (timelib.c:75)

==21329==by 0x809D0F7: timelib_parse_tzfile (parse_tz.c:277)

==21329==by 0x8084211: timelib_get_zone (parse_date.re:737)

==21329==by 0x8085859: timelib_strtotime (parse_date.re:1007)

==21329==by 0x8080A4C: zif_strtotime (php_date.c:1143)

==21329==by 0x8284379: zend_do_fcall_common_helper_SPEC 

(zend_vm_execute.h:200)

==21329==by 0x82710AF: execute (zend_vm_execute.h:92)

==21329==by 0x8243A26: zend_eval_string (zend_execute_API.c:1223)

==21329==by 0x8243B7E: zend_eval_string_ex
(zend_execute_API.c:1258)

==21329==by 0x82BCC29: main (php_cli.c:1204)

==21329==

==21329== LEAK SUMMARY:

==21329==definitely lost: 48 bytes in 1 blocks.

==21329==indirectly lost: 28 bytes in 3 blocks.

==21329==  possibly lost: 0 bytes in 0 blocks.

==21329==still reachable: 0 bytes in 0 blocks.

==21329== suppressed: 0 bytes in 0 blocks.



Please let me know if there is any more I can do, next to fixing the bug


obviously... :-) I'm looking in to that...


Previous Comments:

[2009-09-10 01:15:08] sadrak at sogetthis dot com

Problem verified on:

Linux version 2.6.30-1-amd64 (Debian 2.6.30-6) (wa...@debian.org) (gcc
version 4.3.4 (Debian 4.3.4-1) ) #1 SMP Sat Aug 15 21:08:31 UTC 2009



Using:

PHP 5.2.10-2 with Suhosin-Patch 0.9.7 (cli) (built: Jul 10 2009
00:34:06)

Copyright (c) 1997-2009 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

with Suhosin v0.9.28, Copyright (c) 2007, by SektionEins GmbH


[2009-09-02 11:52:12] j...@php.net

Reproduced on 32/64 bit servers using latest PHP_5_2 checkout. Does NOT
happen with PHP_5_3.


[2009-08-26 16:42:29] heron at xnapid dot com

I can confirm the same leak, running in Apache on Windows.  Apache kills
the script after a time limit, but the leaked memory remains leaked;
refreshing the same URL causes the total leaked memory to increase from
there.  It looks like it leaks 800KB per second or so, and the script is
killed after leaking about 30MB.



I'm running PHP 5.2.9-2, which came straight from the default Windows
installer.


[2009-07-23 20:26:57] scott at crisscott dot com

Reproduced on RHEL 4 (PHP built from source not RPM)

PHP 5.2.9 (cli) (built: May  1 2009 13:47:24) 

Copyright (c) 1997-2009 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

with Zend Debugger v5.2.14, Copyright (c) 1999-2008, by Zend
Technologies



Applying the patch from oliver at realtsp dot com slowed down the leak,
but did not stop it entirely.


[2009-07-07 10:47:47] oliver at realtsp dot com

I can confirm that we can reproduce this bug on FreeBSD 7.2 with
php5.2.10 and that the patch provided by bloudon at townnews dot com
does stop the leak.



I had to manually apply the patch because copying out of the html rarely
works, so I have prepared a "clean" vers

[PHP-BUG] Bug #53294 [NEW]: DateTime->setTimezone() very slow far future dates

2010-11-11 Thread maarten at react dot com
From: 
Operating system: 64 bit Centos
PHP version:  5.2.14
Package:  Date/time related
Bug Type: Bug
Bug description:DateTime->setTimezone() very slow far future dates

Description:

DateTime->setTimezone() is very slow on dates in the far future (or
history), and the time needed isnt monotonic for greater dates.



ie. setTimezone() on a DateTime(PHP_INT_MAX) /* 64 bit max */ takes 0.05
seconds, but takes 250 whole seconds for PHP_INT_MAX/2 .



Using the $timezone parameter of the DateTime constructor is always fast
though.

Test script:
---
$start = microtime(1);

$date = new DateTime('@'.(PHP_INT_MAX));

//  $date = new DateTime('@'.(int)(PHP_INT_MAX / 2));

$date->setTimezone(new DateTimeZone('Europe/Amsterdam'));



echo microtime(1) - $start;

Expected result:

A faster change of the timezone; performance equal to using the constructor
parameter


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



#35841 [NEW]: PHP Does not like underscores?

2005-12-29 Thread maarten at kleeszone dot be
From: maarten at kleeszone dot be
Operating system: Linux2.6.12-1-amd64 Debian
PHP version:  5.1.1
PHP Bug Type: Compile Failure
Bug description:  PHP Does not like underscores?

Description:

Recently I installed a new server with apache2, PHP5.1 and mysql 5.0.16

Now I noticed that sometimes (0.5% of all requests) I get fatal errors:

Fatal error: Unknown function: strtomower() in
/var/www/global/init.global.php on line 235
Fatal error: Unknown function: strtlower() in
/var/www/global/init.global.php on line 235
Fatal error: Unknown function: arrayslice() in
/var/www/global/init.global.php on line 105
Fatal error: Unknown function: classexists() in
/var/www/global/init.global.php on line 259

Typo I tought, but there are no typo's at these lines and after refreshing
the page, there is no error! (these lines are executed each time the script
runs!).

I get these errors sooner or later on every page. But everytime the error
is gone after a refresh.

Maybe some encoding problems? I save my pages as UTF-8. But in that case I
would expect to see the error every request and not just 'sometimes'.


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


#35841 [Bgs]: PHP Does not like underscores?

2005-12-29 Thread maarten at kleeszone dot be
 ID:   35841
 User updated by:  maarten at kleeszone dot be
 Reported By:  maarten at kleeszone dot be
 Status:   Bogus
 Bug Type: Compile Failure
 Operating System: Linux2.6.12-1-amd64 Debian
 PHP Version:  5.1.1
 New Comment:

Yes I noticed the weird characters too. But then again: Why don't I see
these errors every request? It just happens random.

I'll try the latest snapshot tomorrow, it's too late now.


Previous Comments:


[2005-12-29 19:44:37] [EMAIL PROTECTED]

There are typoes there, I see strange things in your report. For
example a weird character instead of an underscore...



[2005-12-29 18:12:22] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip





[2005-12-29 18:10:19] maarten at kleeszone dot be

Description:

Recently I installed a new server with apache2, PHP5.1 and mysql
5.0.16

Now I noticed that sometimes (0.5% of all requests) I get fatal
errors:

Fatal error: Unknown function: strtomower() in
/var/www/global/init.global.php on line 235
Fatal error: Unknown function: strtlower() in
/var/www/global/init.global.php on line 235
Fatal error: Unknown function: arrayslice() in
/var/www/global/init.global.php on line 105
Fatal error: Unknown function: classexists() in
/var/www/global/init.global.php on line 259

Typo I tought, but there are no typo's at these lines and after
refreshing the page, there is no error! (these lines are executed each
time the script runs!).

I get these errors sooner or later on every page. But everytime the
error is gone after a refresh.

Maybe some encoding problems? I save my pages as UTF-8. But in that
case I would expect to see the error every request and not just
'sometimes'.






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


#38140 [NEW]: PDO::prepare() crashes without any error output

2006-07-19 Thread maarten at students dot ch
From: maarten at students dot ch
Operating system: Debian Linux 2.6.16 Xen
PHP version:  5.1.4
PHP Bug Type: PDO related
Bug description:  PDO::prepare() crashes without any error output

Description:

When preparing a statement (see below) I get a whitescreen - the PHP
process seems to die without any error output, despite having
error_reporting  =  E_ALL and display_errors = On in my php.ini.

I'm using PDO Driver for MySQL, client library version  4.1.15


Reproduce code:
---
$pdo = new PDO([...]);
$statement = $pdo->prepare('SELECT r1.a AS a, r1.b AS b, 0 AS v1 FROM
`links` AS r1 WHERE r1.a = :a AND r1.b = :b LIMIT 0,1 UNION SELECT r1.a AS
a, r2.b AS b, r2.a AS v1 FROM `links` AS r1 JOIN `links` AS r2 ON r1.b =
r2.a WHERE r1.a = :a AND r2.b = :b AND r1.a != r2.a AND r2.b != r2.a LIMIT
0,1');

die('foo');

/* other queries with bound params work perfectly here= */



Expected result:

foo

Actual result:
--
Execution stops after calling PDO::prepare()

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


#38140 [Fbk->Opn]: PDO::prepare() crashes without any error output

2006-07-19 Thread maarten at students dot ch
 ID:   38140
 User updated by:  maarten at students dot ch
 Reported By:  maarten at students dot ch
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Debian Linux 2.6.16 Xen
-PHP Version:  5.1.4
+PHP Version:  5.2.0-dev
 New Comment:

Same results with 5.2.0-dev (Build date: Jul 19 2006 13:59:22)


Previous Comments:


[2006-07-19 11:37:51] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2006-07-19 11:36:34] maarten at students dot ch

Description:

When preparing a statement (see below) I get a whitescreen - the PHP
process seems to die without any error output, despite having
error_reporting  =  E_ALL and display_errors = On in my php.ini.

I'm using PDO Driver for MySQL, client library version  4.1.15


Reproduce code:
---
$pdo = new PDO([...]);
$statement = $pdo->prepare('SELECT r1.a AS a, r1.b AS b, 0 AS v1 FROM
`links` AS r1 WHERE r1.a = :a AND r1.b = :b LIMIT 0,1 UNION SELECT r1.a
AS a, r2.b AS b, r2.a AS v1 FROM `links` AS r1 JOIN `links` AS r2 ON
r1.b = r2.a WHERE r1.a = :a AND r2.b = :b AND r1.a != r2.a AND r2.b !=
r2.a LIMIT 0,1');

die('foo');

/* other queries with bound params work perfectly here= */



Expected result:

foo

Actual result:
--
Execution stops after calling PDO::prepare()





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


#38140 [Fbk->Opn]: PDO::prepare() crashes without any error output

2006-07-19 Thread maarten at students dot ch
 ID:   38140
 User updated by:  maarten at students dot ch
 Reported By:  maarten at students dot ch
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Debian Linux 2.6.16 Xen
 PHP Version:  5.2.0-dev
 New Comment:

I've never done this before - so I hope this is what you asked for:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211619648 (LWP 30886)]
0xb7183c2c in mysql_more_results () from /usr/lib/libmysqlclient.so.14
(gdb) bt
#0  0xb7183c2c in mysql_more_results () from
/usr/lib/libmysqlclient.so.14
#1  0xb788cc7c in pdo_mysql_stmt_dtor (stmt=0xb6f999d8) at
/usr/src/php5.2-beta/ext/pdo_mysql/mysql_statement.c:71
#2  0xb78899f9 in free_statement (stmt=0xb6f999d8) at
/usr/src/php5.2-beta/ext/pdo/pdo_stmt.c:2225
#3  0xb79c2399 in zend_objects_store_free_object_storage
(objects=0xb7c81788)
at /usr/src/php5.2-beta/Zend/zend_objects_API.c:86
#4  0xb799f8b8 in shutdown_executor () at
/usr/src/php5.2-beta/Zend/zend_execute_API.c:295
#5  0xb79aa6a0 in zend_deactivate () at
/usr/src/php5.2-beta/Zend/zend.c:839
#6  0xb796ea28 in php_request_shutdown (dummy=0x0) at
/usr/src/php5.2-beta/main/main.c:1299
#7  0xb7a0f9d9 in php_handler (r=0x82a6a00) at
/usr/src/php5.2-beta/sapi/apache2handler/sapi_apache2.c:610
#8  0x08079dd5 in ap_run_handler (r=0x82a6a00) at config.c:157
#9  0x0807a3d0 in ap_invoke_handler (r=0x82a6a00) at config.c:371
#10 0x080a61bf in ap_process_request (r=0x82a6a00) at
http_request.c:258
#11 0x080a3bc8 in ap_process_http_connection (c=0x82a0b80) at
http_core.c:172
#12 0x08080755 in ap_run_process_connection (c=0x82a0b80) at
connection.c:43
#13 0x080c12da in child_main (child_num_arg=-558296818) at
prefork.c:640
#14 0x080c1412 in make_child (s=0xb6f86400, slot=0) at prefork.c:680
#15 0x080c203f in ap_mpm_run (_pconf=0x80f80a8, plog=0x81361a0,
s=0x80fdb28) at prefork.c:956
#16 0x080676ac in main (argc=2, argv=0xbfbd78f4) at main.c:717


Previous Comments:


[2006-07-19 12:14:53] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.





[2006-07-19 12:04:12] maarten at students dot ch

Same results with 5.2.0-dev (Build date: Jul 19 2006 13:59:22)



[2006-07-19 11:37:51] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2006-07-19 11:36:34] maarten at students dot ch

Description:

When preparing a statement (see below) I get a whitescreen - the PHP
process seems to die without any error output, despite having
error_reporting  =  E_ALL and display_errors = On in my php.ini.

I'm using PDO Driver for MySQL, client library version  4.1.15


Reproduce code:
---
$pdo = new PDO([...]);
$statement = $pdo->prepare('SELECT r1.a AS a, r1.b AS b, 0 AS v1 FROM
`links` AS r1 WHERE r1.a = :a AND r1.b = :b LIMIT 0,1 UNION SELECT r1.a
AS a, r2.b AS b, r2.a AS v1 FROM `links` AS r1 JOIN `links` AS r2 ON
r1.b = r2.a WHERE r1.a = :a AND r2.b = :b AND r1.a != r2.a AND r2.b !=
r2.a LIMIT 0,1');

die('foo');

/* other queries with bound params work perfectly here= */



Expected result:

foo

Actual result:
--
Execution stops after calling PDO::prepare()





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


#38140 [Bgs]: PDO::prepare() crashes without any error output

2006-07-19 Thread maarten at students dot ch
 ID:   38140
 User updated by:  maarten at students dot ch
 Reported By:  maarten at students dot ch
 Status:   Bogus
 Bug Type: PDO related
 Operating System: Debian Linux 2.6.16 Xen
 PHP Version:  5.2.0-dev
 New Comment:

If I'm understanding [EMAIL PROTECTED]'s comment in bug #37445 correctly,
the problem's about PDO not handling a fatal error correctly.

How does this error occur? I can't see what I'm doing wrong. Besides,
that MySQL query works elsewhere perfectly. Please help me out here as
I made the effort of reporting the bug.

Any idea when this will be fixed?

Thank you for your help!


Previous Comments:


[2006-07-19 16:18:18] [EMAIL PROTECTED]

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #37445.

----

[2006-07-19 16:10:58] maarten at students dot ch

I've never done this before - so I hope this is what you asked for:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211619648 (LWP 30886)]
0xb7183c2c in mysql_more_results () from /usr/lib/libmysqlclient.so.14
(gdb) bt
#0  0xb7183c2c in mysql_more_results () from
/usr/lib/libmysqlclient.so.14
#1  0xb788cc7c in pdo_mysql_stmt_dtor (stmt=0xb6f999d8) at
/usr/src/php5.2-beta/ext/pdo_mysql/mysql_statement.c:71
#2  0xb78899f9 in free_statement (stmt=0xb6f999d8) at
/usr/src/php5.2-beta/ext/pdo/pdo_stmt.c:2225
#3  0xb79c2399 in zend_objects_store_free_object_storage
(objects=0xb7c81788)
at /usr/src/php5.2-beta/Zend/zend_objects_API.c:86
#4  0xb799f8b8 in shutdown_executor () at
/usr/src/php5.2-beta/Zend/zend_execute_API.c:295
#5  0xb79aa6a0 in zend_deactivate () at
/usr/src/php5.2-beta/Zend/zend.c:839
#6  0xb796ea28 in php_request_shutdown (dummy=0x0) at
/usr/src/php5.2-beta/main/main.c:1299
#7  0xb7a0f9d9 in php_handler (r=0x82a6a00) at
/usr/src/php5.2-beta/sapi/apache2handler/sapi_apache2.c:610
#8  0x08079dd5 in ap_run_handler (r=0x82a6a00) at config.c:157
#9  0x0807a3d0 in ap_invoke_handler (r=0x82a6a00) at config.c:371
#10 0x080a61bf in ap_process_request (r=0x82a6a00) at
http_request.c:258
#11 0x080a3bc8 in ap_process_http_connection (c=0x82a0b80) at
http_core.c:172
#12 0x08080755 in ap_run_process_connection (c=0x82a0b80) at
connection.c:43
#13 0x080c12da in child_main (child_num_arg=-558296818) at
prefork.c:640
#14 0x080c1412 in make_child (s=0xb6f86400, slot=0) at prefork.c:680
#15 0x080c203f in ap_mpm_run (_pconf=0x80f80a8, plog=0x81361a0,
s=0x80fdb28) at prefork.c:956
#16 0x080676ac in main (argc=2, argv=0xbfbd78f4) at main.c:717



[2006-07-19 12:14:53] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.



----

[2006-07-19 12:04:12] maarten at students dot ch

Same results with 5.2.0-dev (Build date: Jul 19 2006 13:59:22)



[2006-07-19 11:37:51] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





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

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


#37445 [Com]: Reproducible segfault

2006-07-26 Thread maarten at students dot ch
 ID:   37445
 Comment by:   maarten at students dot ch
 Reported By:  dhrubab at gmail dot com
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Linux
 PHP Version:  5.1.4
 Assigned To:  wez
 New Comment:

I'm experiencing this, too.


Previous Comments:


[2006-06-29 10:37:10] mark-phpbug at vetrex dot org dot uk

I also have this problem but using bindValue() instead of bindParam()



[2006-06-03 20:13:01] [EMAIL PROTECTED]

Reverting mysql_statement.c from 1.48.2.13 to 1.48.2.12 did not fix the
problem for me.



[2006-06-03 20:07:04] [EMAIL PROTECTED]

Same here, Debian Sarge AMD64

# gdb /usr/sbin/apache2
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "x86_64-linux"...(no debugging symbols
found)
Using host libthread_db library "/lib/libthread_db.so.1".
 
(gdb) run -X
Starting program: /usr/sbin/apache2 -X
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 182925889008 (LWP 27843)]
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182925889008 (LWP 27843)]
0x002a9a67e717 in mysql_more_results () from
/usr/lib/libmysqlclient.so.15
(gdb) bt
#0  0x002a9a67e717 in mysql_more_results () from
/usr/lib/libmysqlclient.so.15
#1  0x002a9a55a141 in pdo_mysql_stmt_dtor (stmt=0x82e2c8) at
/tmp/tmpDAHJQf/PDO_MYSQL-1.0.2/mysql_statement.c:71
#2  0x002a9a44c730 in free_statement (stmt=0x82e2c8) at
/tmp/tmpTQaDT7/PDO-1.0.3/pdo_stmt.c:2200
#3  0x002a9a44c7e9 in pdo_dbstmt_free_storage (stmt=0x82bc60) at
/tmp/tmpTQaDT7/PDO-1.0.3/pdo_stmt.c:2245
#4  0x002a9820702e in zend_objects_store_del_ref () from
/usr/lib/apache2/modules/libphp5.so
#5  0x002a981edcc0 in _zval_dtor_func () from
/usr/lib/apache2/modules/libphp5.so
#6  0x002a981e44e9 in _zval_ptr_dtor () from
/usr/lib/apache2/modules/libphp5.so
#7  0x002a98209143 in execute () from
/usr/lib/apache2/modules/libphp5.so
#8  0x002a982089bc in execute () from
/usr/lib/apache2/modules/libphp5.so
#9  0x002a98208edc in execute () from
/usr/lib/apache2/modules/libphp5.so
#10 0x002a982089bc in execute () from
/usr/lib/apache2/modules/libphp5.so
#11 0x002a9820c6d8 in execute () from
/usr/lib/apache2/modules/libphp5.so
#12 0x002a982089bc in execute () from
/usr/lib/apache2/modules/libphp5.so
#13 0x002a981ef907 in zend_execute_scripts () from
/usr/lib/apache2/modules/libphp5.so
#14 0x002a981b66a2 in php_execute_script () from
/usr/lib/apache2/modules/libphp5.so
#15 0x002a98254768 in zend_get_zval_ptr_ptr () from
/usr/lib/apache2/modules/libphp5.so
#16 0x00434b71 in ap_run_handler ()
#17 0x00435199 in ap_invoke_handler ()
#18 0x004278a6 in ap_process_request ()
#19 0x004234ac in _start ()
#20 0x0043f181 in ap_run_process_connection ()
#21 0x004333ee in ap_graceful_stop_signalled ()
#22 0x004335ae in ap_graceful_stop_signalled ()
#23 0x00433615 in ap_graceful_stop_signalled ()
#24 0x00433d2c in ap_mpm_run ()
#25 0x00439be7 in main ()
(gdb) frame 7
#7  0x002a98209143 in execute () from
/usr/lib/apache2/modules/libphp5.so
(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
$1 = 0x2a9a44e3e5 "query"
(gdb) print (char *)executor_globals.active_op_array->function_name
$2 = 0x82a288 "Database"



[2006-05-27 13:47:53] [EMAIL PROTECTED]

$oDB= new PDO('mysql:host=localhost;dbname=yourdb', 'user',
'pass');

// emulated or not does not matter
$oDB->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true);
$oStm = $oDB->prepare("SELECT * FROM tbl WHERE
xyz=:character_set");
   $oStm->bindParam(':character_set', 'foo);


For the record, the problem here is only about how PDO manages to free
its resource when a fatal error or exit() occurs.

In this example, it is a fatal error raise with the bindParam call (it
expects a variable as it uses a reference).

The problem is the same in many other bug reports (unexpected script
exist, like exit() in a function). The solution is to always set
query_stmt in the dbh struct, and add another flag to define  if there
was an error 

Bug #53294 [Com]: DateTime->setTimezone() very slow far future dates

2011-07-25 Thread maarten at react dot com
Edit report at https://bugs.php.net/bug.php?id=53294&edit=1

 ID: 53294
 Comment by: maarten at react dot com
 Reported by:maarten at react dot com
 Summary:DateTime->setTimezone() very slow far future dates
 Status: Feedback
 Type:   Bug
 Package:Date/time related
 Operating System:   64 bit Centos
 PHP Version:5.2.14
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

Tested in 5.3.6, and appears to be fixed.

$date = new DateTime('@'.(int)(PHP_INT_MAX / 2));
now takes less than 1ms. :)


Previous Comments:

[2011-01-22 08:52:50] s...@php.net

Please try using this snapshot:

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

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




[2010-11-11 13:55:30] maarten at react dot com

Description:

DateTime->setTimezone() is very slow on dates in the far future (or history), 
and the time needed isnt monotonic for greater dates.

ie. setTimezone() on a DateTime(PHP_INT_MAX) /* 64 bit max */ takes 0.05 
seconds, but takes 250 whole seconds for PHP_INT_MAX/2 .

Using the $timezone parameter of the DateTime constructor is always fast though.

Test script:
---
$start = microtime(1);
$date = new DateTime('@'.(PHP_INT_MAX));
//  $date = new DateTime('@'.(int)(PHP_INT_MAX / 2));
$date->setTimezone(new DateTimeZone('Europe/Amsterdam'));

echo microtime(1) - $start;

Expected result:

A faster change of the timezone; performance equal to using the constructor 
parameter







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