3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Shit { public static function getShits() { return array( 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) { $i++; // can't return key = value }, $shit->getPoopies() ) ); }

preferences:
43.95 ms | 402 KiB | 5 Q