<?php
class test {
public function run() {
array_walk($list = ['fuck', 'white'], [$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/t6v7Y:5
Stack trace:
#0 /in/t6v7Y(12): test->run()
#1 {main}
thrown in /in/t6v7Y on line 5
Process exited with code 255.
Fatal error: Uncaught Error: array_walk(): Argument #1 ($array) cannot be passed by reference in /in/t6v7Y:5
Stack trace:
#0 /in/t6v7Y(12): test->run()
#1 {main}
thrown in /in/t6v7Y on line 5
Process exited with code 255.