Re: Re: Compiled variables and backpatching

From: Date: Mon, 01 Oct 2007 17:58:58 +0000
Subject: Re: Re: Compiled variables and backpatching
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-32518@lists.php.net to get a copy of this message
Stanislav wrote me a very useful reply to my CV questions. I wonder if anyone has time to give me a quick note on backpatching, and what that is?
I think backpatching refers to updating past opcodes (i.e. opcodes for code that was already parsed) when they need something that would be known only in the future. E.g., if you have if/else statement, then when if condition is false you need to jump to else, but else was not parsed yet - so when we parse if, we create opcode, but then update it when we parse else so that it jumps to the right place. Also backpatching is used to compose variable expressions - like $foo[$bar]->x->$y->z. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32518) next »