Live data from Hacker News

Announcing a specification for PHP

hhvm.com

91–100 of 263 posts

Re: Announcing a specification for PHP

#91
Recently i feel there even is a kind of PHP renaissance. I think its a good time to revisit PHP and look at what it has to offer these days. The community is enormous and open source frameworks like symfony2, zend2 or laravel are thriving like never before with solid implementations for nearly everything. With composer there is mature packet management now and in general the code put out for these kind of projects is of very high quality. And then there is facebook pushing PHP forward with things like HHVM, however for most stuff i have worked on, php execution time hasn't really been the bottleneck anyway, but its nice being able to squeeze out even more speed.

These days i also work a lot in node and angular, but PHP (using symfony) is still my goto language for a solid REST backend and/or classic static content based websites.

Re: Announcing a specification for PHP

#92

Earlier quoted context omitted.

Amen. I think this thread could use a little: http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ It has never been about whether PHP can get shit done, it's that given languages that actually had formal design processes and make your days as a coder a joy, why would you move TO PHP. There are simply so many other options.

There are many other options, none of which enjoy the ubiquity of PHP (as far as being installed on such a vast majority of hosts). The barrier to entry is higher if you want to run a site on something else. That is the sole reason PHP is as popular as it is and part of the reason why it stays popular and powers so many of the internet's top websites. Other reasons why it stays popular is that they really have improv…

> none of which enjoy the ubiquity of PHP (as far as being installed on such a vast majority of hosts).

So, choose the language based on the ease of the first 15 minutes of your startup?

Re: Announcing a specification for PHP

#94
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

> It's changed a lot since I first used it. Have any good examples? I haven't used the language in years, would love to see what "modern" PHP looks like. (Seriously, not trolling at all)

Apart from the language in itself, the ecosystem has matured leaps and bounds. Symfony is the poster child of the new frameworks: easy to use, flexible and powerful. I haven't used rails but I heard it's going the same direction.

Sometimes I feel we're getting too close to Java territory in terms of abstraction and reliance on libraries, but that would also be a sign of maturity.

Re: Announcing a specification for PHP

#95
post #79
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

Fun with PHP: $a = 'b'; $b = 'a'; echo $a."\n"; >>> b echo $$a."\n"; >>> a echo $$$a."\n"; >>> b Yaaa $obj = new StdClass(); $obj->x = 1; function x_plus_one($obj) { $obj->x++; } x_plus_one($obj); var_dump($obj); >>> object(stdClass)#1 (1) { >>> ["x"]=> >>> int(2) >>> } Huh? A local change to the object changed the object outside the local scope? It must have been passed by reference... function null_the_object($obj)…

Java willl have the same behaviour for function like x_plus_one. And function null_the_object_2 cannot be made in java.

Re: Announcing a specification for PHP

#96
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

> It's changed a lot since I first used it. Have any good examples? I haven't used the language in years, would love to see what "modern" PHP looks like. (Seriously, not trolling at all)

I made a blog post that compares Hack and the new Javascript specifications ES6 and ES7[1]. They have a lot of features in common.

[1] http://blog.vjeux.com/2014/javascript/hack-is-to-php-what-es...

Re: Announcing a specification for PHP

#97
post #79
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

Fun with PHP: $a = 'b'; $b = 'a'; echo $a."\n"; >>> b echo $$a."\n"; >>> a echo $$$a."\n"; >>> b Yaaa $obj = new StdClass(); $obj->x = 1; function x_plus_one($obj) { $obj->x++; } x_plus_one($obj); var_dump($obj); >>> object(stdClass)#1 (1) { >>> ["x"]=> >>> int(2) >>> } Huh? A local change to the object changed the object outside the local scope? It must have been passed by reference... function null_the_object($obj)…

Honestly the reference passing quirks you mentioned behave exactly as I would have assumed, am I alone in this?

Re: Announcing a specification for PHP

#99
post #79
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

Fun with PHP: $a = 'b'; $b = 'a'; echo $a."\n"; >>> b echo $$a."\n"; >>> a echo $$$a."\n"; >>> b Yaaa $obj = new StdClass(); $obj->x = 1; function x_plus_one($obj) { $obj->x++; } x_plus_one($obj); var_dump($obj); >>> object(stdClass)#1 (1) { >>> ["x"]=> >>> int(2) >>> } Huh? A local change to the object changed the object outside the local scope? It must have been passed by reference... function null_the_object($obj)…

There is nothing unexpected by this behavior -- this works exactly the same as any language with the same features (C++, C#, etc). I don't know why you found this at all surprising; it's not at all quirky in this example.

Re: Announcing a specification for PHP

#100
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

> It's changed a lot since I first used it. Have any good examples? I haven't used the language in years, would love to see what "modern" PHP looks like. (Seriously, not trolling at all)

PHP the Right Way is a good place to start:

http://www.phptherightway.com/

Post reply on HN