We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b64cd42 commit e025f2aCopy full SHA for e025f2a
1 file changed
ext/reflection/tests/ReflectionFunction__toString_bound_variables.phpt
@@ -0,0 +1,32 @@
1
+--TEST--
2
+ReflectionFunction::__toString() with bound variables
3
+--FILE--
4
+<?php
5
+
6
+$closure_without_bounds = fn () => 0;
7
8
+$rf = new ReflectionFunction($closure_without_bounds);
9
+echo (string) $rf;
10
11
+$global = "";
12
+$closure_with_bounds = function() use($global) {
13
+ static $counter = 0;
14
+ return $counter++;
15
+};
16
17
+$rf = new ReflectionFunction($closure_with_bounds);
18
19
20
+?>
21
+--EXPECTF--
22
+Closure [ <user> function {closure:%s:%d} ] {
23
+ @@ %sReflectionFunction__toString_bound_variables.php 3 - 3
24
+}
25
26
+ @@ %sReflectionFunction__toString_bound_variables.php 9 - 12
27
28
+ - Bound Variables [2] {
29
+ Variable #0 [ $global ]
30
+ Variable #1 [ $counter ]
31
+ }
32
0 commit comments