use packs a copy
A closure captures $price with use, then $price changes outside.
<?php$price = 10;$show = function () use ($price) { return 'price ' . $price;};$price = 20;echo $show(), PHP_EOL;echo 'now ' . $price, PHP_EOL;1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…