2010-08-30 18:26:31 +08:00
|
|
|
$Id$
|
|
|
|
|
2014-08-26 06:34:36 +08:00
|
|
|
PHP 7.0 INTERNALS UPGRADE NOTES
|
2010-08-30 18:26:31 +08:00
|
|
|
|
|
|
|
1. Internal API changes
|
2014-08-22 16:24:51 +08:00
|
|
|
e. New data types
|
2014-08-22 16:31:48 +08:00
|
|
|
f. zend_parse_parameters() specs
|
2014-08-22 19:22:49 +08:00
|
|
|
g. sprintf() formats
|
|
|
|
h. HashTable API
|
2014-08-22 19:40:45 +08:00
|
|
|
i. New portable macros for large file support
|
2014-08-22 19:48:20 +08:00
|
|
|
j. New portable macros for integers
|
2010-09-17 16:42:12 +08:00
|
|
|
|
2010-11-18 18:43:01 +08:00
|
|
|
2. Build system changes
|
|
|
|
a. Unix build system changes
|
|
|
|
b. Windows build system changes
|
|
|
|
|
|
|
|
|
2010-08-30 18:26:31 +08:00
|
|
|
========================
|
|
|
|
1. Internal API changes
|
|
|
|
========================
|
|
|
|
|
2013-11-18 08:36:17 +08:00
|
|
|
a. zend_set_memory_limit() now takes the TSRMLS_CC macro as its last argument
|
2014-08-22 16:24:51 +08:00
|
|
|
e. New data types
|
|
|
|
|
|
|
|
String
|
|
|
|
|
|
|
|
Besides the old way of accepting the strings with 's', the new 'S' ZPP spec
|
|
|
|
was introduced. It expects an argument of the type zend_string *. String lengths
|
2014-08-26 06:13:37 +08:00
|
|
|
in it are bound to the size_t datatype.
|
2014-08-22 16:24:51 +08:00
|
|
|
|
|
|
|
Integer types
|
|
|
|
|
|
|
|
Integers do no more depend on the firm 'long' type. Instead a platform
|
2014-08-26 06:13:37 +08:00
|
|
|
dependent integer type is used, it is called zend_long. That datatype is
|
|
|
|
defined dynamically to guarantee the consistent 64 bit support. The zval
|
|
|
|
field representing user land integer it bound to zend_long.
|
2014-08-22 16:24:51 +08:00
|
|
|
|
2014-08-26 06:13:37 +08:00
|
|
|
Signed integer is defined as zend_long, unsigned integer as zend_ulong
|
|
|
|
inside Zend.
|
2014-08-22 16:24:51 +08:00
|
|
|
|
|
|
|
Other datatypes
|
|
|
|
|
|
|
|
zend_off_t - portable off_t analogue
|
|
|
|
zend_stat_t - portable 'struct stat' analogue
|
|
|
|
|
|
|
|
These datatypes are declared to be portable across platforms. Thus, direct
|
|
|
|
usage of the functions like fseek, stat, etc. as well as direct usage of
|
|
|
|
off_t and struct stat is strongly not recommended. Instead the portable
|
|
|
|
macros should be used.
|
|
|
|
|
|
|
|
zend_fseek - portable fseek equivalent
|
|
|
|
zend_ftell - portable ftell equivalent
|
|
|
|
zend_lseek - portable lseek equivalent
|
|
|
|
zend_fstat - portable fstat equivalent
|
|
|
|
zend_stat - portable stat equivalent
|
2013-11-18 08:36:17 +08:00
|
|
|
|
2014-08-22 16:31:48 +08:00
|
|
|
f. zend_parse_parameters() specs
|
|
|
|
|
2014-08-22 19:22:49 +08:00
|
|
|
The new spec 'S' introduced, which expects an argument of type zend_string *.
|
2014-08-27 15:26:25 +08:00
|
|
|
The 'l' spec expects a parameter of the type zend_long, not long anymore.
|
2014-08-28 00:51:01 +08:00
|
|
|
The 's' spec expects parameters of the type char * and size_t, no int anymore.
|
2014-08-22 19:22:49 +08:00
|
|
|
|
|
|
|
g. sprintf() formats
|
|
|
|
|
2014-08-26 06:13:37 +08:00
|
|
|
New printf modifier 'p' was implemented to platform independently output zend_long,
|
|
|
|
zend_ulong and php_size_t datatypes. That modifier can be used with'd', 'u', 'x' and 'o'
|
2014-08-22 19:22:49 +08:00
|
|
|
printf format specs with spprintf, snprintf and the wrapping printf implementations.
|
2014-08-26 06:13:37 +08:00
|
|
|
%pu is sufficient for both zend_ulong and php_size_t. the code using %p spec to output
|
2014-08-22 19:22:49 +08:00
|
|
|
pointer address might need to be enclosed into #ifdef when it unlickily followed by 'd',
|
|
|
|
'u', 'x' or 'o'.
|
|
|
|
|
2014-08-24 08:36:17 +08:00
|
|
|
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
|
|
|
|
they can use the implemenations available on the system, not the PHP one. Fro snprintf the
|
2014-08-24 08:57:19 +08:00
|
|
|
the macros ZEND_INT_FMT ZEND_UINT_FMT should be used.
|
2014-08-24 08:36:17 +08:00
|
|
|
|
2014-08-22 19:22:49 +08:00
|
|
|
h. HashTable API
|
|
|
|
|
2014-08-26 06:13:37 +08:00
|
|
|
Datatype for array indexes was changed to zend_ulong, for string keys to zend_string *.
|
2013-09-27 00:39:17 +08:00
|
|
|
|
2014-08-22 19:40:45 +08:00
|
|
|
i. New portable macros for large file support
|
|
|
|
|
2014-08-22 19:48:20 +08:00
|
|
|
Function(s) Alias Comment
|
2014-08-22 19:40:45 +08:00
|
|
|
stat, _stat64 zend_stat for use with zend_stat_t
|
|
|
|
fstat, _fstat64 zend_fstat for use with zend_stat_t
|
|
|
|
lseek, _lseeki64 zend_lseek for use with zend_off_t
|
|
|
|
ftell, _ftelli64 zend_ftell for use with zend_off_t
|
|
|
|
fseek, _fseeki64 zend_fseek for use with zend_off_t
|
|
|
|
|
2014-08-22 19:48:20 +08:00
|
|
|
j. New portable macros for integers
|
|
|
|
|
|
|
|
Function(s) Alias Comment
|
2014-08-26 06:13:37 +08:00
|
|
|
snprintf with "%ld" or "%lld", _ltoa_s, _i64toa_s ZEND_LTOA for use with zend_long
|
|
|
|
atol, atoll, _atoi64 ZEND_ATOL for use with zend_long
|
|
|
|
strtol, strtoll, _strtoi64 ZEND_STRTOL for use with zend_long
|
|
|
|
strtoul, strtoull, _strtoui64 ZEND_STRTOUL for use with zend_long
|
|
|
|
abs, llabs, _abs64 ZEND_ABS for use with zend_long
|
|
|
|
- ZEND_LONG_MAX replaces LONG_MAX where appropriate
|
|
|
|
- ZEND_LONG_MIN replaces LONG_MIN where appropriate
|
|
|
|
- ZEND_ULONG_MAX replaces ULONG_MAX where appropriate
|
|
|
|
- SIZEOF_ZEND_LONG reworked SIZEOF_ZEND_LONG representing the size of zend_long datatype
|
|
|
|
- ZEND_SIZE_MAX Max value of size_t
|
2014-08-22 19:48:20 +08:00
|
|
|
|
2014-10-10 18:28:55 +08:00
|
|
|
k. The get_class_entry object handler is no longer available. Instead
|
|
|
|
zend_object.ce is always used.
|
|
|
|
|
|
|
|
l. The get_class_name object handler is now only used for displaying class
|
|
|
|
names in debugging functions like var_dump(). It is no longer used in
|
|
|
|
get_class(), get_parent_class() or similar.
|
|
|
|
|
|
|
|
The handler is now obligatory, no longer accepts a `parent` argument and
|
|
|
|
must return a non-NULL zend_string*, which will be released by the caller.
|
|
|
|
|
2010-11-18 18:43:01 +08:00
|
|
|
========================
|
|
|
|
2. Build system changes
|
|
|
|
========================
|
|
|
|
|
2014-11-10 21:25:14 +08:00
|
|
|
a. Unix build system changes
|
|
|
|
|
|
|
|
b. Windows build system changes
|
|
|
|
|
|
|
|
- Besides Visual Studio, building with Clang or Intel Composer is now
|
|
|
|
possible. To enable an alternative toolset, add the option
|
|
|
|
--with-toolset=[vs,clang,icc] to the configure line. The default
|
|
|
|
toolset is vs. Still clang or icc need the correct environment
|
|
|
|
which involves many tools from the vs toolset.
|
|
|
|
|
|
|
|
AWARENESS The only recommended and supported toolset to produce production
|
|
|
|
ready binaries is Visual Studio. Still other compilers can be used now for
|
|
|
|
testing and analyzing purposes.
|
|
|
|
|