3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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();
based on 0Z9Ca
Output for 7.0.0 - 7.2.0
Notice: Only variables should be passed by reference in /in/t6v7Y on line 5 array(2) { [0]=> string(4) "fuck" [1]=> string(5) "white" }
Output for 5.4.10 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/t6v7Y on line 5 array(2) { [0]=> string(4) "fuck" [1]=> string(5) "white" }
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/t6v7Y on line 5
Process exited with code 255.