I need to access the first argument to a function inside an anonymous function passed as the second argument to said function. For example:
<?php
function a($arg, $func) {
echo $func();
}
a("argument 1", function () use($arg) {return $arg;});
?>
The above will return the following error:
Notice: Undefined variable: arg in path/to/file.php on line 5
While the desired result would be:
argument 1