-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Cannot build application on HHVM #3320
Comments
$ composer info | sort
doctrine/instantiator 1.1.0 A small, lightweight utility to...
guzzlehttp/guzzle 6.3.3 Guzzle is a PHP HTTP client lib...
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.4.2 PSR-7 message implementation th...
myclabs/deep-copy 1.8.1 Create deep copies (clones) of ...
phar-io/manifest 1.0.1 Component for reading phar.io m...
phar-io/version 1.0.1 Library for handling version in...
phpdocumentor/reflection-common 1.0.1 Common reflection classes used ...
phpdocumentor/reflection-docblock 4.3.0 With this component, a library ...
phpdocumentor/type-resolver 0.4.0
phpspec/prophecy 1.8.0 Highly opinionated mocking fram...
phpunit/php-code-coverage 5.3.2 Library that provides collectio...
phpunit/php-file-iterator 1.4.5 FilterIterator implementation t...
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.9 Utility class for timing
phpunit/php-token-stream 2.0.2 Wrapper around PHP's tokenizer ...
phpunit/phpunit 6.5.13 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 5.0.10 Mock Object library for PHPUnit
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.0.2 Common interface for logging li...
satooshi/php-coveralls v2.0.0 PHP client library for Coverall...
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or meth...
sebastian/comparator 2.1.3 Provides the functionality to c...
sebastian/diff 2.0.1 Diff implementation
sebastian/environment 3.1.0 Provides functionality to handl...
sebastian/exporter 3.1.0 Provides the functionality to e...
sebastian/global-state 2.0.0 Snapshotting of global state
sebastian/object-enumerator 3.0.3 Traverses array structures and ...
sebastian/object-reflector 1.1.1 Allows reflection of object att...
sebastian/recursion-context 3.0.0 Provides functionality to recur...
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in...
sebastian/version 2.0.1 Library that helps with managin...
symfony/config v4.1.5 Symfony Config Component
symfony/console v4.1.5 Symfony Console Component
symfony/filesystem v4.1.5 Symfony Filesystem Component
symfony/polyfill-ctype v1.9.0 Symfony polyfill for ctype func...
symfony/polyfill-mbstring v1.9.0 Symfony polyfill for the Mbstri...
symfony/stopwatch v4.1.5 Symfony Stopwatch Component
symfony/yaml v4.1.5 Symfony Yaml Component
theseer/tokenizer 1.1.0 A small library for converting ...
webmozart/assert 1.3.0 Assertions to validate method i... |
HHVM is not supported. |
Yes, I found that out, but is there anything I can do to run the tests on HHVM? Can I downgrade it to some version or something? Is there no way to run it, other than to rewrite my tests to other testing framework? |
HHVM has announced that they no longer intend to maintain compatibility with PHP, so if you want to stay on HHVM, you should not expect to be able to use anything that's written for PHP. You should commit your app to either PHP 7 without HHVM compatibility, or pure Hack without PHP compatibility. Trying to work with both is going to cause a lot of headaches for you, and will eventually be impossible. |
@ayg Yes, I'm aware of that. However, my applications still work under HHVM, so I see no reason to stop building it on HHVM. The only thing, that's stopping me is PhpUnit, which can't be run on hhvm. If I were to rewrite all my tests to other Php testing frameworks, everything would work as expected |
@danon In that case your choices are simple:
Many of the improvements brought by the HHVM are now part of the latest versions of PHP: performance, stability and language features. From a maintainability standpoint I'd suggest upgrading your test collection to a newer version of PHPUnit. If for no other reason that new functionality is being added and major refactoring efforts are underway. Come to us, join ussssss... 👾 |
@epdenouden I wanted to do it! Really! but:
Sorry, but the project I'm maintaining has to work for Php v7 and it would be nice if it worked on HHVM and it does! But phpunit doesn't. |
Hello @danon! Yes, PHPUnit in fact requires PHP 7.1 or higher. Because we want to use every bit of performance we can get and the new language features are nice, too. Since PHP7 is the way forward HHVM support has actually been removed from PHPUnit a while ago. I do not know of any other frameworks that keep support for either PHP5 or HHVM alive. Keep in mind that both those technologies are almost at their end-of-life.
I am wondering, is it really that much work to update your tests to work with PHPUnit 7.x? |
Please, tell me. How can I run phpunit tests on hhvm? |
@danon The short answer is: you cannot run your PHPUnit tests on the HHVM I understand you want your project to run both on PHP v7 and the HHVM. The closest you can come to a 'solution' would be: write extensive tests for your library (the regular expression one?) and make sure it's 100% coverage and green, so you are pretty sure everything works as expected. Then cover the HHVM runtime context with a list of integration tests along the lines of: That way you make sure
I hope this helps. |
BTW, keep in mind that this will complicate your CI: now you will have to run your project through two testing unit test passes, each with a slightly different PHP version+config. |
@epdenouden But you, in your answer suggested three options:
So I have questions:
CI is not a problem for me. |
Ok, I will rephrase and answer your exact questions:
For more context, search for HHVM in the issues here on Github. For example: #3207 |
If you are set on keeping support for HHVM, I suggest you branch off from your master branch now, lock your PHP version to 5.5^ in your composer file, use (unsupported) PHPUnit 4 and keep supporting PHP 5.5 and HHVM in this separate version of your code. Maybe right now only PHPUnit is preventing HHVM compatibility (or it might just be the first fatal error to pop up, while there are way more incompatibilities hidden behind it), but many more libraries are going be unsupported soon enough. It is not going to be worth the headaches trying to juggle dependencies that accidentally supported HHVM as well as recent PHP versions. |
While I agree with the above objections that HHVM decided to drop PHP support in the future and I do not expect PHPUnit to keep supporting HHVM, just to answer your question, here's how you can run an outdated and unsupported PHPUnit version with HHVM: Outdated PHPUnit 5 appears to be the last version that I could get to run on outdated HHVM on Travis CI. You can also explicitly install another PHPUnit version just for HHVM using Travis CI, for example see also clue/socket-raw#42. |
So there is no testing framework for PHP for HHVM? |
What is the latest version that supported HHVM? Does it support namespaced test syntax (available after PHPUnit 4.8.36)? |
PHPUnit dropped support of hhvm, so build unlikely will pass tests. sebastianbergmann/phpunit#3320 (comment)
* Bump PHP version to 7.1 in readme * Bump PHP version to 7.1 in class templates * Remove HHVM from Travis CI config PHPUnit dropped support of hhvm, so build unlikely will pass tests. sebastianbergmann/phpunit#3320 (comment) * Remove sudo: false from Travis-CI config Official doc recommendation: https://docs.travis-ci.com/user/reference/trusty/#container-based-infrastructure * Change tested versions to 7.1, 7.2 in Travis-CI * Remove PHP_CodeSniffer from dev dependencies There is another linter(PHP CS Fixer) which is fully configured while CodeSniffer isn't configured at all. * Use caret instead of tilde in dependencies ^2.12 equals (>= 2.12.0 && <3.0.0) while ~2.12 is (>=2.12.0 && <2.13.0) * Refresh samples
^6.4
While running a travis build for
hhvm
this is an error I getWhat can I do to run tests in PhpUnit on hhvm?
The text was updated successfully, but these errors were encountered: