PHP语言规范?

发布于 2024-10-11 12:25:43 字数 153 浏览 8 评论 0原文

我知道Java(JLS)有一个官方文档,我想知道PHP语言是否也是如此。我在PHP手册上找到了“语言参考”部分,但它看起来没有JLS那么详细。

问题是我对 PHP 有很好的实践知识,但我对幕后真正发生的事情一无所知。

如果没有官方文档,您能给我推荐一些好书吗?

I know there is an official document for Java (JLS), I'd like to know if it's also the case of PHP language. I found the "Language Reference" section on the PHP manual, but it doesn't look as detailed as the JLS.

The thing is I have a good practical knowledge of PHP but I'm miserably clueless about what really happens under the hood.

If there isn't any official document, could you recommend me some good books to read?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

浅唱ヾ落雨殇 2024-10-18 12:25:44

根据我在 Wikipedia 上读到的内容,PHP 和 Perl5 的共同点是它们都是完全通过单一实现定义的“语言”。语言正是口译员所做的一切。它们都不像 C、C++、Java 或 ECMAScript,它们都是具有许多不同实现的标准化语言。 (显然 Perl6 会有所不同,并且实际上有一个规范。不知道 PHP 有一天也会迈出这一步。)

From what I read on Wikipedia, both PHP and Perl5 have in common that they are "languages" which are entirely defined through one single implementation. The language is precisely whatever the interpreter does. Neither are like C or C++ or Java or ECMAScript, which are standardised languages with many different implementations. (Apparently Perl6 will be different and actually have a specification. No idea of PHP will also one day make this step.)

池予 2024-10-18 12:25:44

在这篇文章中,HHVM 社区宣布了 PHP 规范:http:// hhvm.com/blog/5723/announcing-a-specation-for-php

它现在位于以下 Github 存储库中:https://github.com/php/php-langspec

In this post, the HHVM Community announced a specification for PHP: http://hhvm.com/blog/5723/announcing-a-specification-for-php

It's now located in the following Github repo: https://github.com/php/php-langspec

半衾梦 2024-10-18 12:25:44

对于正式的兴趣,可以在 www.phpsemantics.org 上获取 PHP 的详细(可执行)语义,并将于明天在瑞典举行的 ECOOP 2014 会议上发布。

For the formally inclined, a detailed (executable) semantics of PHP is available at www.phpsemantics.org and will be presented tomorrow at the ECOOP 2014 conference in Sweden.

ぺ禁宫浮华殁 2024-10-18 12:25:44

从这个(日期)博客文章看来,PHP没有像这样的规范有一个用于 Java 的。

From this (dated) weblog post it appears that there is no specification for PHP like there is one for Java.

难理解 2024-10-18 12:25:44

PHP 和 Java 是用于不同目的的不同语言,当然文档不遵循相同的标准。我认为 php.net 是找到您想要的任何内容的最佳场所,也有好书,这完全取决于您的需求。

Java 也有很棒的书籍,当然还有Java 规范

PHP 没有规范,但有一份技术手册和大量示例。您还需要什么?也许是一本特定的书,尝试寻找Wiley Publishing,他们印刷有关 PHP 和其他语言的书籍。

PHP and Java are different languages for different purposes, of course the documentation do not follow the same standard. I think php.net is the best place to find whatever you want, also have good books, it all depends what about your needs.

Java also has great books, and of course the Java Specification.

PHP does not have an specification, but have a tech manual of it and plenty of examples. What more do you need? Perhaps an specific book, try to look for Wiley Publishing they print books about PHP and other languages.

天荒地未老 2024-10-18 12:25:43

PHP 的初始草案规范该语言现已宣布。规范简介如下:

本规范旨在提供 PHP 语言语法和语义的完整、简洁的定义,适合以下人员使用:

  • PHP 编译器的实现者
  • PHP 语言测试套件的实现者
  • 编写 PHP 代码的程序员

目前,运行时库已被排除,正如 www.php.net 中记录的那样。因此,所有对图书馆设施的前向引用都有 (§xx) 形式的占位符。

另请参阅最新版本的草案< /a>.

An initial draft specification for the PHP language has now been announced. The introduction of the specification reads as follows:

This specification is intended to provide a complete and concise definition of the syntax and semantics of the PHP language, suitable for use by the following:

  • Implementers of a PHP compiler
  • Implementers of a test suite for the PHP language
  • Programmers writing PHP code

For now, the runtime library has been excluded, as that is documented at www.php.net. As such, all forward references to library facilities have placeholders of the form (§xx).

See also the latest version of the draft.

痴情换悲伤 2024-10-18 12:25:43

不久前,内部邮件列表上有一个关于该主题的讨论。

您可以在那里检查状态。

起始帖子:http://marc.info/?l=php-内部&m=129379585417113&w=2

亲爱的内部人士

羡慕地看完了pythons语法
(http://docs.python.org/dev/reference/grammar.html) 我一直感觉
PHP 错过了很多有趣的元项目
拥有官方 EBNF。
[...]

以及一个希望有帮助的后续描述一些语法:

http ://marc.info/?l=php-internals&m=129387252319019&w=2

统计数据记录了此事:

http://marc.info/?l=php-internals&m=129383062812273&w=2

嗨!
[...]

你不是唯一一个在想这个问题的人
它。但到目前为止还没有人搬走
从思考到实际去做
:)

-- Stanislav Malyshev,软件架构师

There was a discussion about that topic on the internals mailing list not too long ago.

You can check the status there.

Starting Post: http://marc.info/?l=php-internals&m=129379585417113&w=2

Dear internals

After enviously looking at pythons grammar
(http://docs.python.org/dev/reference/grammar.html) I keep feeling
that PHP is missing out on a lot of interesting meta projects by not
having an official EBNF.
[...]

and one hopefully helpfull follow up describing some grammar:

http://marc.info/?l=php-internals&m=129387252319019&w=2

And Stats take in the matter:

http://marc.info/?l=php-internals&m=129383062812273&w=2

Hi!
[...]

You're not the only one thinking about
it. But so far nobody moved from
thinking about it to actually doing it
:)

-- Stanislav Malyshev, Software Architect

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文