3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function testAnonFunc() { $testArray = array(1, 2, 3); $testArray2 = array(10, 20, 30); $result = array_map( function ($x, $y) { $x = $x + 1; return $x; }, $testArray, $testArray2 ); return $result; } } $a = new A(); print_r($a->testAnonFunc());

preferences:
39.87 ms | 402 KiB | 5 Q