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

Deprecated support of php 5.6 from codeception version 2.3.1 #4269

Closed
gaainf opened this issue May 28, 2017 · 5 comments
Closed

Deprecated support of php 5.6 from codeception version 2.3.1 #4269

gaainf opened this issue May 28, 2017 · 5 comments

Comments

@gaainf
Copy link
Contributor

@gaainf gaainf commented May 28, 2017

What are you trying to achieve?

Download the latest version from codeception.com (2.3.2 currently)
Try to execute php codecept.phar

What do you get instead?

Error appeared: "Parse error: syntax error, unexpected '?' in phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 822"
Seems php 5.6 support was deprecated with 2.3.1 release.
With 2.3.0 such issue is absent.

Provide console output if related. Use -vvv mode for more details.

air-alex:test3 alex$ wget http://codeception.com/releases/2.3.1/codecept.phar
2017-05-29 00:19:22 (1.58 MB/s) - 'codecept.phar' saved [10486623/10486623]

air-alex:test3 alex$ php codecept.phar
PHP Parse error:  syntax error, unexpected '?' in phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 822
PHP Stack trace:
PHP   1. {main}() /Users/alex/Documents/My_Projects/PHP/test3/codecept.phar:0
PHP   2. require_once() /Users/alex/Documents/My_Projects/PHP/test3/codecept.phar:5
PHP   3. include_once() phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/autoload.php:45
PHP   4. class_exists(*uninitialized*) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/shim.php:16
PHP   5. spl_autoload_call(*uninitialized*) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/shim.php:16
PHP   6. Composer\Autoload\ClassLoader->loadClass($class = *uninitialized*) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/shim.php:16
PHP   7. Composer\Autoload\includeFile($file = *uninitialized*) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/vendor/composer/ClassLoader.php:301

Parse error: syntax error, unexpected '?' in phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 822

Call Stack:
    0.0503    1730304   1. {main}() /Users/alex/Documents/My_Projects/PHP/test3/codecept.phar:0
    0.0548    1768648   2. require_once('phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/autoload.php') /Users/alex/Documents/My_Projects/PHP/test3/codecept.phar:5
    0.0775    3646928   3. include_once('phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/shim.php') phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/autoload.php:45
    0.0779    3657792   4. class_exists(???) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/shim.php:16
    0.0779    3658528   5. spl_autoload_call(???) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/shim.php:16
    0.0779    3658640   6. Composer\Autoload\ClassLoader->loadClass(???) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/shim.php:16
    0.0779    3658640   7. Composer\Autoload\includeFile(???) phar:///Users/alex/Documents/My_Projects/PHP/test3/codecept.phar/vendor/composer/ClassLoader.php:301

Provide source code if related

air-alex:test3 alex$ sed -n "822p" < vendor/phpunit/phpunit/src/Framework/TestCase.php
$configurationFilePath = $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] ?? '';

Details

  • Codeception version: 2.3.1
  • PHP Version: PHP 5.6.30
  • Operating System: Mac OS 10.12
  • Installation type: Phar
@gaainf gaainf changed the title Deprecated support of php 5.6 from codeception 2.3.1 Deprecated support of php 5.6 from codeception version 2.3.1 May 28, 2017
@gaainf
Copy link
Contributor Author

@gaainf gaainf commented May 28, 2017

The incompatibility appeared due to '??' using in files:
./vendor/phpunit/phpunit/src/Framework/TestCase.php
./vendor/phpunit/phpunit/src/TextUI/Command.php
./vendor/phpunit/phpunit/src/TextUI/TestRunner.php
./vendor/phpunit/phpunit/src/Util/Filter.php
./vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php
./vendor/sebastian/environment/src/Console.php

Note: The issue isn't reproducible for composer installation type.

@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented May 29, 2017

2.3.1 is the first release with support for PHPUnit 7 but it shouldn't be building phar file with it. I will take a look at it later.

Download http://codeception.com/releases/2.3.2/php54/codecept.phar for now.

@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented May 29, 2017

It appears that this change was intentional, default codecept.phar requires PHP 7.

@DavertMik please update Builds page and replace installDependenciesForPhp56 method with installDependenciesForPhp70.

@DavertMik
Copy link
Member

@DavertMik DavertMik commented May 30, 2017

Ok

@DavertMik
Copy link
Member

@DavertMik DavertMik commented May 30, 2017

@gaainf meanwhile use PHP5 build

wget http://codeception.com/php5/codecept.phar

It's prepacked with dependencies for PHP5

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.