ZF-12152: High time of execution when adding/substracing days/months or years by Zend_Date functions

Issue Type: Bug Created: 2012-04-13T14:18:11.000+0000 Last Updated: 2012-04-13T14:18:11.000+0000 Status: Open Fix version(s): Reporter: Marcin Probola (redeemer) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:


Lets look at the following code: {color:gray} <?php include('Zend/Date.php');

$value = 10000000;

$date = new Zend_Date(time()); $date->addMonth($value); {color}

Here are values and time of execution pairs (tested on Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz)

| value | time of execution | | 10000000 | 3.049s | | 100000000 | 36.241s | | 1000000000 | 5m 34.667s |

Profiler said that function which takes 99% time of execution is getDateParts of Zend_Date_DateObject.

Note: When developer dont check range of input parameters DoS attack is possible (I was able to take down production live server by following simple bash script): {color:gray}


for i in {1..100} do url="$i"; wget $url & done {color}


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.