Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Major
Category:
Plan
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jan 2016 at 21:55 UTC
Updated:
8 Feb 2019 at 15:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #3
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedLooks like a lot of the failures are covered by #2460833: _drupal_session_destroy() should return boolean and #2620104: PHP 5.4 test failures, although there may be a few others beyond that.
Comment #4
pounardI quite sure making Drupal 7 PHP7 friendly is doable, I'd very much to see it happen!
Comment #5
twistor CreditAttribution: twistor as a volunteer commentedCombining #2460833: _drupal_session_destroy() should return boolean and #2620104: PHP 5.4 test failures to see what's left.
Comment #6
twistor CreditAttribution: twistor as a volunteer commentedComment #8
twistor CreditAttribution: twistor as a volunteer commentedComment #10
twistor CreditAttribution: twistor as a volunteer commentedComment #11
twistor CreditAttribution: twistor as a volunteer commentedComment #12
twistor CreditAttribution: twistor as a volunteer commentedCurrent patch contains:
Comment #13
twistor CreditAttribution: twistor as a volunteer commentedComment #14
twistor CreditAttribution: twistor as a volunteer commentedComment #15
littletiger CreditAttribution: littletiger commentedHi, what's the status on this? Who is working on it? Is it stuck on some difficult issues, or all fixed but in need of testing?
Comment #16
anavarreComment #17
matglas86 CreditAttribution: matglas86 commentedLooking at this issue and having Ubuntu 16.04 being released with Php 7 as default a few days ago I'm curious if there is any progress on the last two fails?
Comment #18
ayalon CreditAttribution: ayalon commentedThe Drupal7 package is not installable on Ubuntu 16.04:
https://wiki.ubuntu.com/XenialXerus/ReleaseNotes
Comment #19
MustangGB CreditAttribution: MustangGB commentedI took a crack at the first of the remaining two failures.
#2712993: Can't override the same CSS files multiple times
Comment #20
hass CreditAttribution: hass commentedAny chance to commit the RTBC patches to move things forward?
Comment #21
mikeytown2 CreditAttribution: mikeytown2 commentedLatest from
#2460833-30: _drupal_session_destroy() should return boolean
#2620104-14: PHP 5.4 test failures
#2215369-69: Various bugs with PHP 5.5 imagerotate(), including when incorrect color indices are passed in
#2663746-2: Array to string conversion in trigger.test for PHP 7.
#2663752-2: Undefined string index 0 in DrupalTestCase::getAbsoluteUrl() in PHP 7
#2712993-2: Can't override the same CSS files multiple times
Also commented out the RDF failure from #12. Will open up an issue for that if this goes green.
Also for anyone moving to PHP 7 this will find issues with Uniform Variable Syntax change
grep -rn -e "->\$[a-zA-Z0-9_]*\[" ./
Comment #22
mikeytown2 CreditAttribution: mikeytown2 commentedCreated #2717633: PHP 7 hook_rdf_mapping() ['mapping']['rdftype'] failing in rdf.test: RDF type is present on post. in order to deal with the RDF failure in PHP 7
Comment #23
omega8cc CreditAttribution: omega8cc commented@mikeytown2 Works great for BOA/Aegir, thank you all ! -- https://www.drupal.org/node/2704303#comment-11153029
Comment #24
btopro CreditAttribution: btopro commented#21 looking good thus far
Comment #25
MustangGB CreditAttribution: MustangGB commentedSince this was a sub-task of a previously major task that has since been marked as fixed, I think it's only valid to increase the priority, especially considering we were specifically called out as being incompatible with Ubuntu 16.04.
Comment #26
twistor CreditAttribution: twistor as a volunteer commentedHere's the fix from #2717633: PHP 7 hook_rdf_mapping() ['mapping']['rdftype'] failing in rdf.test: RDF type is present on post. rolled in.
Comment #27
twistor CreditAttribution: twistor as a volunteer commentedComment #28
twistor CreditAttribution: twistor as a volunteer commentedBoom shakalaka!!
Comment #29
twistor CreditAttribution: twistor as a volunteer commentedFor those interested, the 5.4 issues still need review.
Comment #30
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedThanks for all the great work on this!
I'll try to review those last 4 issues myself if no one else does (though I don't really like being the only reviewer and committer on the same patch). And I'll check to make sure that all the RTBC ones look on track for commit also. It would definitely be nice to have all these tests passing for the upcoming release.
This really does seem odd to me; my understanding was that all the issues are pretty minor. And no one really complained before about Drupal 7 not passing tests on PHP 5.4 or PHP 5.5 :) But in any case, hopefully we can get them passing on all versions soon.
Comment #31
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedPer discussion with stefan.r making this a critical plan.
The goal is to say:
"Drupal 7 core fully supports PHP 7".
And hopefully contrib will follow along then.
Comment #32
stefan.r CreditAttribution: stefan.r commentedComment #33
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedWe need to check _all_ the issues in #2454439: [META] Support PHP 7 for implication on Drupal 7.
Just because tests don't fail, does not mean that we are not affected by them.
And these things can lead to very very very weird bugs.
Comment #34
DamienMcKennaBTW we'll also need #2738921: Drupal 7 tests should not be blocked for PHP 7 on the Automated Testing tab of project pages in order for contrib to support it.
Comment #35
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedCurrent status here (regarding the test failures specifically):
Comment #36
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedSorry, I had that window open in my browser for a few days :)
Comment #37
MustangGB CreditAttribution: MustangGB commentedNow this issue has a real title and child issues have been linked we don't need to double reference them all.
Comment #38
Cyberwolf CreditAttribution: Cyberwolf at 2DotsTwice bvba for European Commission commentedHi,
Is the one-line change in modules/rdf/tests/rdf_test.info in patch #26 intentional?
This seems a bit strange to me, for a PHP 7 compatibility patch.
Comment #39
mikeytown2 CreditAttribution: mikeytown2 commented@Cyberwolf
#2717633-16: PHP 7 hook_rdf_mapping() ['mapping']['rdftype'] failing in rdf.test: RDF type is present on post. explains it; also see #20 in that issue.
Comment #40
geerlingguy CreditAttribution: geerlingguy at Acquia commentedJust an aside... Last night I had a brain fart to end all brain farts and accidentally upgraded one of my production Drupal 7 servers to PHP 7 instead of 5.6, and surprisingly, even though the server had over 25 wildly-different D7 sites with a combination of around 150 different D7 modules per site, none of the sites had any discernible new errors, and I monitored syslog for a couple hours and didn't see one notice, warning or error out of the ordinary.
Bonus: for the few sites that aren't served via a proxy cache, page loads got 30% faster across the board (monitoring through the night confirmed it wasn't just a short term speed up due to a fresh server reboot).
So, though there are a couple dark corners where D7 needs a little brushing up to work perfectly under PHP7 (see: this issue), on the whole, people should not be afraid to dive into modern PHP. The water's nice... And pleasantly fast-flowing!
Comment #41
Ayesh CreditAttribution: Ayesh commentedI can also confirm D7 current dev works reasonably well with PHP 7.0 and MySQL 5.7. The session errors were not fixed at the time I tested, and the patches (now in dev) fixed that. I have my blog and several other production sites working perfectly well there.
I have been pulling my hair to fix the RDF issue, but not much luck with that.
Comment #42
DamienMcKenna@geerlinguy: For the contrib-focused contributors in the audience, would you mind providing a list of the contrib modules the site is currently using? Thanks.
Comment #43
greg.1.anderson CreditAttribution: greg.1.anderson at Pantheon commentedI encountered an issue with updatedb on D7 with php7 (n.b. fresh install with no updates to run), but it's been a little while since I tried. Sounds encouraging -- I'll have to give it another spin.
Comment #44
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commented#40 Thanks for the anecdotal evidence.
I would suggest to open a wiki or documentation page with known good contrib modules.
I feel for the next release, we will be able to say something like:
"We have experimental support for PHP 7. There could still be bugs. Please test carefully. We will fully support PHP 7 once we feel safe that it works in the "wild". And @contrib: Please test and make your modules ready for PHP 7 as well - if needed."
I think for now the most crucial issues are stable sorting and syntax errors (due to stricter syntax).
Comment #45
Ayesh CreditAttribution: Ayesh commentedIf it helps, you can check your current contrib code with php7cc (https://github.com/sstalle/php7cc ; requires PHP 5.3 or later).
Attached a check results for core (includes/*, modules/*).
Comment #46
Cyberwolf CreditAttribution: Cyberwolf at 2DotsTwice bvba for European Commission commentedThanks @mikeytown2 for pointing me to the other ticket regarding the missing dependency on the blog module in rdf_test.
Comment #47
MustangGB CreditAttribution: MustangGB commentedNot really the point of this issue, but all my servers (production or otherwise) have run on PHP7 for the last 8 months, and yes it's glorious, hence my enthusiasm for this issue. Less so for 5.4/5.5, which I guess partially answers #30.
Although if we're doing asides, I'd love to know what the "Pending Drupal 7 commit" tag is for, I read all the comments on all the issues that have added this tag and not one of them explains or points to an explanation of where it comes from or what it's intent is, is there a timeline associated with this, if not what's the point of the commit delay?
Comment #48
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commented#47:
The "Pending Drupal 7 commit" was originally used by me and stefan.r when we were officially announced, but did not yet have the power to actually commit, but really wanted to start triaging the queue.
I think of it as an (experimental) feedback mechanism: e.g. One D7 core committer thinks it is ready and there is no more work needed, but another core committer or even maintainer / contributor might disagree.
I am a fan of giving quick feedback to the Community (You are all awesome), but on the other hand reviewing something as "okay" / "approved" is not the same as actually committing it and in D7 especially we need to be really careful with not breaking anything. The tag is just a way to organize that.
And if you have followed some of the issues, David especially had some great insights on some of them still.
Also sometimes I (personally) am on a computer, where I can't commit, but can already give the feedback to the community that no more work is needed.
Also stefan.r and me talked about having two core committers sign off on more complicated patches. Or me doing reviews, him committing if my schedule does not permit committing at the moment. (e.g. team up on that)
So this is all internal and experimental for now, but I feel it is better to give some kind of feedback, than to leave an issue for RTBC for 2 months (though that could still happen too), where no one knows if this just has not yet been reviewed and actually needs work or just need some time to being committed - due to careful testing and re-review.
I also - and this is more personal for me - often find that my brain continues to think about reviewed patches and often I find flaws or issues hours or days later or when I re-review the issue.
I hope this clarifies the question - even though it is totally off-topic here.
TL;DR: Patch review and that something is ready does not mean that it passes all testing in depth or might need some more thinking or careful review before commit.
Comment #49
MustangGB CreditAttribution: MustangGB commented@Fabianx: Thanks!
Also congrats to yourself and stefan.r, I was aware D7 was looking for maintainers, didn't know it got some though, very happy to hear the good news.
Okay I'll shut-up now, sorry for the off topic, honestly thought I'd just get pointed at a docs page where it was all explained that I'd missed.
Comment #50
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedPHP 7 is green on tests and will be available for contrib modules testing soon! (pending #2738921: Drupal 7 tests should not be blocked for PHP 7 on the Automated Testing tab of project pages)
However not yet marking this fixed, because there are still issues to review and #45 should be checked / fixed as well.
I would however say we have experimental PHP 7 support now!
Comment #51
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedAdding test to prove it.
Comment #52
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedI added tests above for all the other environments also, just to see where we're at and to make sure all PHP versions 5.3/5.4/5.5/5.6/7 are now passing. (I don't really expect the SQLite/PostgreSQL ones to pass, but added those too just to check.)
I think we might want to be a little more aggressive about labeling PHP 7 as actually supported rather than "experimental". If we have known issues we should definitely document and link to them, but I would say unless they're serious, we could go ahead and mark PHP 7 as supported in the table at https://www.drupal.org/requirements/php and advertise it in the release notes. I do agree with offering a caveat/warning that it hasn't been used on many production sites yet, though.
But basically, we're holding it to a pretty high standard here :) PHP 5.5 was considered as "supported" for a long time, well before all tests were passing, and with known bugs like #2215369: Various bugs with PHP 5.5 imagerotate(), including when incorrect color indices are passed in that was more serious than any of the PHP7-only bugs fixed here. With all tests passing on PHP 7 and several comments here and elsewhere that it's perfectly possible to run Drupal 7 on PHP 7 and has been for a while, I feel like we can say that it's meaningfully supported (which is not the same as saying there are no bugs :).
Comment #53
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commented#52: I do agree, but especially the non-stable sorting can you bite in edge cases quite hard (element_children e.g.).
I ran into some of them myself and it was quite a WTF (and very hard to debug). I also do think we should be aggressive.
Maybe: Supported with some known bugs that happen in edge cases.
Comment #54
Ayesh CreditAttribution: Ayesh commentedWoot!
D8 has a working fix for element sorting, so what is left is porting it to 7 (from the current known issues of course).
Comment #55
hass CreditAttribution: hass commentedDoes it make sense to suppress these warnings in core error_reporting or should the modules change their code? I'm not sure if this is possible... als not sure if this only bubbles up on my dev machine because of devel or so. Just asking...
Comment #56
dillix CreditAttribution: dillix commented@hass, I think that maintainers of ctools & panels should change their code to be compatible with php7.
Comment #57
bojanz CreditAttribution: bojanz commentedClass-named constructors are literally PHP4 code. No need for that to stay unfixed.
Comment #58
DamienMcKennaI've opened issues for CTools (#2760041: Make CTools on D7 fully compatible with PHP 7) and Panels (#2760043: Make Panels on D7 fully compatible with PHP 7) to cover its PHP 7 incompatibilities.
Comment #59
DamienMcKennaBecause CTools doesn't have a release that fixes the PHP 7 bugs, any module that depends upon it is likely to have its tests fail due to CTools 1.9's bugs, this problem is hitting Panelizer (#2687795: Make Panelizer on D7 fully compatible with PHP 7) and Metatag (#2687793: Make Metatag on D7 fully compatible with PHP 7).
Comment #60
Alan D. CreditAttribution: Alan D. commentedAwesome work everybody.
I guess once the new release is rolled, all that needs to be done in relation to this issue is to update the doc's page...
https://www.drupal.org/requirements/php
The table
In progress (orange) to yes (green)
Probably some contrib with PHP 5.3 notices still, but I guess you could mention something in the section below, but these are no longer a core issue:
Drupal 7
Drupal 7 requires PHP 5.2.5 or higher (or PHP 5.2.4 with backported security patches, such as the version included with Ubuntu 8.04). PHP 5.4 or higher is recommended. PHP 7 support was added on DATE and support in various modules and themes are likely to follow quickly. If you notice any errors, please report these into the appropriate project issue queue tagged with "PHP 7".
[edit]
Most of the core projects do have good PHP7 support, Views, CTools, ..., but many lack recent releases. I'm partially responsible for this with Diff for example that has PHP 4 style class constructors that have been fixed, but no new release done yet. :)
Comment #61
Ayesh CreditAttribution: Ayesh commentedI ran php7cc on top 200 modules as reported on drupal.org, and only 58 of them have issues from php7cc. Most of them are false positives due to func_get_args() usage. I'm attaching the list if anyone's interested. The zip file contains multiple txt files named after the module machine name, and their issues inside them as relative paths. This is the script I used. Most notably, ctools, SMTP, and Panels modules have surefire issues. May be we split up and report them to each issue queue?
Comment #62
hass CreditAttribution: hass commentedI can say that php7cc seems to be highly unreliable. It has not found errors that crashed (wsod) my site. See #2760025: Make HTTPRL on D7 fully compatible with PHP 7. I checked all my modules and nothing was found, but I fear this may not true now.
Comment #63
dillix CreditAttribution: dillix commentedIs there any blokers for this issue?
Comment #64
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedYes,
#2756297: [D7] Element::children sort order undefined and slower than it could be - this makes the sort order inconsistent between PHP 5 and PHP 7 is a blocker, but I guess we'll need to ship 7.50 with the known bug.
Comment #65
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #66
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #67
MegaChriz CreditAttribution: MegaChriz at WebCoo commentedI found another PHP 7 issue: #2761285: _drupal_session_write() does not always return a boolean
Comment #68
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commented#67: I RTBC'ed the issue and brought it to the other committers attention - in the worst case it will be in the next bug fix release instead.
I also found another one, which I always apply locally to make self-signed certificates work: #2761345: PHP 5.6, 7 - drupal_http_request() behavior changes for SSL using self-signed certs
Comment #69
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedTrying to figure out how to reference this in the Drupal 7.50 release announcement, here's what I came up with for now (just in case anyone has any feedback):
And then:
Comment #70
Alan D. CreditAttribution: Alan D. commentedMaybe it is best to use PHP 7.0 rather than PHP 7? A bit nitpicky, but if 7.1 doesn't pass, the doco will be misleading.
If this is going to be like PHP 5, with minor releases, there were lots of API changes between 5.2 & 5.3 that causes a large amount of issues with core & contrib. Using just PHP 7 suggests coverage of all versions, including yet to be released versions ;)
Comment #71
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedI think the text includes everything it should, though if I overanalyze it, there are some parts in it that sound like contradictions:
"Drupal 7 can be successfully used on PHP 7" vs "There are some bugs when using Drupal 7 on PHP 7".
And: "Drupal < 7.50 can be used on PHP 7" vs "Several bugs affecting PHP 7 have been fixed in Drupal 7.50".
The text could be a bit puzzling for a small group of users, but I think in the end the message is clear enough: "When you want to use Drupal 7 with PHP 7.0, please test first if it works for you."
I think it is good to keep this issue open until all child issues have been fixed.
Comment #72
Crell CreditAttribution: Crell at Platform.sh commentedIt sounds like the proposed text recommends anything from 5.4-7. We should probably explicitly recommend PHP 5.6 as the oldest to use, given that PHP 5.5 is dead (checks watch) today! :-)
The "all tests pass" and "some bugs" seem in conflict. I'd suggest clarifying that the bugs are in selected edge cases (if accurate, seems to be). Contrib is the bigger concern, since who knows how tests are doing there. That warrants a mention, too.
Comment #73
heddnI take some issue with
It isn't that new. Its been out for quite some time. I feel the *real* reason to be cautious with 7.0 is contrib. Core is fairly solid at this point. I'm already running several sites on 7.0 in production.
Comment #74
btopro CreditAttribution: btopro commentedDefinitely worth mentioning that even though core supports it that contrib is still woefully behind. Perhaps pushing an issue tag like #PHP7compat or something. Also maybe a link to the PHP7 deprecation note about what is no longer compatible. For example the bulk of issues I've had in prepping for PHP7 involved converting
return;
toreturn FALSE;
. Not to suggest it's the only thing but it's probably the easiest gotcha that can quickly be resolved across much of contrib.Comment #75
klausiThere is already the "PHP 7" tag for all of core and contrib: https://www.drupal.org/project/issues/search?issue_tags=PHP%207
Comment #76
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedThanks for the suggestions everyone.
Putting it together, text would be:
Comment #77
btopro CreditAttribution: btopro commented:thumbsup
Comment #78
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commented+1 from me as well on #76
Comment #79
heddn+1 to #76.
Comment #80
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedNow that Drupal 7.50 is out, I edited the table at https://www.drupal.org/requirements/php so that PHP 7 + Drupal 7 is green.
I put "yes, but see this issue for discussion" (linking to this issue) as the text. Based on some of the above comments here, we might want to refine that more as time goes on, but I figured that was good enough for now.
Comment #81
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedFYI, only partially related to this issue (but related to the tests of all the PHP versions done in #51 above) - we tried running Drupal 7 core branch tests on a regular basis for PHP 5.5 and 5.6, but I had to turn it off because they're failing due to a testbot problem (#2762541: PHP 5.5 and 5.6 branch tests fail on Drupal 7 core, even though they pass when run on a patch). The underlying tests themselves presumably still pass though, as in the results above.
We're still running PHP 5.4 and PHP 7 tests after every Drupal 7 commit though.
Comment #82
DamienMcKennaNow that CTools 7.x-1.10 is out with the PHP 7 fixes, we can get back to writing contrib tests :-)
Comment #83
Tharick CreditAttribution: Tharick commented+ 1 to #76
Comment #84
a1tsal CreditAttribution: a1tsal commentedShould this issue be marked as closed?
I'm confused because external references suggest the matter is resolved, but the status here is still "needs review."
Comment #85
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@a1tsal
I think this issue is still open because two child issues are still open:
#2756297: [D7] Element::children sort order undefined and slower than it could be - this makes the sort order inconsistent between PHP 5 and PHP 7
#2761345: PHP 5.6, 7 - drupal_http_request() behavior changes for SSL using self-signed certs
Comment #86
andypostbtw PHP 7.1 released
Comment #87
DamienMcKennaUpdate notes for PHP 7.1: http://php.net/manual/en/migration71.php
Comment #88
jonathan.green CreditAttribution: jonathan.green commentedI think this is another issue that will cause issues with PHP support in Drupal core:
#2834022: drupal_sort_weight sort order undefined and possibly inconsistent between PHP 5 and PHP 7
Very much related to, but not solved by:
#2756297: [D7] Element::children sort order undefined and slower than it could be - this makes the sort order inconsistent between PHP 5 and PHP 7
Comment #89
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedI think we might consider closing this issue actually:
So I don't see any open core issues linked here that represent problems really specific to PHP 7.
Or is it helpful to keep this issue open still for people to coordinate on fixing contrib modules, etc?
Comment #90
alesr CreditAttribution: alesr commented+1
Quite surprisingly actually, all is working fine with Drupal 7.53 on PHP 7.0.8 with a bunch of contrib and custom modules installed too.
Comment #91
cilefenComment #92
chrisgross CreditAttribution: chrisgross commentedFYI, I ran PHP_Codesniffer against 7.0 on my drupal Install and found a few issues in core:
Comment #93
DamienMcKenna@chrisgross: FYI the file misc/healthchecks/db.check.php doesn't exist in the Drupal codebase, maybe you have something else added to your site?
The magic_quotes_runtime and modules/filter/filter.api.php things could be split off as new issues.
Comment #94
chrisgross CreditAttribution: chrisgross commented@DamienMcKenna, it must be from Pantheon, then. I can create new issues for the other two.
Comment #95
chrisgross CreditAttribution: chrisgross commentedLooks like there's already one out there:
#2594235: phpcs php codesniffer produces errors on compatibility test for php 56 5.6
Comment #96
cilefen#2877243: DATE_RFC7231 already defined in PHP 7.0.19 and 7.1.5
Comment #97
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #98
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #99
Ayesh CreditAttribution: Ayesh commentedWith the first 7.2 alpha available, I tested with it, and there are a few minor issues with some functions being deprecated:
- #2885309: [PHP 7.2] each() function is deprecated
- #2885129: [PHP 7.2] create_function() is deprecated
- #2885610: [PHP 7.2] Avoid count() calls on uncountable variables
Comment #100
hass CreditAttribution: hass commentedShouldn't we not close this issue as PHP 7.0 and 7.1 is fully supported from my understanding? Than we could open a follow up for 7.2 and maybe more follow ups for later releases. Otherwise we end up with an 10 years case trying to tackle all possible PHP 7.x releases!?
Comment #101
Ayesh CreditAttribution: Ayesh commentedYou are right mass my apologies. It makes much more sense.
Comment #102
klausiAgreed. Please open a new meta issue to track PHP 7.2 support for Drupal 7.
While we are running PHP 7.0 with Drupal 7 successfully for a year now there are 2 child issues left that are not fixed yet:
#2756297: [D7] Element::children sort order undefined and slower than it could be - this makes the sort order inconsistent between PHP 5 and PHP 7
#2594235: phpcs php codesniffer produces errors on compatibility test for php 56 5.6
Do we consider those minor enough that we can still close this issue?
Comment #103
MustangGB CreditAttribution: MustangGB commentedPersonally I think we should wait until #2756297: [D7] Element::children sort order undefined and slower than it could be - this makes the sort order inconsistent between PHP 5 and PHP 7 is fixed at least, as this can be quite a wtf when encountered.
Comment #104
webservant316 CreditAttribution: webservant316 commentedWhich is preferred at this point PHP70 or PHP71?
Comment #105
eporama CreditAttribution: eporama at Acquia commentedWe should definitely be targeting a minimum of 7.1 since php 7.0 is completely unsupported before php 5.6 (by 28 days). http://php.net/supported-versions.php
Comment #106
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedMy understanding of #2756297: [D7] Element::children sort order undefined and slower than it could be - this makes the sort order inconsistent between PHP 5 and PHP 7 is (still) that it would make things consistent between PHP 5 and PHP 7, but that the current sorting behavior of core is typically "better" (by most people's definition of "better") in PHP 7 already. If so, it doesn't seem like a good reason to keep this issue open on its own.
Comment #107
madri2 CreditAttribution: madri2 commenteddrupal 7 isn't fully compatible with PHP7. here is a report with php7cc (compatibility tester) :
File: /modules/filter/filter.api.php
> Line 205: Removed regular expression modifier "e" used
preg_replace('|
(.+?)
|se', '[codefilter_code]$1[/codefilter_code]', $text);> Line 237: Removed regular expression modifier "e" used
preg_replace('|\\[codefilter_code\\](.+?)\\[/codefilter_code\\]|se', '
', $text);
Comment #108
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commented@madri2 There's an issue for that at #2843864: Examples in filter.api.php use deprecated regular expression modifier "e" and it's definitely worth fixing. However, that isn't actual code - just example code that's part of the API documentation. So it doesn't make Drupal 7 incompatible with PHP 7 in any way.
Comment #109
webservant316 CreditAttribution: webservant316 commentedphpcs produced this list on my Drupal 7.56 codebase...
That is 3 errors and 8 warnings. #108 says that two of these errors are not a concern.
Comment #110
webservant316 CreditAttribution: webservant316 commentedFirst major problem observed after my move to PHP71, easily reproduced in my configurations.
Create a book node. Add some children. Try to edit and save the book node and I get this error...
I was initially concerned thinking that I broke things while creating book node content programmatically. However, the error occurs the same whether I create the book content manually or programmatically.
Also curious is that the error does not occur when logged in as user 1, but does occur when logged in as another user.
And likewise when I drop back to PHP56 the error goes away.
Any insight? Is this the best place to post this issue?
Comment #111
Alan D. CreditAttribution: Alan D. commentedCreate a new issue (if one doesn't already exist), and tag with PHP 7, and reference back to this thread, albeit this thread seems to have run it's course now.
Comment #112
webservant316 CreditAttribution: webservant316 commentedThanks, new thread started here, https://www.drupal.org/node/2897415
Comment #113
kc-drupal CreditAttribution: kc-drupal as a volunteer commentedDear @webservant316,
I'm a complete newbie in Drupal development considering the stature of all the members in this discussion, so, please stay with me even if I ask any lame questions!
Our existing code base consists of:-
- D7.5.6
- contrib modules (90+)
- custom modules (25+)
Currently, I run the PHPCS report with PHP_CodeSniffer version 2.9.1 on the DrupalPractice ruleset, bound with our existing code base based on PHP 5.3.3.
I'm trying to run Drupal 7.56 on PHP 7.0.10, and I haven't seen any major issues so far. May be our project haven't been using the pure core to the fullest yet.
However, I still want to go ahead and run a PHPCS report on our existing code base with PHP 7.0.10.
So, can you please help me understand if there is any updated/new DrupalPractice ruleset version to run a PHPCS report on PHP 7.0.x + D7.5.6?
Thank you, and Appreciate your help!
Comment #114
cilefenHi @knowledge-c:
The scope of this issue is getting Drupal 7 to operate properly on PHP 7, not coding standards as such—see drupal/coder for that. I think your question is better for IRC or the forums.
Comment #115
webservant316 CreditAttribution: webservant316 commentedI just used phpcs to look for any issues before moving to PHP71. The only special concern I was investigating was functionality. I wanted to figure out if Drupal 7.56 and the contributed modules I am using work with PHP71. I did discover a problem in the book_made_simple module and so abandoned it as explained at https://www.drupal.org/node/2897415.
Otherwise I have been using PHP71 with Drupal 7.56 and 100+ contributed modules on 4 production websites with no problem for several months. Thanks Drupal!
Comment #116
kc-drupal CreditAttribution: kc-drupal as a volunteer commentedThat helps, @webservant316, Thank you!
@cilefen - Yes, I would have done so, and Thank you for guiding me on the correct process!
I posted it here because I wanted to take some confirmation from "webservant316". Next time onwards, I will be careful.
Comment #117
cilefenCertainly report any PHP 7 issues here.
Comment #118
heyyo CreditAttribution: heyyo commentedThis warning shows up with the new PHP 7.2:
Warning: count(): Parameter must be an array or an object that implements Countable in theme_table() (line 2061 of /var/www/html/imart/includes/theme.inc).
Comment #119
Alan D. CreditAttribution: Alan D. commented@heyyo
You should create a new ticket for this and reference this issue as a parent.
This looked like a GIGO issue, but it should be easily replicatable.
i.e. Just don't define any of the theme parameters that default to NULL that are then are used with count(), namely caption, header, rows, colgroups theme variable arguments.
Workaround should be a trivial via THEME_preprocessor_table to add some checks, fix would be to change the theme default definitions from NULL to array I believe ;)
Comment #120
freelylw CreditAttribution: freelylw commentedI got these error message on screen when I upgrade to php7.2 for my D7, and the whole site is gone.
Fatal error: Uncaught Error: Call to undefined function cache_get() in /home/abccom/abc.com/includes/module.inc:754 Stack trace: #0 /home/abccom/abc.com/includes/module.inc(954): module_implements('system_theme_in...') #1 /home/abccom/abc.com/modules/system/system.module(2511): module_invoke_all('system_theme_in...') #2 /home/abccom/abc.com/includes/theme.inc(798): _system_rebuild_theme_data() #3 /home/abccom/abc.com/includes/theme.maintenance.inc(57): list_themes() #4 /home/abccom/abc.com/includes/bootstrap.inc(2872): _drupal_maintenance_theme() #5 /home/abccom/abc.com/includes/errors.inc(179): drupal_maintenance_theme() #6 /home/abccom/abc.com/includes/bootstrap.inc(2609): _drupal_log_error(Array, true) #7 [internal function]: _drupal_exception_handler(Object(Error)) #8 {main} thrown in /home/abccom/ab.com/includes/module.inc on line 754
IF i only upgrade to php7.0 or 7.1, the drupal site simply just display a blank front page.
Please suggest what should I do ? Thank you!
Comment #121
cilefen@freelylw How to extract logs from a WSOD: https://www.drupal.org/node/158043
Comment #122
freelylw CreditAttribution: freelylw commented@cilefen sorry its not blank page when update to php7.0/7.1, its a page displaying the message :
This page isn’t working
abc.com is currently unable to handle this request.
HTTP ERROR 500
Comment #123
cilefen@freelylw Indeed. Check the logs.
Comment #124
rahim123 CreditAttribution: rahim123 commentedHi everyone, what's the current status of Drupal 7 on PHP7? My Linux distribution of choice for my server will soon be dropping PHP5 and moving to PHP 7.2.5. They are dropping PHP5 because the last release of PHP 5.6 is nearing the end of its support lifecycle on 31 Dec 2018, and apparently that's the last release in the 5.x branch.
I'm a bit worried about the contrib modules with PHP7. For example, Rules just recently fixed two major PHP7 compatibility issues:
- https://www.drupal.org/node/2952654
- https://www.drupal.org/node/2923477
Comment #125
DamienMcKenna@sb56637: Once core is fixed up we can test out core modules to make sure they work correctly.
Comment #126
SKAUGHT@sb56637
Of course, this issue is only toward Drupal Core.
Assuming your project is using Rules..and that's the only issue for that site. life will be good. You'll have to look at each project used in your site (or sites).
Really only run the project on a test server and...see how good or bad it's going to go running under php7.x. You'll have probably need to comb thru each project's issues to see if any issues/patches exist, if not: happy patching!
I also do/have long term maintenance for projects, so i hear your concern. hopefully you're project(s) are build 'well'.
Comment #127
joseph.olstad CreditAttribution: joseph.olstad commentedThis is resolved with:
#2947772: Fully support PHP 7.2 in Drupal 7
Comment #128
joseph.olstad CreditAttribution: joseph.olstad commentedFYI, I've created a new issue for support of PHP 7.3.
#3028648: Fully support PHP 7.3 in Drupal 7
Comment #129
MustangGB CreditAttribution: MustangGB commentedI don't think it can be justified to close this issue with so many outstanding child issues that haven't been fixed or moved to another parent issue that is active.
Please clarify why you think #2947772: Fully support PHP 7.2 in Drupal 7 resolves this, if these child issues aren't resolved?
Comment #130
joseph.olstad CreditAttribution: joseph.olstad commentedOk, yes MustangGB, after looking again there appears to be several related issues left over.
I suggest that someone (other than me) attach/link any remaining unresolved related issues onto #3028648: Fully support PHP 7.3 in Drupal 7
and then close this for us,
please and thanks :)
Comment #131
Alan D. CreditAttribution: Alan D. commentedAs an aside, this thread was primarily related to PHP 7.0, which is itself now an unsupported branch (EOL was 10 Jan 2019) and David himself suggested closing this a couple years back (#89).
Maybe there should be a parent meta issue for PHP support per Drupal major branch, with child issues to cover individual minor PHP release support for that branch (PHP 7.1, 7.2, ...). Otherwise this thread will still be open in 2021/22 for PHP 7.6 related issues. :/
Comment #132
klausiAgreed, php 7.0 is not supported anymore, let's continue in follow-up issues on the supported or future versions. Then people don't have to read up on this long thread where 95% is fixed already.
Comment #133
joseph.olstad CreditAttribution: joseph.olstad commentedOk put that way, yes I agree with Klausi and Alan D, keep this closed as it was in #127.
slight correction;
php 7.0 is supported by Drupal, however not by zend
Vendors of Linux distributions such as RedHat offer security support for versions of PHP going back to 5.x.x