Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
HHVM vs Zend Engine in PHP 6
Jan 27, 2014 @ 18:05:55

In this recent post to the SitePoint PHP blog Bruno Skvorc compares two technologies that have influence how PHP performs - the HHVM (HipHop Virtual Machine) and the Zend Engine in PHP6 - and the potential replacement of one with the other.

The fabled PHP 6 is long overdue. This unicorn of the web dev world has been “coming” for decades now, and it’s still not clear whether or not it’s actually something that’s going to happen in this decade, or just an idea, a fantasy of the PHP userbase. [...] In the latest edition [of the PHPClasses podcast] between Manuel Lemos and César Rodas, an interesting topic arose among others – Facebook’s HHVM replacing Zend Engine in PHP 6. While this was purely speculation on the part of the participants, and whether or not you believe in PHP 6, you have to admit it’s an interesting notion.

He starts with a look at the overall pros of the HHVM solution - the speed of execution, that it's backed by Facebook and its support for static typing. There's some cons that come with the HHVM though, including not allowing custom extensions, that it's developed by Facebook (yes, this can be a con too) and that there are other ways to enhance PHP's execution speed without sacrificing other functionality.

tagged: hhvm sitepoint pro con compare zendengine

Link: http://www.sitepoint.com/hhvm-vs-zend-engine-php-6/

Kevin Schroeder:
Would this be a dumb idea for PHP core?
Feb 19, 2013 @ 15:26:55

In this new post to his site Kevin Schroeder thinks out loud and wonders if an idea of his is "a dumb idea" to be included into the PHP core - engine state caching.

I was consulting and I would see significant server resources consumed by bootstrapping the apps. Loading config files, loading dependent classes, setting up dependencies, initializing ACL’s, and the list goes on and on. One of the ways to negate the effect would be to cache a bootstrap object and then pull that object from the cache at the start of the request. However, the problem is that unserialization can actually end up taking more time than the bootstrap process itself.

He wonders if, after the initial bootstrapping happened, a method could be called (his example is "init_engine_state") that would cache the Zend Engine's current state and pass that to a callback function. This would cache everything - objects, variables, classes, etc - all pre-interpreted into memory and make them easy to reuse on future executions. What do you think? Share your thoughts in the comments of the post.

tagged: engine state cache zendengine bootstrap callback

Link:

Abhinav Singh's Blog:
PHP tokens & opcodes: 3 useful extensions for understanding the Zend Engine
Nov 24, 2009 @ 17:32:31

Abhinav Singh has a recent post to his blog looking at three extensions that you can use to help understand the inner workings of the core Zend Engine.

“PHP tokens and opcodes” – When a PHP script is executed it goes through a number of processes, before the final result is displayed. These processes are namely: Lexing, Parsing, Compiling and Executing. In this blog post, I will walk you through all these processes with a sample example. In the end I will list some useful PHP extensions, which can be used to analyze results of every intermediate process.

He touches on the steps the average PHP script takes in its processing - lexing, parsing/compiling and the actual execution of the opcodes. The tokenizer, parsekit and VLD (Vulcan Logic Disassembler) extensions can help you get down into the nuts and bolts of the language and the engine that makes it work.

tagged: zendengine extension lexer compile opcode

Link:


Trending Topics: