Live data from Hacker News

What to Look For in PHP 5.4

jburrows.wordpress.com

1–10 of 67 posts

Re: What to Look For in PHP 5.4

#3
I'v been thinking about using Php lately. I come from a C# background, so I was poking around to see what I would be missing or gaining from Php. Why haven't they added a compiled option yet? I know you can use http://phpcompiler.org compiler to do it but why hasn't it just been added to the project? The speed increase is well worth it. Also I noticed Php doesn't have generics or Template classes. I use these a lot in my C# libraries. Anyone know if thats going to be added anytime soon? I do like that its used everywhere. Also looking for a good MVC framework for Php like Asp.net MVC.

UPDATE Can you please stop down voting. I'm not hating on Php, read my other comments below.

Re: What to Look For in PHP 5.4

#4
post #3

I'v been thinking about using Php lately. I come from a C# background, so I was poking around to see what I would be missing or gaining from Php. Why haven't they added a compiled option yet? I know you can use http://phpcompiler.org compiler to do it but why hasn't it just been added to the project? The speed increase is well worth it. Also I noticed Php doesn't have generics or Template classes. I use these a lot i…

Didn't downvote you, but

1) You're hijacking the thread with something unrelated and better suited for some online research or sites like SO

2) According to your questions you're not investigating PHP, you're looking for C# in disguise/in another set of clothes.

Re: What to Look For in PHP 5.4

#5
It's been a long time since I had any interest at all in PHP, and these new features make me feel uneasy once again.

The development server seems like the only good thing about it.

Traits looks like a silly implementation of multiple inheritance mixins, with a 'use' keyword that doesn't really fit in with the language itself. And the whole 'insteadof' thing looks weird. It will lead to hackish code for many people, encouraging weird monkey-patching.

The author says "when stored in an array", then proceeds to use "$functions['anonymous']". That's not an array. Sigh. I know PHP likes to call them that, but I just find it weird that they would continue to insist on mis-naming two of the fundamental data types of computer science.

The introduction of closures can only be a good thing, and a lot better than the passing of a string name of a function as a callback argument from before.

As usual though, it's expected that most servers and frameworks won't get the update for some time, due to whatever backwards incompatible changes have been made.

I know it's all the rage to hate on PHP these days, but even giving an objective look at the state of the language, given the thriving ecosystems of its competitors, makes it look to me like something I would never touch.

Re: What to Look For in PHP 5.4

#7
post #3

I'v been thinking about using Php lately. I come from a C# background, so I was poking around to see what I would be missing or gaining from Php. Why haven't they added a compiled option yet? I know you can use http://phpcompiler.org compiler to do it but why hasn't it just been added to the project? The speed increase is well worth it. Also I noticed Php doesn't have generics or Template classes. I use these a lot i…

I too wish php had a widely supported compiler, but in reality it's not something that most projects require. The overhead of interpreting php is a lot lower than e.g. making a single db call. Also, in the most common usage scenarios, PHP processes only live for the time it takes to deal with each request, so how do you approach that if you're compiling your code? Keep spinning up new processes or rewrite your application code?

Regarding MVC frameworks, try Yii - http://www.yiiframework.com

Re: What to Look For in PHP 5.4

#8
post #3

I'v been thinking about using Php lately. I come from a C# background, so I was poking around to see what I would be missing or gaining from Php. Why haven't they added a compiled option yet? I know you can use http://phpcompiler.org compiler to do it but why hasn't it just been added to the project? The speed increase is well worth it. Also I noticed Php doesn't have generics or Template classes. I use these a lot i…

PHP is not strongly typed as C# so it doesn't need generics or templates or better said it wouldn't make much difference on performance unless it would be compiled (which is not the case on the standard).

I don't think that an official compiler is planned but HipHop (http://en.wikipedia.org/wiki/HipHop_for_PHP) might change that in the future.

There are plenty of MVC Frameworks for PHP you can try with SilverStripe or CakePHP.

Re: What to Look For in PHP 5.4

#9
post #5

It's been a long time since I had any interest at all in PHP, and these new features make me feel uneasy once again. The development server seems like the only good thing about it. Traits looks like a silly implementation of multiple inheritance mixins, with a 'use' keyword that doesn't really fit in with the language itself. And the whole 'insteadof' thing looks weird. It will lead to hackish code for many people, e…

I don't think that PHP referring to hash maps as an array is a bad thing, in fact I've always loved the flexibility of the overloaded array implementation in PHP.

> ...due to whatever backwards incompatible changes have been made.

PHP is normally very good that way, does anyone know of any backwards incompatible changes that have been made?

> I know it's all the rage to hate on PHP these days, but even giving an objective look at the state of the language, given the thriving ecosystems of its competitors, makes it look to me like something I would never touch.

Yes you're right, it is quite fashionable to hate PHP and has been so for the ~10 years I've been using it, but who cares it gets the job done (a language for the pragmatists not the purists).

Re: What to Look For in PHP 5.4

#10
post #5

It's been a long time since I had any interest at all in PHP, and these new features make me feel uneasy once again. The development server seems like the only good thing about it. Traits looks like a silly implementation of multiple inheritance mixins, with a 'use' keyword that doesn't really fit in with the language itself. And the whole 'insteadof' thing looks weird. It will lead to hackish code for many people, e…

* traits is a concept explored in smalltalk. surely the greates monkey patchers among us.

* array? yeah, it's called like that. it could even be named "fridge" or "smartass".

* due to the new release process php BC is guaranteed for non major versions. adaption will be fast.

* thriving ecosystems don't matter, PHP is just one possible piece in the toolchain.

Post reply on HN