- array_map: documentation ( source)
- print_r: documentation ( source)
<?php
class Test {
private $notPublic = "hello";
public function myMethod() {
$map = array_map(
function($str) {
return $this->notPublic." ".$str;
},
array(
"world",
"universe",
"galaxy"
)
);
return $map;
}
}
$test = new Test();
print_r($test->myMethod());