- pow: documentation ( source)
- range: documentation ( source)
<?php
function getStuff()
{
$stuff = range(0, 1000);
$result = [];
foreach ($stuff as $elem) {
$result[] = pow($elem, 2);
}
return $result;
}
foreach (getStuff() as $stuff)
{
echo "$stuff\n";
}