4 ms·
PHP does make big, backwards-incompatible changes at major versions. They are slowly happening, but only slowly, unfortunately. But I hope to see some big chang
by TazeTSchnitzel 14y ago
PHP does make big, backwards-incompatible changes at major versions. They are slowly happening, but only slowly, unfortunately. But I hope to see some big changes before trunk becomes PHP 6.
- encoderer 14y agoI'll bite... like what? All of PHP4's syntax is still valid in PHP5 even if it does raise a deprecated notice. The only real thing that broke in the upgrade is if you had a LOC that was expecting an object to be passed by value. Theoretically possible but practically very very rare. And of course config settings like register globals being changed, but that's just that: a config change.
- TazeTSchnitzel 14y agoregister_globals was removed. PHP5 changed the semantics of objects entirely. Before they were value types. Still, yes, not enough has changed IMO.
- encoderer 14y agoThis is certainly a debate about semantics, but I don't think you mean "semantics." They changed the implementation of objects. And they added new syntax. But they made no changes that affected the old syntax -- except the one I mentioned.
- TazeTSchnitzel 14y agoI guess so, I'm not well-versed in programming nomenclature, I haven't done a CS course.
- deleted 14y ago[deleted]
- wvenable 14y ago> They changed the implementation of objects You're implying it was an implementation detail. They fundamentally changed how objects worked, the semantics, that made it completely impossible to move any of my PHP4 code over in a reasonable way. It is possible to make code, that uses objects, work in both PHP4 and PHP5 but you have to restrict yourself to a subset of both versions.
- encoderer 14y agoThat's interesting. What were you doing with your PHP4 classes that didn't run in PHP5?
- wvenable 14y agoThe difference between value semantics and reference semantics is pretty significant. It's almost impossible to do any meaningful OOP without taking that into account. Getting PHP4 to work reasonably requires a lot of work (hence the change in PHP5). None of the PHP4 frameworks moved over to PHP5 without a lot of re-writing. My code simply assumed value assignment semantics and changing that everywhere was just too much work. At this moment, I still have sites running PHP4.
- encoderer 14y agoI'd love some specifics. Were you passing around objects and mutating them while expecting the existing object to be unchanged? For example: $o = new MyObject() $o->important_data = 'clean'; function foo($give_me_o) { $o->important_data = 'dirty'; } foo($o); echo $o; // Need this to say "clean" Because that, literally, is all that changed. Yes, the implementation changed. But PHP4 syntax (including explicit pass-by-reference and class-named constructors) still works in PHP5. That's not an accident. That was by design. Go back and read the discussions. Frameworks chose to upgrade because you get MUCH better memory management and cleaner syntax from PHP5. But many, many people run PHP4 code in a PHP5 runtime. It works just fine. Because that example I used above -- while it is totally possible you have code like that, that's in practice pretty rare.
- TylerE 14y agoWhich is a problem in and of itself...languages shouldn't have config files.