-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Bump minimum version to PHP 7.1 for Symfony 4 #22733
Conversation
fabpot
commented
May 17, 2017
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes-ish? |
BC breaks? | yes-ish? |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | n/a |
License | MIT |
Doc PR | n/a |
054280d
to
0c3616c
Compare
.travis.yml
Outdated
- php: 5.5 | ||
- php: 5.6 | ||
- php: 7.0 | ||
- php: 7.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have a test running the fullstack testsuite on latest 7.1 too IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have one, like in the previous branches: the deps=low line does it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deps=low is a per-component build, not a fullstack build. It does not test the requirements of the fullstack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I misunderstood what you meant, the line you're asking for doesn't exist on the SF3 lines. Thus we should not add it since it has never been required.
appveyor.yml
Outdated
@@ -59,8 +57,6 @@ test_script: | |||
- cd c:\php && 7z x php-7.1.3-Win32-VC14-x64.zip -y >nul && copy /Y php.ini-min php.ini | |||
- cd c:\projects\symfony | |||
- php phpunit src\Symfony --exclude-group benchmark,intl-data || SET X=!errorlevel! | |||
- cd c:\php && 7z x php-5.5.9-nts-Win32-VC11-x86.zip -y >nul && copy /Y php.ini-min php.ini | |||
- cd c:\projects\symfony | |||
- SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped | |||
- php phpunit src\Symfony --exclude-group benchmark,intl-data || SET X=!errorlevel! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be removed, as it was the one running tests on 5.5.9. there is no need to run tests a second time on 7.1.3 without changing the php.ini (skipped tests will stay the same)
@fabpot when bumping the version to 4.0, you forgot to update all inter-component requirements to allow them to use the 4.0 version of other components in their own 4.0 versions |
Looks like this requires us to drop HHVM, impossible to make it run on the CI. I'm fine with that personally. |
In addition to the poll, according to the latest global PHP stats, HHVM is used by 0.36% of PHP developers. The number is practically zero ... but maybe there are some high-profile clients there (Facebook is using it, Slack was thinking about using it, ...) |
@javiereguiluz please don't forget that the stats are about number of composer installs.. That doesn't translate 1:1 to users, as some may do more installs than others. I think it's mostly interesting to see trends over time as exact point-in-time numbers can't be fully trusted. |
@nicolas-grekas HHVM has 2 modes: PHP 5 mode and PHP 7 mode. IIRC, it runs in PHP 5 mode by default. We should add |
I just tried again this mode, same failure. We'd need a php 7.1 mode. There is just no way currently to make hhvm run on a 7.1 code base. HHVM advertises itself as 70099 so even Composer cant. |
cc41e57
to
224b043
Compare
Have you tried using the latest HHVM rather than 3.18 ? they may have updated their PHP 7 mode to expose it as 7.1 later |
Yep, 3.19 locally, same result |
224b043
to
c0e4f53
Compare
.travis.yml
Outdated
# Load fixtures | ||
if [[ ! $skip ]]; then | ||
sleep 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why sleeping ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we did not require it because we had some extensions to compile, which gave some time for the ldap sever to start in the background. But now we have to sleep a bit to let it start.
c0e4f53
to
fd56941
Compare
composer.json
Outdated
@@ -16,7 +16,7 @@ | |||
} | |||
], | |||
"require": { | |||
"php": ">=5.5.9", | |||
"php": "^7.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we keep the ">=" operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this constraint forbids using the existing version with PHP 8. I think it is fine. I'm almost sure that the current code will not work with PHP 8 (PHP major versions will break BC for sure if we look at the existing releases where even minor versions have a hard time preserving BC fully). This way, when PHP 8 starts to come out, we can update our requirements once we start testing it with PHP 7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way exclude PHP8, IMO it's a good thing and avoid future PR to exclude it and then re-enable PHP8 after BC breaks corrected.
fb64a47
to
b930c86
Compare
@@ -83,11 +77,11 @@ before_install: | |||
echo extension = ldap.so >> $INI | |||
echo extension = redis.so >> $INI | |||
echo extension = memcached.so >> $INI | |||
[[ $PHP = 5.* ]] && echo extension = mongo.so >> $INI | |||
[[ $PHP = 5.* ]] && echo extension = memcache.so >> $INI | |||
#echo extension = mongodb.so >> $INI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test suite does not pass yet with mongodb - but this is not master specific so should be handled on a lower branch
1482630
to
809736f
Compare
fc893b2
to
47a3b51
Compare
"symfony/http-foundation": "~3.3|~4.0.0", | ||
"symfony/http-kernel": "~3.3|~4.0.0", | ||
"symfony/cache": "~3.4|~4.0", | ||
"symfony/class-loader": "~3.4|~4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ClassLoader component won't have a 4.0 release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but the requirement will be dropped entirely when removing deprecated code anyway (only the BC layer requires it), so it is fine for now
"symfony/translation": "~2.8|~3.0|~4.0.0", | ||
"symfony/var-dumper": "~3.3|~4.0.0", | ||
"symfony/browser-kit": "~3.4|~4.0", | ||
"symfony/class-loader": "~3.4|~4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ClassLoader component won't have a 4.0 release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do that in the next PR removing class loader, here it's a batch change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough
}, | ||
"suggest": { | ||
"symfony/browser-kit": "", | ||
"symfony/class-loader": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
47a3b51
to
4758c2c
Compare
Thank you @fabpot. |
;) |
… dunglas, nicolas-grekas) This PR was merged into the 4.0-dev branch. Discussion ---------- Bump minimum version to PHP 7.1 for Symfony 4 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes-ish? | BC breaks? | yes-ish? | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 4758c2c Tweak travis and appveyor for Symfony 4 6633c8b Allow individual bridges, bundles and components to be used with 4.0 c850733 bumped minimum version to PHP 7.1
Is this just a version number issue? HHVM can change what version number it gives back. Are there some PHP7 features we haven't implemented yet that are making it burdensome for Symfony to support HHVM? |
That's not the only issue because even with the branches that support php5.5 thus hhvm, once you enable the php7 mode the test suite fails to just run, with strange type issues being reported. |
We have an suboption to PHP7 that can disable the strict type checks. The strict type checks are broken in some cases, and we have that on our radar. It happens to not be trivial to fix, and also currently not at the top of our priority list. |
This PR was squashed before being merged into the 4.0-dev branch (closes #22820). Discussion ---------- Remove PHP < 7.1.3 code | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #22733 | License | MIT | Doc PR | N/A Commits ------- 7091fb4 Remove PHP < 7.1.3 code
Will Symfony 4 use scalar type hints and return types? This would be a break to the 3.x versions, but with a major release the best time to introduce them. |
@SenseException we will use them in new APIs. But we won't add them in existing interfaces, as this would be a BC break without a progressive upgrade path, and so the drawbacks are much bigger than the benefits for the community. Btw, the master branch already contains a scalar typehint in at least one place (the last argument in
|
@stof I'm aware that this would be a bold move, but your argument also fits to a future Symfony 5, 6, 7 and so on. Implementing an old Symfony 4 interface forces a user to omit type hints even when it is a new project that never was on version 3 before. But it seems that a return type can be added to the class implementing an interface that misses that type: https://3v4l.org/BHlVW. |
@SenseException yes you can add return types to implementations, even when the interface doesn't require them. But doing this would be something for Symfony 5 so developers can first upgrade to Symfony 4, add the return-types, and then when Symfony 5 is released they can safely upgrade. |
So Symfony 5 is going to have the type hints and return types? I just want to read when Symfony and its components arr going to use modern (2017) PHP. |
We'll use type hints and return types for the new code. It's not possible without a BC break for the old one (and it has very little interest because, as pointed out by other people, you can use type hints in your code and our code base is well tested). |
@SenseException in addition to what Kévin told you, we can only use PHP 7 features for new code added to Symfony. For the existing code, we can't use PHP 7 until November 2021 (as explained in this comment: #22862 (comment)) |
@javiereguiluz Thank you for pointing me to the comment and the answer to my question. |
@@ -63,7 +63,7 @@ | |||
|
|||
const VERSION = '4.0.0-DEV'; | |||
const VERSION_ID = 40000; | |||
const MAJOR_VERSION = 4; | |||
const MAJOR_VERSION = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like a bug in the release script 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already fixed in ce519b6
This PR was squashed before being merged into the 4.0-dev branch (closes #22820). Discussion ---------- Remove PHP < 7.1.3 code | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | symfony/symfony#22733 | License | MIT | Doc PR | N/A Commits ------- 54adaf8 Remove PHP < 7.1.3 code