I found code like this and can\'t find what it does
$callback = function ($pricePerItem) use ($tax, &$total) { $total += $pricePerItem * ($tax + 1.0)
Check this - http://php.net/manual/en/functions.anonymous.php, if an anonymous function wants to use local variables (for your code, it's $tax and $total), it should use use to reference them.
$tax
$total
use