closure_021.phpt 305 B

12345678910111213141516171819202122
  1. --TEST--
  2. Closure 021: Throwing exception inside lambda
  3. --FILE--
  4. <?php
  5. $foo = function() {
  6. try {
  7. throw new Exception('test!');
  8. } catch(Exception $e) {
  9. throw $e;
  10. }
  11. };
  12. try {
  13. $foo();
  14. } catch (Exception $e) {
  15. var_dump($e->getMessage());
  16. }
  17. ?>
  18. --EXPECT--
  19. string(5) "test!"