Annotation of embedaddon/php/ext/reflection/tests/bug64936.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: ReflectionMethod::getDocComment() uses left over doc comment from previous scanner run
                      3: --INI--
                      4: opcache.save_comments=1
                      5: opcache.load_comments=1
1.1.1.2 ! misho       6: --SKIPIF--
        !             7: <?php
        !             8: if (!extension_loaded('reflection') || !extension_loaded('tokenizer')) print 'skip missing reflection of tokernizer extension';
        !             9: ?>
1.1       misho      10: --FILE--
                     11: <?php
                     12: 
                     13: function strip_doc_comment($c)
                     14: {
                     15:        if (!strlen($c) || $c === false) return $c;
                     16:        return trim(substr($c, 3, -2));
                     17: }
                     18: 
                     19: token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment
                     20: 
                     21: eval('class A { }'); // Could also be an include of a file containing similar
                     22: 
                     23: $ra = new ReflectionClass('A');
                     24: var_dump(strip_doc_comment($ra->getDocComment()));
                     25: 
                     26: token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment
                     27: 
                     28: include('bug64936.inc');
                     29: 
                     30: $rb = new ReflectionClass('B');
                     31: var_dump(strip_doc_comment($rb->getDocComment()));
                     32: 
                     33: ?>
                     34: ===DONE===
                     35: --EXPECT--
                     36: bool(false)
                     37: bool(false)
                     38: ===DONE===

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