Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46482 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59476 invoked from network); 21 Dec 2009 16:34:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Dec 2009 16:34:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.133 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.133 mailout1.netbeat.de Linux 2.6 Received: from [83.243.58.133] ([83.243.58.133:43803] helo=mailout1.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/C6-20736-D93AF2B4 for ; Mon, 21 Dec 2009 11:34:40 -0500 Received: (qmail 16285 invoked by uid 89); 21 Dec 2009 16:41:52 -0000 Received: from unknown (HELO ?192.168.1.21?) (postmaster%schlueters.de@93.104.122.25) by mailout1.netbeat.de with ESMTPA; 21 Dec 2009 16:41:52 -0000 X-Originator: 9e51b244e0a38413ab6a9876e36ba9df To: Christian Grobmeier Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Organization: php.net Date: Mon, 21 Dec 2009 17:33:51 +0100 Message-ID: <1261413231.13430.46.camel@guybrush> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] How does the interpreter work From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Mon, 2009-12-21 at 14:56 +0100, Christian Grobmeier wrote: > I would like to learn more about how the interpreter works, but I was > unable to find good documents on the web. Basically I am thinking on > something about allocation of variables, how does object creation work > and such stuff. Maybe something on the overall architecture of PHP > would be of interest too. > > In java world there is the JVM specification, I hoped there is > something for PHP too. Well there's one quite complete document about it available - the source code ;-) PHP isn't developed following standards but simply by implementing and extending it. PHP is defined by the implementation ... But: What exactly do you want to learn? Do you want to learn how to use it better or "academic reasons" or something else? - Depending on all that the focus of the learning might be quite different. As a starting point for this I recently created a small toy project: A minimal basic inspired language on top of the ZendVM, just 200 lines of C code which might give a few pointers to do further research. It's quite hackish ugly code but enough to compile and execute a script like this: 10 GOTO 40 20 PRINT "B" 30 END 40 PRINT "A" 50 GOTO 20 This all will be compiled to Zend Opcodes which can be executed, cached with APC, dumped by vld, ... I hope I find the time to write the documentation around it, other than that this code is absolutely useless :-) http://github.com/johannes/pasic johannes