<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Changes to PHP Internals</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="migration55.ini.html">Changes to INI file handling</a></div> <div class="next" style="text-align: right; float: right;"><a href="migration54.html">Migrating from PHP 5.3.x to PHP 5.4.x</a></div> <div class="up"><a href="migration55.html">Migrating from PHP 5.4.x to PHP 5.5.x</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="migration55.internals" class="sect1"> <h2 class="title">Changes to PHP Internals</h2> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> Extensions cannot override <strong class="command">zend_execute()</strong> any more and should override <strong class="command">zend_execute_ex()</strong> instead. <em>EG(current_execute_data)</em> is already initialized in <strong class="command">zend_execute_ex()</strong>, so for compatibility extensions may need to use <em>EG(current_execute_data)->prev_execute_data</em> instead. </span> </li> <li class="listitem"> <span class="simpara"> Removed <em>EG(arg_types_stack)</em>, <em>EX(fbc)</em>, <em>EX(called_scope)</em> and <em>EX(current_object)</em>. </span> </li> <li class="listitem"> <span class="simpara"> Added <em>op_array->nested_calls</em>, which is calculated at compile time. </span> </li> <li class="listitem"> <span class="simpara"> Added <em>EX(call_slots)</em>, which is an array to store information about syntaticaly nested calls (e.g. <em>foo(bar())</em>) and is preallocated together with <em>execute_data</em>. </span> </li> <li class="listitem"> <span class="simpara"> Added <em>EX(call)</em>, which is a pointer to a current calling function, and is an element of <em>EX(call_slots)</em>. </span> </li> <li class="listitem"> <span class="simpara"> Opcodes <a href="internals2.opcodes.init-method-call.html" class="link">INIT_METHOD_CALL</a>, <a href="internals2.opcodes.init-static-method-call.html" class="link">ZEND_INIT_STATIC_METHOD_CALL</a>, <a href="internals2.opcodes.init-fcall-by-name.html" class="link">ZEND_INIT_FCALL_BY_NAME</a> and <a href="internals2.opcodes.init-ns-fcall-by-name.html" class="link">ZEND_INIT_NS_FCALL_BY_NAME</a> use <em>result.num</em> as an index in <em>EX(call_slots)</em>. </span> </li> <li class="listitem"> <span class="simpara"> Opcode <a href="internals2.opcodes.new.html" class="link">ZEND_NEW</a> uses <em>extended_value</em> as an index in <em>EX(call_slots)</em>. </span> </li> <li class="listitem"> <span class="simpara"> Opcodes <a href="internals2.opcodes.do-fcall.html" class="link">ZEND_DO_FCALL</a> and <a href="internals2.opcodes.do-fcall-by-name.html" class="link">ZEND_DO_FCALL_BY_NAME</a> use <em>op2.num</em> as an index in <em>EX(call_slots)</em>. </span> </li> <li class="listitem"> <span class="simpara"> Added <em>op_array->used_stack</em>, which is calculated at compile time; the corresponding stack space is preallocated together with <em>execute_data</em>. As a result, the ZEND_SEND* and ZEND_DO_FCALL* opcodes no longer need to check for stack overflow. </span> </li> <li class="listitem"> <span class="simpara"> Removed <em>execute_data->Ts</em> field. The VM temporary variables are always allocated immediately before the <em>execute_data</em> structure, and are now accessed by their offset from the <em>execute_data</em> base pointer instead of via <em>execute_data->Ts</em>. The compiler stores new offsets in <em>op_array->opcodes[*].op?.num</em>. The <strong class="command">EX_TMP_VAR()</strong> and <strong class="command">EX_TMP_VAR_NUM()</strong> macros can be used to access temporary variables by offset or number. You can convert the number to an offset using <strong class="command">EX_TMP_VAR_NUM(0, num)</strong> or offset to number using <strong class="command">(EX_TMP_VAR_NUM(0,0)-EX_TMP_VAR(0,offset))</strong>. </span> </li> <li class="listitem"> <span class="simpara"> Removed the <em>execute_data->CVs</em> field. The VM compiled variables are always allocated immediately after the <em>execute_data</em> structure, and are now accessed by the offset from the <em>execute_data</em> base pointer instead of via <em>execute_data->CVs</em>. You can use the <strong class="command">EX_CV_NUM()</strong> macro to access compiled variables by number. </span> </li> </ul> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="migration55.ini.html">Changes to INI file handling</a></div> <div class="next" style="text-align: right; float: right;"><a href="migration54.html">Migrating from PHP 5.3.x to PHP 5.4.x</a></div> <div class="up"><a href="migration55.html">Migrating from PHP 5.4.x to PHP 5.5.x</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>