Skip to content

Commit 1ddc64f

Browse files
committed
Verify that whitespace is irrelevant.
1 parent b68fbf4 commit 1ddc64f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Zend/tests/short_functions/short-func.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ Basic short functions return values.
55

66
function test(int $a) => $a + 1;
77

8-
function test2(int $b) => return $b . 'error';
8+
function test2(int $b)
9+
=> $b + 1;
910

10-
print test(5);
11+
print test(5) . PHP_EOL;
12+
print test2(5) . PHP_EOL;
1113

1214
?>
1315
--EXPECT--
1416
6
17+
6
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Basic short functions return values.
2+
Short methods.
33
--FILE--
44
<?php
55

@@ -8,12 +8,17 @@ class Test {
88
public function __construct(private int $b) {}
99

1010
public function addUp(int $a) => $a + $this->b;
11+
12+
public function addUp2(int $a)
13+
=> $a + $this->b;
1114
}
1215

1316
$t = new Test(1);
1417

15-
print $t->addUp(5);
18+
print $t->addUp(5) . PHP_EOL;
19+
print $t->addUp2(5) . PHP_EOL;
1620

1721
?>
1822
--EXPECT--
1923
6
24+
6

0 commit comments

Comments
 (0)