Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46481 Return-Path: <0xcafefeed@gmail.com> Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52690 invoked from network); 21 Dec 2009 16:02:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Dec 2009 16:02:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=0xcafefeed@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=0xcafefeed@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.219 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: 0xcafefeed@gmail.com X-Host-Fingerprint: 209.85.219.219 mail-ew0-f219.google.com Received: from [209.85.219.219] ([209.85.219.219:32891] helo=mail-ew0-f219.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/85-20736-90C9F2B4 for ; Mon, 21 Dec 2009 11:02:18 -0500 Received: by ewy19 with SMTP id 19so4138663ewy.1 for ; Mon, 21 Dec 2009 08:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SdHG/e12vgpZP39rFCVlw2CyYxyVkueXtkPGVRXrRGM=; b=Bc2tR8u7fc6ADznx7Nt+CmADDT2p8eN+NoLq5p+50gqHYUWSJ3ebMuxlxeZ6KmpN4p QQ+niZgs9uY2ykmpxvQ1g2jvuQklq10RwQCSWOIZZmJoHmtifI7eihUpECOCTmFuzbph mikb4qJBPlT2BiwfseSgOWUGI/QwE8kQFc2nc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oLrOQvNLalQ5+14Dng/BbxJ3J2/E5r3HdeJlqbVVKMsnW63i5h1OAiloU6UxztyEi1 wQpliom2eBqjUPdVhZwszo808Ds17hlEhdrFjFlQ4iUEXS/VYMpJ8n2usx72grGrZ0jH SR+2rDJLSS7WIyBjLQROzRhTRnEGkio5bL2fI= MIME-Version: 1.0 Received: by 10.216.85.5 with SMTP id t5mr2702428wee.142.1261411332932; Mon, 21 Dec 2009 08:02:12 -0800 (PST) In-Reply-To: References: Date: Mon, 21 Dec 2009 08:02:12 -0800 Message-ID: To: Rob Nicholson Cc: Christian Grobmeier , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] How does the interpreter work From: 0xcafefeed@gmail.com (mm w) Hello, this document is clearly outdated and for me so far confuse just gave a try for 5 mins, and I am worry about the printf tech, lucky you are not to be in multi-thread env..., at least fprintf on the stderr to read un-buffered results, those guys have a job? maybe greenhouse keepers certainly not developers. Christian, the best way to enter in the zend engine, it's to create a zend extension project, then go thru all the step of the code to manipulate the hashtable, learn where object are living in the tree, then when you know how to play with the "public" interface, that's really easy to go deeper, the zend "bytecode engine" is so far less complex that what you could find in any JVM (I know a couple of things in area) even python bytecode and how the interpreter is able to handle various version, in two weeks you should have done your tour by using the zend interface and reading the code, php zend core is tiny in term of code, the only things that could appear weird and clumsy is the semantic code used, this is the only thing that could appear like a mind barrier. Best, On Mon, Dec 21, 2009 at 6:27 AM, Rob Nicholson w= rote: > > Christian Grobmeier wrote on 21/12/2009 13:56:08: > > >> 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. > > Hi Christian, > > The PHP architecture is a little different from the JVM in that it does n= ot > explicitly document/specify the interface between the compiler and the > bytecode/opcode interpreter the way that Java does. It still exists thoug= h. > > I suggest you look at the links under here: > > http://www.php.net/manual/en/internals2.php > In particular: > =C2=A0http://www.php.net/manual/en/internals2.opcodes.php > > Another good reference is Sara Goleman's book "Extending and Embedding PH= P" > > Andy Wharmby produced a set of charts which you can find on Zoe's Blog > here : http://zoomsplatter.blogspot.com/2008/08/php-opcodes.html . > These may help you to make a fast start =C2=A0understanding the overall d= esign. > > Rob. > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >