class Renderer {
public function render(): string
{
return <<<HTML
<div>
<h1>Hello</h1>
</div>
HTML;
}
}class Renderer {
public function render(): string
{
return <<<HTML
<div>
<h1>Hello</h1>
</div>
HTML;
}
}$result = array_reduce(
$items,
function ($carry, $item) {
return $carry + $item;
},
0
);$result = array_reduce(
$items,
function ($carry, $item) {
return $carry + $item;
},
0,
);$point = [1, 2];
$x = $point[0];
$y = $point[1];
$x = 10;$point = [1, 2];
[$x, $y] = &$point;
$x = 10;
// $point is now [10, 2]$items = get_items();
$count = (
is_array($items) ||
$items instanceof Countable
) ? count($items) : 0;$items = get_items();
$count = is_countable($items)
? count($items)
: 0;