6 comments

[ 3.6 ms ] story [ 24.4 ms ] thread
This essentially boils down to the fact that your development environment and production environment were running completely different software. This isn't a PHP-specific problem.

> the designers’ strategy to break code compatibility between PHP versions only for aesthetic reasons (array(a,b,c) vs [a, b, c]) is bound to lose the confidence of its users sooner or later.

This is not a backwards-compatibility issue. You used features which were introduced in 5.4, and expected them to work in 5.3.

@wldlyinaccurate - I never said anything about backwards-compatibility, its just a matter of compatibility between versions backward or not.

>>You used features which were introduced in 5.4, and expected them to work in 5.3. Yes, that can happen sometimes, especially when you are working between dev and production environments. But basic things like improvising array De-referencing syntax should not be done this late in time, don't you agree?

Other languages do have innovations but they are in advanced things - C# improvisations were in introducing LINQ library and the parallel task library. Python has a standard way of doing basic things like array De-referencing since the 90s!. Then why is PHP changing such basic language constructs today? 5.3 was released in 2009. Language constructs ought to have been standardized by then.

Just to be clear: PHP didn't change these language constructs. The old constructs are still available. You made a conscious choice to use new language features and are now (understandably) frustrated that they don't work in a 5-year-old version of the language.

> 5.3 was released in 2009. Language constructs ought to have been standardized by then.

Absolutely not. By this logic, no languages would ever evolve. The PHP core team are making an effort to evolve PHP into a better, modern language. If you want to take advantage of this, then do. If you want to write code that runs on your clients' older servers, then write backwards-compatible code and don't expect to be able to use new language features.

Okay why are we still being worked up by simple things such as array initialization ? [] vs Array() ? I don't see what code you're writing and how fast, that this shorthand comes into effect and makes any difference to you?
@kostko - Obviously, I can't disclose the entire client-confidential code on this forum. But suffice it to say that short-hands are typically used in different languages. But that doesn't mean that you suddenly introduce shorthands in a particular language and thus break working code.
If something introduced in newer version doesn't run in the older, how it's breaking backward compatibility? It would've been if the PHP5.3 version of your code didn't work in 5.4.