zephir | compiled high-level language | Generator Utils library
kandi X-RAY | zephir Summary
kandi X-RAY | zephir Summary
Zephir - is a high level programming language that eases the creation and maintainability of extensions for PHP. Zephir extensions are exported to C code that can be compiled and optimized by major C compilers such as gcc/clang/vc++. Functionality is exposed to the PHP language.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Executes a variable assignment .
- Compiles a range expression .
- Assign a single property as a single index .
- Call normal function .
- Creates a variable for read - only .
- Compiles an expression .
- Generate the concatenation code
- Pass the statement block .
- Process a statement .
- Gets optimized concatenated expressions .
zephir Key Features
zephir Examples and Code Snippets
Community Discussions
Trending Discussions on zephir
QUESTION
I read the Zephir's documentation (https://docs.zephir-lang.com/0.12/en/types) and I'm not sure I understand the difference between var
and let
in Zephir. My first thought was that maybe var
only declares a variable and if you want to assign it to something, you have to use let
. But then I saw the following lines in the documentation:
ANSWER
Answered 2020-Mar-01 at 08:13Per the docs:
Variables are, by default, immutable. This means that Zephir expects that most variables will stay unchanged. Variables that maintain their initial value can be optimized down by the compiler to static constants. When the variable value needs to be changed, the keyword let must be used.
In other words, your assumption seems right. The reason the sample you posted uses var
is because those are initial assignments as opposed to reassignments. Immutable, in that context, means that Zephir expects variables to maintain their original values.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install zephir
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page