Annotation of embedaddon/php/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: ReflectionParameter::getDefaultValueConstant() should raise exception on non optional parameter
                      3: --FILE--
                      4: <?php
                      5: 
                      6: define("CONST_TEST_1", "const1");
                      7: 
                      8: function ReflectionParameterTest($test, $test2 = CONST_TEST_1) {
                      9:        echo $test;
                     10: }
                     11: $reflect = new ReflectionFunction('ReflectionParameterTest');
                     12: foreach($reflect->getParameters() as $param) {
                     13:        try {
                     14:                echo $param->getDefaultValueConstantName() . "\n";
                     15:        }
                     16:        catch(ReflectionException $e) {
                     17:                echo $e->getMessage() . "\n";
                     18:        }
                     19: }
                     20: ?>
                     21: --EXPECT--
                     22: Internal error: Failed to retrieve the default value
                     23: CONST_TEST_1

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