zlacker

[return to "PHP 8.2"]
1. Cianti+R7[view] [source] 2022-12-08 13:21:04
>>TimWol+(OP)
As someone who has written in past a lot of PHP and Python, I find it interesting that PHP devs can do a lot of breaking changes, and don't get a huge amount of flak for it.

Python 2 -> 3 change really was painful for Python community, but PHP does these almost fundamental breaking changes so often, that maybe people just get used to it? I haven't really followed Python past version 2, but I think they are less likely to ever do such amount of breaking changes.

There must be a lot of unmaintained PHP codebases that will break if PHP is updated by hosting provider etc. Someone must be pulling a lot of hairs because of this.

Edit: Those dogpiling there, I rest my case with josefresco's comment:

https://news.ycombinator.com/item?id=33907628

It's painful. Dropping dynamic properties? That will be a lot of fun. WordPress is probably biggest segment for PHP usage.

◧◩
2. mgkims+S8[view] [source] 2022-12-08 13:29:01
>>Cianti+R7
Can you give some specific examples? I can't think of too many 'fundamental breaking changes' in PHP between major versions. Some things that will be changed in 9 are now deprecated in 8.2.

PHP has gone through a few changes.

PHP 3->4 was a moderately big change under the hood, and introduced a lot of new things, but most 3 'worked' under 4 (but was... awkward).

PHP 4->5 - a few 'big' things changed - XML processing changed - I had to use some shims to get some projects upgraded.

PHP 5->7 - my recollection, and that of most colleagues, is that this was pretty painless for most projects. I can't recall too many major breaking changes, but it was mostly just getting a doubling of speed without any substantive changes.

The PHP community has a couple decades of 'major version changes' to look at to learn from. I still can't say I agree with 100% of the decisions, but it's still progressing nicely.

◧◩◪
3. denton+Vj[view] [source] 2022-12-08 14:42:34
>>mgkims+S8
> PHP 5->7 - my recollection, and that of most colleagues, is that this was pretty painless for most projects.

They replaced the MySQL plugin in version 7. All MySQL code was broken. I don't know, but I'd guess that most PHP sites were using MySQL as their database (the 'M' in 'LAMP' stands for MySQL).

◧◩◪◨
4. stephe+Cb1[view] [source] 2022-12-08 18:58:58
>>denton+Vj
> All MySQL code was broken.

Not quite. Code that *wasn't* using either of the two modern APIs for MySQL was "broken".

They removed the oldest, jankiest of the three APIs for connecting to MySQL in php7.

MySQLi (literally, "MySQL Improved" extension) was introduced with PHP 5.0, in 2004.

PDO was introduced with PHP 5.1 in 2005.

The documentation started showing "soft deprecation" notices on mysql_* functions in 2012. It was already common practice to advise people to upgrade to either mysqli or PDO.

The old mysql extension was deprecated as of php5.5, in 2013.

The final shipped version with the mysql extension was 5.6, which was supported until 2018 - half a decade after the deprecation was added.

[go to top]