<?php$a = 1;$x = function ($n) use ($a) {echo "a=$a, n=$n\n";}; $x(10); // a=1,n=10$a = 2;$x(5); // a=1, n=5
Standard input is empty
a=1, n=10 a=1, n=5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!