Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests are php.net implementation specific #220

Open
cmb69 opened this issue Aug 29, 2018 · 0 comments
Open

Tests are php.net implementation specific #220

cmb69 opened this issue Aug 29, 2018 · 0 comments

Comments

@cmb69
Copy link
Member

cmb69 commented Aug 29, 2018

See, for instance, list_007.phpt:

--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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant