什么是PHP的体系结构限制? [英] What are the architectural limitations of PHP?

查看:155
本文介绍了什么是PHP的体系结构限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读的文章PHP很烂,但它不通过杰夫阿特伍德事

在评论他写道:

这是说,我绝对认为对PHP开发者要意识到PHP的建筑限制,并了解它的替代品是非常重要的。

That said, I absolutely think it's important for PHP devs to be aware of the architectural limitations of PHP, and understand the alternatives.

什么是那些限制和它们如何与其他脚本/弱类型语言比较?

What are those limitations and how do they compare with other scripting / weakly typed languages?

此外,什么是在那些限制需避免的情况选择呢?

Also, what are the alternatives in those conditions where limitations need to be avoided?

推荐答案

有两种基本的现实局限性,所以我看到:

There are basically two real limitations I see:

PHP是一个完全同步的语言即可。这有冲击对哪些东西可以用PHP和不容易实现。例如实施长轮询驱动的聊天应用程序是不平凡的,因为PHP需要阻止喋喋不休每一个进程。我不是说这是不可能的,你可以入侵周围使用一些PHP守护图书馆这一限制。我只是说,这是在哪里其他语言,如JavaScript,是比较合适的案例之一( 的NodeJS)。

PHP is a fully synchronous language. This has impact on which things you can easily implement in PHP and which not. For example implementing a Long Polling driven chat application isn't trivial, because PHP would need block one process per chatter. I'm not saying it's impossible, you can hack around this limitation using some PHP Daemon library. I'm just saying that this is one of the cases where other languages, like JavaScript, are more appropriate (NodeJS).

PHP是慢。请不明白这一点的,即属犯罪。这是一个事实,即PHP - 由Zend的实现 - 相对于其他脚本语言是缓慢的。此网站建设时,通常是没有问题的,但你显然不能做某些事情:实现PHP中的光线追踪,绝对是一个坏主意 - 而在JavaScript中,你可以做到这一点。

PHP is slow. Please don't understand this an an offense. It's a fact that PHP - as implemented by Zend - is slow compared to other scripting languages. This typically is no problem when building websites, but you obviously can't do certain things: Implementing a ray tracer in PHP is definitely a bad idea - whereas in JavaScript you could do this.

但除此之外,我认为PHP是pretty多用。你可以用它为几乎任何 - 我做的;)

But apart from that, I think that PHP is pretty multi-purpose. You can use it for nearly anything - and I do ;)

这篇关于什么是PHP的体系结构限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆