- array_map: documentation ( source)
- range: documentation ( source)
<?php
class Shit {
public static function getShits() {
return [
new Shit,
new Shit,
new Shit
];
}
public function getTird() {
return 'sucks';
}
public function getPoopies() {
return range(0,10);
}
}
$shits = array();
foreach(Shit::getShits() as $shit) {
$shits[] = array(
'tird' => $shit->getTird(),
'ffff' => array_map(
function($val) {
// can't return key = value
},
$this->getPoopies()
)
);
}