PHP 7.3 Brings C Inlining and Speed Improvements (techrepublic.com)
An anonymous reader quotes TechRepublic:
PHP 7.3, the newest update to the widespread server-side web development language, was released on Thursday, bringing with it a handful of new features, modernizations, and modest speed improvements.... The largest improvements in 7.3 include support for Foreign Function Interface (FFI), allowing programmers to write inline C code inside PHP scripts. Though this feature does not presently provide the same level of performance as native PHP code, it can under certain circumstances be used to reduce the memory footprint of a given task.
PHP 7.3 also includes flexible heredoc and nowdoc syntax, now no longer requiring closing markers to be followed by a semicolon or new line. The feature proposal for this notes that the previous rigid requirements "caused them to be, in-part, eschewed by developers because their usage in code can look ugly and harm readability...." PHP 7.3 does bring some backward incompatible changes and deprecated functions. The use of case-insensitive constraints is now deprecated, as is the use of case-insensitive constants with a case that differs from the declaration.
Phoronix reports that PHP 7.3 is nearly 10% faster than version 7.2, while it's 31% faster than PHP 7.0 and nearly three times faster than PHP 5.6.
PHP 7.3 also includes flexible heredoc and nowdoc syntax, now no longer requiring closing markers to be followed by a semicolon or new line. The feature proposal for this notes that the previous rigid requirements "caused them to be, in-part, eschewed by developers because their usage in code can look ugly and harm readability...." PHP 7.3 does bring some backward incompatible changes and deprecated functions. The use of case-insensitive constraints is now deprecated, as is the use of case-insensitive constants with a case that differs from the declaration.
Phoronix reports that PHP 7.3 is nearly 10% faster than version 7.2, while it's 31% faster than PHP 7.0 and nearly three times faster than PHP 5.6.
staying with whatever vulnerable version of 5 i have now until i die
im not updating this code
Used to come here a lot ten years ago, and I know it's not as "popular" as it used to be, but it seems like the smartest people stayed. Really enjoying the commentary.
I asked this question last time and no one answered. Where are the docs for this FFI thing? The only thing I could find was some unmaintained deprecated precursor pcre external. No docs there either.
The announcement doesn't even list it.
Where the hell are all these reporters getting this information from if not from the announcement and there are no docs?
Bueller?
Yes! C code in PHP code. It's all ever wanted.
Yep, giving the power of C to people who can't code PHP properly to begin with. Best idea ever.
"Everybody's naked underneath" -- The Doctor
Good news
and screwed 14000 lines of my code doing it...im done with that code .....
So you truly get ALL the downsides.
Insecurity and error-proneness of the low-level language C,
in the messy vagueness and slowness of the scripting language PHP,
with even more slowness on top of that!
Yeah, sounds perfectly suited to the average PHP "programmer" I've met. ... [Moved on to Python, Haskell, and a few others I knew from before, since then.])
(And I used to be one, as my day job. So I know.
P.S.: What the hell does "code PHP properly" even mean? ^^ I still know PHP very very well, and that would simply make it not PHP anymore. PHP isn't proper by the very definition of its language and libraries. Even as just a scripting language.
I don't like PHP all that much but it pays my bills and gets the job done. Say what you want but it's the only domain specific language in widespread use that has a proven record of delivering. I also like the document driven approach. PHP doesn't memory leak, it simply timeouts. Most of the time that is. A simpleton can program and add some logic to his documents within minutes and it's powerful enough to build large applications that work as advertised.
I will be sticking with PHP as a main PL for the time being and PHP 7.3 once again looks like a promising and useful update.
My 2 eurocents.
We suffer more in our imagination than in reality. - Seneca
Foreign Function Interface (FFI), allowing programmers to write inline C code inside PHP scripts.
It's not FFI that allows to write inline code. With an FFI, you can access foreign object code. So which one is it? Does it have an FFI, or inline foreign code?
Ezekiel 23:20