Skip to content

Commit 318627b

Browse files
committed
No need for these to be closures
1 parent cd11a77 commit 318627b

5 files changed

+24
-24
lines changed

ext/reflection/tests/ReflectionProperty_isReadable_hooks.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ class A {
1212
public $f { get {} set {} }
1313
}
1414

15-
$test = static function ($scope) {
15+
function test($scope) {
1616
$rc = new ReflectionClass(A::class);
1717
foreach ($rc->getProperties() as $rp) {
1818
echo $rp->getName() . ' from ' . ($scope ?? 'global') . ': ';
1919
var_dump($rp->isReadable($scope, null));
2020
}
21-
};
21+
}
2222

23-
$test('A');
24-
$test(null);
23+
test('A');
24+
test(null);
2525

2626
?>
2727
--EXPECT--

ext/reflection/tests/ReflectionProperty_isReadable_init.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ class C {
4545
public function __get($name) {}
4646
}
4747

48-
$test = static function ($class) {
48+
function test($class) {
4949
$rc = new ReflectionClass($class);
5050
foreach ($rc->getProperties() as $rp) {
5151
echo $rp->getName() . ' from global: ';
5252
var_dump($rp->isReadable(null, new $class));
5353
}
54-
};
54+
}
5555

56-
$test('A');
57-
$test('B');
58-
$test('C');
56+
test('A');
57+
test('B');
58+
test('C');
5959

6060
?>
6161
--EXPECT--

ext/reflection/tests/ReflectionProperty_isReadable_visibility.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ class E extends D {
2626
}
2727
}
2828

29-
$test = static function ($scope) {
29+
function test($scope) {
3030
$rc = new ReflectionClass(B::class);
3131
foreach ($rc->getProperties() as $rp) {
3232
echo $rp->getName() . ' from ' . ($scope ?? 'global') . ': ';
3333
var_dump($rp->isReadable($scope, $scope && $scope !== 'A' ? new $scope : null));
3434
}
35-
};
35+
}
3636

3737
foreach (['A', 'B', 'C', 'D', 'E'] as $scope) {
38-
$test($scope);
38+
test($scope);
3939
}
40-
$test(null);
40+
test(null);
4141

4242
?>
4343
--EXPECT--

ext/reflection/tests/ReflectionProperty_isWritable_hooks.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ class A {
1212
public $f { get {} set {} }
1313
}
1414

15-
$test = static function ($scope) {
15+
function test($scope) {
1616
$rc = new ReflectionClass(A::class);
1717
foreach ($rc->getProperties() as $rp) {
1818
echo $rp->getName() . ' from ' . ($scope ?? 'global') . ': ';
1919
var_dump($rp->isWritable($scope, null));
2020
}
21-
};
21+
}
2222

23-
$test('A');
24-
$test(null);
23+
test('A');
24+
test(null);
2525

2626
?>
2727
--EXPECT--

ext/reflection/tests/ReflectionProperty_isWritable_visibility.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ class D extends C {
2020
public function __set($name, $value) {}
2121
}
2222

23-
$test = static function ($scope) {
23+
function test($scope) {
2424
$rc = new ReflectionClass(B::class);
2525
foreach ($rc->getProperties() as $rp) {
2626
echo $rp->getName() . ' from ' . ($scope ?? 'global') . ': ';
2727
var_dump($rp->isWritable($scope, $scope && $scope !== 'A' ? new $scope : null));
2828
}
29-
};
29+
}
3030

31-
$test('A');
32-
$test('B');
33-
$test('C');
34-
$test('D');
35-
$test(null);
31+
test('A');
32+
test('B');
33+
test('C');
34+
test('D');
35+
test(null);
3636

3737
?>
3838
--EXPECT--

0 commit comments

Comments
 (0)