php-src/ext/reflection/tests/bug45765.phpt
Dmitry Stogov a75c195000 Implemented the RFC Support Class Constant Visibility.
Squashed commit of the following:

commit f11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:38:42 2015 +0300

    Fixed test expectation

commit 211f873f54
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:28:38 2015 +0300

    Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags

commit 51deab84b2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Dec 7 11:18:55 2015 +0300

    Fixed issues found by Nikita

commit 544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Dec 5 02:41:05 2015 +0300

    Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility
    @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
2015-12-08 12:40:42 +03:00

82 lines
1.3 KiB
PHP

--TEST--
Fixed bug #45765 (ReflectionObject with default parameters of self::xxx cause an error)
--FILE--
<?php
class foo2 {
const BAR = 'foobar';
}
class foo extends foo2 {
const BAR = "foo's bar";
function test($a = self::BAR) {
}
function test2($a = parent::BAR) {
}
function test3($a = foo::BAR) {
}
function test4($a = foo2::BAR) {
}
}
ReflectionObject::export(new foo);
?>
--EXPECTF--
Object of class [ <user> class foo extends foo2 ] {
@@ %s 7-21
- Constants [1] {
Constant [ public string BAR ] { foo's bar }
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [0] {
}
- Dynamic properties [0] {
}
- Methods [4] {
Method [ <user> public method test ] {
@@ %s 10 - 11
- Parameters [1] {
Parameter #0 [ <optional> $a = 'foo's bar' ]
}
}
Method [ <user> public method test2 ] {
@@ %s 13 - 14
- Parameters [1] {
Parameter #0 [ <optional> $a = 'foobar' ]
}
}
Method [ <user> public method test3 ] {
@@ %s 16 - 17
- Parameters [1] {
Parameter #0 [ <optional> $a = 'foo's bar' ]
}
}
Method [ <user> public method test4 ] {
@@ %s 19 - 20
- Parameters [1] {
Parameter #0 [ <optional> $a = 'foobar' ]
}
}
}
}