1--TEST-- 2Closure 018: Assigning lambda to static var and returning by ref 3--FILE-- 4<?php 5 6class foo { 7 public function test(&$x) { 8 static $lambda; 9 $lambda = function &() use (&$x) { 10 return $x = $x * $x; 11 }; 12 return $lambda(); 13 } 14} 15 16$test = new foo; 17 18$y = 2; 19var_dump($test->test($y)); 20var_dump($x = $test->test($y)); 21var_dump($y, $x); 22 23?> 24--EXPECT-- 25int(4) 26int(16) 27int(16) 28int(16) 29