|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-12-12 14:05 UTC] flip101 at gmail dot com
Description:
------------
When php parses the source files and converts it to bytecode, does it do dead code elimination? For things like
if (false) {}
or when using constants (self defined or predefined)
or when checking certain expressions such as if (4 > 10-15) {}
I couldn't find anything about this after searching. It would certainly benefit libraries which have a lot of version checks and checks on which operating system it's using. To me (unknowingly of anything happening in the compiler) it seems a bit low hanging fruit optimization, but perhaps to cover all the edge cases is not so trivial. However a partial implementation would already help a lot. In case it does exist please link to relevant documentation or source files.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 15:00:01 2025 UTC |
if (4 > 10-15) {} <-- wrong example, should have been --> if (4 > 10-5) {}