<?php
class test {
public function run() {
array_walk($list = ['asda', 'basdsa'], [$this, 'sqlFilter']);
var_dump($list);
}
private function sqlFilter($key, &$value) {
$value = ucfirst($value);
}
}
(new test)->run();
Fatal error: Uncaught Error: array_walk(): Argument #1 ($array) could not be passed by reference in /in/0Z9Ca:5
Stack trace:
#0 /in/0Z9Ca(12): test->run()
#1 {main}
thrown in /in/0Z9Ca on line 5
Process exited with code 255.
Fatal error: Uncaught Error: array_walk(): Argument #1 ($array) cannot be passed by reference in /in/0Z9Ca:5
Stack trace:
#0 /in/0Z9Ca(12): test->run()
#1 {main}
thrown in /in/0Z9Ca on line 5
Process exited with code 255.