- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
- Fatal error: Cannot use $this as lexical variable in /in/8eSuu on line 9
Process exited with code 255.
<?php
class Test {
private $privateProperty = "hello";
public function myMethod() {
$map = array_map(
function($value) use($this) {
return $this->privateProperty." ".$value;
},
array(
"city",
"world",
"universe"
)
);
return $map;
}
}
$test = new Test();
print_r($test->myMethod());