Skip to content

Commit

Permalink
IsReferenceTest: fix invalid test case
Browse files Browse the repository at this point in the history
Closures use clauses only take plain variables, not complex variables, like properties or array keys.

In other words, this test case as-is, was a parse error.

For the purposes of this test, it makes no difference what type of variable is passed, so let's fix the test.
  • Loading branch information
jrfnl committed Mar 31, 2024
1 parent c5e1807 commit 36aa41a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Core/File/IsReferenceTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ functionCall( $something , &new Foobar() );
$closure = function() use (&$var){};

/* testUseByReferenceWithCommentFirstParam */
$closure = function() use /*comment*/ (&$this->value){};
$closure = function() use /*comment*/ (&$value){};

/* testUseByReferenceWithCommentSecondParam */
$closure = function() use /*comment*/ ($varA, &$varB){};
Expand Down

0 comments on commit 36aa41a

Please sign in to comment.