On 01/10/2020 15:23, 肖 鑫鑫 wrote:
1. Opcode binaries can be published when binding to a PHP interpreter (version dependent) release product, rather than just the PHP source code(for example, JAVA and .NET is version-dependent)


Just to clarify the comparison with other languages:

- Both the .Net CLR and the JVM are designed to be backwards compatible, so that an assembly / class compiled for version 1 should run without re-compilation on version 2 (but not the other way around) - Until recently, the .Net CLR was a very stable target, which had gone through only 4 versions in nearly 20 years (confusingly numbered 1.0, 1.1, 2.0, and 4.0) - The JVM is specified independently of the Java language, and has multiple interoperable implementations

This is very different from PHP OpCodes, which are not documented outside the engine's source, and have no provision for backwards compatibility. Not only are they likely to change between annual releases (e.g. 7.3 to 7.4) but a change in 7.4.23 could conceivably change the VM in such a way that code compiled on 7.4.22 would no longer run correctly.


The Python .pyc (and .pyo, which is just a .pyc created with optimisation turned on) is a better comparison - like PHP, it is an implementation-dependent bytecode, although it appears there is some guarantee of stability between bugfix releases. Its primary use seems to be accelerating runtime on a single machine, not distributing a binary elsewhere, and OpCache already provides that for PHP.


Regards,

--
Rowan Tommins (né Collins)
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to