- Notifications
You must be signed in to change notification settings - Fork 272
Open
Description
See, for instance, list_007.phpt:
php-langspec/tests/expressions/list/list_007.phpt
Lines 1 to 15 in 7d35063
--TEST-- | |
Using lambda with list() | |
--FILE-- | |
<?php | |
list($x, $y) = function() { }; | |
var_dump($x, $y); | |
?> | |
--EXPECTF-- | |
Fatal error: Uncaught Error: Cannot use object of type Closure as array in %slist_007.php:3 | |
Stack trace: | |
#0 {main} | |
thrown in %slist_007.php on line 3 |
The test obviously expects a certain error message including a certain message and stack trace format, although the spec merely mentions:
the right-hand operand must be an expression that designates an array or object implementing the ArrayAccess interface
Furthermore, the test uses var_dump
which is only mentioned, but not specified in the langspec (particularly it's output format may differ).
If the tests should be useful for language implementations other than the php.net implementation, they should be written with portability in mind. Otherwise we could as well get rid of the test suite altogether (and merge possibly missing tests to the php.net test suite).
Metadata
Metadata
Assignees
Labels
No labels