This is an error 404
There are `0` results
preferences:
142.62 ms | 1403 KiB | 7 Q<?php
class Foo
{
private $time;
public function __construct()
{
$this->time = new \DateTime();
}
public function getTime()
{
return $this->time;
}
}
$start = microtime(true);
for ($i = 0; $i < 1000; $i++) {
fn(array_pad([], 1500, new Foo));
}
$end = microtime(true);
echo $end - $start;
function fn($priceSeries)
{
$latest = new \DateTime('+1 year');
$earliest = clone $latest;
$earliest->modify('-375 days');
array_filter(
$priceSeries,
function ($priceValue) use ($earliest, $latest) {
return $priceValue->getTime() >= $earliest
&& $priceValue->getTime() <= $latest;
}
);
}