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.
What to Look For in PHP 5.4
11–20 of 67 posts
Re: What to Look For in PHP 5.4
#12It'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…
As for traits, sure but as with all things it depends on who will use them. Some will make a mess out of them, while other will use them properly. Just as with any other feature in any other language. Please stop using this tiered "reason" for why PHP is bad. It's just doesn't hold water.
Re: What to Look For in PHP 5.4
#13I'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 applic…
Thanks for the Yii link.
Re: What to Look For in PHP 5.4
#14It'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 obje…
But they're not arrays. JavaScript and Lua do the same thing, allowing you to assign numeric or hashed keys on objects (or tables in Lua), but they don't call them Arrays, because they aren't. Arrays have expected behavior and implementations. So do hash maps. It's fine to amalgamate them, just give it the right name.
> PHP is normally very good that way, does anyone know of any backwards incompatible changes that have been made?
I haven't looked at any in this version, but recently there was an article (I think on HN) complaining about severe ABI changes that required all compiled modules to be recompiled, leading to adoption problems.
> 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).
I used PHP for many years as well, and for that reason I don't think it's a language for the pragmatist at all. It's not expressive enough, it encourages bad coding, and it doesn't have an ecosystem comparable to Ruby, Python, or even the amazing one Node.JS has managed to garner in the past year or so.
Re: What to Look For in PHP 5.4
#15Earlier quoted context omitted.
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 applic…
These speed charts are why I would compile Php. http://naspinski.net/post/AspNet-vs-php--speed-comparison.as... It seems worth it too me. Thanks for the Yii link.
Re: What to Look For in PHP 5.4
#16It'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…
PHP 5.4 does NOT introduce closures, they've been in there from 5.3. As for traits, sure but as with all things it depends on who will use them. Some will make a mess out of them, while other will use them properly. Just as with any other feature in any other language. Please stop using this tiered "reason" for why PHP is bad. It's just doesn't hold water.
Re: What to Look For in PHP 5.4
#17Closure::bindTo gives a nice js-like feeling, but i wonder why the hell a invocation of a closure in a class member triggers a warning.
I'm guessing this is at least some of the reason for that behaviour.
You can force it to work in the absence of a collision by using a __call override. An example of which can be seen here: https://github.com/TomNomNom/Talk---New-stuff-in-PHP-5.4/blo...
Re: What to Look For in PHP 5.4
#18Earlier quoted context omitted.
These speed charts are why I would compile Php. http://naspinski.net/post/AspNet-vs-php--speed-comparison.as... It seems worth it too me. Thanks for the Yii link.
those charts don't say whether APC is enabled, which leads me to suspect that it isn't. APC is an opcode cache that greatly enhances php performance, no one runs a high traffic website without using APC
Re: What to Look For in PHP 5.4
#19Nice to read something constructive and informative besides all the hate PHP has been getting lately.
Re: What to Look For in PHP 5.4
#20Earlier quoted context omitted.
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.
Yeah your probably right about asking this here. I was hoping for some Php experts maybe to point me in the right direction. I'm not trying to hate on Php just want to learn an open source framework or language that has similar features to C#. I really don't want to learn Java because I think thats a dead language. I'd rather use Mono but they don't have very good support for asp.net mvc.
That aside, PHP is plenty fast as long as you avoid Zend and design your apps correctly for what you're doing. Lots of bad stuff out there giving PHP a bad name, like Magento.