3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $att = 0; public function __construct(){} public function do() { $this->att = 42; $array = ['test1', 'test2', 'test3', 'test4']; array_walk($array, [$this, 'go']); } public function go($value, $key) { echo $value,'<br>'; echo $this->att,'<br>'; } }

preferences:
42.47 ms | 402 KiB | 5 Q