Live data from Hacker News

PHP 7 Released

github.com

191–200 of 317 posts

Re: PHP 7 Released

#191

Earlier quoted context omitted.

> instead of playing to the language's advantages and using light-weight tools and libraries that would allow them to move faster. Depending on what you mean by "move faster", I may have to disagree. Besides a one-off script, I can't envision a scenario where using "tools and libraries" would allow you to move faster than using Laravel. Laravel comes with an unbelievable amount of stuff done for you, right out of the…

Laravel is an excellent Rails clone, but the entire problem with Laravel is that it's a PHP framework. I've been a PHP dev for 15 years and the biggest issue with frameworks in PHP is PHP itself. A request comes in, the PHP process loads up everything, executes the request and tears down...on every single request. In just about every other language, the application boots up, loads everything into RAM and each individ…

>A request comes in, the PHP process loads up everything, executes the request and tears down...on every single request.

Wouldn't that make debugging much much easier? Since you get a clean slate for every request, bugs can now be tracked and replicated in a saner way. I personally prefer this method for building and maintaining a huge and complex application despite knowing that it may not be an efficient one.

Re: PHP 7 Released

#192

Earlier quoted context omitted.

Cobol is still in use. That doesn't make it good. PHP is a poorly written language. From comparisons to namespaces to other gotchas, it's just pigs guts. From the ground up, it's a badly designed language. Look up "Fractal of bad design" for a better understanding of why.

The numbers tell a different story. Wordpress powers 25% of the entire web. That is a quarter of the entire internet. It's pretty much your opinion vs the entire internet. You can see how your opinions come off as ludicrous ?

[deleted]

Re: PHP 7 Released

#194
To me, PHP is still interesting, because of the ProcessWire CMS/CMF [1], which is basically the next best thing afte sliced bread (A generic hierarchical content structure, with a jquery-inspired PHP template API, giving FULL flexibility to customize your design and presentation to anything you like ... even REST apis are just a few lines of code in a template. Add to that dozens of dozens of extremely nicec features built in, such as automatic thumbnail resize through API methods such as size(90,90)->url}"> ... and you have something immensely powerful).

[1] http://processwire.com

Re: PHP 7 Released

#195

Earlier quoted context omitted.

Pretty sure newer versions of php have an opcode cache built in, so they don't need to load everything on every request now?

Unless something has changed, that's the equivalent of keeping the files in RAM but it doesn't maintain state and routes, etc so it still has to reprocess.

That depends on implementation. The cache could be maintained in shared memory, an external process or disk files and in all cases can provide a significant speed up over reading in and compiling hundreds of files without burdening all workers with all compiled opcodes.

The current implementation uses shared memory.

In addition, that does not mean retaining all the variables and data, only the compiled opcodes and that's the bulk of the startup time.

Re: PHP 7 Released

#196

Earlier quoted context omitted.

> A request comes in, the PHP process loads up everything, executes the request and tears down...on every single request. It's called the "shared nothing architecture", and its by design. Nothing is shared between requests, so why _not_ tear down? That model actually has a lot of benefits for web applications (it scales very well), and I consider it one of PHP's strong points.

I do to, except with heavy frameworks.

Yep you're right, its the framework bootstrapping that's the killer, especially when those frameworks are expensively parsing config files each time (Yaml, XML...).

Re: PHP 7 Released

#197

Earlier quoted context omitted.

> instead of playing to the language's advantages and using light-weight tools and libraries that would allow them to move faster. Depending on what you mean by "move faster", I may have to disagree. Besides a one-off script, I can't envision a scenario where using "tools and libraries" would allow you to move faster than using Laravel. Laravel comes with an unbelievable amount of stuff done for you, right out of the…

Until you hit something the framework wasn't design to do (which happens 100% of the time in my experience). Now you're working for the framework instead of it working for you. This guy said it better: “Frameworks invert control. They control the lifecycle of the app, and give you entry points where your code runs. You’re still responsible for the final code, but you’re not in control.” https://aerotwist.com/blog/the…

I find this very true from my personal experience, but I also fine the repetition in my work to happen often enough that if you don't use a framework, you end up making your own framework

Re: PHP 7 Released

#198

Why do they keep adding global functions like "intdiv"? For example in JS, it being another language with a similar compatibility burden, they are moving most of the global functions (like parseInt) to "namespaces" (like Number.parseInt) while keeping global references there. When I open the docs (for example, the array functions page[1]), I get frightened by the global functions which do not seem to share a naming c…

The internals list has a weird combination of die hard "PHP is PHP" people who really prefer for things to not change even if they are bad.

Re: PHP 7 Released

#199
post #191

Earlier quoted context omitted.

Laravel is an excellent Rails clone, but the entire problem with Laravel is that it's a PHP framework. I've been a PHP dev for 15 years and the biggest issue with frameworks in PHP is PHP itself. A request comes in, the PHP process loads up everything, executes the request and tears down...on every single request. In just about every other language, the application boots up, loads everything into RAM and each individ…

>A request comes in, the PHP process loads up everything, executes the request and tears down...on every single request. Wouldn't that make debugging much much easier? Since you get a clean slate for every request, bugs can now be tracked and replicated in a saner way. I personally prefer this method for building and maintaining a huge and complex application despite knowing that it may not be an efficient one.

It does, but you get that whether or not you're using a heavy framework.

Without a heavy framework, you get the best of both worlds.

Re: PHP 7 Released

#200

Why do they keep adding global functions like "intdiv"? For example in JS, it being another language with a similar compatibility burden, they are moving most of the global functions (like parseInt) to "namespaces" (like Number.parseInt) while keeping global references there. When I open the docs (for example, the array functions page[1]), I get frightened by the global functions which do not seem to share a naming c…

[deleted]
Post reply on HN