1$Id$ 2 3UPGRADE NOTES - PHP X.Y 4 51. Internal API changes 6 a. Executor changes 7 b. Streams pooling API 8 c. Lowercasing and locales 9 d. zend_qsort_r 10 e. get_current_key 11 f. unserialization of manipulated object strings 12 132. Build system changes 14 a. Unix build system changes 15 b. Windows build system changes 16 17 18======================== 191. Internal API changes 20======================== 21 22 a. Executor changes 23 24 * extensions can't override zend_execute() any more, they should override 25 zend_execute_ex() instead. The EG(current_execute_data) is already 26 initialized in zend_execute_ex(), so for compatibility extensions 27 may need to use EG(current_execute_data)->prev_execute_data instead. 28 * removed EG(arg_types_stack), EX(fbc), EX(called_scope), EX(current_object) 29 * added op_array->nested_calls. It's calculated at compile time. 30 * added EX(call_slots). It is an array to store information about syntaticaly 31 nested calls (e.g. foo(bar())). It's preallocated together with execute_data. 32 * added EX(call) - pointer to a current calling function. Actually an 33 element of EX(call_slots) 34 * opcodes INIT_METHOD_CALL, ZEND_INIT_STATIC_METHOD_CALL, 35 ZEND_INIT_FCALL_BY_NAME, ZEND_INIT_NS_FCALL_BY_NAME use result.num as 36 an index in EX(call_slots) 37 * opcode ZEND_NEW uses extended_vallue as an index in EX(call_slots) 38 * opcoes ZEND_DO_FCALL and ZEND_DO_FCALL_BY_NAME use op2.num as 39 an index in EX(call_slots) 40 * added op_array->used_stack. It's calculated at compile time and the 41 corresponding stack space is preallocated together with execute_data. 42 ZEND_SEND* and ZEND_DO_FCALL* don't need to check for stack overflow 43 anymore. 44 * Removed execute_data->Ts field. The VM temporary variables always allocated 45 immediately before execute_data structure. Now they are accessed by offset 46 from the execute_data base pointer (instead of execute_data->Ts). Compiler 47 stores new offsets in op_array->opcodes[*].op?.num. You can use macros 48 EX_TMP_VAR() and EX_TMP_VAR_NUM() to access temp_variable by offset or 49 number. You can convert number to offset using EX_TMP_VAR_NUM(0, num) or 50 offset to number (EX_TMP_VAR_NUM(0,0)-EX_TMP_VAR(0,offset)). 51 * Removed execute_data->CVs field. The VM compiled variables always allocated 52 immediately after execute_data structure. Now they are accessed by offset 53 from the execute_data base pointer (instead of execute_data->CVs). You can 54 use macros EX_CV_NUM() to access compiled variables by number. 55 56 b. Streams pooling API 57 58The streams pooling API has been removed. The following functions no longer 59exist: 60 61PHPAPI int php_stream_context_get_link(php_stream_context *context, 62 const char *hostent, php_stream **stream); 63PHPAPI int php_stream_context_set_link(php_stream_context *context, 64 const char *hostent, php_stream *stream); 65PHPAPI int php_stream_context_del_link(php_stream_context *context, 66 php_stream *stream); 67 68 c. Lowercasing and locales 69 70The lowercasing functions in zend_operators.c were split into those that do 71lowercasing according to locale rules and those that do ASCII lowercasing. 72ASCII: 73 74 zend_str_tolower_copy 75 zend_str_tolower_dup 76 zend_str_tolower 77 zend_binary_strcasecmp 78 zend_binary_strncasecmp 79 80Locale-based: 81 zend_binary_strncasecmp_l 82 zend_binary_strcasecmp_l 83 zend_binary_zval_strcasecmp 84 zend_binary_zval_strncasecmp 85 string_compare_function_ex 86 string_case_compare_function 87 88Internal engine lowercasing will be using ASCII-only rules. User-facing functions, 89such as strcasecmp, will be using locale rules. 90 91Two new functions - zend_binary_strncasecmp_l and zend_binary_strcasecmp_l - added as 92locale-based counterparts to zend_binary_strcasecmp and zend_binary_strncasecmp. 93 94 d. zend_qsort_r 95 96Added the function zend_qsort_r(): 97 98typedef int (*compare_r_func_t)(const void *, const void * TSRMLS_DC, void *); 99void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg TSRMLS_DC); 100 101The extra argument it has (relatively to zend_qsort()) is passed to the 102comparison function. 103 104 e. get_current_key 105 106The signature of the get_current_key iteration handler has been changed to: 107 108void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC); 109 110The key should be written into the zval* using the ZVAL_* macros. 111 112 f. unserialization of manipulated object strings 113 114Strings requiring unserialization of objects are now explicitly checked 115whether the object they contain implements the Serializable interface. 116This solves the situation where manipulated strings could be passed for 117objects using Serializable to disallow serialization. An object 118implementing Serializable will always start with "C:" in the serialized 119string, all other objects are represented with starting "O:". Objects 120implementing Serializable to disable serialization using 121zend_class_unserialize_deny and zend_class_serialize_deny, when 122instantiated from the serializer with a manipulated "O:" string at the 123start, will most likely be defectively initialized. This is now 124fixed at the appropriate place by checking for the presence of the 125serialize callback in the class entry. 126 127======================== 1282. Build system changes 129======================== 130 131 a. Unix build system changes 132 - 133 134 b. Windows build system changes 135 - Drop Windows XP and 2003 support. 136 137