Welcome Guest, Not a member yet? Register   Sign In
Poll: Would you consider upgrading to PHP 8.0?
You do not have permission to vote in this poll.
Yes
89.66%
26 89.66%
No
10.34%
3 10.34%
Total 29 vote(s) 100%
* You voted for this item. [Show Results]

Surprised to see codeigniter 3.x running successfull with PHP 8.0 as well.
#10

(This post was last modified: 01-16-2021, 06:10 AM by unplugged.)

(01-16-2021, 03:05 AM)CINewb Wrote:
unplugged Wrote:Another Gotcha that doesen't affect CI but affects a lot of legacy code I look after is that the charming "STFU Operator" now doesen't STFU.
$variable = @$array['entry']; Now throws an error rather than containing "null" gaaa.

Are there any such STFU operators in the CI framework?  I have nearly always avoided using them in my own code.  I might have some really, really ancient non-CI projects that I'll have to check prior to a PHP 8 upgrade though.  Although it looks like it's mainly fatal errors which are not silenced now, which kind of makes sense, as the application would fail at that point anyway.

It also appears there is an issue with Migrations when using PHP 8, although the fix looks simple.

Thankfully no Smile I did have a quick search for "@" however it's nearly all comments as expected and it's use is "discouraged" however it's a staple of PHP if you maintain older code.

In theory it shouldn't be an issue if you're using display_errors=off which should be the case in production although they end up in the logs. I don't know yet what if any impact it will have with CI however it will be in user code I suspect and not the core.

For code I maintain it's largely around file methods that could fail such as unlink() (if it doesen't matter that a a file actually gets deleted) or @unserialize() @json_decode() etc to return null if the data is invalid. I don't know how much of an annoyance this will be to be but I expect lots over the next year or so as I test code for PHP8 Wink
Reply


Messages In This Thread
RE: Surprised to see codeigniter 3.x running successfull with PHP 8.0 as well. - by unplugged - 01-16-2021, 06:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB