closure_025.phpt 207 B

123456789101112
  1. --TEST--
  2. Closure 025: Using closure in create_function()
  3. --FILE--
  4. <?php
  5. $a = create_function('$x', 'return function($y) use ($x) { return $x * $y; };');
  6. var_dump($a(2)->__invoke(4));
  7. ?>
  8. --EXPECT--
  9. int(8)