/**
* Class AbstractAnimal
*/
abstract class AbstractAnimal
{
/**
* @var string
*/
private $name;
/**
* AbstractAnimal constructor.
* @param string $cat_name
*/
public function __construct(string $cat_name)
{
$this->name = $cat_name;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
}
/**
* Interface CatInterface
*/
interface CatInterface
{
/**
* @return string
*/
public function meow();
}
/**
* Class Cat
*/
class Cat extends AbstractAnimal implements CatInterface
{
/**
* @return string
*/
public function meow(): string
{
return 'Cat ' . $this->getName() . ' is saying meow ';
}
}
$cat = new Cat('garfield');
echo $cat->meow();
echo '<hr>'. $cat->getName();
$response["items"] = [
["session" => "555144475", "uid" => "111945277"],
["session" => "555144476", "uid" => "123123123"],
["session" => "555144477", "uid" => "111945277"]
];
$uidOld = [];
$result = [];
foreach ($response['items'] as $k => $v) {
if (array_search($v['uid'], $uidOld)) unset($result[$v['uid']]);
$uidOld[] = $v['uid'];
$result[$v['uid']] = $v;
}
echo '<pre>';
print_r($result);
ну вы же наверняка поняли суть, к чему придирки?
Но у вас, практически все в чистом виде, раз там 2мб.
В логах 19 предупреждений, депрекейды?
xdebug включен?
Что насчет кеширования?