Annotation of embedaddon/php/ext/reflection/tests/closures_004.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Reflection on closures: Segfault with getClosure() on closure itself
        !             3: --FILE-- 
        !             4: <?php
        !             5: $closure = function() { echo "Invoked!\n"; };
        !             6: 
        !             7: $method = new ReflectionFunction ($closure);
        !             8: 
        !             9: $closure2 = $method->getClosure ();
        !            10: 
        !            11: $closure2 ();
        !            12: $closure2->__invoke ();
        !            13: 
        !            14: unset ($closure);
        !            15: 
        !            16: $closure2 ();
        !            17: $closure2->__invoke ();
        !            18: 
        !            19: $closure = function() { echo "Invoked!\n"; };
        !            20: 
        !            21: $method = new ReflectionMethod ($closure, '__invoke');
        !            22: $closure2 = $method->getClosure ($closure);
        !            23: 
        !            24: $closure2 ();
        !            25: $closure2->__invoke ();
        !            26: 
        !            27: unset ($closure);
        !            28: 
        !            29: $closure2 ();
        !            30: $closure2->__invoke ();
        !            31: 
        !            32: ?>
        !            33: ===DONE===
        !            34: --EXPECTF--
        !            35: Invoked!
        !            36: Invoked!
        !            37: Invoked!
        !            38: Invoked!
        !            39: Invoked!
        !            40: Invoked!
        !            41: Invoked!
        !            42: Invoked!
        !            43: ===DONE===

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