- array_map: documentation ( source)
- var_dump: documentation ( source)
- array_merge: documentation ( source)
<?php
class Foo {
public $x;
public function __construct($x) {
$this->x = $x;
}
private static $i = 0;
private static function a($x) {
return new self($x.(self::$i++));
}
public static function b($y) {
return array_map(array("Foo", "a"), array_merge($y, $y));
}
}
var_dump(Foo::b(array("a", "b", "c")));