File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
ext/reflection/tests/internal_parameter_default_value Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Check that all internal parameter defaults evaluate without error
3
+ --FILE--
4
+ <?php
5
+
6
+ function checkDefaults (ReflectionFunctionAbstract $ rf ) {
7
+ foreach ($ rf ->getParameters () as $ param ) {
8
+ if ($ param ->isDefaultValueAvailable ()) {
9
+ try {
10
+ $ param ->getDefaultValue ();
11
+ } catch (Error $ e ) {
12
+ echo "{$ rf ->getName ()}: {$ e ->getMessage ()}\n" ;
13
+ }
14
+ }
15
+ }
16
+ }
17
+
18
+ foreach (get_defined_functions ()["internal " ] as $ func ) {
19
+ $ rf = new ReflectionFunction ($ func );
20
+ checkDefaults ($ rf );
21
+ }
22
+
23
+ foreach (get_declared_classes () as $ class ) {
24
+ $ rc = new ReflectionClass ($ class );
25
+ foreach ($ rc ->getMethods () as $ method ) {
26
+ checkDefaults ($ method );
27
+ }
28
+ }
29
+
30
+ ?>
31
+ ===DONE===
32
+ --EXPECT--
33
+ ===DONE===
You can’t perform that action at this time.
0 commit comments