Annotation of embedaddon/php/Zend/tests/closure_001.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Closure 001: Lambda without lexical variables
                      3: --FILE--
                      4: <?php
                      5: 
                      6: $lambda1 = function () {
                      7:        echo "Hello World!\n";
                      8: };
                      9: 
                     10: $lambda2 = function ($x) {
                     11:        echo "Hello $x!\n";
                     12: };
                     13: 
                     14: var_dump(is_callable($lambda1));
                     15: var_dump(is_callable($lambda2));
                     16: $lambda1();
                     17: $lambda2("Universe");
                     18: call_user_func($lambda1);
                     19: call_user_func($lambda2, "Universe");
                     20: 
                     21: echo "Done\n";
                     22: ?>
                     23: --EXPECT--     
                     24: bool(true)
                     25: bool(true)
                     26: Hello World!
                     27: Hello Universe!
                     28: Hello World!
                     29: Hello Universe!
                     30: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>