diff options
1224 files changed, 15251 insertions, 31020 deletions
@@ -638,3 +638,28 @@ document zmemcheck usage: zmemcheck [ptr]. if ptr is 0, all blocks will be listed. end + +define lookup_root + set $found = 0 + if gc_globals->roots + set $current = gc_globals->roots->next + printf "looking ref %p in roots\n", $arg0 + while $current != &gc_globals->roots + if $current->ref == $arg0 + set $found = $current + break + end + set $current = $current->next + end + if $found != 0 + printf "found root %p\n", $found + else + printf "not found\n" + end + end +end + +document lookup_root + lookup a refcounted in root + usage: lookup_root [ptr]. +end diff --git a/.gitignore b/.gitignore index e0943f115c..06dac174a9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ *.tgz *.tar.gz *.tar.bz2 +*.tar.xz .FBCIndex .FBCLockFolder .deps @@ -82,7 +83,7 @@ mkinstalldirs modules php php-*.tar.gz -php5.spec +php7.spec php_lcov.info php_test_results_*.txt php_version.h @@ -260,9 +261,9 @@ pear/phpize pear/run-tests pear/php-config pear/scripts -sapi/apache/libphp5.module -sapi/apache2handler/libphp5.module -sapi/apache_hooks/libphp5.module +sapi/apache/libphp7.module +sapi/apache2handler/libphp7.module +sapi/apache_hooks/libphp7.module sapi/cgi/php-cgi sapi/cgi/php-cgi.1 sapi/cli/php.1 diff --git a/EXTENSIONS b/EXTENSIONS index 61a1688b3c..757a1a8fd6 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -228,13 +228,6 @@ MAINTENANCE: Maintained STATUS: Working COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less have fatal bug. ------------------------------------------------------------------------------- -EXTENSION: sqlite -PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>, Wez Furlong <wez@php.net>, Ilia Alshanetsky <iliaa@php.net> -MAINTENANCE: Maintained -STATUS: Working -SINCE: 5.0 (Since 4.3.2 in PECL) -COMMENT: Integrates SQLite 2 embeddable SQL database engine. -------------------------------------------------------------------------------- EXTENSION: sqlite3 PRIMARY MAINTAINER: Scott MacVicar <scottmac@php.net> MAINTENANCE: Maintained @@ -385,6 +378,12 @@ MAINTENANCE: Maintained STATUS: Working SINCE: 4.0.4 ------------------------------------------------------------------------------- +EXTENSION: hash +PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net> +MAINTENANCE: Maintained +STATUS: Working +SINCE: 5.1.2 +------------------------------------------------------------------------------- EXTENSION: iconv PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net> MAINTENANCE: Maintained @@ -422,22 +421,6 @@ PRIMARY MAINTAINER: Derick Rethans <derick@derickrethans.nl> MAINTENANCE: Maintained STATUS: Working ------------------------------------------------------------------------------- -EXTENSION: mhash -PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>, Scott MacVicar <scottmac@php.net> -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mime_magic -PRIMARY MAINTAINER: Unknown -MAINTENANCE: Deprecated -STATUS: Experimental -COMMENT: Use the fileinfo extension instead -------------------------------------------------------------------------------- -EXTENSION: ming -PRIMARY MAINTAINER: Frank M. Kromann -MAINTENANCE: Unknown -STATUS: Experimental -------------------------------------------------------------------------------- EXTENSION: openssl PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net> MAINTENANCE: Maintained @@ -223,12 +223,12 @@ Apache 1.3.x on Unix systems module on your system. The make install from above may have already added this for you, but be sure to check. - LoadModule php5_module libexec/libphp5.so + LoadModule php7_module libexec/libphp7.so 15. And in the AddModule section of httpd.conf, somewhere under the ClearModuleList, add this: - AddModule mod_php5.c + AddModule mod_php7.c 16. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse the .php extension as PHP. You could @@ -263,8 +263,8 @@ Apache 1.3.x on Unix systems 10. cd ../apache_1.3.x -11. ./configure --prefix=/www --activate-module=src/modules/php5/libphp5.a - (The above line is correct! Yes, we know libphp5.a does not exist at this +11. ./configure --prefix=/www --activate-module=src/modules/php7/libphp7.a + (The above line is correct! Yes, we know libphp7.a does not exist at this stage. It isn't supposed to. It will be created.) 12. make @@ -309,24 +309,24 @@ stop and start: Different examples of compiling PHP for apache are as follows: ./configure --with-apxs --with-pgsql - This will create a libphp5.so shared library that is loaded into Apache + This will create a libphp7.so shared library that is loaded into Apache using a LoadModule line in Apache's httpd.conf file. The PostgreSQL support is embedded into this library. ./configure --with-apxs --with-pgsql=shared - This will create a libphp5.so shared library for Apache, but it will + This will create a libphp7.so shared library for Apache, but it will also create a pgsql.so shared library that is loaded into PHP either by using the extension directive in php.ini file or by loading it explicitly in a script using the dl() function. ./configure --with-apache=/path/to/apache_source --with-pgsql - This will create a libmodphp5.a library, a mod_php5.c and some - accompanying files and copy this into the src/modules/php5 directory in + This will create a libmodphp7.a library, a mod_php7.c and some + accompanying files and copy this into the src/modules/php7 directory in the Apache source tree. Then you compile Apache using - --activate-module=src/modules/php5/libphp5.a and the Apache build - system will create libphp5.a and link it statically into the httpd + --activate-module=src/modules/php7/libphp7.a and the Apache build + system will create libphp7.a and link it statically into the httpd binary. The PostgreSQL support is included directly into this httpd binary, so the final result here is a single httpd binary that includes all of Apache and all of PHP. @@ -450,7 +450,7 @@ cp php.ini-development /usr/local/lib/php.ini hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check. -LoadModule php5_module modules/libphp5.so +LoadModule php7_module modules/libphp7.so 8. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse .php files as PHP. Instead of only using the Apache AddType directive, we want to avoid potentially dangerous @@ -461,7 +461,7 @@ LoadModule php5_module modules/libphp5.so <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch> - Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, + Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php7, and .phtml files to be executed as PHP, but nothing else, we'd use this: <FilesMatch "\.ph(p[2-6]?|tml)$"> @@ -1004,16 +1004,16 @@ Debian GNU/Linux installation notes Using APT First, note that other related packages may be desired like - libapache2-mod-php5 to integrate with Apache 2, and php-pear for PEAR. + libapache2-mod-php7 to integrate with Apache 2, and php-pear for PEAR. Second, before installing a package, it's wise to ensure the package list is up to date. Typically, this is done by running the command apt-get update. Example #1 Debian Install Example with Apache 2 -# apt-get install php5-common libapache2-mod-php5 php5-cli +# apt-get install php7-common libapache2-mod-php7 php7-cli - APT will automatically install the PHP 5 module for Apache 2 and all of + APT will automatically install the PHP 7 module for Apache 2 and all of its dependencies, and then activate it. Apache should be restarted in order for the changes take place. For example: @@ -1027,23 +1027,23 @@ Better control of configuration very likely that additional modules will be desired, such as MySQL, cURL, GD, etc. These may also be installed via the apt-get command. - Example #3 Methods for listing additional PHP 5 packages -# apt-cache search php5 -# aptitude search php5 -# aptitude search php5 |grep -i mysql + Example #3 Methods for listing additional PHP 7 packages +# apt-cache search php7 +# aptitude search php7 +# aptitude search php7 |grep -i mysql The examples will show a lot of packages including several PHP specific - ones like php5-cgi, php5-cli and php5-dev. Determine which are needed + ones like php7-cgi, php7-cli and php7-dev. Determine which are needed and install them like any other with either apt-get or aptitude. And because Debian performs dependency checks, it'll prompt for those so for example to install MySQL and cURL: Example #4 Install PHP with MySQL, cURL -# apt-get install php5-mysql php5-curl +# apt-get install php7-mysql php7-curl APT will automatically add the appropriate lines to the different - php.ini related files like /etc/php5/apache2/php.ini, - /etc/php5/conf.d/pdo.ini, etc. and depending on the extension will add + php.ini related files like /etc/php7/apache2/php.ini, + /etc/php7/conf.d/pdo.ini, etc. and depending on the extension will add entries similar to extension=foo.so. However, restarting the web server (like Apache) is required before these changes take affect. @@ -1137,9 +1137,9 @@ Using the bundled PHP 2. With a text editor, uncomment the lines (by removing the #) that look similar to the following (these two lines are often not together, locate them both in the file): -# LoadModule php5_module libexec/httpd/libphp5.so +# LoadModule php7_module libexec/httpd/libphp7.so -# AddModule mod_php5.c +# AddModule mod_php7.c Notice the location/path. When building PHP in the future, the above files should be replaced or commented out. @@ -1148,7 +1148,7 @@ Using the bundled PHP Due to the following statement already existing in httpd.conf (as of Mac Panther), once PHP is enabled the .php files will automatically parse as PHP. -<IfModule mod_php5.c> +<IfModule mod_php7.c> # If php is turned on, we respect .php and .phps files. AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps @@ -1740,7 +1740,7 @@ Running PHP as an Apache module php_admin_flag can not be overridden by .htaccess or ini_set(). Example #1 Apache configuration example -<IfModule mod_php5.c> +<IfModule mod_php7.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag engine on </IfModule> @@ -1810,7 +1810,7 @@ Installation script file via my browser, I get a server 500 error. 8. Some operating systems: I have installed PHP without errors, but when I try to start Apache I get undefined symbol errors: - [mybox:user /src/php5] root# apachectl configtest apachectl: + [mybox:user /src/php7] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress 9. Windows: I have installed PHP, but when I try to access a PHP @@ -1912,7 +1912,7 @@ AddModule mod_perl.c # Extra Modules LoadModule php_module modules/mod_php.so -LoadModule php5_module modules/libphp5.so +LoadModule php7_module modules/libphp7.so LoadModule perl_module modules/libperl.so And add: @@ -1954,7 +1954,7 @@ AddType application/x-httpd-php .php Some operating systems: I have installed PHP without errors, but when I try to start Apache I get undefined symbol errors: -[mybox:user /src/php5] root# apachectl configtest +[mybox:user /src/php7] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress @@ -1984,7 +1984,7 @@ cgi error: script via the browser again. If it still fails then it could be one of the following: - + File permissions on your PHP script, php.exe, php5ts.dll, + + File permissions on your PHP script, php.exe, php7ts.dll, php.ini or any PHP extensions you are trying to load are such that the anonymous internet user ISUR_<machinename> cannot access them. @@ -2103,7 +2103,7 @@ cgi error: to choose PHP files from URL with no extension. In this case, replace the line AddType application/x-httpd-php .php with: -AddHandler php5-script php +AddHandler php7-script php AddType text/html php This solution doesn't work for Apache 1 as PHP module doesn't diff --git a/Makefile.global b/Makefile.global index bd82daf4d8..f833efa5e7 100644 --- a/Makefile.global +++ b/Makefile.global @@ -119,7 +119,7 @@ clean: distclean: clean rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h - rm -f php5.spec main/build-defs.h scripts/phpize + rm -f php7.spec main/build-defs.h scripts/phpize rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1 rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API index 25a41096cf..46e190efc1 100644 --- a/README.PARAMETER_PARSING_API +++ b/README.PARAMETER_PARSING_API @@ -50,7 +50,7 @@ Type specifiers instance of that class. a - array (zval*) - A - array or object (zval *) + A - array or object (zval*) b - boolean (zend_bool) C - class (zend_class_entry*) d - double (double) @@ -58,15 +58,16 @@ Type specifiers zend_fcall_info and zend_fcall_info_cache) h - array (returned as HashTable*) H - array or HASH_OF(object) (returned as HashTable*) - l - long (long) - L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long) + l - long (zend_long) + L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (zend_long) o - object of any type (zval*) O - object of specific type given by class entry (zval*, zend_class_entry) - p - valid path (string without null bytes in the middle) and its length (char*, int) + p - valid path (string without null bytes in the middle) and its length (char*, size_t) + P - valid path (string without null bytes in the middle) as zend_string (zend_string) r - resource (zval*) - s - string (with possible null bytes) and its length (char*, int) + s - string (with possible null bytes) and its length (char*, size_t) + S - string (with possible null bytes) as zend_string (zend_string) z - the actual zval (zval*) - Z - the actual zval (zval**) * - variable arguments list (0 or more) + - variable arguments list (1 or more) @@ -80,28 +81,26 @@ Type specifiers passed and the output for such type is a pointer, then the output pointer is set to a native NULL pointer. For 'b', 'l' and 'd', an extra argument of type zend_bool* must be - passed after the corresponding bool*, long* or double* arguments, - respectively. A non-zero value will be written to the zend_bool iif a + passed after the corresponding bool*, zend_long* or double* arguments, + respectively. A non-zero value will be written to the zend_bool if a PHP NULL is passed. Note on 64bit compatibility --------------------------- -Please do not forget that int and long are two different things on 64bit -OSes (int is 4 bytes and long is 8 bytes), so make sure you pass longs to "l" -and ints to strings length (i.e. for "s" you need to pass char * and int), +Please note that since version 7 PHP uses zend_long as integer type and +zend_string with size_t as length, so make sure you pass zend_longs to "l" +and size_t to strings length (i.e. for "s" you need to pass char * and int), not the other way round! -Remember: "l" is the only case when you need to pass long (and that's why -it's "l", not "i" btw). -Both mistakes cause memory corruptions and segfaults on 64bit OSes: +Both mistakes might cause memory corruptions and segfaults: 1) char *str; - long str_len; /* XXX THIS IS WRONG!! Use int instead. */ + long str_len; /* XXX THIS IS WRONG!! Use size_t instead. */ zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) 2) - int num; /* XXX THIS IS WRONG!! Use long instead. */ + int num; /* XXX THIS IS WRONG!! Use zend_long instead. */ zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) If you're in doubt, use check_parameters.php script to the parameters @@ -113,9 +112,9 @@ and their types (it can be found in ./scripts/dev/ directory of PHP sources): Examples -------- /* Gets a long, a string and its length, and a zval */ -long l; +zend_long l; char *s; -int s_len; +size_t s_len; zval *param; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz", &l, &s, &s_len, ¶m) == FAILURE) { @@ -151,16 +150,16 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", } /* Get either a set of 3 longs or a string. */ -long l1, l2, l3; +zend_long l1, l2, l3; char *s; /* - * The function expects a pointer to a integer in this case, not a long + * The function expects a pointer to a size_t in this case, not a long * or any other type. If you specify a type which is larger - * than a 'int', the upper bits might not be initialized + * than a 'size_t', the upper bits might not be initialized * properly, leading to random crashes on platforms like * Tru64 or Linux/Alpha. */ -int length; +size_t length; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "lll", &l1, &l2, &l3) == SUCCESS) { @@ -178,7 +177,7 @@ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, /* Function that accepts only varargs (0 or more) */ int i, num_varargs; -zval ***varargs = NULL; +zval *varargs = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &varargs, &num_varargs) == FAILURE) { @@ -197,9 +196,9 @@ if (varargs) { /* Function that accepts a string, followed by varargs (1 or more) */ char *str; -int str_len; +size_t str_len; int i, num_varargs; -zval ***varargs = NULL; +zval *varargs = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) { return; @@ -209,16 +208,11 @@ for (i = 0; i < num_varargs; i++) { /* do something with varargs[i] */ } -if (varargs) { - efree(varargs); -} - - /* Function that takes an array, followed by varargs, and ending with a long */ -long num; +zend_long num; zval *array; int i, num_varargs; -zval ***varargs = NULL; +zval *varargs = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) { return; @@ -227,8 +221,3 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &n for (i = 0; i < num_varargs; i++) { /* do something with varargs[i] */ } - -if (varargs) { - efree(varargs); -} - diff --git a/README.TESTING b/README.TESTING index 3ed5e6b2ab..1972f5f6f3 100644 --- a/README.TESTING +++ b/README.TESTING @@ -118,7 +118,7 @@ Example script to be run by cron(1): ========== qa-test.sh ============= #!/bin/sh -CO_DIR=$HOME/cvs/php5 +CO_DIR=$HOME/cvs/php7 MYMAIL=qa-test@domain.com TMPDIR=/var/tmp TODAY=`date +"%Y%m%d"` diff --git a/README.UNIX-BUILD-SYSTEM b/README.UNIX-BUILD-SYSTEM index 9b49cb8bc8..54dcae3fc6 100644 --- a/README.UNIX-BUILD-SYSTEM +++ b/README.UNIX-BUILD-SYSTEM @@ -108,7 +108,7 @@ module, program, etc). For example for APXS: -PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php5.c php_apache.c) +PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php7.c php_apache.c) diff --git a/README.input_filter b/README.input_filter index e2941d029e..78e2edd2ec 100644 --- a/README.input_filter +++ b/README.input_filter @@ -181,4 +181,3 @@ PHP_FUNCTION(my_get_raw) RETVAL_FALSE; } } - diff --git a/TSRM/TSRM.dsp b/TSRM/TSRM.dsp deleted file mode 100644 index 8604bc0da8..0000000000 --- a/TSRM/TSRM.dsp +++ /dev/null @@ -1,178 +0,0 @@ -# Microsoft Developer Studio Project File - Name="TSRM" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=TSRM - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak" CFG="TSRM - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "TSRM - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=1 /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "TSRM - Win32 Debug_TS" -# Name "TSRM - Win32 Release_TS" -# Name "TSRM - Win32 Release_TS_inline" -# Name "TSRM - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\TSRM.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\readdir.h -# End Source File -# Begin Source File - -SOURCE=.\TSRM.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config.w32.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config_common.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.h -# End Source File -# End Group -# End Target -# End Project diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 82e272db5b..b232429d4d 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -64,7 +64,7 @@ typedef int ts_rsrc_id; /* Define THREAD_T and MUTEX_T */ #ifdef TSRM_WIN32 -# define THREAD_T UINT_PTR +# define THREAD_T DWORD # define MUTEX_T CRITICAL_SECTION * #elif defined(GNUPTH) # define THREAD_T pth_t diff --git a/TSRM/tsrm_nw.c b/TSRM/tsrm_nw.c index 8d591c0746..8defc4ed94 100644 --- a/TSRM/tsrm_nw.c +++ b/TSRM/tsrm_nw.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/TSRM/tsrm_nw.h b/TSRM/tsrm_nw.h index ba03744a30..02ac4be098 100644 --- a/TSRM/tsrm_nw.h +++ b/TSRM/tsrm_nw.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 0b8228aafb..faa186a1bb 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -605,13 +605,13 @@ TSRM_API int shmget(int key, int size, int flags) shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment); info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info); - if ((!shm_handle && !info_handle)) { + if (!shm_handle && !info_handle) { if (flags & IPC_CREAT) { shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, shm_segment); info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info); created = TRUE; } - if ((!shm_handle || !info_handle)) { + if (!shm_handle || !info_handle) { return -1; } } else { diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h index dc5a3999dd..5933b54ddf 100644 --- a/TSRM/tsrm_win32.h +++ b/TSRM/tsrm_win32.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -21,10 +21,24 @@ PHP X.Y UPGRADE NOTES 1. Backward Incompatible Changes ======================================== +- Core + . Bitwise shifts by negative numbers of bits are disallowed (throws E_WARNING + and gives FALSE, like a division by zero). + . Left bitwise shifts by a number of bits beyond the bit width of an integer + will always result in 0, even on CPUs which wrap around. + . Right bitwise shifts by a number of bits beyond the bit width of an integer + will always result in 0 or -1 (depending on sign), even on CPUs which wrap + around. + - DBA - . dba_delete() now returns false if the key was not found for the inifile + . dba_delete() now returns false if the key was not found for the inifile handler, too. +- GMP + . Requires libgmp version 4.2 or newer now. + . gmp_setbit() and gmp_clrbit() now return FALSE for negative indices, making + them consistent with other GMP functions. + ======================================== 2. New Features ======================================== @@ -100,5 +114,9 @@ PHP X.Y UPGRADE NOTES 13. Other Changes ======================================== +- Core + . Instead of being undefined and platform-dependant, NaN and Infinity will + always be zero when casted to integer. + - Standard . call_user_method() and call_user_method_array() no longer exists. diff --git a/Zend/Makefile.am b/Zend/Makefile.am index 65c4113497..2a76db36b1 100644 --- a/Zend/Makefile.am +++ b/Zend/Makefile.am @@ -8,7 +8,7 @@ noinst_LTLIBRARIES=libZend.la libZend_la_SOURCES=\ zend_language_parser.y zend_language_scanner.l \ zend_ini_parser.y zend_ini_scanner.l \ - zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \ + zend_alloc.c zend_compile.c zend_constants.c \ zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \ zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp deleted file mode 100644 index 98d368fb16..0000000000 --- a/Zend/Zend.dsp +++ /dev/null @@ -1,622 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Zend" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=Zend - Win32 Release_inline
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Zend.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Zend.mak" CFG="Zend - Win32 Release_inline"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Zend - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "Zend - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "Zend - Win32 Release_inline" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Zend - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDebug" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D ZEND_DEBUG=0 /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x40d /d "NDebug"
-# ADD RSC /l 0x40d /d "NDebug"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_Debug" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug" /D "_LIB" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40d /d "_Debug"
-# ADD RSC /l 0x40d /d "_Debug"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Output_Dir "Zend___Win32_Release_inline"
-# PROP BASE Intermediate_Dir "Zend___Win32_Release_inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Output_Dir "Release_inline"
-# PROP Intermediate_Dir "Release_inline"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D ZEND_DEBUG=0 /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x40d /d "NDebug"
-# ADD RSC /l 0x40d /d "NDebug"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "Zend - Win32 Release"
-# Name "Zend - Win32 Debug"
-# Name "Zend - Win32 Release_inline"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\zend.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_alloc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_API.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ast.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_builtin_functions.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_closures.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_compile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_constants.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_default_classes.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_dynamic_array.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_execute.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_execute_API.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_extensions.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_float.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_generators.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_hash.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_highlight.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_indent.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_parser.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_scanner.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_interfaces.c
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_parser.c"
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_scanner.c"
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_list.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_llist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_object_handlers.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects_API.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_opcode.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_operators.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ptr_stack.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_qsort.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_sprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stack.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stream.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_string.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_strtod.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ts_hash.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_variables.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_vm_opcodes.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_virtual_cwd.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\FlexLexer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_alloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_API.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_builtin_functions.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_compile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_config.w32.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_constants.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_default_classes.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_dynamic_array.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_errors.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_execute.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_execute_locks.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_extensions.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_globals.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_globals_macros.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_hash.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_highlight.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_indent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_parser.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_scanner.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_interfaces.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_istdiostream.h
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_parser.h"
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_scanner.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_list.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_llist.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_modules.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_object_handlers.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects_API.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_operators.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ptr_stack.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_qsort.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stack.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stream.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_string.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_strtod.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ts_hash.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_variables.h
-# End Source File
-# End Group
-# Begin Group "Parsers"
-
-# PROP Default_Filter "y"
-# Begin Source File
-
-SOURCE=.\zend_ini_parser.y
-
-!IF "$(CFG)" == "Zend - Win32 Release"
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\zend_ini_parser.y
-
-BuildCmds= \
- bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y
-
-"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_parser.y"
-
-!IF "$(CFG)" == "Zend - Win32 Release"
-
-# Begin Custom Build
-InputDir=.
-InputPath=".\zend_language_parser.y"
-
-BuildCmds= \
- bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
-
-"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
-
-# Begin Custom Build
-InputDir=.
-InputPath=".\zend_language_parser.y"
-
-BuildCmds= \
- bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
-
-"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
-
-# Begin Custom Build
-InputDir=.
-InputPath=".\zend_language_parser.y"
-
-BuildCmds= \
- bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
-
-"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Scanners"
-
-# PROP Default_Filter "l"
-# Begin Source File
-
-SOURCE=.\flex.skl
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_scanner.l
-
-!IF "$(CFG)" == "Zend - Win32 Release"
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
-
-# Begin Custom Build
-InputPath=.\zend_ini_scanner.l
-
-"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_scanner.l"
-
-!IF "$(CFG)" == "Zend - Win32 Release"
-
-# Begin Custom Build
-InputPath=".\zend_language_scanner.l"
-
-"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
-
-# Begin Custom Build
-InputPath=".\zend_language_scanner.l"
-
-"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
-
-# Begin Custom Build
-InputPath=".\zend_language_scanner.l"
-
-"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Text Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\ZEND_BUGS
-# End Source File
-# Begin Source File
-
-SOURCE=.\ZEND_CHANGES
-# End Source File
-# Begin Source File
-
-SOURCE=.\ZEND_TODO
-# End Source File
-# End Group
-# Begin Group "Resources"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\zend.ico
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp deleted file mode 100644 index 21210f1087..0000000000 --- a/Zend/ZendTS.dsp +++ /dev/null @@ -1,748 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ZendTS" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=ZendTS - Win32 Release_TSDbg
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ZendTS.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ZendTS.mak" CFG="ZendTS - Win32 Release_TSDbg"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ZendTS - Win32 Release_TS" (based on "Win32 (x86) Static Library")
-!MESSAGE "ZendTS - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
-!MESSAGE "ZendTS - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library")
-!MESSAGE "ZendTS - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDebug_TS" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x40d /d "NDebug_TS"
-# ADD RSC /l 0x40d /d "NDebug_TS"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_Debug_TS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug_TS" /D ZEND_DEBUG=1 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40d /d "_Debug_TS"
-# ADD RSC /l 0x40d /d "_Debug_TS"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Output_Dir "ZendTS___Win32_Release_TS_inline"
-# PROP BASE Intermediate_Dir "ZendTS___Win32_Release_TS_inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Output_Dir "Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x40d /d "NDebug_TS"
-# ADD RSC /l 0x40d /d "NDebug_TS"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Output_Dir "ZendTS___Win32_Release_TSDbg"
-# PROP BASE Intermediate_Dir "ZendTS___Win32_Release_TSDbg"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Output_Dir "Release_TSDbg"
-# PROP Intermediate_Dir "Release_TSDbg"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x40d /d "NDebug_TS"
-# ADD RSC /l 0x40d /d "NDebug_TS"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "ZendTS - Win32 Release_TS"
-# Name "ZendTS - Win32 Debug_TS"
-# Name "ZendTS - Win32 Release_TS_inline"
-# Name "ZendTS - Win32 Release_TSDbg"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\zend.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_alloc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ast.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_API.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_builtin_functions.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_closures.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_compile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_constants.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_default_classes.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_dynamic_array.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_exceptions.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_execute.c
-# ADD CPP /I "..\TSRM"
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_execute_API.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_extensions.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_generators.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_hash.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_highlight.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_indent.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_parser.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_scanner.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_interfaces.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_iterators.c
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_parser.c"
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_scanner.c"
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_list.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_llist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_object_handlers.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects_API.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_opcode.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_operators.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ptr_stack.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_qsort.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_sprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stack.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stream.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_string.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_strtod.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ts_hash.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_variables.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_vm_opcodes.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\FlexLexer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_alloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_API.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_builtin_functions.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_compile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_config.w32.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_constants.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_default_classes.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_dynamic_array.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_errors.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_exceptions.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_execute.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_extensions.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_globals.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_globals_macros.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_hash.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_highlight.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_indent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_parser.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_scanner.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_interfaces.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_istdiostream.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_iterators.h
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_parser.h"
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_scanner.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_list.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_llist.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_modules.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_object_handlers.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_objects_API.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_operators.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ptr_stack.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_qsort.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stack.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_stream.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_string.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_strtod.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ts_hash.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_variables.h
-# End Source File
-# End Group
-# Begin Group "Parsers"
-
-# PROP Default_Filter "y"
-# Begin Source File
-
-SOURCE=.\zend_ini_parser.y
-
-!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\zend_ini_parser.y
-
-BuildCmds= \
- bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y
-
-"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\zend_ini_parser.y
-
-BuildCmds= \
- bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y
-
-"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\zend_ini_parser.y
-
-BuildCmds= \
- bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y
-
-"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\zend_ini_parser.y
-
-BuildCmds= \
- bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y
-
-"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_parser.y"
-
-!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=".\zend_language_parser.y"
-
-BuildCmds= \
- bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
-
-"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=".\zend_language_parser.y"
-
-BuildCmds= \
- bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
-
-"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
-
-# Begin Custom Build
-InputDir=.
-InputPath=".\zend_language_parser.y"
-
-BuildCmds= \
- bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
-
-"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
-
-# Begin Custom Build
-InputDir=.
-InputPath=".\zend_language_parser.y"
-
-BuildCmds= \
- bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
-
-"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Scanners"
-
-# PROP Default_Filter "l"
-# Begin Source File
-
-SOURCE=.\flex.skl
-# End Source File
-# Begin Source File
-
-SOURCE=.\zend_ini_scanner.l
-
-!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
-
-# Begin Custom Build
-InputPath=.\zend_ini_scanner.l
-
-"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
-
-# Begin Custom Build
-InputPath=.\zend_ini_scanner.l
-
-"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
-
-# Begin Custom Build
-InputPath=.\zend_ini_scanner.l
-
-"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
-
-# Begin Custom Build
-InputPath=.\zend_ini_scanner.l
-
-"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=".\zend_language_scanner.l"
-
-!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
-
-# Begin Custom Build
-InputPath=".\zend_language_scanner.l"
-
-"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
-
-# Begin Custom Build
-InputPath=".\zend_language_scanner.l"
-
-"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
-
-# Begin Custom Build
-InputPath=".\zend_language_scanner.l"
-
-"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
-
-# Begin Custom Build
-InputPath=".\zend_language_scanner.l"
-
-"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Text Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\LICENSE
-# End Source File
-# Begin Source File
-
-SOURCE=.\ZEND_BUGS
-# End Source File
-# Begin Source File
-
-SOURCE=.\ZEND_CHANGES
-# End Source File
-# End Group
-# Begin Group "Resources"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\zend.ico
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/Zend/tests/034.phpt b/Zend/tests/034.phpt index 6e46f2645e..0bcfa23f19 100644 --- a/Zend/tests/034.phpt +++ b/Zend/tests/034.phpt @@ -22,5 +22,5 @@ switch (1) { } ?> ---EXPECT-- -3 +--EXPECTF-- +Fatal error: Switch statements may only contain one default clause in %s on line 13 diff --git a/Zend/tests/bug67633.phpt b/Zend/tests/bug67633.phpt new file mode 100644 index 0000000000..a9e05d10ab --- /dev/null +++ b/Zend/tests/bug67633.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #67633: A foreach on an array returned from a function not doing copy-on-write +--FILE-- +<?php + +function id($x) { + return $x; +} + +function &ref_id(&$x) { + return $x; +} + +$c = 'c'; +$array = ['a', 'b', $c]; + +foreach(id($array) as &$v) { + $v .= 'q'; +} +var_dump($array); + +foreach(ref_id($array) as &$v) { + $v .= 'q'; +} +var_dump($array); + +?> +--EXPECT-- +array(3) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + [2]=> + string(1) "c" +} +array(3) { + [0]=> + string(2) "aq" + [1]=> + string(2) "bq" + [2]=> + &string(2) "cq" +} diff --git a/Zend/tests/bug67985.phpt b/Zend/tests/bug67985.phpt new file mode 100644 index 0000000000..6f032643f4 --- /dev/null +++ b/Zend/tests/bug67985.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #67985 - Last used array index not copied to new array at assignment +--FILE-- +<?php + +$a = ['zero', 'one', 'two']; +unset($a[2]); +$b = $a; +$a[] = 'three'; +$b[] = 'three'; + +var_dump($a === $b); + +?> +--EXPECT-- +bool(true) diff --git a/Zend/tests/bug68118.phpt b/Zend/tests/bug68118.phpt new file mode 100644 index 0000000000..c56e70a112 --- /dev/null +++ b/Zend/tests/bug68118.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined +--FILE-- +<?php + +set_error_handler(function() { + $obj = new stdClass; + $obj->test = 'meow'; + return true; +}); + +$a = new stdClass; +$a->undefined .= 'test'; +var_dump($a); + +?> +--EXPECT-- +object(stdClass)#2 (1) { + ["undefined"]=> + string(4) "test" +} diff --git a/Zend/tests/builtin_in_write_context_error1.phpt b/Zend/tests/builtin_in_write_context_error1.phpt new file mode 100644 index 0000000000..eed03cc3c1 --- /dev/null +++ b/Zend/tests/builtin_in_write_context_error1.phpt @@ -0,0 +1,10 @@ +--TEST-- +Cannot use built-in functions in write context (assignment) +--FILE-- +<?php + +strlen("foo")[0] = 1; + +?> +--EXPECTF-- +Fatal error: Cannot use result of built-in function in write context in %s on line %d diff --git a/Zend/tests/builtin_in_write_context_error2.phpt b/Zend/tests/builtin_in_write_context_error2.phpt new file mode 100644 index 0000000000..aac23e4f4e --- /dev/null +++ b/Zend/tests/builtin_in_write_context_error2.phpt @@ -0,0 +1,10 @@ +--TEST-- +Cannot use built-in functions in write context (reference) +--FILE-- +<?php + +$ref =& strlen("foo"); + +?> +--EXPECTF-- +Fatal error: Cannot use result of built-in function in write context in %s on line %d diff --git a/Zend/tests/class_name_as_scalar_error_007.phpt b/Zend/tests/class_name_as_scalar_error_007.phpt new file mode 100644 index 0000000000..2bfa5f38f8 --- /dev/null +++ b/Zend/tests/class_name_as_scalar_error_007.phpt @@ -0,0 +1,10 @@ +--TEST-- +Cannot access self::class when no class scope is active +--FILE-- +<?php + +var_dump(self::class); + +?> +--EXPECTF-- +Fatal error: Cannot access self::class when no class scope is active in %s on line %d diff --git a/Zend/tests/constant_expressions_dynamic.phpt b/Zend/tests/constant_expressions_dynamic.phpt index 21c9216cc1..d4e06ee258 100644 --- a/Zend/tests/constant_expressions_dynamic.phpt +++ b/Zend/tests/constant_expressions_dynamic.phpt @@ -2,10 +2,76 @@ Dynamic Constant Expressions --FILE-- <?php -const FOO = 1; -const BAR = FOO | 2; -echo BAR; +const C_0 = 0; +const C_1 = 1; +const C_foo = "foo"; +const C_arr = [0 => 0, "foo" => "foo"]; + +const T_1 = C_1 | 2; +const T_2 = C_1 . "foo"; +const T_3 = C_1 > 1; +const T_4 = C_1 >= 1; +const T_5 = -C_1; +const T_6 = +C_1; +const T_7 = +C_foo; +const T_8 = !C_1; +const T_9 = C_0 || 0; +const T_10 = C_1 || 0; +const T_11 = C_0 && 1; +const T_12 = C_1 && 1; +const T_13 = C_0 ? "foo" : "bar"; +const T_14 = C_1 ? "foo" : "bar"; +const T_15 = C_0 ?: "bar"; +const T_16 = C_1 ?: "bar"; +const T_17 = C_arr[0]; +const T_18 = C_arr["foo"]; +const T_19 = [ + C_0, + "foo" => "foo", + 42 => 42, + 3.14 => 3.14, + null => null, + false => false, + true => true, +]; + +var_dump( + T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9, T_10, + T_11, T_12, T_13, T_14, T_15, T_16, T_17, T_18, T_19 +); + ?> ---EXPECTF-- -3 +--EXPECT-- +int(3) +string(4) "1foo" +bool(false) +bool(true) +int(-1) +int(1) +int(0) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +string(3) "bar" +string(3) "foo" +string(3) "bar" +int(1) +int(0) +string(3) "foo" +array(6) { + [0]=> + bool(false) + ["foo"]=> + string(3) "foo" + [42]=> + int(42) + [3]=> + float(3.14) + [""]=> + NULL + [1]=> + bool(true) +} diff --git a/Zend/tests/constant_expressions_dynamic_class_name_error.phpt b/Zend/tests/constant_expressions_dynamic_class_name_error.phpt new file mode 100644 index 0000000000..3ce5844649 --- /dev/null +++ b/Zend/tests/constant_expressions_dynamic_class_name_error.phpt @@ -0,0 +1,11 @@ +--TEST-- +Dynamic class names can't be used in compile-time constant refs +--FILE-- +<?php + +$foo = 'test'; +const C = $foo::BAR; + +?> +--EXPECTF-- +Fatal error: Dynamic class names are not allowed in compile-time class constant references in %s on line %d diff --git a/Zend/tests/constant_expressions_invalid_offset_type_error.phpt b/Zend/tests/constant_expressions_invalid_offset_type_error.phpt new file mode 100644 index 0000000000..440eabc652 --- /dev/null +++ b/Zend/tests/constant_expressions_invalid_offset_type_error.phpt @@ -0,0 +1,11 @@ +--TEST-- +Can't use arrays as key for constant array +--FILE-- +<?php + +const C1 = 1; // force dynamic evaluation +const C2 = [C1, [] => 1]; + +?> +--EXPECTF-- +Fatal error: Illegal offset type in %s on line %d diff --git a/Zend/tests/constant_expressions_static_class_name_error.phpt b/Zend/tests/constant_expressions_static_class_name_error.phpt new file mode 100644 index 0000000000..f03a88b87e --- /dev/null +++ b/Zend/tests/constant_expressions_static_class_name_error.phpt @@ -0,0 +1,10 @@ +--TEST-- +Cannot use static::FOO in constant expressions +--FILE-- +<?php + +const C = static::FOO; + +?> +--EXPECTF-- +Fatal error: "static::" is not allowed in compile-time constants in %s on line %d diff --git a/Zend/tests/debug_backtrace_with_include_and_this.phpt b/Zend/tests/debug_backtrace_with_include_and_this.phpt new file mode 100644 index 0000000000..171ad9f451 --- /dev/null +++ b/Zend/tests/debug_backtrace_with_include_and_this.phpt @@ -0,0 +1,39 @@ +--TEST-- +debug_backtrace segmentation fault with include and error handler +--FILE-- +<?php +class CLWrapper { + function stream_open($path, $mode, $options, $opened_path) { + return false; + } +} + +class CL { + public function load($class) { + if (!include($class)) { + throw new Exception('Failed loading '.$class); + } + } +} + +stream_wrapper_register('class', 'CLWrapper'); +set_error_handler(function($code, $msg, $file, $line) { + $bt= debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); + echo "ERR#$code: $msg @ ", $bt[1]['function'], "\n"; +}); + +try { + (new CL())->load('class://non.existant.Class'); +} catch (CLException $e) { + echo $e."\n"; +} +--EXPECTF-- +ERR#2: include(class://non.existant.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include +ERR#2: include(): Failed opening 'class://non.existant.Class' for inclusion (include_path='%s') @ include + +Fatal error: Uncaught exception 'Exception' with message 'Failed loading class://non.existant.Class' in %s +Stack trace: +#0 %s(%d): CL->load('class://non.exi...') +#1 {main} + thrown in %s on line %d + diff --git a/Zend/tests/duplicate_label_error.phpt b/Zend/tests/duplicate_label_error.phpt new file mode 100644 index 0000000000..c89d7a6991 --- /dev/null +++ b/Zend/tests/duplicate_label_error.phpt @@ -0,0 +1,12 @@ +--TEST-- +Duplicate labels are not allowed +--FILE-- +<?php + +foo: +foo: +goto foo; + +?> +--EXPECTF-- +Fatal error: Label 'foo' already defined in %s on line %d diff --git a/Zend/tests/gc_033.phpt b/Zend/tests/gc_033.phpt new file mode 100644 index 0000000000..dee426a385 --- /dev/null +++ b/Zend/tests/gc_033.phpt @@ -0,0 +1,30 @@ +--TEST-- +GC 033: Crash in GC while run with phpspec +--XFAIL-- +Full GC root buffer not handled correctly yet +--FILE-- +<?php +$a = new stdClass(); +$a->a = array(); +$a->a[0] = new Stdclass(); +$a->a[0]->a = $a; +$a->a[1] = &$a->a; + +/* remove the self-reference array out of roots */ +gc_collect_cycles(); + +/* do unset */ +unset($a); + +/* let's full the gc roots */ +for ($i=0; $i<9999; $i++) { + $b = range(0, 1); + $b[0] = &$b; + unset($b); +} + +/* then $a will be freed, but $a->a[0] is not. reference to a freed $a */ +var_dump(gc_collect_cycles()); +?> +--EXPECT-- +int(20001) diff --git a/Zend/tests/int_special_values.phpt b/Zend/tests/int_special_values.phpt new file mode 100644 index 0000000000..e1a50b6ecb --- /dev/null +++ b/Zend/tests/int_special_values.phpt @@ -0,0 +1,37 @@ +--TEST-- +Conversion of special float values to int +--FILE-- +<?php +$values = [ + 0.0, + INF, + -INF, + 1 / INF, + -1 / INF, // Negative zero, + NAN +]; + +foreach($values as $value) { + var_dump($value); + var_dump((int)$value); + echo PHP_EOL; +} +?> +--EXPECT-- +float(0) +int(0) + +float(INF) +int(0) + +float(-INF) +int(0) + +float(0) +int(0) + +float(-0) +int(0) + +float(NAN) +int(0)
\ No newline at end of file diff --git a/Zend/tests/list_destructuring_to_special_variables.phpt b/Zend/tests/list_destructuring_to_special_variables.phpt new file mode 100644 index 0000000000..4418c967c2 --- /dev/null +++ b/Zend/tests/list_destructuring_to_special_variables.phpt @@ -0,0 +1,49 @@ +--TEST-- +list() can be used to destructure to string offsets, __set and ArrayAccess::offsetSet +--FILE-- +<?php + +class Obj { + public $values = []; + public function __set($name, $value) { + $this->values[$name] = $value; + } +} + +class Arr implements ArrayAccess { + public $values = []; + public function offsetSet($name, $value) { + $this->values[$name] = $value; + } + public function offsetGet($name) {} + public function offsetExists($name) {} + public function offsetUnset($name) {} +} + +$str = 'ab'; +list($str[0], $str[1]) = ['x', 'y']; +var_dump($str); + +$obj = new Obj; +list($obj->foo, $obj->bar) = ['foo', 'bar']; +var_dump($obj->values); + +$arr = new Arr; +list($arr['foo'], $arr['bar']) = ['foo', 'bar']; +var_dump($arr->values); + +?> +--EXPECT-- +string(2) "xy" +array(2) { + ["foo"]=> + string(3) "foo" + ["bar"]=> + string(3) "bar" +} +array(2) { + ["foo"]=> + string(3) "foo" + ["bar"]=> + string(3) "bar" +} diff --git a/Zend/tests/magic_const_in_global_scope.phpt b/Zend/tests/magic_const_in_global_scope.phpt new file mode 100644 index 0000000000..31f7eae6d7 --- /dev/null +++ b/Zend/tests/magic_const_in_global_scope.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test use of magic constants in the global scope +--FILE-- +<?php + +var_dump( + __LINE__, + __FILE__, + __DIR__, + __FUNCTION__, + __METHOD__, + __CLASS__, + __TRAIT__, + __NAMESPACE__ +); + +?> +--EXPECTF-- +int(4) +string(%d) "%s" +string(%d) "%s" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" diff --git a/Zend/tests/special_name_error1.phpt b/Zend/tests/special_name_error1.phpt new file mode 100644 index 0000000000..63bf5a63fd --- /dev/null +++ b/Zend/tests/special_name_error1.phpt @@ -0,0 +1,10 @@ +--TEST-- +Cannot use special class name as namespace +--FILE-- +<?php + +namespace self; + +?> +--EXPECTF-- +Fatal error: Cannot use 'self' as namespace name in %s on line %d diff --git a/Zend/tests/special_name_error2.phpt b/Zend/tests/special_name_error2.phpt new file mode 100644 index 0000000000..08122b3249 --- /dev/null +++ b/Zend/tests/special_name_error2.phpt @@ -0,0 +1,10 @@ +--TEST-- +Cannot use special class name as alias +--FILE-- +<?php + +use Foo\Bar as self; + +?> +--EXPECTF-- +Fatal error: Cannot use Foo\Bar as self because 'self' is a special class name in %s on line %d diff --git a/Zend/tests/special_name_error3.phpt b/Zend/tests/special_name_error3.phpt new file mode 100644 index 0000000000..74e69f1938 --- /dev/null +++ b/Zend/tests/special_name_error3.phpt @@ -0,0 +1,10 @@ +--TEST-- +Cannot use special class name as trait name +--FILE-- +<?php + +trait self {} + +?> +--EXPECTF-- +Fatal error: Cannot use 'self' as class name as it is reserved in %s on line %d diff --git a/Zend/tests/this_as_lexical_var_error.phpt b/Zend/tests/this_as_lexical_var_error.phpt new file mode 100644 index 0000000000..d0e0106dae --- /dev/null +++ b/Zend/tests/this_as_lexical_var_error.phpt @@ -0,0 +1,14 @@ +--TEST-- +Cannot use $this as lexical variable +--FILE-- +<?php + +class Foo { + public function fn() { + return function() use ($this) {}; + } +} + +?> +--EXPECTF-- +Fatal error: Cannot use $this as lexical variable in %s on line %d diff --git a/Zend/tests/varSyntax/indirectFcall.phpt b/Zend/tests/varSyntax/indirectFcall.phpt index 4cc5c1171a..5d616d59a2 100644 --- a/Zend/tests/varSyntax/indirectFcall.phpt +++ b/Zend/tests/varSyntax/indirectFcall.phpt @@ -34,6 +34,7 @@ $obj = new Test; ['Test', 'id']()()('var_dump')(11); 'id'()('id')('var_dump')(12); ('i' . 'd')()('var_dump')(13); +'\id'('var_dump')(14); ?> --EXPECT-- @@ -51,3 +52,4 @@ int(10) int(11) int(12) int(13) +int(14) diff --git a/Zend/tests/varSyntax/staticMember.phpt b/Zend/tests/varSyntax/staticMember.phpt index 22a1fa2b13..e32417771a 100644 --- a/Zend/tests/varSyntax/staticMember.phpt +++ b/Zend/tests/varSyntax/staticMember.phpt @@ -19,6 +19,7 @@ var_dump($A_str::$b); var_dump($A_obj::$b); var_dump(('A' . '')::$b); var_dump('A'::$b); +var_dump('\A'::$b); var_dump('A'[0]::$b); var_dump(A::$$b_str); var_dump(A::$$c_str[1]); @@ -33,5 +34,6 @@ int(0) int(0) int(0) int(0) +int(0) int(1) int(0) diff --git a/Zend/zend.c b/Zend/zend.c index de13108673..06cb9cbc78 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -156,8 +156,8 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, if (string_key) { if (is_object) { const char *prop_name, *class_name; - int prop_len; - int mangled = zend_unmangle_property_name_ex(string_key->val, string_key->len, &class_name, &prop_name, &prop_len); + size_t prop_len; + int mangled = zend_unmangle_property_name_ex(string_key, &class_name, &prop_name, &prop_len); ZEND_WRITE_EX(prop_name, prop_len); if (class_name && mangled == SUCCESS) { @@ -216,79 +216,10 @@ ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC) /* { if (Z_TYPE_P(expr) == IS_STRING) { return 0; + } else { + ZVAL_STR(expr_copy, _zval_get_string_func(expr TSRMLS_CC)); + return 1; } - -again: - switch (Z_TYPE_P(expr)) { - case IS_NULL: - case IS_FALSE: - ZVAL_EMPTY_STRING(expr_copy); - break; - case IS_TRUE: - if (CG(one_char_string)['1']) { - ZVAL_INTERNED_STR(expr_copy, CG(one_char_string)['1']); - } else { - ZVAL_NEW_STR(expr_copy, zend_string_init("1", 1, 0)); - } - break; - case IS_RESOURCE: { - char buf[sizeof("Resource id #") + MAX_LENGTH_OF_LONG]; - int len; - - len = snprintf(buf, sizeof(buf), "Resource id #" ZEND_LONG_FMT, Z_RES_HANDLE_P(expr)); - ZVAL_NEW_STR(expr_copy, zend_string_init(buf, len, 0)); - } - break; - case IS_ARRAY: - zend_error(E_NOTICE, "Array to string conversion"); - // TODO: use interned string ??? - ZVAL_NEW_STR(expr_copy, zend_string_init("Array", sizeof("Array") - 1, 0)); - break; - case IS_OBJECT: - if (Z_OBJ_HANDLER_P(expr, cast_object)) { - Z_ADDREF_P(expr); - if (Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zval_ptr_dtor(expr); - break; - } - zval_ptr_dtor(expr); - } - if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) { - zval rv; - zval *z = Z_OBJ_HANDLER_P(expr, get)(expr, &rv TSRMLS_CC); - - Z_ADDREF_P(z); - if (Z_TYPE_P(z) != IS_OBJECT) { - if (zend_make_printable_zval(z, expr_copy TSRMLS_CC)) { - zval_ptr_dtor(z); - } else { - ZVAL_ZVAL(expr_copy, z, 0, 1); - } - return 1; - } - zval_ptr_dtor(z); - } - zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name->val); - ZVAL_EMPTY_STRING(expr_copy); - break; - case IS_DOUBLE: - ZVAL_DUP(expr_copy, expr); - zend_locale_sprintf_double(expr_copy ZEND_FILE_LINE_CC); - break; - case IS_REFERENCE: - expr = Z_REFVAL_P(expr); - if (Z_TYPE_P(expr) == IS_STRING) { - ZVAL_STR(expr_copy, zend_string_copy(Z_STR_P(expr))); - return 1; - } - goto again; - break; - default: - ZVAL_DUP(expr_copy, expr); - convert_to_string(expr_copy); - break; - } - return 1; } /* }}} */ @@ -509,11 +440,20 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table); if (compiler_globals->last_static_member) { - compiler_globals->static_members_table = calloc(compiler_globals->last_static_member, sizeof(zval**)); + compiler_globals->static_members_table = calloc(compiler_globals->last_static_member, sizeof(zval*)); } else { compiler_globals->static_members_table = NULL; } compiler_globals->script_encoding_list = NULL; + +#ifdef ZTS + compiler_globals->empty_string = zend_string_alloc(sizeof("")-1, 1); + compiler_globals->empty_string->val[0] = '\000'; + zend_string_hash_val(compiler_globals->empty_string); + compiler_globals->empty_string->gc.u.v.flags |= IS_STR_INTERNED; + + memset(compiler_globals->one_char_string, 0, sizeof(compiler_globals->one_char_string)); +#endif } /* }}} */ @@ -538,6 +478,10 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS pefree((char*)compiler_globals->script_encoding_list, 1); } compiler_globals->last_static_member = 0; + +#ifdef ZTS + zend_string_release(compiler_globals->empty_string); +#endif } /* }}} */ @@ -1031,7 +975,7 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */ } \ } while (0) -#ifndef ZEND_WIN32 +#if !defined(ZEND_WIN32) && !defined(DARWIN) ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ #else static void zend_error_va_list(int type, const char *format, va_list args) @@ -1039,7 +983,7 @@ static void zend_error_va_list(int type, const char *format, va_list args) { char *str; int len; -#ifndef ZEND_WIN32 +#if !defined(ZEND_WIN32) && !defined(DARWIN) va_list args; #endif va_list usr_copy; @@ -1144,7 +1088,7 @@ static void zend_error_va_list(int type, const char *format, va_list args) } #endif /* HAVE_DTRACE */ -#ifndef ZEND_WIN32 +#if !defined(ZEND_WIN32) && !defined(DARWIN) va_start(args, format); #endif @@ -1257,7 +1201,7 @@ static void zend_error_va_list(int type, const char *format, va_list args) break; } -#ifndef ZEND_WIN32 +#if !defined(ZEND_WIN32) && !defined(DARWIN) va_end(args); #endif @@ -1274,9 +1218,9 @@ static void zend_error_va_list(int type, const char *format, va_list args) } /* }}} */ -#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__) +#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn)); -#elif defined(ZEND_WIN32) +#elif defined(ZEND_WIN32) || defined(DARWIN) ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ { va_list va; @@ -1294,6 +1238,7 @@ ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, .. zend_error_va_list(type, format, va); va_end(va); } +/* }}} */ #endif ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */ @@ -1410,6 +1355,7 @@ void free_estring(char **str_p) /* {{{ */ { efree(*str_p); } +/* }}} */ void free_string_zval(zval *zv) /* {{{ */ { diff --git a/Zend/zend.h b/Zend/zend.h index d79920fb1e..969fa5e71b 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -26,442 +26,76 @@ #define ZEND_ENGINE_2 -#ifdef __cplusplus -#define BEGIN_EXTERN_C() extern "C" { -#define END_EXTERN_C() } -#else -#define BEGIN_EXTERN_C() -#define END_EXTERN_C() -#endif - -/* - * general definitions - */ - -#ifdef ZEND_WIN32 -# include "zend_config.w32.h" -# define ZEND_PATHS_SEPARATOR ';' -#elif defined(NETWARE) -# include <zend_config.h> -# define ZEND_PATHS_SEPARATOR ';' -#elif defined(__riscos__) -# include <zend_config.h> -# define ZEND_PATHS_SEPARATOR ';' -#else -# include <zend_config.h> -# define ZEND_PATHS_SEPARATOR ':' -#endif - -/* Only use this macro if you know for sure that all of the switches values - are covered by its case statements */ -#if ZEND_DEBUG -# define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_ASSERT(0); break; -#elif defined(ZEND_WIN32) -# define EMPTY_SWITCH_DEFAULT_CASE() default: __assume(0); break; -#else -# define EMPTY_SWITCH_DEFAULT_CASE() -#endif - -/* all HAVE_XXX test have to be after the include of zend_config above */ - -#include <stdio.h> -#include <assert.h> - -#ifdef HAVE_UNIX_H -# include <unix.h> -#endif - -#ifdef HAVE_STDARG_H -# include <stdarg.h> -#endif - -#ifdef HAVE_DLFCN_H -# include <dlfcn.h> -#endif - -#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32) - -# ifndef RTLD_LAZY -# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */ -# endif - -# ifndef RTLD_GLOBAL -# define RTLD_GLOBAL 0 -# endif - -# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT) -# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT) -# elif defined(RTLD_DEEPBIND) -# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND) -# else -# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL) -# endif -# define DL_UNLOAD dlclose -# if defined(DLSYM_NEEDS_UNDERSCORE) -# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" s) -# else -# define DL_FETCH_SYMBOL dlsym -# endif -# define DL_ERROR dlerror -# define DL_HANDLE void * -# define ZEND_EXTENSIONS_SUPPORT 1 -#elif defined(ZEND_WIN32) -# define DL_LOAD(libname) LoadLibrary(libname) -# define DL_FETCH_SYMBOL GetProcAddress -# define DL_UNLOAD FreeLibrary -# define DL_HANDLE HMODULE -# define ZEND_EXTENSIONS_SUPPORT 1 -#else -# define DL_HANDLE void * -# define ZEND_EXTENSIONS_SUPPORT 0 -#endif - -#if HAVE_ALLOCA_H && !defined(_ALLOCA_H) -# include <alloca.h> -#endif - -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# ifndef HAVE_ALLOCA_H -# ifdef _AIX -#pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -/* Compatibility with non-clang compilers */ -#ifndef __has_attribute -# define __has_attribute(x) 0 -#endif - -/* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */ -#ifdef __GNUC__ -# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) -#else -# define ZEND_GCC_VERSION 0 -#endif - -#if ZEND_GCC_VERSION >= 2096 -# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) -#else -# define ZEND_ATTRIBUTE_MALLOC -#endif - -#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size) -# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X))) -# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y))) -#else -# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) -# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) -#endif - -/* Format string checks are disabled by default, because we use custom format modifiers (like %p), - * which cause a large amount of false positives. You can enable format checks by adding - * -DZEND_CHECK_FORMAT_STRINGS to CFLAGS. */ - -#if ZEND_GCC_VERSION >= 2007 && defined(ZEND_CHECK_FORMAT_STRINGS) -# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) -#else -# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) -#endif - -#if ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER) && defined(ZEND_CHECK_FORMAT_STRINGS) -# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) -#else -# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) -#endif - -#if ZEND_GCC_VERSION >= 3001 -# define ZEND_ATTRIBUTE_DEPRECATED __attribute__((deprecated)) -#elif defined(ZEND_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1300 -# define ZEND_ATTRIBUTE_DEPRECATED __declspec(deprecated) -#else -# define ZEND_ATTRIBUTE_DEPRECATED -#endif - -#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003 -# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused)) -# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused)); -#else -# define ZEND_ATTRIBUTE_UNUSED -# define ZEND_ATTRIBUTE_UNUSED_LABEL -#endif - -#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__) -# define ZEND_FASTCALL __attribute__((fastcall)) -#elif defined(_MSC_VER) && defined(_M_IX86) -# define ZEND_FASTCALL __fastcall -#else -# define ZEND_FASTCALL -#endif - -#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 -#else -# define __restrict__ -#endif -#define restrict __restrict__ - -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) -# define ZEND_ALLOCA_MAX_SIZE (32 * 1024) -# define ALLOCA_FLAG(name) \ - zend_bool name; -# define SET_ALLOCA_FLAG(name) \ - name = 1 -# define do_alloca_ex(size, limit, use_heap) \ - ((use_heap = (UNEXPECTED((size) > (limit)))) ? emalloc(size) : alloca(size)) -# define do_alloca(size, use_heap) \ - do_alloca_ex(size, ZEND_ALLOCA_MAX_SIZE, use_heap) -# define free_alloca(p, use_heap) \ - do { if (UNEXPECTED(use_heap)) efree(p); } while (0) -#else -# define ALLOCA_FLAG(name) -# define SET_ALLOCA_FLAG(name) -# define do_alloca(p, use_heap) emalloc(p) -# define free_alloca(p, use_heap) efree(p) -#endif - -#if ZEND_DEBUG -#define ZEND_FILE_LINE_D const char *__zend_filename, const uint __zend_lineno -#define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D -#define ZEND_FILE_LINE_ORIG_D const char *__zend_orig_filename, const uint __zend_orig_lineno -#define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D -#define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno -#define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C -#define ZEND_FILE_LINE_C __FILE__, __LINE__ -#define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C -#define ZEND_FILE_LINE_EMPTY_C NULL, 0 -#define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C -#define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno -#define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C -#define ZEND_ASSERT(c) assert(c) -#else -#define ZEND_FILE_LINE_D -#define ZEND_FILE_LINE_DC -#define ZEND_FILE_LINE_ORIG_D -#define ZEND_FILE_LINE_ORIG_DC -#define ZEND_FILE_LINE_RELAY_C -#define ZEND_FILE_LINE_RELAY_CC -#define ZEND_FILE_LINE_C -#define ZEND_FILE_LINE_CC -#define ZEND_FILE_LINE_EMPTY_C -#define ZEND_FILE_LINE_EMPTY_CC -#define ZEND_FILE_LINE_ORIG_RELAY_C -#define ZEND_FILE_LINE_ORIG_RELAY_CC -#define ZEND_ASSERT(c) -#endif /* ZEND_DEBUG */ - -#ifdef ZTS -#define ZTS_V 1 -#else -#define ZTS_V 0 -#endif +#define ZEND_MAX_RESERVED_RESOURCES 4 +#include "zend_types.h" #include "zend_errors.h" #include "zend_alloc.h" +#include "zend_hash.h" +#include "zend_llist.h" +#include "zend_string.h" +#include "zend_ast.h" +#include "zend_gc.h" +#include "zend_variables.h" +#include "zend_iterators.h" +#include "zend_stream.h" -#include "zend_types.h" - -#ifdef HAVE_LIMITS_H -# include <limits.h> -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647L -#endif - -#ifndef LONG_MIN -#define LONG_MIN (- LONG_MAX - 1) +#ifdef ZEND_SIGNALS +# include "zend_signal.h" #endif -#if SIZEOF_ZEND_LONG == 4 -#define MAX_LENGTH_OF_LONG 11 -static const char long_min_digits[] = "2147483648"; -#elif SIZEOF_ZEND_LONG == 8 -#define MAX_LENGTH_OF_LONG 20 -static const char long_min_digits[] = "9223372036854775808"; +#ifndef ZEND_SIGNALS +# define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); } +# define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); } #else -#error "Unknown SIZEOF_ZEND_LONG" +# define HANDLE_BLOCK_INTERRUPTIONS() ZEND_SIGNAL_BLOCK_INTERRUPUTIONS() +# define HANDLE_UNBLOCK_INTERRUPTIONS() ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() #endif -#define MAX_LENGTH_OF_DOUBLE 32 - -typedef enum { - SUCCESS = 0, - FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */ -} ZEND_RESULT_CODE; - -#include "zend_hash.h" -#include "zend_llist.h" - -#define INTERNAL_FUNCTION_PARAMETERS uint32_t param_count, zval *return_value TSRMLS_DC -#define INTERNAL_FUNCTION_PARAM_PASSTHRU param_count, return_value TSRMLS_CC +#define INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value TSRMLS_DC +#define INTERNAL_FUNCTION_PARAM_PASSTHRU execute_data, return_value TSRMLS_CC #define USED_RET() \ - (!EG(current_execute_data) || \ - !EG(current_execute_data)->prev_execute_data || \ - !ZEND_USER_CODE(EG(current_execute_data)->prev_execute_data->func->common.type) || \ - !(EG(current_execute_data)->prev_execute_data->opline->result_type & EXT_TYPE_UNUSED)) - -#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__) -# define ZEND_NORETURN __attribute__((noreturn)) -void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((noreturn)); -#elif defined(ZEND_WIN32) -# define ZEND_NORETURN __declspec(noreturn) + (!EX(prev_execute_data) || \ + !ZEND_USER_CODE(EX(prev_execute_data)->func->common.type) || \ + !(EX(prev_execute_data)->opline->result_type & EXT_TYPE_UNUSED)) + +#ifdef HAVE_NORETURN +# if defined(ZEND_WIN32) ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...); +# else +void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN; +# endif #else -# define ZEND_NORETURN -# define zend_error_noreturn zend_error +# define zend_error_noreturn zend_error #endif -#include "zend_object_handlers.h" - /* overloaded elements data types */ #define OE_IS_ARRAY (1<<0) #define OE_IS_OBJECT (1<<1) #define OE_IS_METHOD (1<<2) -#define Z_REFCOUNT_P(pz) zval_refcount_p(pz) -#define Z_SET_REFCOUNT_P(pz, rc) zval_set_refcount_p(pz, rc) -#define Z_ADDREF_P(pz) zval_addref_p(pz) -#define Z_DELREF_P(pz) zval_delref_p(pz) - -#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z)) -#define Z_SET_REFCOUNT(z, rc) Z_SET_REFCOUNT_P(&(z), rc) -#define Z_ADDREF(z) Z_ADDREF_P(&(z)) -#define Z_DELREF(z) Z_DELREF_P(&(z)) - -#define Z_TRY_ADDREF_P(pz) do { \ - if (Z_REFCOUNTED_P((pz))) { \ - Z_ADDREF_P((pz)); \ - } \ -} while (0) - -#define Z_TRY_DELREF_P(pz) do { \ - if (Z_REFCOUNTED_P((pz))) { \ - Z_DELREF_P((pz)); \ - } \ -} while (0) - -#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z)) -#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z)) - -#if ZEND_DEBUG -#define zend_always_inline inline -#define zend_never_inline -#else -#if defined(__GNUC__) -#if __GNUC__ >= 3 -#define zend_always_inline inline __attribute__((always_inline)) -#define zend_never_inline __attribute__((noinline)) -#else -#define zend_always_inline inline -#define zend_never_inline -#endif -#elif defined(_MSC_VER) -#define zend_always_inline __forceinline -#define zend_never_inline -#else -#define zend_always_inline inline -#define zend_never_inline -#endif -#endif /* ZEND_DEBUG */ - -#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) -# define EXPECTED(condition) __builtin_expect(!(!(condition)), 1) -# define UNEXPECTED(condition) __builtin_expect(!(!(condition)), 0) -#else -# define EXPECTED(condition) (condition) -# define UNEXPECTED(condition) (condition) -#endif - -#ifndef XtOffsetOf -# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX)) -# ifdef __STDC__ -# define XtOffset(p_type, field) _Offsetof(p_type, field) -# else -# ifdef CRAY2 -# define XtOffset(p_type, field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -# else /* !CRAY2 */ - -# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) - -# endif /* !CRAY2 */ -# endif /* __STDC__ */ -# else /* ! (CRAY || __arm) */ - -# define XtOffset(p_type, field) \ - ((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -# endif /* !CRAY */ - -# ifdef offsetof -# define XtOffsetOf(s_type, field) offsetof(s_type, field) -# else -# define XtOffsetOf(s_type, field) XtOffset(s_type*, field) -# endif - -#endif - -#include "zend_string.h" -#include "zend_ast.h" - -static zend_always_inline uint32_t zval_refcount_p(zval* pz) { - ZEND_ASSERT(Z_REFCOUNTED_P(pz) || Z_IMMUTABLE_P(pz)); - return GC_REFCOUNT(Z_COUNTED_P(pz)); -} - -static zend_always_inline uint32_t zval_set_refcount_p(zval* pz, uint32_t rc) { - ZEND_ASSERT(Z_REFCOUNTED_P(pz)); - return GC_REFCOUNT(Z_COUNTED_P(pz)) = rc; -} - -static zend_always_inline uint32_t zval_addref_p(zval* pz) { - ZEND_ASSERT(Z_REFCOUNTED_P(pz)); - return ++GC_REFCOUNT(Z_COUNTED_P(pz)); -} - -static zend_always_inline uint32_t zval_delref_p(zval* pz) { - ZEND_ASSERT(Z_REFCOUNTED_P(pz)); - return --GC_REFCOUNT(Z_COUNTED_P(pz)); -} - -/* excpt.h on Digital Unix 4.0 defines function_table */ -#undef function_table - -/* A lot of stuff needs shifiting around in order to include zend_compile.h here */ -union _zend_function; - -#include "zend_iterators.h" - struct _zend_serialize_data; struct _zend_unserialize_data; typedef struct _zend_serialize_data zend_serialize_data; typedef struct _zend_unserialize_data zend_unserialize_data; -struct _zend_trait_method_reference { +typedef struct _zend_trait_method_reference { zend_string *method_name; zend_class_entry *ce; zend_string *class_name; -}; -typedef struct _zend_trait_method_reference zend_trait_method_reference; +} zend_trait_method_reference; -struct _zend_trait_precedence { +typedef struct _zend_trait_precedence { zend_trait_method_reference *trait_method; union { zend_class_entry *ce; zend_string *class_name; } *exclude_from_classes; -}; -typedef struct _zend_trait_precedence zend_trait_precedence; +} zend_trait_precedence; -struct _zend_trait_alias { +typedef struct _zend_trait_alias { zend_trait_method_reference *trait_method; /** @@ -473,8 +107,7 @@ struct _zend_trait_alias { * modifiers to be set on trait method */ uint32_t modifiers; -}; -typedef struct _zend_trait_alias zend_trait_alias; +} zend_trait_alias; struct _zend_class_entry { char type; @@ -515,8 +148,8 @@ struct _zend_class_entry { union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method TSRMLS_DC); /* serializer callbacks */ - int (*serialize)(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); - int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC); + int (*serialize)(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC); + int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC); uint32_t num_interfaces; uint32_t num_traits; @@ -540,7 +173,6 @@ struct _zend_class_entry { } info; }; -#include "zend_stream.h" typedef struct _zend_utility_functions { void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0); size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2); @@ -567,39 +199,8 @@ typedef struct _zend_utility_values { typedef int (*zend_write_func_t)(const char *str, uint str_length); -#undef MIN -#undef MAX -#define MAX(a, b) (((a)>(b))?(a):(b)) -#define MIN(a, b) (((a)<(b))?(a):(b)) -#define ZEND_STRL(str) (str), (sizeof(str)-1) -#define ZEND_STRS(str) (str), (sizeof(str)) -#define ZEND_NORMALIZE_BOOL(n) \ - ((n) ? (((n)>0) ? 1 : -1) : 0) -#define ZEND_TRUTH(x) ((x) ? 1 : 0) -#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b)) - -int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC); -void zend_shutdown(TSRMLS_D); -void zend_register_standard_ini_entries(TSRMLS_D); -void zend_post_startup(TSRMLS_D); -void zend_set_utility_values(zend_utility_values *utility_values); - -BEGIN_EXTERN_C() -ZEND_API void _zend_bailout(char *filename, uint lineno); -END_EXTERN_C() - #define zend_bailout() _zend_bailout(__FILE__, __LINE__) -#ifdef HAVE_SIGSETJMP -# define SETJMP(a) sigsetjmp(a, 0) -# define LONGJMP(a,b) siglongjmp(a, b) -# define JMP_BUF sigjmp_buf -#else -# define SETJMP(a) setjmp(a) -# define LONGJMP(a,b) longjmp(a, b) -# define JMP_BUF jmp_buf -#endif - #define zend_try \ { \ JMP_BUF *__orig_bailout = EG(bailout); \ @@ -617,6 +218,14 @@ END_EXTERN_C() #define zend_first_try EG(bailout)=NULL; zend_try BEGIN_EXTERN_C() +int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC); +void zend_shutdown(TSRMLS_D); +void zend_register_standard_ini_entries(TSRMLS_D); +void zend_post_startup(TSRMLS_D); +void zend_set_utility_values(zend_utility_values *utility_values); + +ZEND_API void _zend_bailout(char *filename, uint lineno); + ZEND_API char *get_zend_version(void); ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC); ZEND_API int zend_print_zval(zval *expr, int indent TSRMLS_DC); @@ -625,24 +234,14 @@ ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC); ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC); ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC); ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); -END_EXTERN_C() -BEGIN_EXTERN_C() ZEND_API void zend_activate(TSRMLS_D); ZEND_API void zend_deactivate(TSRMLS_D); ZEND_API void zend_call_destructors(TSRMLS_D); ZEND_API void zend_activate_modules(TSRMLS_D); ZEND_API void zend_deactivate_modules(TSRMLS_D); ZEND_API void zend_post_deactivate_modules(TSRMLS_D); -END_EXTERN_C() - -#if ZEND_DEBUG -#define Z_DBG(expr) (expr) -#else -#define Z_DBG(expr) -#endif -BEGIN_EXTERN_C() ZEND_API void free_estring(char **str_p); ZEND_API void free_string_zval(zval *zv); END_EXTERN_C() @@ -683,16 +282,6 @@ END_EXTERN_C() #define ZEND_UV(name) (zend_uv.name) -#ifndef ZEND_SIGNALS -#define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); } -#define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); } -#else -#include "zend_signal.h" - -#define HANDLE_BLOCK_INTERRUPTIONS() ZEND_SIGNAL_BLOCK_INTERRUPUTIONS() -#define HANDLE_UNBLOCK_INTERRUPTIONS() ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() -#endif - BEGIN_EXTERN_C() ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC); @@ -708,131 +297,6 @@ END_EXTERN_C() #define ZMSG_LOG_SCRIPT_NAME 6L #define ZMSG_MEMORY_LEAKS_GRAND_TOTAL 7L -#define ZVAL_COPY_VALUE(z, v) \ - do { \ - zval *_z1 = (z); \ - zval *_z2 = (v); \ - (_z1)->value = (_z2)->value; \ - Z_TYPE_INFO_P(_z1) = Z_TYPE_INFO_P(_z2); \ - } while (0) - -#define ZVAL_COPY(z, v) \ - do { \ - zval *__z1 = (z); \ - zval *__z2 = (v); \ - ZVAL_COPY_VALUE(__z1, __z2); \ - if (Z_OPT_REFCOUNTED_P(__z1)) { \ - Z_ADDREF_P(__z1); \ - } \ - } while (0) - -#define ZVAL_DUP(z, v) \ - do { \ - zval *__z1 = (z); \ - zval *__z2 = (v); \ - ZVAL_COPY_VALUE(__z1, __z2); \ - zval_opt_copy_ctor(__z1); \ - } while (0) - -#define ZVAL_DEREF(z) do { \ - if (UNEXPECTED(Z_ISREF_P(z))) { \ - (z) = Z_REFVAL_P(z); \ - } \ - } while (0) - -#define ZVAL_MAKE_REF(zv) do { \ - zval *__zv = (zv); \ - if (!Z_ISREF_P(__zv)) { \ - ZVAL_NEW_REF(__zv, __zv); \ - } \ - } while (0) - -#define ZVAL_UNREF(z) do { \ - zval *_z = (z); \ - zend_reference *ref; \ - ZEND_ASSERT(Z_ISREF_P(_z)); \ - ref = Z_REF_P(_z); \ - ZVAL_COPY_VALUE(_z, &ref->val); \ - efree_size(ref, sizeof(zend_reference)); \ - } while (0) - -#define SEPARATE_STRING(zv) do { \ - zval *_zv = (zv); \ - if (Z_REFCOUNTED_P(_zv) && \ - Z_REFCOUNT_P(_zv) > 1) { \ - Z_DELREF_P(_zv); \ - zval_copy_ctor_func(_zv); \ - } \ - } while (0) - -#define SEPARATE_ARRAY(zv) do { \ - zval *_zv = (zv); \ - if (Z_REFCOUNT_P(_zv) > 1) { \ - if (!Z_IMMUTABLE_P(_zv)) { \ - Z_DELREF_P(_zv); \ - } \ - zval_copy_ctor_func(_zv); \ - } \ - } while (0) - -#define SEPARATE_ZVAL_NOREF(zv) do { \ - zval *_zv = (zv); \ - if (Z_COPYABLE_P(_zv) || \ - Z_IMMUTABLE_P(_zv)) { \ - if (Z_REFCOUNT_P(_zv) > 1) { \ - if (!Z_IMMUTABLE_P(_zv)) { \ - Z_DELREF_P(_zv); \ - } \ - zval_copy_ctor_func(_zv); \ - } \ - } \ - } while (0) - -#define SEPARATE_ZVAL(zv) do { \ - zval *_zv = (zv); \ - if (Z_REFCOUNTED_P(_zv) || \ - Z_IMMUTABLE_P(_zv)) { \ - if (Z_REFCOUNT_P(_zv) > 1) { \ - if (Z_COPYABLE_P(_zv) || \ - Z_IMMUTABLE_P(_zv)) { \ - if (!Z_IMMUTABLE_P(_zv)) { \ - Z_DELREF_P(_zv); \ - } \ - zval_copy_ctor_func(_zv); \ - } else if (Z_ISREF_P(_zv)) { \ - Z_DELREF_P(_zv); \ - ZVAL_DUP(_zv, Z_REFVAL_P(_zv)); \ - } \ - } \ - } \ - } while (0) - -#define SEPARATE_ZVAL_IF_NOT_REF(zv) do { \ - zval *_zv = (zv); \ - if (Z_COPYABLE_P(_zv) || \ - Z_IMMUTABLE_P(_zv)) { \ - if (Z_REFCOUNT_P(_zv) > 1) { \ - if (!Z_IMMUTABLE_P(_zv)) { \ - Z_DELREF_P(_zv); \ - } \ - zval_copy_ctor_func(_zv); \ - } \ - } \ - } while (0) - -#define SEPARATE_ARG_IF_REF(varptr) do { \ - ZVAL_DEREF(varptr); \ - if (Z_REFCOUNTED_P(varptr)) { \ - Z_ADDREF_P(varptr); \ - } \ - } while (0) - -#define ZEND_MAX_RESERVED_RESOURCES 4 - -#include "zend_gc.h" -#include "zend_operators.h" -#include "zend_variables.h" - typedef enum { EH_NORMAL = 0, EH_SUPPRESS, @@ -852,6 +316,9 @@ ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC); #define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0) #define DEBUG_BACKTRACE_IGNORE_ARGS (1<<1) +#include "zend_object_handlers.h" +#include "zend_operators.h" + #endif /* ZEND_H */ /* diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 05d49b8f59..b965d20991 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -27,6 +27,7 @@ #include "zend_constants.h" #include "zend_exceptions.h" #include "zend_closures.h" +#include "zend_inheritance.h" #ifdef HAVE_STDARG_H #include <stdarg.h> @@ -1144,9 +1145,8 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC) if (key) { zval member; - ZVAL_STR(&member, zend_string_copy(key)); + ZVAL_STR(&member, key); obj_ht->write_property(obj, &member, value, NULL TSRMLS_CC); - zval_ptr_dtor(&member); } } ZEND_HASH_FOREACH_END(); EG(scope) = old_scope; @@ -1268,13 +1268,12 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti { object->properties = properties; if (object->ce->default_properties_count) { - zval *prop, tmp; + zval *prop; zend_string *key; zend_property_info *property_info; ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) { - ZVAL_STR(&tmp, key); - property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC); + property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC); if (property_info && (property_info->flags & ZEND_ACC_STATIC) == 0 && property_info->offset >= 0) { @@ -1293,8 +1292,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties zend_property_info *property_info; ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) { - ZVAL_STR(&tmp, key); - property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC); + property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC); if (property_info && (property_info->flags & ZEND_ACC_STATIC) == 0 && property_info->offset >= 0) { @@ -1303,7 +1301,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties zval_add_ref(&object->properties_table[property_info->offset]); if (object->properties) { ZVAL_INDIRECT(&tmp, &object->properties_table[property_info->offset]); - prop = zend_hash_update(object->properties, key, &tmp); + zend_hash_update(object->properties, key, &tmp); } } else { if (!object->properties) { @@ -2280,7 +2278,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio /* If types of arguments have to be checked */ if (reg_function->common.arg_info && reg_function->common.num_args) { - int i; + uint32_t i; for (i = 0; i < reg_function->common.num_args; i++) { if (reg_function->common.arg_info[i].class_name || reg_function->common.arg_info[i].type_hint) { @@ -2856,8 +2854,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache } else { fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL; fcc->calling_scope = EG(scope); - if (!fcc->object && Z_OBJ(EG(This))) { - fcc->object = Z_OBJ(EG(This)); + if (!fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This)) { + fcc->object = Z_OBJ(EG(current_execute_data)->This); } ret = 1; } @@ -2869,8 +2867,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache } else { fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL; fcc->calling_scope = EG(scope)->parent; - if (!fcc->object && Z_OBJ(EG(This))) { - fcc->object = Z_OBJ(EG(This)); + if (!fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This)) { + fcc->object = Z_OBJ(EG(current_execute_data)->This); } *strict_class = 1; ret = 1; @@ -2881,8 +2879,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache } else { fcc->called_scope = EG(current_execute_data)->called_scope; fcc->calling_scope = EG(current_execute_data)->called_scope; - if (!fcc->object && Z_OBJ(EG(This))) { - fcc->object = Z_OBJ(EG(This)); + if (!fcc->object && Z_OBJ(EG(current_execute_data)->This)) { + fcc->object = Z_OBJ(EG(current_execute_data)->This); } *strict_class = 1; ret = 1; @@ -2896,11 +2894,11 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache } scope = ex ? ex->func->common.scope : NULL; fcc->calling_scope = ce; - if (scope && !fcc->object && Z_OBJ(EG(This)) && - instanceof_function(Z_OBJCE(EG(This)), scope TSRMLS_CC) && + if (scope && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && + instanceof_function(Z_OBJCE(EG(current_execute_data)->This), scope TSRMLS_CC) && instanceof_function(scope, fcc->calling_scope TSRMLS_CC)) { - fcc->object = Z_OBJ(EG(This)); - fcc->called_scope = Z_OBJCE(EG(This)); + fcc->object = Z_OBJ(EG(current_execute_data)->This); + fcc->called_scope = Z_OBJCE(EG(current_execute_data)->This); } else { fcc->called_scope = fcc->object ? zend_get_class_entry(fcc->object TSRMLS_CC) : fcc->calling_scope; } @@ -3101,10 +3099,10 @@ get_function_via_handler: if (fcc->function_handler) { retval = 1; call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0; - if (call_via_handler && !fcc->object && Z_OBJ(EG(This)) && - Z_OBJ_HT(EG(This))->get_class_entry && - instanceof_function(Z_OBJCE(EG(This)), fcc->calling_scope TSRMLS_CC)) { - fcc->object = Z_OBJ(EG(This)); + if (call_via_handler && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && + Z_OBJ_HT(EG(current_execute_data)->This)->get_class_entry && + instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) { + fcc->object = Z_OBJ(EG(current_execute_data)->This); } } } @@ -3133,15 +3131,15 @@ get_function_via_handler: if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) { retval = 0; } - if (Z_OBJ(EG(This)) && instanceof_function(Z_OBJCE(EG(This)), fcc->calling_scope TSRMLS_CC)) { - fcc->object = Z_OBJ(EG(This)); + if (EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) { + fcc->object = Z_OBJ(EG(current_execute_data)->This); if (error) { - zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(This))->name->val); + zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val); if (severity == E_ERROR) { retval = 0; } } else if (retval) { - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(This))->name->val); + zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val); } } else { if (error) { @@ -3450,7 +3448,7 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_i ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem) /* {{{ */ { if (fci->params) { - int i; + uint32_t i; for (i = 0; i < fci->param_count; i++) { zval_ptr_dtor(&fci->params[i]); @@ -3484,7 +3482,7 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args TSRMLS_DC) /* {{{ */ { zval *arg, *params; - int n = 1; + uint32_t n = 1; zend_fcall_info_args_clear(fci, !args); @@ -3928,9 +3926,11 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na zval garbage; ZVAL_COPY_VALUE(&garbage, property); - Z_ADDREF_P(value); - if (Z_ISREF_P(value)) { - SEPARATE_ZVAL(value); + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + if (Z_ISREF_P(value)) { + SEPARATE_ZVAL(value); + } } ZVAL_COPY_VALUE(property, value); zval_ptr_dtor(&garbage); @@ -4147,6 +4147,39 @@ ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_functi } /* }}} */ +ZEND_API void zend_ctor_make_null(zend_execute_data *execute_data) /* {{{ */ +{ + if (EX(return_value)) { +/* + if (Z_TYPE_P(EX(return_value)) == IS_OBJECT) { + zend_object *object = Z_OBJ_P(EX(return_value)); + zend_execute_data *ex = EX(prev_execute_data); + + while (ex && Z_OBJ(ex->This) == object) { + if (ex->func) { + if (ZEND_USER_CODE(ex->func->type)) { + if (ex->func->op_array.this_var != -1) { + zval *this_var = EX_VAR_2(ex, ex->func->op_array.this_var); + if (this_var != EX(return_value)) { + zval_ptr_dtor(this_var); + ZVAL_NULL(this_var); + } + } + } + } + Z_OBJ(ex->This) = NULL; + ZVAL_NULL(&ex->This); + ex = ex->prev_execute_data; + } + } +*/ + zval_ptr_dtor(EX(return_value)); + Z_OBJ_P(EX(return_value)) = NULL; + ZVAL_NULL(EX(return_value)); + } +} +/* }}} */ + /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 616934fcd2..730e1b9e14 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -46,10 +46,10 @@ typedef struct _zend_fcall_info { zval function_name; zend_array *symbol_table; zval *retval; - uint32_t param_count; zval *params; zend_object *object; zend_bool no_separation; + uint32_t param_count; } zend_fcall_info; typedef struct _zend_fcall_info_cache { @@ -343,12 +343,12 @@ ZEND_API zend_class_entry *zend_get_class_entry(const zend_object *object TSRMLS ZEND_API zend_string *zend_get_object_classname(const zend_object *object TSRMLS_DC); ZEND_API char *zend_get_type_by_const(int type); -#define getThis() (Z_OBJ(EG(This)) ? &EG(This) : NULL) +#define getThis() (Z_OBJ(EX(This)) ? &EX(This) : NULL) #define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT() #define WRONG_PARAM_COUNT_WITH_RETVAL(ret) ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) -#define ARG_COUNT(dummy) (param_count) -#define ZEND_NUM_ARGS() (param_count) +#define ARG_COUNT(dummy) EX(num_args) +#define ZEND_NUM_ARGS() EX(num_args) #define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(TSRMLS_C); return; } #define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) { zend_wrong_param_count(TSRMLS_C); return ret; } @@ -531,6 +531,8 @@ ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int ZEND_API zend_string *zend_find_alias_name(zend_class_entry *ce, zend_string *name); ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f); +ZEND_API void zend_ctor_make_null(zend_execute_data *execute_data); + #define add_method(arg, key, method) add_assoc_function((arg), (key), (method)) ZEND_API ZEND_FUNCTION(display_disabled_function); @@ -639,26 +641,8 @@ END_EXTERN_C() } while (0) /* May be used in internal constructors to make them return NULL */ -#if 1 // support for directly called constructors only ??? -#define ZEND_CTOR_MAKE_NULL() do { \ - if (EG(current_execute_data)->return_value) { \ - zval_ptr_dtor(EG(current_execute_data)->return_value); \ - ZVAL_NULL(EG(current_execute_data)->return_value); \ - } \ - } while (0) -#else // attempt to support calls to parent::__construct() ??? - // see: ext/date/tests/bug67118.phpt -#define ZEND_CTOR_MAKE_NULL() do { \ - if (EG(current_execute_data)->return_value) { \ - zval_ptr_dtor(EG(current_execute_data)->return_value); \ - ZVAL_NULL(EG(current_execute_data)->return_value); \ - } else if (EG(current_execute_data)->prev_execute_data && \ - EG(current_execute_data)->prev_execute_data->object == \ - EG(current_execute_data)->object) { \ - EG(current_execute_data)->prev_execute_data->object = NULL; \ - } \ - } while (0) -#endif +#define ZEND_CTOR_MAKE_NULL() \ + zend_ctor_make_null(execute_data) #define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; } @@ -729,7 +713,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec const int _flags = (flags); \ int _min_num_args = (min_num_args); \ int _max_num_args = (max_num_args); \ - int _num_args = EG(current_execute_data)->num_args; \ + int _num_args = EX(num_args); \ int _i; \ zval *_real_arg, *_arg = NULL; \ zend_expected_type _expected_type = IS_UNDEF; \ @@ -756,7 +740,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec break; \ } \ _i = 0; \ - _real_arg = ZEND_CALL_ARG(EG(current_execute_data), 0); + _real_arg = ZEND_CALL_ARG(execute_data, 0); #define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args) \ ZEND_PARSE_PARAMETERS_START_EX(0, min_num_args, max_num_args) @@ -1193,7 +1177,7 @@ static zend_always_inline int _z_param_string(zval *arg, char **dest, size_t *de static zend_always_inline int _z_param_path_str(zval *arg, zend_string **dest, int check_null TSRMLS_DC) { if (!_z_param_str(arg, dest, check_null TSRMLS_CC) || - (check_null && UNEXPECTED(!(*dest)->val)) || + (check_null && UNEXPECTED(!(*dest)->val[0])) || UNEXPECTED(CHECK_NULL_PATH((*dest)->val, (*dest)->len))) { return 0; } diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 00cdd04647..ac403617a6 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -57,6 +57,7 @@ #include "zend_alloc.h" #include "zend_globals.h" #include "zend_operators.h" +#include "zend_multiply.h" #ifdef HAVE_SIGNAL_H # include <signal.h> @@ -372,6 +373,30 @@ static ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap, exit(1); } +#ifdef _WIN32 +void +stderr_last_error(char *msg) +{ + LPSTR buf = NULL; + DWORD err = GetLastError(); + + if (!FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + err, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&buf, + 0, NULL)) { + fprintf(stderr, "\n%s: [0x%08x]\n", msg, err); + } + else { + fprintf(stderr, "\n%s: [0x%08x] %s\n", msg, err, buf); + } +} +#endif + /*****************/ /* OS Allocation */ /*****************/ @@ -408,7 +433,7 @@ static void *zend_mm_mmap(size_t size) if (ptr == NULL) { #if ZEND_MM_ERROR - fprintf(stderr, "\nVirtualAlloc() failed: [%d]\n", GetLastError()); + stderr_last_error("VirtualAlloc() failed"); #endif return NULL; } @@ -431,7 +456,7 @@ static void zend_mm_munmap(void *addr, size_t size) #ifdef _WIN32 if (VirtualFree(addr, 0, MEM_RELEASE) == 0) { #if ZEND_MM_ERROR - fprintf(stderr, "\nVirtualFree() failed: [%d]\n", GetLastError()); + stderr_last_error("VirtualFree() failed"); #endif } #else @@ -452,6 +477,19 @@ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset) { #if defined(__GNUC__) return __builtin_ctzl(~bitset); +#elif defined(_WIN32) + unsigned long index; + +#if defined(_WIN64) + if (!BitScanForward64(&index, ~bitset)) { +#else + if (!BitScanForward(&index, ~bitset)) { +#endif + /* undefined behavior */ + return 32; + } + + return (int)index; #else int n; @@ -476,6 +514,19 @@ static zend_always_inline int zend_mm_bitset_ntz(zend_mm_bitset bitset) { #if defined(__GNUC__) return __builtin_ctzl(bitset); +#elif defined(_WIN32) + unsigned long index; + +#if defined(_WIN64) + if (!BitScanForward64(&index, bitset)) { +#else + if (!BitScanForward(&index, bitset)) { +#endif + /* undefined behavior */ + return 32; + } + + return (int)index; #else int n; @@ -882,6 +933,13 @@ not_found: chunk = (zend_mm_chunk*)zend_mm_chunk_alloc(ZEND_MM_CHUNK_SIZE, ZEND_MM_CHUNK_SIZE); if (UNEXPECTED(chunk == NULL)) { /* insufficient memory */ +#if !ZEND_MM_LIMIT + zend_mm_safe_error(heap, "Out of memory"); +#elif ZEND_DEBUG + zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %lu bytes)", heap->real_size, __zend_filename, __zend_lineno, size); +#else + zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %lu bytes)", heap->real_size, ZEND_MM_PAGE_SIZE * pages_count); +#endif return NULL; } #if ZEND_MM_STAT @@ -991,6 +1049,15 @@ static zend_always_inline int zend_mm_small_size_to_bit(int size) { #if defined(__GNUC__) return (__builtin_clz(size) ^ 0x1f) + 1; +#elif defined(_WIN32) + unsigned long index; + + if (!BitScanReverse(&index, (unsigned long)size)) { + /* undefined behavior */ + return 64; + } + + return (((31 - (int)index) ^ 0x1f) + 1); #else int n = 16; if (size <= 0x00ff) {n -= 8; size = size << 8;} @@ -1545,6 +1612,13 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D ptr = zend_mm_chunk_alloc(new_size, ZEND_MM_CHUNK_SIZE); if (UNEXPECTED(ptr == NULL)) { /* insufficient memory */ +#if !ZEND_MM_LIMIT + zend_mm_safe_error(heap, "Out of memory"); +#elif ZEND_DEBUG + zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %lu bytes)", heap->real_size, __zend_filename, __zend_lineno, size); +#else + zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %lu bytes)", heap->real_size, size); +#endif return NULL; } #if ZEND_DEBUG @@ -1597,8 +1671,12 @@ zend_mm_heap *zend_mm_init(void) if (UNEXPECTED(chunk == NULL)) { #if ZEND_MM_ERROR +#ifdef _WIN32 + stderr_last_error("Can't initialize heap"); +#else fprintf(stderr, "\nCan't initialize heap: [%d] %s\n", errno, strerror(errno)); #endif +#endif return NULL; } heap = &chunk->heap_slot; @@ -2079,124 +2157,17 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } -#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) - -static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) +static zend_always_inline size_t safe_address(size_t nmemb, size_t size, size_t offset) { - size_t res = nmemb; - zend_ulong overflow = 0; - - __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1" - : "=&a"(res), "=&d" (overflow) - : "%0"(res), - "rm"(size), - "rm"(offset)); + int overflow; + size_t ret = zend_safe_address(nmemb, size, offset, &overflow); if (UNEXPECTED(overflow)) { zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); return 0; } - return res; -} - -#elif defined(__GNUC__) && defined(__x86_64__) - -static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -{ - size_t res = nmemb; - zend_ulong overflow = 0; - -#ifdef __ILP32__ /* x32 */ -# define LP_SUFF "l" -#else /* amd64 */ -# define LP_SUFF "q" -#endif - - __asm__ ("mul" LP_SUFF " %3\n\t" - "add %4,%0\n\t" - "adc $0,%1" - : "=&a"(res), "=&d" (overflow) - : "%0"(res), - "rm"(size), - "rm"(offset)); - -#undef LP_SUFF - if (UNEXPECTED(overflow)) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); - return 0; - } - return res; -} - -#elif defined(__GNUC__) && defined(__arm__) - -static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -{ - size_t res; - zend_ulong overflow; - - __asm__ ("umlal %0,%1,%2,%3" - : "=r"(res), "=r"(overflow) - : "r"(nmemb), - "r"(size), - "0"(offset), - "1"(0)); - - if (UNEXPECTED(overflow)) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); - return 0; - } - return res; -} - -#elif defined(__GNUC__) && defined(__aarch64__) - -static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -{ - size_t res; - zend_ulong overflow; - - __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr" - : "=&r"(res), "=&r"(overflow) - : "r"(nmemb), - "r"(size), - "r"(offset)); - - if (UNEXPECTED(overflow)) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); - return 0; - } - return res; -} - -#elif SIZEOF_SIZE_T == 4 && defined(HAVE_ZEND_LONG64) - -static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -{ - zend_ulong64 res = (zend_ulong64)nmemb * (zend_ulong64)size + (zend_ulong64)offset; - - if (UNEXPECTED(res > (zend_ulong64)0xFFFFFFFFL)) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); - return 0; - } - return (size_t) res; -} - -#else - -static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -{ - size_t res = nmemb * size + offset; - double _d = (double)nmemb * (double)size + (double)offset; - double _delta = (double)res - _d; - - if (UNEXPECTED((_d + _delta ) != _d)) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); - return 0; - } - return res; + return ret; } -#endif ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index d6d3415dd5..d50d3d5cb8 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -45,8 +45,8 @@ typedef struct _zend_leak_info { void *addr; size_t size; const char *filename; - uint lineno; const char *orig_filename; + uint lineno; uint orig_lineno; } zend_leak_info; @@ -164,7 +164,7 @@ ZEND_API void ZEND_FASTCALL _efree_huge(void *, size_t size); #define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) #define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -inline static void * __zend_malloc(size_t len) +zend_always_inline static void * __zend_malloc(size_t len) { void *tmp = malloc(len); if (tmp) { @@ -174,14 +174,14 @@ inline static void * __zend_malloc(size_t len) exit(1); } -inline static void * __zend_calloc(size_t nmemb, size_t len) +zend_always_inline static void * __zend_calloc(size_t nmemb, size_t len) { void *tmp = _safe_malloc(nmemb, len, 0); memset(tmp, 0, nmemb * len); return tmp; } -inline static void * __zend_realloc(void *p, size_t len) +zend_always_inline static void * __zend_realloc(void *p, size_t len) { p = realloc(p, len); if (p) { diff --git a/Zend/zend_arena.h b/Zend/zend_arena.h index 8988eb4ab5..64fde19619 100644 --- a/Zend/zend_arena.h +++ b/Zend/zend_arena.h @@ -80,13 +80,14 @@ static zend_always_inline void* zend_arena_alloc(zend_arena **arena_ptr, size_t static zend_always_inline void* zend_arena_calloc(zend_arena **arena_ptr, size_t count, size_t unit_size) { - zend_long overflow; - double d; + int overflow; size_t size; void *ret; - ZEND_SIGNED_MULTIPLY_LONG(unit_size, count, size, d, overflow); - ZEND_ASSERT(overflow == 0); + size = zend_safe_address(unit_size, count, 0, &overflow); + if (UNEXPECTED(overflow)) { + zend_error(E_ERROR, "Possible integer overflow in zend_arena_calloc() (%zu * %zu)", unit_size, count); + } ret = zend_arena_alloc(arena_ptr, size); memset(ret, 0, size); return ret; diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 8c9607fcff..9604079a9e 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -163,7 +163,7 @@ ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind ki } static inline zend_bool is_power_of_two(uint32_t n) { - return n == (n & -n); + return ((n != 0) && (n == (n & (~n + 1)))); } ZEND_API zend_ast *zend_ast_list_add(zend_ast *ast, zend_ast *op) { diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h index 2a1582ca24..6bd6850d83 100644 --- a/Zend/zend_ast.h +++ b/Zend/zend_ast.h @@ -115,6 +115,7 @@ enum _zend_ast_kind { ZEND_AST_NEW, ZEND_AST_INSTANCEOF, ZEND_AST_YIELD, + ZEND_AST_COALESCE, ZEND_AST_STATIC, ZEND_AST_WHILE, @@ -207,27 +208,29 @@ ZEND_API void zend_ast_destroy_and_free(zend_ast *ast); typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr TSRMLS_DC); ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn TSRMLS_DC); -static inline zend_bool zend_ast_is_list(zend_ast *ast) { +static zend_always_inline zend_bool zend_ast_is_list(zend_ast *ast) { return (ast->kind >> ZEND_AST_IS_LIST_SHIFT) & 1; } -static inline zend_ast_list *zend_ast_get_list(zend_ast *ast) { +static zend_always_inline zend_ast_list *zend_ast_get_list(zend_ast *ast) { ZEND_ASSERT(zend_ast_is_list(ast)); return (zend_ast_list *) ast; } -static inline zval *zend_ast_get_zval(zend_ast *ast) { +static zend_always_inline zval *zend_ast_get_zval(zend_ast *ast) { ZEND_ASSERT(ast->kind == ZEND_AST_ZVAL); return &((zend_ast_zval *) ast)->val; } -static inline zend_string *zend_ast_get_str(zend_ast *ast) { - return Z_STR_P(zend_ast_get_zval(ast)); +static zend_always_inline zend_string *zend_ast_get_str(zend_ast *ast) { + zval *zv = zend_ast_get_zval(ast); + ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING); + return Z_STR_P(zv); } -static inline uint32_t zend_ast_get_num_children(zend_ast *ast) { +static zend_always_inline uint32_t zend_ast_get_num_children(zend_ast *ast) { ZEND_ASSERT(!zend_ast_is_list(ast)); return ast->kind >> ZEND_AST_NUM_CHILDREN_SHIFT; } -static inline uint32_t zend_ast_get_lineno(zend_ast *ast) { +static zend_always_inline uint32_t zend_ast_get_lineno(zend_ast *ast) { if (ast->kind == ZEND_AST_ZVAL) { zval *zv = zend_ast_get_zval(ast); return zv->u2.lineno; @@ -236,27 +239,27 @@ static inline uint32_t zend_ast_get_lineno(zend_ast *ast) { } } -static inline zend_ast *zend_ast_create_zval(zval *zv) { +static zend_always_inline zend_ast *zend_ast_create_zval(zval *zv) { return zend_ast_create_zval_ex(zv, 0); } -static inline zend_ast *zend_ast_create_zval_from_str(zend_string *str) { +static zend_always_inline zend_ast *zend_ast_create_zval_from_str(zend_string *str) { zval zv; ZVAL_STR(&zv, str); return zend_ast_create_zval(&zv); } -static inline zend_ast *zend_ast_create_zval_from_long(zend_long lval) { +static zend_always_inline zend_ast *zend_ast_create_zval_from_long(zend_long lval) { zval zv; ZVAL_LONG(&zv, lval); return zend_ast_create_zval(&zv); } -static inline zend_ast *zend_ast_create_binary_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) { +static zend_always_inline zend_ast *zend_ast_create_binary_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) { return zend_ast_create_ex(ZEND_AST_BINARY_OP, opcode, op0, op1); } -static inline zend_ast *zend_ast_create_assign_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) { +static zend_always_inline zend_ast *zend_ast_create_assign_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) { return zend_ast_create_ex(ZEND_AST_ASSIGN_OP, opcode, op0, op1); } -static inline zend_ast *zend_ast_create_cast(uint32_t type, zend_ast *op0) { +static zend_always_inline zend_ast *zend_ast_create_cast(uint32_t type, zend_ast *op0) { return zend_ast_create_ex(ZEND_AST_CAST, type, op0); } diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index f320585e70..728d90acdf 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -400,7 +400,7 @@ ZEND_FUNCTION(gc_disable) Get the number of arguments that were passed to the function */ ZEND_FUNCTION(func_num_args) { - zend_execute_data *ex = EG(current_execute_data)->prev_execute_data; + zend_execute_data *ex = EX(prev_execute_data); if (ex->frame_kind == VM_FRAME_NESTED_FUNCTION || ex->frame_kind == VM_FRAME_TOP_FUNCTION) { RETURN_LONG(ex->num_args); @@ -415,7 +415,7 @@ ZEND_FUNCTION(func_num_args) Get the $arg_num'th argument that was passed to the function */ ZEND_FUNCTION(func_get_arg) { - int arg_count, first_extra_arg; + uint32_t arg_count, first_extra_arg; zval *arg; zend_long requested_offset; zend_execute_data *ex; @@ -429,7 +429,7 @@ ZEND_FUNCTION(func_get_arg) RETURN_FALSE; } - ex = EG(current_execute_data)->prev_execute_data; + ex = EX(prev_execute_data); if (ex->frame_kind != VM_FRAME_NESTED_FUNCTION && ex->frame_kind != VM_FRAME_TOP_FUNCTION) { zend_error(E_WARNING, "func_get_arg(): Called from the global scope - no function context"); RETURN_FALSE; @@ -460,9 +460,9 @@ ZEND_FUNCTION(func_get_arg) ZEND_FUNCTION(func_get_args) { zval *p; - int arg_count, first_extra_arg; - int i; - zend_execute_data *ex = EG(current_execute_data)->prev_execute_data; + uint32_t arg_count, first_extra_arg; + uint32_t i; + zend_execute_data *ex = EX(prev_execute_data); if (ex->frame_kind != VM_FRAME_NESTED_FUNCTION && ex->frame_kind != VM_FRAME_TOP_FUNCTION) { zend_error(E_WARNING, "func_get_args(): Called from the global scope - no function context"); @@ -539,7 +539,6 @@ ZEND_FUNCTION(strlen) } /* }}} */ - /* {{{ proto int strcmp(string str1, string str2) Binary safe string comparison */ ZEND_FUNCTION(strcmp) @@ -554,7 +553,6 @@ ZEND_FUNCTION(strcmp) } /* }}} */ - /* {{{ proto int strncmp(string str1, string str2, int len) Binary safe string comparison */ ZEND_FUNCTION(strncmp) @@ -575,7 +573,6 @@ ZEND_FUNCTION(strncmp) } /* }}} */ - /* {{{ proto int strcasecmp(string str1, string str2) Binary safe case-insensitive string comparison */ ZEND_FUNCTION(strcasecmp) @@ -590,7 +587,6 @@ ZEND_FUNCTION(strcasecmp) } /* }}} */ - /* {{{ proto int strncasecmp(string str1, string str2, int len) Binary safe string comparison */ ZEND_FUNCTION(strncasecmp) @@ -611,7 +607,6 @@ ZEND_FUNCTION(strncasecmp) } /* }}} */ - /* {{{ proto array each(array arr) Return the currently pointed key..value pair in the passed array, and advance the pointer to the next element */ ZEND_FUNCTION(each) @@ -660,7 +655,7 @@ ZEND_FUNCTION(each) /* add the key elements */ if (zend_hash_get_current_key(target_hash, &key, &num_key, 0) == HASH_KEY_IS_STRING) { - ZVAL_STR(&tmp, zend_string_copy(key)); + ZVAL_STR_COPY(&tmp, key); if (Z_REFCOUNTED(tmp)) Z_ADDREF(tmp); } else { ZVAL_LONG(&tmp, num_key); @@ -671,7 +666,6 @@ ZEND_FUNCTION(each) } /* }}} */ - /* {{{ proto int error_reporting([int new_error_level]) Return the current error_reporting level, and if an argument was passed - change to the new level */ ZEND_FUNCTION(error_reporting) @@ -694,7 +688,6 @@ ZEND_FUNCTION(error_reporting) } /* }}} */ - /* {{{ proto bool define(string constant_name, mixed value, boolean case_insensitive=false) Define a new constant */ ZEND_FUNCTION(define) @@ -774,7 +767,6 @@ repeat: } /* }}} */ - /* {{{ proto bool defined(string constant_name) Check whether a constant exists Warning: This function is special-cased by zend_compile.c and so is usually bypassed */ @@ -800,7 +792,6 @@ ZEND_FUNCTION(defined) } /* }}} */ - /* {{{ proto string get_class([object object]) Retrieves the class name */ ZEND_FUNCTION(get_class) @@ -824,7 +815,6 @@ ZEND_FUNCTION(get_class) } /* }}} */ - /* {{{ proto string get_called_class() Retrieves the "Late Static Binding" class name */ ZEND_FUNCTION(get_called_class) @@ -833,8 +823,8 @@ ZEND_FUNCTION(get_called_class) return; } - if (EG(current_execute_data)->called_scope) { - RETURN_STR(zend_string_copy(EG(current_execute_data)->called_scope->name)); + if (EX(called_scope)) { + RETURN_STR(zend_string_copy(EX(called_scope)->name)); } else if (!EG(scope)) { zend_error(E_WARNING, "get_called_class() called from outside a class"); } @@ -842,7 +832,6 @@ ZEND_FUNCTION(get_called_class) } /* }}} */ - /* {{{ proto string get_parent_class([mixed object]) Retrieves the parent class name for object or class or current scope. */ ZEND_FUNCTION(get_parent_class) @@ -883,8 +872,7 @@ ZEND_FUNCTION(get_parent_class) } /* }}} */ - -static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) +static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /* {{{ */ { zval *obj; zend_string *class_name; @@ -936,7 +924,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) RETURN_BOOL(retval); } - +/* }}} */ /* {{{ proto bool is_subclass_of(mixed object_or_string, string class_name [, bool allow_string=true]) Returns true if the object has this class as one of its parents */ @@ -946,7 +934,6 @@ ZEND_FUNCTION(is_subclass_of) } /* }}} */ - /* {{{ proto bool is_a(mixed object_or_string, string class_name [, bool allow_string=false]) Returns true if the first argument is an object and is this class or has this class as one of its parents, */ ZEND_FUNCTION(is_a) @@ -955,7 +942,6 @@ ZEND_FUNCTION(is_a) } /* }}} */ - /* {{{ add_class_vars */ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value TSRMLS_DC) { @@ -1003,7 +989,6 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value } /* }}} */ - /* {{{ proto array get_class_vars(string class_name) Returns an array of default properties of the class. */ ZEND_FUNCTION(get_class_vars) @@ -1027,7 +1012,6 @@ ZEND_FUNCTION(get_class_vars) } /* }}} */ - /* {{{ proto array get_object_vars(object obj) Returns an array of object properties */ ZEND_FUNCTION(get_object_vars) @@ -1036,8 +1020,6 @@ ZEND_FUNCTION(get_object_vars) zval *value; HashTable *properties; zend_string *key; - const char *prop_name, *class_name; - uint prop_len; zend_object *zobj; #ifndef FAST_ZPP @@ -1070,7 +1052,9 @@ ZEND_FUNCTION(get_object_vars) /* Not separating references */ if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); if (key->val[0] == 0) { - zend_unmangle_property_name_ex(key->val, key->len, &class_name, &prop_name, (int*) &prop_len); + const char *prop_name, *class_name; + size_t prop_len; + zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len); zend_hash_str_add_new(Z_ARRVAL_P(return_value), prop_name, prop_len, value); } else { zend_hash_add_new(Z_ARRVAL_P(return_value), key, value); @@ -1081,13 +1065,14 @@ ZEND_FUNCTION(get_object_vars) } /* }}} */ -static int same_name(const char *key, const char *name, uint32_t name_len) +static int same_name(const char *key, const char *name, uint32_t name_len) /* {{{ */ { char *lcname = zend_str_tolower_dup(name, name_len); int ret = memcmp(lcname, key, name_len) == 0; efree(lcname); return ret; } +/* }}} */ /* {{{ proto array get_class_methods(mixed class) Returns an array of method names for class or class instance. */ @@ -1131,7 +1116,7 @@ ZEND_FUNCTION(get_class_methods) /* Do not display old-style inherited constructors */ if (!key) { - ZVAL_STR(&method_name, zend_string_copy(mptr->common.function_name)); + ZVAL_STR_COPY(&method_name, mptr->common.function_name); zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &method_name); } else if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 || mptr->common.scope == ce || @@ -1141,10 +1126,10 @@ ZEND_FUNCTION(get_class_methods) *mptr->op_array.refcount > 1 && (len != key->len || !same_name(key->val, mptr->common.function_name->val, len))) { - ZVAL_STR(&method_name, zend_string_copy(zend_find_alias_name(mptr->common.scope, key))); + ZVAL_STR_COPY(&method_name, zend_find_alias_name(mptr->common.scope, key)); zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &method_name); } else { - ZVAL_STR(&method_name, zend_string_copy(mptr->common.function_name)); + ZVAL_STR_COPY(&method_name, mptr->common.function_name); zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &method_name); } } @@ -1153,7 +1138,6 @@ ZEND_FUNCTION(get_class_methods) } /* }}} */ - /* {{{ proto bool method_exists(object object, string method) Checks if the class method exists */ ZEND_FUNCTION(method_exists) @@ -1262,7 +1246,6 @@ ZEND_FUNCTION(property_exists) } /* }}} */ - /* {{{ proto bool class_exists(string classname [, bool autoload]) Checks if the class exists */ ZEND_FUNCTION(class_exists) @@ -1393,7 +1376,6 @@ ZEND_FUNCTION(trait_exists) } /* }}} */ - /* {{{ proto bool function_exists(string function_name) Checks if the function exists */ ZEND_FUNCTION(function_exists) @@ -1537,7 +1519,6 @@ ZEND_FUNCTION(get_included_files) } /* }}} */ - /* {{{ proto void trigger_error(string message [, int error_type]) Generates a user-level error/warning/notice message */ ZEND_FUNCTION(trigger_error) @@ -1567,7 +1548,6 @@ ZEND_FUNCTION(trigger_error) } /* }}} */ - /* {{{ proto string set_error_handler(string error_handler [, int error_types]) Sets a user-defined error handler function. Returns the previously defined error handler, or false on error */ ZEND_FUNCTION(set_error_handler) @@ -1607,7 +1587,6 @@ ZEND_FUNCTION(set_error_handler) } /* }}} */ - /* {{{ proto void restore_error_handler(void) Restores the previously defined error handler function */ ZEND_FUNCTION(restore_error_handler) @@ -1634,7 +1613,6 @@ ZEND_FUNCTION(restore_error_handler) } /* }}} */ - /* {{{ proto string set_exception_handler(callable exception_handler) Sets a user-defined exception handler function. Returns the previously defined exception handler, or false on error */ ZEND_FUNCTION(set_exception_handler) @@ -1671,7 +1649,6 @@ ZEND_FUNCTION(set_exception_handler) } /* }}} */ - /* {{{ proto void restore_exception_handler(void) Restores the previously defined exception handler function */ ZEND_FUNCTION(restore_exception_handler) @@ -1690,7 +1667,7 @@ ZEND_FUNCTION(restore_exception_handler) } /* }}} */ -static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zend_class_entry *ce = (zend_class_entry *)Z_PTR_P(el); zval *array = va_arg(args, zval *); @@ -1710,6 +1687,7 @@ static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_lis } return ZEND_HASH_APPLY_KEEP; } +/* }}} */ /* {{{ proto array get_declared_traits() Returns an array of all declared traits. */ @@ -1727,7 +1705,6 @@ ZEND_FUNCTION(get_declared_traits) } /* }}} */ - /* {{{ proto array get_declared_classes() Returns an array of all declared classes. */ ZEND_FUNCTION(get_declared_classes) @@ -1760,8 +1737,7 @@ ZEND_FUNCTION(get_declared_interfaces) } /* }}} */ - -static int copy_function_name(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +static int copy_function_name(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zend_function *func = Z_PTR_P(zv); zval *internal_ar = va_arg(args, zval *), @@ -1779,13 +1755,13 @@ static int copy_function_name(zval *zv TSRMLS_DC, int num_args, va_list args, ze return 0; } - +/* }}} */ /* {{{ proto array get_defined_functions(void) Returns an array of all defined functions */ ZEND_FUNCTION(get_defined_functions) { - zval internal, user, *ret; + zval internal, user; if (zend_parse_parameters_none() == FAILURE) { return; @@ -1797,27 +1773,11 @@ ZEND_FUNCTION(get_defined_functions) zend_hash_apply_with_arguments(EG(function_table) TSRMLS_CC, copy_function_name, 2, &internal, &user); - ret = zend_hash_str_add_new(Z_ARRVAL_P(return_value), "internal", sizeof("internal")-1, &internal); - - if (!ret) { - zval_ptr_dtor(&internal); - zval_ptr_dtor(&user); - zval_dtor(return_value); - zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()"); - RETURN_FALSE; - } - - ret = zend_hash_str_add_new(Z_ARRVAL_P(return_value), "user", sizeof("user")-1, &user); - if (!ret) { - zval_ptr_dtor(&user); - zval_dtor(return_value); - zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()"); - RETURN_FALSE; - } + zend_hash_str_add_new(Z_ARRVAL_P(return_value), "internal", sizeof("internal")-1, &internal); + zend_hash_str_add_new(Z_ARRVAL_P(return_value), "user", sizeof("user")-1, &user); } /* }}} */ - /* {{{ proto array get_defined_vars(void) Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */ ZEND_FUNCTION(get_defined_vars) @@ -1829,7 +1789,6 @@ ZEND_FUNCTION(get_defined_vars) } /* }}} */ - #define LAMBDA_TEMP_FUNCNAME "__lambda_func" /* {{{ proto string create_function(string args, string code) Creates an anonymous function, and returns its name (funny, eh?) */ @@ -1900,7 +1859,6 @@ ZEND_FUNCTION(create_function) } /* }}} */ - #if ZEND_DEBUG ZEND_FUNCTION(zend_test_func) { @@ -1986,22 +1944,24 @@ ZEND_FUNCTION(get_resources) } /* }}} */ -static int add_extension_info(zval *item, void *arg TSRMLS_DC) +static int add_extension_info(zval *item, void *arg TSRMLS_DC) /* {{{ */ { zval *name_array = (zval *)arg; zend_module_entry *module = (zend_module_entry*)Z_PTR_P(item); add_next_index_string(name_array, module->name); return 0; } +/* }}} */ -static int add_zendext_info(zend_extension *ext, void *arg TSRMLS_DC) +static int add_zendext_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */ { zval *name_array = (zval *)arg; add_next_index_string(name_array, ext->name); return 0; } +/* }}} */ -static int add_constant_info(zval *item, void *arg TSRMLS_DC) +static int add_constant_info(zval *item, void *arg TSRMLS_DC) /* {{{ */ { zval *name_array = (zval *)arg; zend_constant *constant = (zend_constant*)Z_PTR_P(item); @@ -2016,7 +1976,7 @@ static int add_constant_info(zval *item, void *arg TSRMLS_DC) zend_hash_add_new(Z_ARRVAL_P(name_array), constant->name, &const_val); return 0; } - +/* }}} */ /* {{{ proto array get_loaded_extensions([bool zend_extensions]) U Return an array containing names of loaded extensions */ @@ -2038,7 +1998,6 @@ ZEND_FUNCTION(get_loaded_extensions) } /* }}} */ - /* {{{ proto array get_defined_constants([bool categorize]) Return an array containing the names and values of all defined constants */ ZEND_FUNCTION(get_defined_constants) @@ -2101,18 +2060,17 @@ ZEND_FUNCTION(get_defined_constants) } /* }}} */ - -static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TSRMLS_DC) +static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TSRMLS_DC) /* {{{ */ { - int num_args = call->num_args; + uint32_t num_args = call->num_args; array_init_size(arg_array, num_args); if (num_args) { - int i = 0; + uint32_t i = 0; zval *p = ZEND_CALL_ARG(call, 1); if (call->func->type == ZEND_USER_FUNCTION) { - int first_extra_arg = call->func->op_array.num_args; + uint32_t first_extra_arg = call->func->op_array.num_args; if (call->func->op_array.fn_flags & ZEND_ACC_VARIADIC) { first_extra_arg--; @@ -2136,8 +2094,9 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TS } } } +/* }}} */ -void debug_print_backtrace_args(zval *arg_array TSRMLS_DC) +void debug_print_backtrace_args(zval *arg_array TSRMLS_DC) /* {{{ */ { zval *tmp; int i = 0; @@ -2149,6 +2108,7 @@ void debug_print_backtrace_args(zval *arg_array TSRMLS_DC) zend_print_flat_zval_r(tmp TSRMLS_CC); } ZEND_HASH_FOREACH_END(); } +/* }}} */ /* {{{ proto void debug_print_backtrace([int options[, int limit]]) */ ZEND_FUNCTION(debug_print_backtrace) @@ -2172,7 +2132,7 @@ ZEND_FUNCTION(debug_print_backtrace) } ZVAL_UNDEF(&arg_array); - ptr = EG(current_execute_data)->prev_execute_data; + ptr = EX(prev_execute_data); /* skip debug_backtrace() */ call = ptr; @@ -2212,7 +2172,7 @@ ZEND_FUNCTION(debug_print_backtrace) } /* $this may be passed into regular internal functions */ - object = call->object; + object = Z_OBJ(call->This); if (object && call && call->func->type == ZEND_INTERNAL_FUNCTION && @@ -2339,7 +2299,7 @@ ZEND_FUNCTION(debug_print_backtrace) /* }}} */ -ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit TSRMLS_DC) +ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit TSRMLS_DC) /* {{{ */ { zend_execute_data *call, *ptr, *skip; zend_object *object; @@ -2434,8 +2394,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int } /* $this may be passed into regular internal functions */ - object = call ? call->object : NULL; + object = call ? Z_OBJ(call->This) : NULL; if (object && + call->func && call->func->type == ZEND_INTERNAL_FUNCTION && !call->func->common.scope) { object = NULL; @@ -2547,7 +2508,6 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int } /* }}} */ - /* {{{ proto array debug_backtrace([int options[, int limit]]) Return backtrace as array */ ZEND_FUNCTION(debug_backtrace) @@ -2586,7 +2546,6 @@ ZEND_FUNCTION(extension_loaded) } /* }}} */ - /* {{{ proto array get_extension_funcs(string extension_name) Returns an array with the names of functions belonging to the named extension */ ZEND_FUNCTION(get_extension_funcs) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index c8497a4f2d..90d7a6bb86 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -47,7 +47,7 @@ static zend_object_handlers closure_handlers; ZEND_METHOD(Closure, __invoke) /* {{{ */ { - zend_function *func = EG(current_execute_data)->func; + zend_function *func = EX(func); zval *arguments; arguments = emalloc(sizeof(zval) * ZEND_NUM_ARGS()); @@ -376,7 +376,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_ arg_info->pass_by_reference ? "&" : "", i + 1); } - ZVAL_STR(&info, zend_strpprintf(0, "%s", i >= required ? "<optional>" : "<required>")); + ZVAL_NEW_STR(&info, zend_strpprintf(0, "%s", i >= required ? "<optional>" : "<required>")); zend_hash_update(Z_ARRVAL(val), name, &info); zend_string_release(name); arg_info++; diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a5a32298d5..91bfbfeebb 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -30,6 +30,7 @@ #include "zend_virtual_cwd.h" #include "zend_multibyte.h" #include "zend_language_scanner.h" +#include "zend_inheritance.h" #define CONSTANT_EX(op_array, op) \ (op_array)->literals[op] @@ -76,29 +77,6 @@ ZEND_API zend_compiler_globals compiler_globals; ZEND_API zend_executor_globals executor_globals; #endif -static zend_property_info *zend_duplicate_property_info(zend_property_info *property_info TSRMLS_DC) /* {{{ */ -{ - zend_property_info* new_property_info; - - new_property_info = zend_arena_alloc(&CG(arena), sizeof(zend_property_info)); - memcpy(new_property_info, property_info, sizeof(zend_property_info)); - zend_string_addref(new_property_info->name); - if (new_property_info->doc_comment) { - zend_string_addref(new_property_info->doc_comment); - } - return new_property_info; -} -/* }}} */ - -static zend_property_info *zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */ -{ - zend_property_info* new_property_info = pemalloc(sizeof(zend_property_info), 1); - memcpy(new_property_info, property_info, sizeof(zend_property_info)); - zend_string_addref(new_property_info->name); - return new_property_info; -} -/* }}} */ - static void zend_destroy_property_info(zval *zv) /* {{{ */ { zend_property_info *property_info = Z_PTR_P(zv); @@ -137,21 +115,33 @@ static zend_string *zend_build_runtime_definition_key(zend_string *name, unsigne { zend_string *result; char char_pos_buf[32]; - size_t char_pos_len = zend_sprintf(char_pos_buf, "%p", lex_pos); + size_t filename_len, char_pos_len = zend_sprintf(char_pos_buf, "%p", lex_pos); const char *filename; if (CG(active_op_array)->filename) { filename = CG(active_op_array)->filename->val; + filename_len = CG(active_op_array)->filename->len; } else { filename = "-"; + filename_len = sizeof("-") - 1; } - /* NULL, name length, filename length, last accepting char position length */ - result = zend_string_alloc(1 + name->len + strlen(filename) + char_pos_len, 0); + result = zend_string_alloc(1 + name->len + filename_len + char_pos_len, 0); + sprintf(result->val, "%c%s%s%s", '\0', name->val, filename, char_pos_buf); + return zend_new_interned_string(result TSRMLS_CC); +} +/* }}} */ - result->val[0] = '\0'; - sprintf(result->val + 1, "%s%s%s", name->val, filename, char_pos_buf); - return result; +static zend_bool zend_get_unqualified_name(const zend_string *name, const char **result, size_t *result_len) /* {{{ */ +{ + const char *ns_separator = zend_memrchr(name->val, '\\', name->len); + if (ns_separator != NULL) { + *result = ns_separator + 1; + *result_len = name->val + name->len - *result; + return 1; + } + + return 0; } /* }}} */ @@ -342,82 +332,63 @@ int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC) /* {{{ */ } /* }}} */ -static int zend_add_func_name_literal(zend_op_array *op_array, zval *zv TSRMLS_DC) /* {{{ */ +static inline int zend_add_literal_string(zend_op_array *op_array, zend_string **str TSRMLS_DC) /* {{{ */ { int ret; - zend_string *lc_name; - zval c; - - if (op_array->last_literal > 0 && - &op_array->literals[op_array->last_literal - 1] == zv && - Z_CACHE_SLOT(op_array->literals[op_array->last_literal - 1]) == -1) { - /* we already have function name as last literal (do nothing) */ - ret = op_array->last_literal - 1; - } else { - ret = zend_add_literal(op_array, zv TSRMLS_CC); - } + zval zv; + ZVAL_STR(&zv, *str); + ret = zend_add_literal(op_array, &zv TSRMLS_CC); + *str = Z_STR(zv); + return ret; +} - lc_name = zend_string_alloc(Z_STRLEN_P(zv), 0); - zend_str_tolower_copy(lc_name->val, Z_STRVAL_P(zv), Z_STRLEN_P(zv)); - ZVAL_NEW_STR(&c, lc_name); - zend_add_literal(CG(active_op_array), &c TSRMLS_CC); +static int zend_add_func_name_literal(zend_op_array *op_array, zend_string *name TSRMLS_DC) /* {{{ */ +{ + /* Original name */ + int ret = zend_add_literal_string(op_array, &name TSRMLS_CC); + + /* Lowercased name */ + zend_string *lc_name = zend_string_alloc(name->len, 0); + zend_str_tolower_copy(lc_name->val, name->val, name->len); + zend_add_literal_string(op_array, &lc_name TSRMLS_CC); return ret; } /* }}} */ -static int zend_add_ns_func_name_literal(zend_op_array *op_array, zval *zv TSRMLS_DC) /* {{{ */ +static int zend_add_ns_func_name_literal(zend_op_array *op_array, zend_string *name TSRMLS_DC) /* {{{ */ { - int ret; - zend_string *lc_name; - const char *ns_separator; - int lc_len; - zval c; - - if (op_array->last_literal > 0 && - &op_array->literals[op_array->last_literal - 1] == zv && - Z_CACHE_SLOT(op_array->literals[op_array->last_literal - 1]) == -1) { - /* we already have function name as last literal (do nothing) */ - ret = op_array->last_literal - 1; - } else { - ret = zend_add_literal(op_array, zv TSRMLS_CC); - } + const char *unqualified_name; + size_t unqualified_name_len; - lc_name = zend_string_alloc(Z_STRLEN_P(zv), 0); - zend_str_tolower_copy(lc_name->val, Z_STRVAL_P(zv), Z_STRLEN_P(zv)); - ZVAL_NEW_STR(&c, lc_name); - zend_add_literal(CG(active_op_array), &c TSRMLS_CC); + /* Original name */ + int ret = zend_add_literal_string(op_array, &name TSRMLS_CC); - ns_separator = (const char*)zend_memrchr(Z_STRVAL_P(zv), '\\', Z_STRLEN_P(zv)); + /* Lowercased name */ + zend_string *lc_name = zend_string_alloc(name->len, 0); + zend_str_tolower_copy(lc_name->val, name->val, name->len); + zend_add_literal_string(op_array, &lc_name TSRMLS_CC); - if (ns_separator != NULL) { - ns_separator += 1; - lc_len = Z_STRLEN_P(zv) - (ns_separator - Z_STRVAL_P(zv)); - lc_name = zend_string_alloc(lc_len, 0); - zend_str_tolower_copy(lc_name->val, ns_separator, lc_len); - ZVAL_NEW_STR(&c, lc_name); - zend_add_literal(CG(active_op_array), &c TSRMLS_CC); + /* Lowercased unqualfied name */ + if (zend_get_unqualified_name(name, &unqualified_name, &unqualified_name_len)) { + lc_name = zend_string_alloc(unqualified_name_len, 0); + zend_str_tolower_copy(lc_name->val, unqualified_name, unqualified_name_len); + zend_add_literal_string(op_array, &lc_name TSRMLS_CC); } return ret; } /* }}} */ -static int zend_add_class_name_literal(zend_op_array *op_array, zend_string *name TSRMLS_DC) /* {{{ */ { - int ret; - zend_string *lc_name; - - zval zv; - ZVAL_STR(&zv, name); - - ret = zend_add_literal(op_array, &zv TSRMLS_CC); - name = Z_STR(zv); /* Load new name string in case it was interned */ +static int zend_add_class_name_literal(zend_op_array *op_array, zend_string *name TSRMLS_DC) /* {{{ */ +{ + /* Original name */ + int ret = zend_add_literal_string(op_array, &name TSRMLS_CC); - lc_name = zend_string_alloc(name->len, 0); + /* Lowercased name */ + zend_string *lc_name = zend_string_alloc(name->len, 0); zend_str_tolower_copy(lc_name->val, name->val, name->len); - - ZVAL_NEW_STR(&zv, lc_name); - zend_add_literal(CG(active_op_array), &zv TSRMLS_CC); + zend_add_literal_string(op_array, &lc_name TSRMLS_CC); zend_alloc_cache_slot(ret TSRMLS_CC); @@ -425,72 +396,44 @@ static int zend_add_class_name_literal(zend_op_array *op_array, zend_string *nam } /* }}} */ -static int zend_add_const_name_literal(zend_op_array *op_array, zval *zv, int unqualified TSRMLS_DC) /* {{{ */ +static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *name, zend_bool unqualified TSRMLS_DC) /* {{{ */ { - int ret; - char *name; zend_string *tmp_name; - const char *ns_separator; - int name_len, ns_len; - zval c; - - if (op_array->last_literal > 0 && - &op_array->literals[op_array->last_literal - 1] == zv && - Z_CACHE_SLOT(op_array->literals[op_array->last_literal - 1]) == -1) { - /* we already have function name as last literal (do nothing) */ - ret = op_array->last_literal - 1; - } else { - ret = zend_add_literal(op_array, zv TSRMLS_CC); - } - /* skip leading '\\' */ - if (Z_STRVAL_P(zv)[0] == '\\') { - name_len = Z_STRLEN_P(zv) - 1; - name = Z_STRVAL_P(zv) + 1; - } else { - name_len = Z_STRLEN_P(zv); - name = Z_STRVAL_P(zv); - } - ns_separator = zend_memrchr(name, '\\', name_len); - if (ns_separator) { - ns_len = ns_separator - name; - } else { - ns_len = 0; - } + int ret = zend_add_literal_string(op_array, &name TSRMLS_CC); + + size_t ns_len = 0, after_ns_len = name->len; + const char *after_ns = zend_memrchr(name->val, '\\', name->len); + if (after_ns) { + after_ns += 1; + ns_len = after_ns - name->val - 1; + after_ns_len = name->len - ns_len - 1; - if (ns_len) { /* lowercased namespace name & original constant name */ - tmp_name = zend_string_init(name, name_len, 0); + tmp_name = zend_string_init(name->val, name->len, 0); zend_str_tolower(tmp_name->val, ns_len); - ZVAL_NEW_STR(&c, tmp_name); - zend_add_literal(CG(active_op_array), &c TSRMLS_CC); + zend_add_literal_string(op_array, &tmp_name TSRMLS_CC); /* lowercased namespace name & lowercased constant name */ - tmp_name = zend_string_alloc(name_len, 0); - zend_str_tolower_copy(tmp_name->val, name, name_len); - ZVAL_NEW_STR(&c, tmp_name); - zend_add_literal(CG(active_op_array), &c TSRMLS_CC); - } + tmp_name = zend_string_alloc(name->len, 0); + zend_str_tolower_copy(tmp_name->val, name->val, name->len); + zend_add_literal_string(op_array, &tmp_name TSRMLS_CC); - if (ns_len) { if (!unqualified) { return ret; } - ns_len++; - name += ns_len; - name_len -= ns_len; + } else { + after_ns = name->val; } - /* original constant name */ - tmp_name = zend_string_init(name, name_len, 0); - ZVAL_NEW_STR(&c, tmp_name); - zend_add_literal(CG(active_op_array), &c TSRMLS_CC); + /* original unqualified constant name */ + tmp_name = zend_string_init(after_ns, after_ns_len, 0); + zend_add_literal_string(op_array, &tmp_name TSRMLS_CC); - /* lowercased constant name */ - tmp_name = zend_string_alloc(name_len, 0); - zend_str_tolower_copy(tmp_name->val, name, name_len); - ZVAL_NEW_STR(&c, tmp_name); - zend_add_literal(CG(active_op_array), &c TSRMLS_CC); + /* lowercased unqualified constant name */ + tmp_name = zend_string_alloc(after_ns_len, 0); + zend_str_tolower_copy(tmp_name->val, after_ns, after_ns_len); + zend_add_literal_string(op_array, &tmp_name TSRMLS_CC); return ret; } @@ -559,8 +502,7 @@ void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */ && opline->result.var == op1->u.op.var) { if (opline->opcode == ZEND_FETCH_R || opline->opcode == ZEND_FETCH_DIM_R || - opline->opcode == ZEND_FETCH_OBJ_R || - opline->opcode == ZEND_QM_ASSIGN_VAR) { + opline->opcode == ZEND_FETCH_OBJ_R) { /* It's very rare and useless case. It's better to use additional FREE opcode and simplify the FETCH handlers their selves */ @@ -653,12 +595,16 @@ zend_string *zend_prefix_with_ns(zend_string *name TSRMLS_DC) { } } -void *zend_hash_find_ptr_lc(HashTable *ht, char *str, size_t len) { +void *zend_hash_find_ptr_lc(HashTable *ht, const char *str, size_t len) { void *result; - zend_string *lcname = zend_string_alloc(len, 0); + zend_string *lcname; + ALLOCA_FLAG(use_heap); + + STR_ALLOCA_ALLOC(lcname, len, use_heap); zend_str_tolower_copy(lcname->val, str, len); result = zend_hash_find_ptr(ht, lcname); - zend_string_free(lcname); + STR_ALLOCA_FREE(lcname, use_heap); + return result; } @@ -882,7 +828,7 @@ static int generate_free_loop_var(znode *var TSRMLS_DC) /* {{{ */ { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = var->op_type == IS_TMP_VAR ? ZEND_FREE : ZEND_SWITCH_FREE; + opline->opcode = ZEND_FREE; SET_NODE(opline->op1, var); SET_UNUSED(opline->op2); } @@ -932,1527 +878,6 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */ } /* }}} */ -static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - zend_function *function, *new_function; - - if (!ce->parent) { - return; - } - - /* You cannot change create_object */ - ce->create_object = ce->parent->create_object; - - /* Inherit special functions if needed */ - if (!ce->get_iterator) { - ce->get_iterator = ce->parent->get_iterator; - } - if (!ce->iterator_funcs.funcs) { - ce->iterator_funcs.funcs = ce->parent->iterator_funcs.funcs; - } - if (!ce->__get) { - ce->__get = ce->parent->__get; - } - if (!ce->__set) { - ce->__set = ce->parent->__set; - } - if (!ce->__unset) { - ce->__unset = ce->parent->__unset; - } - if (!ce->__isset) { - ce->__isset = ce->parent->__isset; - } - if (!ce->__call) { - ce->__call = ce->parent->__call; - } - if (!ce->__callstatic) { - ce->__callstatic = ce->parent->__callstatic; - } - if (!ce->__tostring) { - ce->__tostring = ce->parent->__tostring; - } - if (!ce->clone) { - ce->clone = ce->parent->clone; - } - if(!ce->serialize) { - ce->serialize = ce->parent->serialize; - } - if(!ce->unserialize) { - ce->unserialize = ce->parent->unserialize; - } - if (!ce->destructor) { - ce->destructor = ce->parent->destructor; - } - if (!ce->__debugInfo) { - ce->__debugInfo = ce->parent->__debugInfo; - } - if (ce->constructor) { - if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) { - zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()", - ce->parent->name->val, ce->parent->constructor->common.function_name->val, - ce->name->val, ce->constructor->common.function_name->val - ); - } - return; - } - - if ((function = zend_hash_str_find_ptr(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1)) != NULL) { - /* inherit parent's constructor */ - if (function->type == ZEND_INTERNAL_FUNCTION) { - new_function = pemalloc(sizeof(zend_internal_function), 1); - memcpy(new_function, function, sizeof(zend_internal_function)); - } else { - new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); - memcpy(new_function, function, sizeof(zend_op_array)); - } - zend_hash_str_update_ptr(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1, new_function); - function_add_ref(new_function); - } else { - /* Don't inherit the old style constructor if we already have the new style constructor */ - zend_string *lc_class_name; - zend_string *lc_parent_class_name; - - lc_class_name = zend_string_alloc(ce->name->len, 0); - zend_str_tolower_copy(lc_class_name->val, ce->name->val, ce->name->len); - if (!zend_hash_exists(&ce->function_table, lc_class_name)) { - lc_parent_class_name = zend_string_alloc(ce->parent->name->len, 0); - zend_str_tolower_copy(lc_parent_class_name->val, ce->parent->name->val, ce->parent->name->len); - if (!zend_hash_exists(&ce->function_table, lc_parent_class_name) && - (function = zend_hash_find_ptr(&ce->parent->function_table, lc_parent_class_name)) != NULL) { - if (function->common.fn_flags & ZEND_ACC_CTOR) { - /* inherit parent's constructor */ - new_function = pemalloc(sizeof(zend_function), function->type == ZEND_INTERNAL_FUNCTION); - memcpy(new_function, function, sizeof(zend_function)); - zend_hash_update_ptr(&ce->function_table, lc_parent_class_name, new_function); - function_add_ref(new_function); - } - } - zend_string_release(lc_parent_class_name); - } - zend_string_free(lc_class_name); - } - ce->constructor = ce->parent->constructor; -} -/* }}} */ - -char *zend_visibility_string(uint32_t fn_flags) /* {{{ */ -{ - if (fn_flags & ZEND_ACC_PRIVATE) { - return "private"; - } - if (fn_flags & ZEND_ACC_PROTECTED) { - return "protected"; - } - if (fn_flags & ZEND_ACC_PUBLIC) { - return "public"; - } - return ""; -} -/* }}} */ - -static zend_function *do_inherit_method(zend_function *old_function TSRMLS_DC) /* {{{ */ -{ - zend_function *new_function; - - if (old_function->type == ZEND_INTERNAL_FUNCTION) { - new_function = pemalloc(sizeof(zend_internal_function), 1); - memcpy(new_function, old_function, sizeof(zend_internal_function)); - } else { - new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); - memcpy(new_function, old_function, sizeof(zend_op_array)); - } - /* The class entry of the derived function intentionally remains the same - * as that of the parent class. That allows us to know in which context - * we're running, and handle private method calls properly. - */ - function_add_ref(new_function); - return new_function; -} -/* }}} */ - -static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */ -{ - uint32_t i, num_args; - - /* If it's a user function then arg_info == NULL means we don't have any parameters but - * we still need to do the arg number checks. We are only willing to ignore this for internal - * functions because extensions don't always define arg_info. - */ - if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) { - return 1; - } - - /* Checks for constructors only if they are declared in an interface, - * or explicitly marked as abstract - */ - if ((fe->common.fn_flags & ZEND_ACC_CTOR) - && ((proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0 - && (proto->common.fn_flags & ZEND_ACC_ABSTRACT) == 0)) { - return 1; - } - - /* If both methods are private do not enforce a signature */ - if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) { - return 1; - } - - /* check number of arguments */ - if (proto->common.required_num_args < fe->common.required_num_args - || proto->common.num_args > fe->common.num_args) { - return 0; - } - - /* by-ref constraints on return values are covariant */ - if ((proto->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) - && !(fe->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { - return 0; - } - - if ((proto->common.fn_flags & ZEND_ACC_VARIADIC) - && !(fe->common.fn_flags & ZEND_ACC_VARIADIC)) { - return 0; - } - - /* For variadic functions any additional (optional) arguments that were added must be - * checked against the signature of the variadic argument, so in this case we have to - * go through all the parameters of the function and not just those present in the - * prototype. */ - num_args = proto->common.num_args; - if ((proto->common.fn_flags & ZEND_ACC_VARIADIC) - && fe->common.num_args > proto->common.num_args) { - num_args = fe->common.num_args; - } - - for (i = 0; i < num_args; i++) { - zend_arg_info *fe_arg_info = &fe->common.arg_info[i]; - - zend_arg_info *proto_arg_info; - if (i < proto->common.num_args) { - proto_arg_info = &proto->common.arg_info[i]; - } else { - proto_arg_info = &proto->common.arg_info[proto->common.num_args-1]; - } - - if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) { - /* Only one has a type hint and the other one doesn't */ - return 0; - } - - if (fe_arg_info->class_name) { - zend_string *fe_class_name, *proto_class_name; - - if (!strcasecmp(fe_arg_info->class_name, "parent") && proto->common.scope) { - fe_class_name = zend_string_copy(proto->common.scope->name); - } else if (!strcasecmp(fe_arg_info->class_name, "self") && fe->common.scope) { - fe_class_name = zend_string_copy(fe->common.scope->name); - } else { - fe_class_name = zend_string_init( - fe_arg_info->class_name, - fe_arg_info->class_name_len, 0); - } - - if (!strcasecmp(proto_arg_info->class_name, "parent") && proto->common.scope && proto->common.scope->parent) { - proto_class_name = zend_string_copy(proto->common.scope->parent->name); - } else if (!strcasecmp(proto_arg_info->class_name, "self") && proto->common.scope) { - proto_class_name = zend_string_copy(proto->common.scope->name); - } else { - proto_class_name = zend_string_init( - proto_arg_info->class_name, - proto_arg_info->class_name_len, 0); - } - - if (strcasecmp(fe_class_name->val, proto_class_name->val)!=0) { - const char *colon; - - if (fe->common.type != ZEND_USER_FUNCTION) { - zend_string_release(proto_class_name); - zend_string_release(fe_class_name); - return 0; - } else if (strchr(proto_class_name->val, '\\') != NULL || - (colon = zend_memrchr(fe_class_name->val, '\\', fe_class_name->len)) == NULL || - strcasecmp(colon+1, proto_class_name->val) != 0) { - zend_class_entry *fe_ce, *proto_ce; - - fe_ce = zend_lookup_class(fe_class_name TSRMLS_CC); - proto_ce = zend_lookup_class(proto_class_name TSRMLS_CC); - - /* Check for class alias */ - if (!fe_ce || !proto_ce || - fe_ce->type == ZEND_INTERNAL_CLASS || - proto_ce->type == ZEND_INTERNAL_CLASS || - fe_ce != proto_ce) { - zend_string_release(proto_class_name); - zend_string_release(fe_class_name); - return 0; - } - } - } - zend_string_release(proto_class_name); - zend_string_release(fe_class_name); - } - if (fe_arg_info->type_hint != proto_arg_info->type_hint) { - /* Incompatible type hint */ - return 0; - } - - /* by-ref constraints on arguments are invariant */ - if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) { - return 0; - } - } - - return 1; -} -/* }}} */ - -#define REALLOC_BUF_IF_EXCEED(buf, offset, length, size) \ - if (UNEXPECTED(offset - buf + size >= length)) { \ - length += size + 1; \ - buf = erealloc(buf, length); \ - } - -static char *zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{ */ -{ - char *offset, *buf; - uint32_t length = 1024; - - offset = buf = (char *)emalloc(length * sizeof(char)); - if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) { - *(offset++) = '&'; - *(offset++) = ' '; - } - - if (fptr->common.scope) { - memcpy(offset, fptr->common.scope->name->val, fptr->common.scope->name->len); - offset += fptr->common.scope->name->len; - *(offset++) = ':'; - *(offset++) = ':'; - } - - { - size_t name_len = fptr->common.function_name->len; - REALLOC_BUF_IF_EXCEED(buf, offset, length, name_len); - memcpy(offset, fptr->common.function_name->val, name_len); - offset += name_len; - } - - *(offset++) = '('; - if (fptr->common.arg_info) { - uint32_t i, required; - zend_arg_info *arg_info = fptr->common.arg_info; - - required = fptr->common.required_num_args; - for (i = 0; i < fptr->common.num_args;) { - if (arg_info->class_name) { - const char *class_name; - uint32_t class_name_len; - if (!strcasecmp(arg_info->class_name, "self") && fptr->common.scope ) { - class_name = fptr->common.scope->name->val; - class_name_len = fptr->common.scope->name->len; - } else if (!strcasecmp(arg_info->class_name, "parent") && fptr->common.scope->parent) { - class_name = fptr->common.scope->parent->name->val; - class_name_len = fptr->common.scope->parent->name->len; - } else { - class_name = arg_info->class_name; - class_name_len = arg_info->class_name_len; - } - REALLOC_BUF_IF_EXCEED(buf, offset, length, class_name_len); - memcpy(offset, class_name, class_name_len); - offset += class_name_len; - *(offset++) = ' '; - } else if (arg_info->type_hint) { - uint32_t type_name_len; - char *type_name = zend_get_type_by_const(arg_info->type_hint); - type_name_len = strlen(type_name); - REALLOC_BUF_IF_EXCEED(buf, offset, length, type_name_len); - memcpy(offset, type_name, type_name_len); - offset += type_name_len; - *(offset++) = ' '; - } - - if (arg_info->pass_by_reference) { - *(offset++) = '&'; - } - - if (arg_info->is_variadic) { - *(offset++) = '.'; - *(offset++) = '.'; - *(offset++) = '.'; - } - - *(offset++) = '$'; - - if (arg_info->name) { - REALLOC_BUF_IF_EXCEED(buf, offset, length, arg_info->name_len); - memcpy(offset, arg_info->name, arg_info->name_len); - offset += arg_info->name_len; - } else { - uint32_t idx = i; - memcpy(offset, "param", 5); - offset += 5; - do { - *(offset++) = (char) (idx % 10) + '0'; - idx /= 10; - } while (idx > 0); - } - if (i >= required && !arg_info->is_variadic) { - *(offset++) = ' '; - *(offset++) = '='; - *(offset++) = ' '; - if (fptr->type == ZEND_USER_FUNCTION) { - zend_op *precv = NULL; - { - uint32_t idx = i; - zend_op *op = ((zend_op_array *)fptr)->opcodes; - zend_op *end = op + ((zend_op_array *)fptr)->last; - - ++idx; - while (op < end) { - if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT) - && op->op1.num == (zend_ulong)idx) - { - precv = op; - } - ++op; - } - } - if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) { - zval *zv = precv->op2.zv; - - if (Z_TYPE_P(zv) == IS_CONSTANT) { - REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN_P(zv)); - memcpy(offset, Z_STRVAL_P(zv), Z_STRLEN_P(zv)); - offset += Z_STRLEN_P(zv); - } else if (Z_TYPE_P(zv) == IS_FALSE) { - memcpy(offset, "false", 5); - offset += 5; - } else if (Z_TYPE_P(zv) == IS_TRUE) { - memcpy(offset, "true", 4); - offset += 4; - } else if (Z_TYPE_P(zv) == IS_NULL) { - memcpy(offset, "NULL", 4); - offset += 4; - } else if (Z_TYPE_P(zv) == IS_STRING) { - *(offset++) = '\''; - REALLOC_BUF_IF_EXCEED(buf, offset, length, MIN(Z_STRLEN_P(zv), 10)); - memcpy(offset, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 10)); - offset += MIN(Z_STRLEN_P(zv), 10); - if (Z_STRLEN_P(zv) > 10) { - *(offset++) = '.'; - *(offset++) = '.'; - *(offset++) = '.'; - } - *(offset++) = '\''; - } else if (Z_TYPE_P(zv) == IS_ARRAY) { - memcpy(offset, "Array", 5); - offset += 5; - } else if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { - memcpy(offset, "<expression>", 12); - offset += 12; - } else { - zend_string *str = zval_get_string(zv); - REALLOC_BUF_IF_EXCEED(buf, offset, length, str->len); - memcpy(offset, str->val, str->len); - offset += str->len; - zend_string_release(str); - } - } - } else { - memcpy(offset, "NULL", 4); - offset += 4; - } - } - - if (++i < fptr->common.num_args) { - *(offset++) = ','; - *(offset++) = ' '; - } - arg_info++; - REALLOC_BUF_IF_EXCEED(buf, offset, length, 32); - } - } - *(offset++) = ')'; - *offset = '\0'; - - return buf; -} -/* }}} */ - -static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) /* {{{ */ -{ - uint32_t child_flags; - uint32_t parent_flags = parent->common.fn_flags; - - if ((parent->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0 - && parent->common.fn_flags & ZEND_ACC_ABSTRACT - && parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope) - && child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) { - zend_error_noreturn(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)", - parent->common.scope->name->val, - child->common.function_name->val, - child->common.prototype ? child->common.prototype->common.scope->name->val : child->common.scope->name->val); - } - - if (parent_flags & ZEND_ACC_FINAL) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val); - } - - child_flags = child->common.fn_flags; - /* You cannot change from static to non static and vice versa. - */ - if ((child_flags & ZEND_ACC_STATIC) != (parent_flags & ZEND_ACC_STATIC)) { - if (child->common.fn_flags & ZEND_ACC_STATIC) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child)); - } else { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child)); - } - } - - /* Disallow making an inherited method abstract. */ - if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child)); - } - - if (parent_flags & ZEND_ACC_CHANGED) { - child->common.fn_flags |= ZEND_ACC_CHANGED; - } else { - /* Prevent derived classes from restricting access that was available in parent classes - */ - if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) { - zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); - } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK)) - && ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) { - child->common.fn_flags |= ZEND_ACC_CHANGED; - } - } - - if (parent_flags & ZEND_ACC_PRIVATE) { - child->common.prototype = NULL; - } else if (parent_flags & ZEND_ACC_ABSTRACT) { - child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT; - child->common.prototype = parent; - } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) { - /* ctors only have a prototype if it comes from an interface */ - child->common.prototype = parent->common.prototype ? parent->common.prototype : parent; - } - - if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) { - if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) { - zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_get_function_declaration(child->common.prototype TSRMLS_CC)); - } - } else if (EG(error_reporting) & E_STRICT || Z_TYPE(EG(user_error_handler)) != IS_UNDEF) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ - if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) { - char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC); - zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, method_prototype); - efree(method_prototype); - } - } -} -/* }}} */ - -static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_string *key, zend_class_entry *child_ce) /* {{{ */ -{ - uint32_t parent_flags = parent->common.fn_flags; - zend_function *child; - TSRMLS_FETCH(); - - if ((child = zend_hash_find_ptr(child_function_table, key)) == NULL) { - if (parent_flags & (ZEND_ACC_ABSTRACT)) { - child_ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; - } - return 1; /* method doesn't exist in child, copy from parent */ - } - - do_inheritance_check_on_method(child, parent TSRMLS_CC); - - return 0; -} -/* }}} */ - -static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - zend_property_info *child_info; - zend_class_entry *parent_ce = ce->parent; - - if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) { - if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) { - child_info->flags |= ZEND_ACC_CHANGED; - } else { - if(ce->type & ZEND_INTERNAL_CLASS) { - child_info = zend_duplicate_property_info_internal(parent_info); - } else { - child_info = zend_duplicate_property_info(parent_info TSRMLS_CC); - } - zend_hash_update_ptr(&ce->properties_info, key, child_info); - child_info->flags &= ~ZEND_ACC_PRIVATE; /* it's not private anymore */ - child_info->flags |= ZEND_ACC_SHADOW; /* but it's a shadow of private */ - } - return 0; /* don't copy access information to child */ - } - - if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) { - if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s", - (parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name->val, key->val, - (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name->val, key->val); - - } - - if(parent_info->flags & ZEND_ACC_CHANGED) { - child_info->flags |= ZEND_ACC_CHANGED; - } - - if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) { - zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name->val, key->val, zend_visibility_string(parent_info->flags), parent_ce->name->val, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); - } else if ((child_info->flags & ZEND_ACC_STATIC) == 0) { - zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset])); - ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset]; - ZVAL_UNDEF(&ce->default_properties_table[child_info->offset]); - child_info->offset = parent_info->offset; - } - return 0; /* Don't copy from parent */ - } else { - return 1; /* Copy from parent */ - } -} -/* }}} */ - -static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */ -{ - if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce TSRMLS_CC) == FAILURE) { - zend_error(E_CORE_ERROR, "Class %s could not implement interface %s", ce->name->val, iface->name->val); - } - if (ce == iface) { - zend_error(E_ERROR, "Interface %s cannot implement itself", ce->name->val); - } -} -/* }}} */ - -ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC) /* {{{ */ -{ - /* expects interface to be contained in ce's interface list already */ - uint32_t i, ce_num, if_num = iface->num_interfaces; - zend_class_entry *entry; - - if (if_num==0) { - return; - } - ce_num = ce->num_interfaces; - - if (ce->type == ZEND_INTERNAL_CLASS) { - ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num)); - } else { - ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num)); - } - - /* Inherit the interfaces, only if they're not already inherited by the class */ - while (if_num--) { - entry = iface->interfaces[if_num]; - for (i = 0; i < ce_num; i++) { - if (ce->interfaces[i] == entry) { - break; - } - } - if (i == ce_num) { - ce->interfaces[ce->num_interfaces++] = entry; - } - } - - /* and now call the implementing handlers */ - while (ce_num < ce->num_interfaces) { - do_implement_interface(ce, ce->interfaces[ce_num++] TSRMLS_CC); - } -} -/* }}} */ - -#ifdef ZTS -# define zval_property_ctor(parent_ce, ce) \ - (((parent_ce)->type != (ce)->type) ? ZVAL_COPY_CTOR : zval_add_ref) -#else -# define zval_property_ctor(parent_ce, ce) \ - zval_add_ref -#endif - -static void do_inherit_class_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */ -{ - if (!Z_ISREF_P(zv)) { - if (parent_ce->type == ZEND_INTERNAL_CLASS) { - ZVAL_NEW_PERSISTENT_REF(zv, zv); - } else { - ZVAL_NEW_REF(zv, zv); - } - } - if (Z_CONSTANT_P(Z_REFVAL_P(zv))) { - ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; - } - if (zend_hash_add(&ce->constants_table, name, zv)) { - Z_ADDREF_P(zv); - } -} -/* }}} */ - -ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */ -{ - zend_property_info *property_info; - zend_function *func; - zend_string *key; - zval *zv; - - if ((ce->ce_flags & ZEND_ACC_INTERFACE) - && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name->val, parent_ce->name->val); - } - if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) { - zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name->val, parent_ce->name->val); - } - - ce->parent = parent_ce; - /* Copy serialize/unserialize callbacks */ - if (!ce->serialize) { - ce->serialize = parent_ce->serialize; - } - if (!ce->unserialize) { - ce->unserialize = parent_ce->unserialize; - } - - /* Inherit interfaces */ - zend_do_inherit_interfaces(ce, parent_ce TSRMLS_CC); - - /* Inherit properties */ - if (parent_ce->default_properties_count) { - int i = ce->default_properties_count + parent_ce->default_properties_count; - - ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS); - if (ce->default_properties_count) { - while (i-- > parent_ce->default_properties_count) { - ce->default_properties_table[i] = ce->default_properties_table[i - parent_ce->default_properties_count]; - } - } - for (i = 0; i < parent_ce->default_properties_count; i++) { -#ifdef ZTS - if (parent_ce->type != ce->type) { - ZVAL_DUP(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]); - if (Z_OPT_CONSTANT(ce->default_properties_table[i])) { - ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; - } - continue; - } -#endif - - ZVAL_COPY(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]); - if (Z_OPT_CONSTANT(ce->default_properties_table[i])) { - ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; - } - } - ce->default_properties_count += parent_ce->default_properties_count; - } - - if (parent_ce->type != ce->type) { - /* User class extends internal class */ - zend_update_class_constants(parent_ce TSRMLS_CC); - if (parent_ce->default_static_members_count) { - int i = ce->default_static_members_count + parent_ce->default_static_members_count; - - ce->default_static_members_table = erealloc(ce->default_static_members_table, sizeof(zval) * i); - if (ce->default_static_members_count) { - while (i-- > parent_ce->default_static_members_count) { - ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count]; - } - } - for (i = 0; i < parent_ce->default_static_members_count; i++) { - ZVAL_MAKE_REF(&CE_STATIC_MEMBERS(parent_ce)[i]); - ce->default_static_members_table[i] = CE_STATIC_MEMBERS(parent_ce)[i]; - Z_ADDREF(ce->default_static_members_table[i]); - if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) { - ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; - } - } - ce->default_static_members_count += parent_ce->default_static_members_count; - ce->static_members_table = ce->default_static_members_table; - } - } else { - if (parent_ce->default_static_members_count) { - int i = ce->default_static_members_count + parent_ce->default_static_members_count; - - ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS); - if (ce->default_static_members_count) { - while (i-- > parent_ce->default_static_members_count) { - ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count]; - } - } - for (i = 0; i < parent_ce->default_static_members_count; i++) { - ZVAL_MAKE_REF(&parent_ce->default_static_members_table[i]); - ce->default_static_members_table[i] = parent_ce->default_static_members_table[i]; - Z_ADDREF(ce->default_static_members_table[i]); - if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) { - ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; - } - } - ce->default_static_members_count += parent_ce->default_static_members_count; - if (ce->type == ZEND_USER_CLASS) { - ce->static_members_table = ce->default_static_members_table; - } - } - } - - ZEND_HASH_FOREACH_PTR(&ce->properties_info, property_info) { - if (property_info->ce == ce) { - if (property_info->flags & ZEND_ACC_STATIC) { - property_info->offset += parent_ce->default_static_members_count; - } else { - property_info->offset += parent_ce->default_properties_count; - } - } - } ZEND_HASH_FOREACH_END(); - - ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) { - if (do_inherit_property_access_check(&ce->properties_info, property_info, key, ce TSRMLS_CC)) { - if (ce->type & ZEND_INTERNAL_CLASS) { - property_info = zend_duplicate_property_info_internal(property_info); - } else { - property_info = zend_duplicate_property_info(property_info TSRMLS_CC); - } - zend_hash_add_new_ptr(&ce->properties_info, key, property_info); - } - } ZEND_HASH_FOREACH_END(); - - ZEND_HASH_FOREACH_STR_KEY_VAL(&parent_ce->constants_table, key, zv) { - do_inherit_class_constant(key, zv, ce, parent_ce TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - - ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) { - if (do_inherit_method_check(&ce->function_table, func, key, ce)) { - zend_function *new_func = do_inherit_method(func TSRMLS_CC); - zend_hash_add_new_ptr(&ce->function_table, key, new_func); - } - } ZEND_HASH_FOREACH_END(); - - do_inherit_parent_constructor(ce TSRMLS_CC); - - if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) { - ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; - } else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) { - /* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */ - zend_verify_abstract_class(ce TSRMLS_CC); - } - ce->ce_flags |= parent_ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS; -} -/* }}} */ - -static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */ -{ - zval *old_constant; - - if ((old_constant = zend_hash_find(child_constants_table, name)) != NULL) { - if (!Z_ISREF_P(old_constant) || - !Z_ISREF_P(parent_constant) || - Z_REFVAL_P(old_constant) != Z_REFVAL_P(parent_constant)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", name->val, iface->name->val); - } - return 0; - } - return 1; -} -/* }}} */ - -static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */ -{ - if (do_inherit_constant_check(&ce->constants_table, zv, name, iface)) { - ZVAL_MAKE_REF(zv); - Z_ADDREF_P(zv); - if (Z_CONSTANT_P(Z_REFVAL_P(zv))) { - ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; - } - zend_hash_update(&ce->constants_table, name, zv); - } -} -/* }}} */ - -ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */ -{ - uint32_t i, ignore = 0; - uint32_t current_iface_num = ce->num_interfaces; - uint32_t parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0; - zend_function *func; - zend_string *key; - zval *zv; - - for (i = 0; i < ce->num_interfaces; i++) { - if (ce->interfaces[i] == NULL) { - memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i)); - i--; - } else if (ce->interfaces[i] == iface) { - if (i < parent_iface_num) { - ignore = 1; - } else { - zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name->val, iface->name->val); - } - } - } - if (ignore) { - /* Check for attempt to redeclare interface constants */ - ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, zv) { - do_inherit_constant_check(&iface->constants_table, zv, key, iface); - } ZEND_HASH_FOREACH_END(); - } else { - if (ce->num_interfaces >= current_iface_num) { - if (ce->type == ZEND_INTERNAL_CLASS) { - ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num)); - } else { - ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num)); - } - } - ce->interfaces[ce->num_interfaces++] = iface; - - ZEND_HASH_FOREACH_STR_KEY_VAL(&iface->constants_table, key, zv) { - do_inherit_iface_constant(key, zv, ce, iface TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - - ZEND_HASH_FOREACH_STR_KEY_PTR(&iface->function_table, key, func) { - if (do_inherit_method_check(&ce->function_table, func, key, ce)) { - zend_function *new_func = do_inherit_method(func TSRMLS_CC); - zend_hash_add_new_ptr(&ce->function_table, key, new_func); - } - } ZEND_HASH_FOREACH_END(); - - do_implement_interface(ce, iface TSRMLS_CC); - zend_do_inherit_interfaces(ce, iface TSRMLS_CC); - } -} -/* }}} */ - -ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */ -{ - uint32_t i, ignore = 0; - uint32_t current_trait_num = ce->num_traits; - uint32_t parent_trait_num = ce->parent ? ce->parent->num_traits : 0; - - for (i = 0; i < ce->num_traits; i++) { - if (ce->traits[i] == NULL) { - memmove(ce->traits + i, ce->traits + i + 1, sizeof(zend_class_entry*) * (--ce->num_traits - i)); - i--; - } else if (ce->traits[i] == trait) { - if (i < parent_trait_num) { - ignore = 1; - } - } - } - if (!ignore) { - if (ce->num_traits >= current_trait_num) { - if (ce->type == ZEND_INTERNAL_CLASS) { - ce->traits = (zend_class_entry **) realloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num)); - } else { - ce->traits = (zend_class_entry **) erealloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num)); - } - } - ce->traits[ce->num_traits++] = trait; - } -} -/* }}} */ - -static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn TSRMLS_DC) /* {{{ */ -{ - uint32_t fn_flags = fn->common.scope->ce_flags; - uint32_t other_flags = other_fn->common.scope->ce_flags; - - return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC) - && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)) - && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) == - (other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */ -} -/* }}} */ - -static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe TSRMLS_DC) /* {{{ */ -{ - if (!strncmp(mname->val, ZEND_CLONE_FUNC_NAME, mname->len)) { - ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE; - } else if (!strncmp(mname->val, ZEND_CONSTRUCTOR_FUNC_NAME, mname->len)) { - if (ce->constructor) { - zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val); - } - ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR; - } else if (!strncmp(mname->val, ZEND_DESTRUCTOR_FUNC_NAME, mname->len)) { - ce->destructor = fe; fe->common.fn_flags |= ZEND_ACC_DTOR; - } else if (!strncmp(mname->val, ZEND_GET_FUNC_NAME, mname->len)) { - ce->__get = fe; - } else if (!strncmp(mname->val, ZEND_SET_FUNC_NAME, mname->len)) { - ce->__set = fe; - } else if (!strncmp(mname->val, ZEND_CALL_FUNC_NAME, mname->len)) { - ce->__call = fe; - } else if (!strncmp(mname->val, ZEND_UNSET_FUNC_NAME, mname->len)) { - ce->__unset = fe; - } else if (!strncmp(mname->val, ZEND_ISSET_FUNC_NAME, mname->len)) { - ce->__isset = fe; - } else if (!strncmp(mname->val, ZEND_CALLSTATIC_FUNC_NAME, mname->len)) { - ce->__callstatic = fe; - } else if (!strncmp(mname->val, ZEND_TOSTRING_FUNC_NAME, mname->len)) { - ce->__tostring = fe; - } else if (!strncmp(mname->val, ZEND_DEBUGINFO_FUNC_NAME, mname->len)) { - ce->__debugInfo = fe; - } else if (ce->name->len == mname->len) { - zend_string *lowercase_name = zend_string_alloc(ce->name->len, 0); - zend_str_tolower_copy(lowercase_name->val, ce->name->val, ce->name->len); - lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC); - if (!memcmp(mname->val, lowercase_name->val, mname->len)) { - if (ce->constructor) { - zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val); - } - ce->constructor = fe; - fe->common.fn_flags |= ZEND_ACC_CTOR; - } - zend_string_release(lowercase_name); - } -} -/* }}} */ - -static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_string *key, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */ -{ - zend_function *existing_fn = NULL; - zend_function *new_fn; - - if ((existing_fn = zend_hash_find_ptr(&ce->function_table, key)) != NULL) { - if (existing_fn->common.scope == ce) { - /* members from the current class override trait methods */ - /* use temporary *overriden HashTable to detect hidden conflict */ - if (*overriden) { - if ((existing_fn = zend_hash_find_ptr(*overriden, key)) != NULL) { - if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* Make sure the trait method is compatible with previosly declared abstract method */ - if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { - zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", - zend_get_function_declaration(fn TSRMLS_CC), - zend_get_function_declaration(existing_fn TSRMLS_CC)); - } - } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* Make sure the abstract declaration is compatible with previous declaration */ - if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { - zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", - zend_get_function_declaration(fn TSRMLS_CC), - zend_get_function_declaration(existing_fn TSRMLS_CC)); - } - return; - } - } - } else { - ALLOC_HASHTABLE(*overriden); - zend_hash_init_ex(*overriden, 8, NULL, ptr_dtor, 0, 0); - } - fn = zend_hash_update_mem(*overriden, key, fn, sizeof(zend_function)); - return; - } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* Make sure the trait method is compatible with previosly declared abstract method */ - if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { - zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", - zend_get_function_declaration(fn TSRMLS_CC), - zend_get_function_declaration(existing_fn TSRMLS_CC)); - } - } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* Make sure the abstract declaration is compatible with previous declaration */ - if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { - zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", - zend_get_function_declaration(fn TSRMLS_CC), - zend_get_function_declaration(existing_fn TSRMLS_CC)); - } - return; - } else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - /* two traits can't define the same non-abstract method */ -#if 1 - zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", - name, ce->name->val); -#else /* TODO: better error message */ - zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s", - fn->common.scope->name->val, fn->common.function_name->val, - ce->name->val, name, - existing_fn->common.scope->name->val, existing_fn->common.function_name->val); -#endif - } else { - /* inherited members are overridden by members inserted by traits */ - /* check whether the trait method fulfills the inheritance requirements */ - do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); - } - } - - function_add_ref(fn); - new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); - memcpy(new_fn, fn, sizeof(zend_op_array)); - fn = zend_hash_update_ptr(&ce->function_table, key, new_fn); - zend_add_magic_methods(ce, key, fn TSRMLS_CC); -} -/* }}} */ - -static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /* {{{ */ -{ - if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - - fn->common.scope = ce; - - if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; - } - if (fn->op_array.static_variables) { - ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; - } - } -} -/* }}} */ - -static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, zend_class_entry *ce, HashTable **overriden, HashTable *exclude_table TSRMLS_DC) /* {{{ */ -{ - zend_trait_alias *alias, **alias_ptr; - zend_string *lcname; - zend_function fn_copy; - - /* apply aliases which are qualified with a class name, there should not be any ambiguity */ - if (ce->trait_aliases) { - alias_ptr = ce->trait_aliases; - alias = *alias_ptr; - while (alias) { - /* Scope unset or equal to the function we compare to, and the alias applies to fn */ - if (alias->alias != NULL - && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) - && alias->trait_method->method_name->len == fnname->len - && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) { - fn_copy = *fn; - - /* if it is 0, no modifieres has been changed */ - if (alias->modifiers) { - fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK)); - } - - lcname = zend_string_alloc(alias->alias->len, 0); - zend_str_tolower_copy(lcname->val, alias->alias->val, alias->alias->len); - zend_add_trait_method(ce, alias->alias->val, lcname, &fn_copy, overriden TSRMLS_CC); - zend_string_release(lcname); - - /* Record the trait from which this alias was resolved. */ - if (!alias->trait_method->ce) { - alias->trait_method->ce = fn->common.scope; - } - } - alias_ptr++; - alias = *alias_ptr; - } - } - - if (exclude_table == NULL || zend_hash_find(exclude_table, fnname) == NULL) { - /* is not in hashtable, thus, function is not to be excluded */ - fn_copy = *fn; - - /* apply aliases which have not alias name, just setting visibility */ - if (ce->trait_aliases) { - alias_ptr = ce->trait_aliases; - alias = *alias_ptr; - while (alias) { - /* Scope unset or equal to the function we compare to, and the alias applies to fn */ - if (alias->alias == NULL && alias->modifiers != 0 - && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) - && (alias->trait_method->method_name->len == fnname->len) - && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) { - - fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK)); - - /** Record the trait from which this alias was resolved. */ - if (!alias->trait_method->ce) { - alias->trait_method->ce = fn->common.scope; - } - } - alias_ptr++; - alias = *alias_ptr; - } - } - - zend_add_trait_method(ce, fn->common.function_name->val, fnname, &fn_copy, overriden TSRMLS_CC); - } - - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */ -{ - uint32_t i; - - if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) { - zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name->val); - } - - for (i = 0; i < ce->num_traits; i++) { - if (ce->traits[i] == trait) { - return; - } - } - zend_error_noreturn(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name->val, ce->name->val); -} -/* }}} */ - -static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - size_t i, j = 0; - zend_trait_precedence *cur_precedence; - zend_trait_method_reference *cur_method_ref; - zend_string *lcname; - zend_bool method_exists; - - /* resolve class references */ - if (ce->trait_precedences) { - i = 0; - while ((cur_precedence = ce->trait_precedences[i])) { - /** Resolve classes for all precedence operations. */ - if (cur_precedence->exclude_from_classes) { - cur_method_ref = cur_precedence->trait_method; - if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name, - ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val); - } - zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC); - - /** Ensure that the prefered method is actually available. */ - lcname = zend_string_alloc(cur_method_ref->method_name->len, 0); - zend_str_tolower_copy(lcname->val, - cur_method_ref->method_name->val, - cur_method_ref->method_name->len); - method_exists = zend_hash_exists(&cur_method_ref->ce->function_table, - lcname); - zend_string_free(lcname); - if (!method_exists) { - zend_error_noreturn(E_COMPILE_ERROR, - "A precedence rule was defined for %s::%s but this method does not exist", - cur_method_ref->ce->name->val, - cur_method_ref->method_name->val); - } - - /** With the other traits, we are more permissive. - We do not give errors for those. This allows to be more - defensive in such definitions. - However, we want to make sure that the insteadof declaration - is consistent in itself. - */ - j = 0; - while (cur_precedence->exclude_from_classes[j].class_name) { - zend_string* class_name = cur_precedence->exclude_from_classes[j].class_name; - - if (!(cur_precedence->exclude_from_classes[j].ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name->val); - } - zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j].ce TSRMLS_CC); - - /* make sure that the trait method is not from a class mentioned in - exclude_from_classes, for consistency */ - if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i].ce) { - zend_error_noreturn(E_COMPILE_ERROR, - "Inconsistent insteadof definition. " - "The method %s is to be used from %s, but %s is also on the exclude list", - cur_method_ref->method_name->val, - cur_precedence->trait_method->ce->name->val, - cur_precedence->trait_method->ce->name->val); - } - - zend_string_release(class_name); - j++; - } - } - i++; - } - } - - if (ce->trait_aliases) { - i = 0; - while (ce->trait_aliases[i]) { - /** For all aliases with an explicit class name, resolve the class now. */ - if (ce->trait_aliases[i]->trait_method->class_name) { - cur_method_ref = ce->trait_aliases[i]->trait_method; - if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val); - } - zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC); - - /** And, ensure that the referenced method is resolvable, too. */ - lcname = zend_string_alloc(cur_method_ref->method_name->len, 0); - zend_str_tolower_copy(lcname->val, - cur_method_ref->method_name->val, - cur_method_ref->method_name->len); - method_exists = zend_hash_exists(&cur_method_ref->ce->function_table, - lcname); - zend_string_free(lcname); - - if (!method_exists) { - zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name->val, cur_method_ref->method_name->val); - } - } - i++; - } - } -} -/* }}} */ - -static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_trait_precedence **precedences, zend_class_entry *trait) /* {{{ */ -{ - size_t i = 0, j; - - if (!precedences) { - return; - } - while (precedences[i]) { - if (precedences[i]->exclude_from_classes) { - j = 0; - while (precedences[i]->exclude_from_classes[j].ce) { - if (precedences[i]->exclude_from_classes[j].ce == trait) { - zend_string *lcname = zend_string_alloc(precedences[i]->trait_method->method_name->len, 0); - - zend_str_tolower_copy(lcname->val, - precedences[i]->trait_method->method_name->val, - precedences[i]->trait_method->method_name->len); - if (zend_hash_add_empty_element(exclude_table, lcname) == NULL) { - zend_string_release(lcname); - zend_error_noreturn(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name->val, trait->name->val); - } - zend_string_release(lcname); - } - ++j; - } - } - ++i; - } -} -/* }}} */ - -static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - uint32_t i; - HashTable *overriden = NULL; - zend_string *key; - zend_function *fn; - - for (i = 0; i < ce->num_traits; i++) { - if (ce->trait_precedences) { - HashTable exclude_table; - - /* TODO: revisit this start size, may be its not optimal */ - zend_hash_init_ex(&exclude_table, 8, NULL, NULL, 0, 0); - - zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]); - - /* copies functions, applies defined aliasing, and excludes unused trait methods */ - ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) { - zend_traits_copy_functions(key, fn, ce, &overriden, &exclude_table TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - - zend_hash_destroy(&exclude_table); - } else { - ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) { - zend_traits_copy_functions(key, fn, ce, &overriden, NULL TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - } - } - - ZEND_HASH_FOREACH_PTR(&ce->function_table, fn) { - zend_fixup_trait_method(fn, ce); - } ZEND_HASH_FOREACH_END(); - - if (overriden) { - zend_hash_destroy(overriden); - FREE_HASHTABLE(overriden); - } -} -/* }}} */ - -static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, zend_string *prop_name, zend_class_entry *coliding_ce) /* {{{ */ -{ - size_t i; - - if (coliding_ce == ce) { - for (i = 0; i < current_trait; i++) { - if (zend_hash_exists(&ce->traits[i]->properties_info, prop_name)) { - return ce->traits[i]; - } - } - } - - return coliding_ce; -} -/* }}} */ - -static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - size_t i; - zend_property_info *property_info; - zend_property_info *coliding_prop; - zval compare_result; - zend_string* prop_name; - const char* class_name_unused; - zend_bool not_compatible; - zval* prop_value; - uint32_t flags; - zend_string *doc_comment; - - /* In the following steps the properties are inserted into the property table - * for that, a very strict approach is applied: - * - check for compatibility, if not compatible with any property in class -> fatal - * - if compatible, then strict notice - */ - for (i = 0; i < ce->num_traits; i++) { - ZEND_HASH_FOREACH_PTR(&ce->traits[i]->properties_info, property_info) { - /* first get the unmangeld name if necessary, - * then check whether the property is already there - */ - flags = property_info->flags; - if ((flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) { - prop_name = zend_string_copy(property_info->name); - } else { - const char *pname; - int pname_len; - - /* for private and protected we need to unmangle the names */ - zend_unmangle_property_name_ex(property_info->name->val, property_info->name->len, - &class_name_unused, &pname, &pname_len); - prop_name = zend_string_init(pname, pname_len, 0); - } - - /* next: check for conflicts with current class */ - if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) { - if (coliding_prop->flags & ZEND_ACC_SHADOW) { - zend_hash_del(&ce->properties_info, prop_name); - flags |= ZEND_ACC_CHANGED; - } else { - if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC)) - == (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) { - /* flags are identical, now the value needs to be checked */ - if (flags & ZEND_ACC_STATIC) { - not_compatible = (FAILURE == compare_function(&compare_result, - &ce->default_static_members_table[coliding_prop->offset], - &ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC)) - || (Z_LVAL(compare_result) != 0); - } else { - not_compatible = (FAILURE == compare_function(&compare_result, - &ce->default_properties_table[coliding_prop->offset], - &ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC)) - || (Z_LVAL(compare_result) != 0); - } - } else { - /* the flags are not identical, thus, we assume properties are not compatible */ - not_compatible = 1; - } - - if (not_compatible) { - zend_error_noreturn(E_COMPILE_ERROR, - "%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed", - find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val, - property_info->ce->name->val, - prop_name->val, - ce->name->val); - } else { - zend_error(E_STRICT, - "%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed", - find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val, - property_info->ce->name->val, - prop_name->val, - ce->name->val); - zend_string_release(prop_name); - continue; - } - } - } - - /* property not found, so lets add it */ - if (flags & ZEND_ACC_STATIC) { - prop_value = &ce->traits[i]->default_static_members_table[property_info->offset]; - } else { - prop_value = &ce->traits[i]->default_properties_table[property_info->offset]; - } - if (Z_REFCOUNTED_P(prop_value)) Z_ADDREF_P(prop_value); - - doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL; - zend_declare_property_ex(ce, prop_name, - prop_value, flags, - doc_comment TSRMLS_CC); - zend_string_release(prop_name); - } ZEND_HASH_FOREACH_END(); - } -} -/* }}} */ - -static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - int i = 0; - zend_trait_alias* cur_alias; - zend_string* lc_method_name; - - if (ce->trait_aliases) { - while (ce->trait_aliases[i]) { - cur_alias = ce->trait_aliases[i]; - /** The trait for this alias has not been resolved, this means, this - alias was not applied. Abort with an error. */ - if (!cur_alias->trait_method->ce) { - if (cur_alias->alias) { - /** Plain old inconsistency/typo/bug */ - zend_error_noreturn(E_COMPILE_ERROR, - "An alias (%s) was defined for method %s(), but this method does not exist", - cur_alias->alias->val, - cur_alias->trait_method->method_name->val); - } else { - /** Here are two possible cases: - 1) this is an attempt to modifiy the visibility - of a method introduce as part of another alias. - Since that seems to violate the DRY principle, - we check against it and abort. - 2) it is just a plain old inconsitency/typo/bug - as in the case where alias is set. */ - - lc_method_name = zend_string_alloc(cur_alias->trait_method->method_name->len, 0); - zend_str_tolower_copy( - lc_method_name->val, - cur_alias->trait_method->method_name->val, - cur_alias->trait_method->method_name->len); - if (zend_hash_exists(&ce->function_table, - lc_method_name)) { - zend_string_free(lc_method_name); - zend_error_noreturn(E_COMPILE_ERROR, - "The modifiers for the trait alias %s() need to be changed in the same statment in which the alias is defined. Error", - cur_alias->trait_method->method_name->val); - } else { - zend_string_free(lc_method_name); - zend_error_noreturn(E_COMPILE_ERROR, - "The modifiers of the trait method %s() are changed, but this method does not exist. Error", - cur_alias->trait_method->method_name->val); - - } - } - } - i++; - } - } -} -/* }}} */ - -ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - - if (ce->num_traits <= 0) { - return; - } - - /* complete initialization of trait strutures in ce */ - zend_traits_init_trait_structures(ce TSRMLS_CC); - - /* first care about all methods to be flattened into the class */ - zend_do_traits_method_binding(ce TSRMLS_CC); - - /* Aliases which have not been applied indicate typos/bugs. */ - zend_do_check_for_inconsistent_traits_aliasing(ce TSRMLS_CC); - - /* then flatten the properties into it, to, mostly to notfiy developer about problems */ - zend_do_traits_property_binding(ce TSRMLS_CC); - - /* verify that all abstract methods from traits have been implemented */ - zend_verify_abstract_class(ce TSRMLS_CC); - - /* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */ - if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) { - ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; - } -} -/* }}} */ - ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time TSRMLS_DC) /* {{{ */ { zend_function *function, *new_function; @@ -2668,13 +1093,11 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS } /* }}} */ -ZEND_API zend_string *zend_mangle_property_name(const char *src1, int src1_length, const char *src2, int src2_length, int internal) /* {{{ */ +ZEND_API zend_string *zend_mangle_property_name(const char *src1, size_t src1_length, const char *src2, size_t src2_length, int internal) /* {{{ */ { - zend_string *prop_name; - int prop_name_length; + size_t prop_name_length = 1 + src1_length + 1 + src2_length; + zend_string *prop_name = zend_string_alloc(prop_name_length, internal); - prop_name_length = 1 + src1_length + 1 + src2_length; - prop_name = zend_string_alloc(prop_name_length, internal); prop_name->val[0] = '\0'; memcpy(prop_name->val + 1, src1, src1_length+1); memcpy(prop_name->val + 1 + src1_length + 1, src2, src2_length+1); @@ -2682,105 +1105,94 @@ ZEND_API zend_string *zend_mangle_property_name(const char *src1, int src1_lengt } /* }}} */ -static int zend_strnlen(const char* s, int maxlen) /* {{{ */ +static int zend_strnlen(const char* s, size_t maxlen) /* {{{ */ { - int len = 0; + size_t len = 0; while (*s++ && maxlen--) len++; return len; } /* }}} */ -ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int len, const char **class_name, const char **prop_name, int *prop_len) /* {{{ */ +ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char **class_name, const char **prop_name, size_t *prop_len) /* {{{ */ { - int class_name_len; + size_t class_name_len; *class_name = NULL; - if (mangled_property[0]!=0) { - *prop_name = mangled_property; + if (name->val[0] != '\0') { + *prop_name = name->val; if (prop_len) { - *prop_len = len; + *prop_len = name->len; } return SUCCESS; } - if (len < 3 || mangled_property[1]==0) { + if (name->len < 3 || name->val[1] == '\0') { zend_error(E_NOTICE, "Illegal member variable name"); - *prop_name = mangled_property; + *prop_name = name->val; if (prop_len) { - *prop_len = len; + *prop_len = name->len; } return FAILURE; } - class_name_len = zend_strnlen(mangled_property + 1, --len - 1) + 1; - if (class_name_len >= len || mangled_property[class_name_len]!=0) { + class_name_len = zend_strnlen(name->val + 1, name->len - 2); + if (class_name_len >= name->len - 2 || name->val[class_name_len + 1] != '\0') { zend_error(E_NOTICE, "Corrupt member variable name"); - *prop_name = mangled_property; + *prop_name = name->val; if (prop_len) { - *prop_len = len + 1; + *prop_len = name->len; } return FAILURE; } - *class_name = mangled_property + 1; - *prop_name = (*class_name) + class_name_len; + + *class_name = name->val + 1; + *prop_name = name->val + class_name_len + 2; if (prop_len) { - *prop_len = len - class_name_len; + *prop_len = name->len - class_name_len - 2; } return SUCCESS; } /* }}} */ -static zend_constant *zend_get_ct_const(zend_string *name, int all_internal_constants_substitution TSRMLS_DC) /* {{{ */ +static zend_constant *zend_lookup_reserved_const(const char *name, size_t len TSRMLS_DC) /* {{{ */ { - zend_constant *c = NULL; - char *lookup_name; - - if (name->val[0] == '\\') { - c = zend_hash_str_find_ptr(EG(zend_constants), name->val + 1, name->len - 1); - if (!c) { - lookup_name = zend_str_tolower_dup(name->val + 1, name->len - 1); - c = zend_hash_str_find_ptr(EG(zend_constants), lookup_name, name->len - 1); - efree(lookup_name); - - if (c && (c->flags & CONST_CT_SUBST) && !(c->flags & CONST_CS)) { - return c; - } - return NULL; - } - } else if ((c = zend_hash_find_ptr(EG(zend_constants), name)) == NULL) { - lookup_name = zend_str_tolower_dup(name->val, name->len); - c = zend_hash_str_find_ptr(EG(zend_constants), lookup_name, name->len); - efree(lookup_name); - - if (c && (c->flags & CONST_CT_SUBST) && !(c->flags & CONST_CS)) { - return c; - } - return NULL; - } - - if (c->flags & CONST_CT_SUBST) { - return c; - } - if (all_internal_constants_substitution && - (c->flags & CONST_PERSISTENT) && - !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION) && - !Z_CONSTANT(c->value)) { + zend_constant *c = zend_hash_find_ptr_lc(EG(zend_constants), name, len); + if (c && !(c->flags & CONST_CS) && (c->flags & CONST_CT_SUBST)) { return c; } return NULL; } /* }}} */ -static int zend_constant_ct_subst(znode *result, zval *const_name, int all_internal_constants_substitution TSRMLS_DC) /* {{{ */ +static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool is_fully_qualified TSRMLS_DC) /* {{{ */ { - zend_constant *c = zend_get_ct_const(Z_STR_P(const_name), - all_internal_constants_substitution TSRMLS_CC); + zend_constant *c; - if (c) { - result->op_type = IS_CONST; - ZVAL_DUP(&result->u.constant, &c->value); - return 1; + if (!(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION)) { + /* Substitute case-sensitive (or lowercase) persistent constants */ + c = zend_hash_find_ptr(EG(zend_constants), name); + if (c && (c->flags & CONST_PERSISTENT)) { + ZVAL_DUP(zv, &c->value); + return 1; + } } + + { + /* Substitute true, false and null (including unqualified usage in namespaces) */ + const char *lookup_name = name->val; + size_t lookup_len = name->len; + + if (!is_fully_qualified) { + zend_get_unqualified_name(name, &lookup_name, &lookup_len); + } + + c = zend_lookup_reserved_const(lookup_name, lookup_len TSRMLS_CC); + if (c) { + ZVAL_DUP(zv, &c->value); + return 1; + } + } + return 0; } /* }}} */ @@ -2934,9 +1346,6 @@ again: if (LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-1] != '>') { CG(increment_lineno) = 1; } - if (CG(has_bracketed_namespaces) && !CG(in_namespace)) { - goto again; - } retval = ';'; /* implicit ; */ break; case T_OPEN_TAG_WITH_ECHO: @@ -3311,7 +1720,9 @@ static zend_op *zend_emit_op_tmp(znode *result, zend_uchar opcode, znode *op1, z SET_NODE(opline->op2, op2); } - zend_make_tmp_result(result, opline TSRMLS_CC); + if (result) { + zend_make_tmp_result(result, opline TSRMLS_CC); + } return opline; } @@ -3575,7 +1986,6 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint zend_compile_expr(&name_node, name_ast TSRMLS_CC); - opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL TSRMLS_CC); opline->extended_value = ZEND_FETCH_LOCAL; @@ -3613,6 +2023,22 @@ static void zend_separate_if_call_and_write(znode *node, zend_ast *ast, uint32_t /* }}} */ void zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC); +void zend_compile_assign(znode *result, zend_ast *ast TSRMLS_DC); +static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_node TSRMLS_DC); + +static inline void zend_emit_assign_znode(zend_ast *var_ast, znode *value_node TSRMLS_DC) /* {{{ */ +{ + znode dummy_node; + if (var_ast->kind == ZEND_AST_LIST) { + zend_compile_list_assign(&dummy_node, var_ast, value_node TSRMLS_CC); + } else { + zend_ast *assign_ast = zend_ast_create(ZEND_AST_ASSIGN, var_ast, + zend_ast_create_znode(value_node)); + zend_compile_assign(&dummy_node, assign_ast TSRMLS_CC); + } + zend_do_free(&dummy_node TSRMLS_CC); +} +/* }}} */ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */ { @@ -3773,7 +2199,7 @@ static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_n for (i = 0; i < list->children; ++i) { zend_ast *var_ast = list->child[i]; - znode fetch_result, dim_node, var_node, assign_result; + znode fetch_result, dim_node; zend_op *opline; if (var_ast == NULL) { @@ -3791,17 +2217,7 @@ static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_n get_list_fetch_opcode(expr_node->op_type), expr_node, &dim_node TSRMLS_CC); opline->extended_value |= ZEND_FETCH_ADD_LOCK; - if (var_ast->kind != ZEND_AST_LIST) { - if (is_this_fetch(var_ast)) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); - } - zend_compile_var(&var_node, var_ast, BP_VAR_W TSRMLS_CC); - zend_emit_op(&assign_result, ZEND_ASSIGN, &var_node, &fetch_result TSRMLS_CC); - zend_do_free(&assign_result TSRMLS_CC); - } else { - zend_compile_list_assign(&assign_result, var_ast, &fetch_result TSRMLS_CC); - zend_do_free(&assign_result TSRMLS_CC); - } + zend_emit_assign_znode(var_ast, &fetch_result TSRMLS_CC); } *result = *expr_node; } @@ -3903,16 +2319,6 @@ void zend_compile_assign(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ } /* }}} */ -static inline void zend_emit_assign_znode(zend_ast *var_ast, znode *value_node TSRMLS_DC) /* {{{ */ -{ - znode dummy_node; - zend_ast *assign_ast = zend_ast_create(ZEND_AST_ASSIGN, var_ast, - zend_ast_create_znode(value_node)); - zend_compile_assign(&dummy_node, assign_ast TSRMLS_CC); - zend_do_free(&dummy_node TSRMLS_CC); -} -/* }}} */ - void zend_compile_assign_ref(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ { zend_ast *target_ast = ast->child[0]; @@ -3929,6 +2335,10 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ zend_compile_var(&target_node, target_ast, BP_VAR_W TSRMLS_CC); zend_compile_var(&source_node, source_ast, BP_VAR_REF TSRMLS_CC); + if (source_node.op_type != IS_VAR && zend_is_call(source_ast)) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use result of built-in function in write context"); + } + opline = zend_emit_op(result, ZEND_ASSIGN_REF, &target_node, &source_node TSRMLS_CC); if (!result) { opline->result_type |= EXT_TYPE_UNUSED; @@ -4142,7 +2552,7 @@ void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args_ast TS SET_UNUSED(opline->op1); opline->op2_type = IS_CONST; opline->op2.constant = zend_add_ns_func_name_literal( - CG(active_op_array), &name_node->u.constant TSRMLS_CC); + CG(active_op_array), Z_STR(name_node->u.constant) TSRMLS_CC); zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC); zend_compile_call_common(result, args_ast, NULL TSRMLS_CC); @@ -4156,8 +2566,8 @@ void zend_compile_dynamic_call(znode *result, znode *name_node, zend_ast *args_a SET_UNUSED(opline->op1); if (name_node->op_type == IS_CONST && Z_TYPE(name_node->u.constant) == IS_STRING) { opline->op2_type = IS_CONST; - opline->op2.constant - = zend_add_func_name_literal(CG(active_op_array), &name_node->u.constant TSRMLS_CC); + opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), + Z_STR(name_node->u.constant) TSRMLS_CC); zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC); } else { SET_NODE(opline->op2, name_node); @@ -4243,13 +2653,13 @@ int zend_compile_func_defined(znode *result, zend_ast_list *args TSRMLS_DC) /* { } /* }}} */ -static int zend_try_compile_ct_bound_init_user_func(znode *result, zend_ast *name_ast, uint32_t num_args TSRMLS_DC) /* {{{ */ +static int zend_try_compile_ct_bound_init_user_func(zend_ast *name_ast, uint32_t num_args TSRMLS_DC) /* {{{ */ { zend_string *name, *lcname; zend_function *fbc; zend_op *opline; - if (name_ast->kind != ZEND_AST_CONST || Z_TYPE_P(zend_ast_get_zval(name_ast)) != IS_STRING) { + if (name_ast->kind != ZEND_AST_ZVAL || Z_TYPE_P(zend_ast_get_zval(name_ast)) != IS_STRING) { return FAILURE; } @@ -4266,20 +2676,22 @@ static int zend_try_compile_ct_bound_init_user_func(znode *result, zend_ast *nam } opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, NULL TSRMLS_CC); + opline->extended_value = num_args; + opline->op2_type = IS_CONST; LITERAL_STR(opline->op2, lcname); - opline->extended_value = num_args; + zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC); return SUCCESS; } /* }}} */ -static void zend_compile_init_user_func(znode *result, zend_ast *name_ast, uint32_t num_args, zend_string *orig_func_name TSRMLS_DC) /* {{{ */ +static void zend_compile_init_user_func(zend_ast *name_ast, uint32_t num_args, zend_string *orig_func_name TSRMLS_DC) /* {{{ */ { zend_op *opline; znode name_node; - if (zend_try_compile_ct_bound_init_user_func(result, name_ast, num_args TSRMLS_CC) == SUCCESS) { + if (zend_try_compile_ct_bound_init_user_func(name_ast, num_args TSRMLS_CC) == SUCCESS) { return; } @@ -4301,7 +2713,7 @@ int zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcna return FAILURE; } - zend_compile_init_user_func(NULL, args->child[0], 1, lcname TSRMLS_CC); + zend_compile_init_user_func(args->child[0], 1, lcname TSRMLS_CC); zend_compile_expr(&arg_node, args->child[1] TSRMLS_CC); zend_emit_op(NULL, ZEND_SEND_ARRAY, &arg_node, NULL TSRMLS_CC); zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL TSRMLS_CC); @@ -4319,7 +2731,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam return FAILURE; } - zend_compile_init_user_func(NULL, args->child[0], args->children - 1, lcname TSRMLS_CC); + zend_compile_init_user_func(args->child[0], args->children - 1, lcname TSRMLS_CC); for (i = 1; i < args->children; ++i) { zend_ast *arg_ast = args->child[i]; znode arg_node; @@ -4469,8 +2881,8 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type TSRMLS } opline->op2_type = IS_CONST; - opline->op2.constant = - zend_add_func_name_literal(CG(active_op_array), &method_node.u.constant TSRMLS_CC); + opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), + Z_STR(method_node.u.constant) TSRMLS_CC); zend_alloc_polymorphic_cache_slot(opline->op2.constant TSRMLS_CC); } else { SET_NODE(opline->op2, &method_node); @@ -4524,8 +2936,8 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type TSRMLS if (method_node.op_type == IS_CONST) { opline->op2_type = IS_CONST; - opline->op2.constant = - zend_add_func_name_literal(CG(active_op_array), &method_node.u.constant TSRMLS_CC); + opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), + Z_STR(method_node.u.constant) TSRMLS_CC); if (opline->op1_type == IS_CONST) { zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC); } else { @@ -4551,7 +2963,7 @@ void zend_compile_new(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ zend_compile_class_ref(&class_node, class_ast TSRMLS_CC); opnum = get_next_op_number(CG(active_op_array)); - opline = zend_emit_op(result, ZEND_NEW, &class_node, NULL TSRMLS_CC); + zend_emit_op(result, ZEND_NEW, &class_node, NULL TSRMLS_CC); zend_compile_call_common(&ctor_result, args_ast, NULL TSRMLS_CC); zend_do_free(&ctor_result TSRMLS_CC); @@ -4588,7 +3000,8 @@ void zend_compile_global_var(zend_ast *ast TSRMLS_DC) /* {{{ */ } if (zend_try_compile_cv(&result, var_ast TSRMLS_CC) == SUCCESS) { - zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node TSRMLS_CC); + zend_op *opline = zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node TSRMLS_CC); + zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC); } else { zend_emit_op(&result, ZEND_FETCH_W, &name_node, NULL TSRMLS_CC); @@ -4804,11 +3217,9 @@ void zend_compile_goto(zend_ast *ast TSRMLS_DC) /* {{{ */ void zend_compile_label(zend_ast *ast TSRMLS_DC) /* {{{ */ { - zval *label = zend_ast_get_zval(ast->child[0]); + zend_string *label = zend_ast_get_str(ast->child[0]); zend_label dest; - ZEND_ASSERT(Z_TYPE_P(label) == IS_STRING); - if (!CG(context).labels) { ALLOC_HASHTABLE(CG(context).labels); zend_hash_init(CG(context).labels, 8, NULL, ptr_dtor, 0); @@ -4817,8 +3228,8 @@ void zend_compile_label(zend_ast *ast TSRMLS_DC) /* {{{ */ dest.brk_cont = CG(context).current_brk_cont; dest.opline_num = get_next_op_number(CG(active_op_array)); - if (!zend_hash_add_mem(CG(context).labels, Z_STR_P(label), &dest, sizeof(zend_label))) { - zend_error_noreturn(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL_P(label)); + if (!zend_hash_add_mem(CG(context).labels, label, &dest, sizeof(zend_label))) { + zend_error_noreturn(E_COMPILE_ERROR, "Label '%s' already defined", label->val); } } /* }}} */ @@ -4935,7 +3346,7 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */ zend_bool is_variable = zend_is_variable(expr_ast) && !zend_is_call(expr_ast) && zend_can_write_to_variable(expr_ast); - znode expr_node, reset_node, value_node, key_node, dummy_node; + znode expr_node, reset_node, value_node, key_node; zend_op *opline; uint32_t opnum_reset, opnum_fetch; @@ -4958,10 +3369,14 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */ zend_compile_expr(&expr_node, expr_ast TSRMLS_CC); } + if (by_ref) { + zend_separate_if_call_and_write(&expr_node, expr_ast, BP_VAR_W TSRMLS_CC); + } + opnum_reset = get_next_op_number(CG(active_op_array)); opline = zend_emit_op(&reset_node, ZEND_FE_RESET, &expr_node, NULL TSRMLS_CC); if (by_ref && is_variable) { - opline->extended_value = ZEND_FE_RESET_VARIABLE | ZEND_FE_RESET_REFERENCE; // ??? + opline->extended_value = ZEND_FE_FETCH_BYREF; } zend_stack_push(&CG(loop_var_stack), &reset_node); @@ -4989,10 +3404,7 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */ zend_make_tmp_result(&key_node, opline TSRMLS_CC); } - if (value_ast->attr == ZEND_AST_LIST) { - zend_compile_list_assign(&dummy_node, value_ast, &value_node TSRMLS_CC); - zend_do_free(&dummy_node TSRMLS_CC); - } else if (by_ref) { + if (by_ref) { zend_emit_assign_ref_znode(value_ast, &value_node TSRMLS_CC); } else { zend_emit_assign_znode(value_ast, &value_node TSRMLS_CC); @@ -5091,6 +3503,11 @@ void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */ znode cond_node; if (!cond_ast) { + if (has_default_case) { + CG(zend_lineno) = case_ast->lineno; + zend_error_noreturn(E_COMPILE_ERROR, + "Switch statements may only contain one default clause"); + } has_default_case = 1; continue; } @@ -5129,7 +3546,7 @@ void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */ zend_end_loop(get_next_op_number(CG(active_op_array)), 1 TSRMLS_CC); if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) { - zend_emit_op(NULL, expr_node.op_type == IS_TMP_VAR ? ZEND_FREE : ZEND_SWITCH_FREE, + zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL TSRMLS_CC); } else if (expr_node.op_type == IS_CONST) { zval_dtor(&expr_node.u.constant); @@ -5518,8 +3935,6 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo } if (op_array->fn_flags & ZEND_ACC_ABSTRACT) { - //zend_op *opline; - if (op_array->fn_flags & ZEND_ACC_PRIVATE) { zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", in_interface ? "Interface" : "Abstract", ce->name->val, name->val); @@ -5531,11 +3946,6 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo } ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; - - /*opline = get_next_op(op_array TSRMLS_CC); - opline->opcode = ZEND_RAISE_ABSTRACT_ERROR; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2);*/ } else if (!has_body) { zend_error_noreturn(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", ce->name->val, name->val); @@ -6288,10 +4698,11 @@ void zend_compile_use(zend_ast *ast TSRMLS_DC) /* {{{ */ if (new_name_ast) { new_name = zend_string_copy(zend_ast_get_str(new_name_ast)); } else { - /* The form "use A\B" is eqivalent to "use A\B as B" */ - const char *p = zend_memrchr(old_name->val, '\\', old_name->len); - if (p) { - new_name = zend_string_init(p + 1, old_name->len - (p - old_name->val + 1), 0); + const char *unqualified_name; + size_t unqualified_name_len; + if (zend_get_unqualified_name(old_name, &unqualified_name, &unqualified_name_len)) { + /* The form "use A\B" is eqivalent to "use A\B as B" */ + new_name = zend_string_init(unqualified_name, unqualified_name_len, 0); } else { new_name = zend_string_copy(old_name); @@ -6395,11 +4806,12 @@ void zend_compile_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */ value_node.op_type = IS_CONST; zend_const_expr_to_zval(value_zv, value_ast TSRMLS_CC); - if (zend_get_ct_const(name, 0 TSRMLS_CC)) { + if (zend_lookup_reserved_const(name->val, name->len TSRMLS_CC)) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", name->val); } name = zend_prefix_with_ns(name TSRMLS_CC); + name = zend_new_interned_string(name TSRMLS_CC); if (CG(current_import_const) && (import_name = zend_hash_find_ptr(CG(current_import_const), name)) @@ -6524,7 +4936,7 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC) ZVAL_LONG(zv, CG(zend_lineno)); break; case T_FILE: - ZVAL_STR(zv, zend_string_copy(CG(compiled_filename))); + ZVAL_STR_COPY(zv, CG(compiled_filename)); break; case T_DIR: { @@ -6547,7 +4959,7 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC) } case T_FUNC_C: if (op_array && op_array->function_name) { - ZVAL_STR(zv, zend_string_copy(op_array->function_name)); + ZVAL_STR_COPY(zv, op_array->function_name); } else { ZVAL_EMPTY_STRING(zv); } @@ -6555,13 +4967,13 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC) case T_METHOD_C: if (ce) { if (op_array && op_array->function_name) { - ZVAL_STR(zv, zend_concat3(ce->name->val, ce->name->len, "::", 2, + ZVAL_NEW_STR(zv, zend_concat3(ce->name->val, ce->name->len, "::", 2, op_array->function_name->val, op_array->function_name->len)); } else { - ZVAL_STR(zv, zend_string_copy(ce->name)); + ZVAL_STR_COPY(zv, ce->name); } } else if (op_array && op_array->function_name) { - ZVAL_STR(zv, zend_string_copy(op_array->function_name)); + ZVAL_STR_COPY(zv, op_array->function_name); } else { ZVAL_EMPTY_STRING(zv); } @@ -6571,7 +4983,7 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC) if (ZEND_CE_IS_TRAIT(ce)) { return 0; } else { - ZVAL_STR(zv, zend_string_copy(ce->name)); + ZVAL_STR_COPY(zv, ce->name); } } else { ZVAL_EMPTY_STRING(zv); @@ -6579,14 +4991,14 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC) break; case T_TRAIT_C: if (ce && ZEND_CE_IS_TRAIT(ce)) { - ZVAL_STR(zv, zend_string_copy(ce->name)); + ZVAL_STR_COPY(zv, ce->name); } else { ZVAL_EMPTY_STRING(zv); } break; case T_NS_C: if (CG(current_namespace)) { - ZVAL_STR(zv, zend_string_copy(CG(current_namespace))); + ZVAL_STR_COPY(zv, CG(current_namespace)); } else { ZVAL_EMPTY_STRING(zv); } @@ -6851,7 +5263,7 @@ void zend_compile_cast(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ zend_compile_expr(&expr_node, expr_ast TSRMLS_CC); - opline = zend_emit_op(result, ZEND_CAST, &expr_node, NULL TSRMLS_CC); + opline = zend_emit_op_tmp(result, ZEND_CAST, &expr_node, NULL TSRMLS_CC); opline->extended_value = ast->attr; } /* }}} */ @@ -6876,17 +5288,7 @@ static void zend_compile_shorthand_conditional(znode *result, zend_ast *ast TSRM opline_jmp_set = &CG(active_op_array)->opcodes[opnum_jmp_set]; opline_jmp_set->op2.opline_num = get_next_op_number(CG(active_op_array)) + 1; - if (cond_node.op_type == IS_VAR || cond_node.op_type == IS_CV - || false_node.op_type == IS_VAR || false_node.op_type == IS_CV - ) { - opline_jmp_set->opcode = ZEND_JMP_SET_VAR; - opline_jmp_set->result_type = IS_VAR; - GET_NODE(result, opline_jmp_set->result); - - opline_qm_assign = zend_emit_op(NULL, ZEND_QM_ASSIGN_VAR, &false_node, NULL TSRMLS_CC); - } else { - opline_qm_assign = zend_emit_op(NULL, ZEND_QM_ASSIGN, &false_node, NULL TSRMLS_CC); - } + opline_qm_assign = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &false_node, NULL TSRMLS_CC); SET_NODE(opline_qm_assign->result, result); } /* }}} */ @@ -6913,7 +5315,7 @@ void zend_compile_conditional(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ zend_compile_expr(&true_node, true_ast TSRMLS_CC); opnum_qm_assign1 = get_next_op_number(CG(active_op_array)); - zend_emit_op(result, ZEND_QM_ASSIGN, &true_node, NULL TSRMLS_CC); + zend_emit_op_tmp(result, ZEND_QM_ASSIGN, &true_node, NULL TSRMLS_CC); opnum_jmp = zend_emit_jump(0 TSRMLS_CC); @@ -6922,14 +5324,6 @@ void zend_compile_conditional(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ zend_compile_expr(&false_node, false_ast TSRMLS_CC); opline_qm_assign1 = &CG(active_op_array)->opcodes[opnum_qm_assign1]; - if (true_node.op_type == IS_VAR || true_node.op_type == IS_CV - || false_node.op_type == IS_VAR || false_node.op_type == IS_CV - ) { - opline_qm_assign1->opcode = ZEND_QM_ASSIGN_VAR; - opline_qm_assign1->result_type = IS_VAR; - GET_NODE(result, opline_qm_assign1->result); - } - opline_qm_assign2 = zend_emit_op(NULL, opline_qm_assign1->opcode, &false_node, NULL TSRMLS_CC); SET_NODE(opline_qm_assign2->result, result); @@ -6937,6 +5331,30 @@ void zend_compile_conditional(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ } /* }}} */ +void zend_compile_coalesce(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ +{ + zend_ast *expr_ast = ast->child[0]; + zend_ast *default_ast = ast->child[1]; + + znode expr_node, default_node; + zend_op *opline; + uint32_t opnum; + + zend_compile_var(&expr_node, expr_ast, BP_VAR_IS TSRMLS_CC); + + opnum = get_next_op_number(CG(active_op_array)); + zend_emit_op_tmp(result, ZEND_COALESCE, &expr_node, NULL TSRMLS_CC); + + zend_compile_expr(&default_node, default_ast TSRMLS_CC); + + opline = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &default_node, NULL TSRMLS_CC); + SET_NODE(opline->result, result); + + opline = &CG(active_op_array)->opcodes[opnum]; + opline->op2.opline_num = get_next_op_number(CG(active_op_array)); +} +/* }}} */ + void zend_compile_print(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; @@ -7141,7 +5559,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ { zend_ast_list *list = zend_ast_get_list(ast); zend_op *opline; - uint32_t i, opnum_init; + uint32_t i, opnum_init = -1; zend_bool packed = 1; if (zend_try_ct_eval_array(&result->u.constant, ast TSRMLS_CC)) { @@ -7149,8 +5567,6 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ return; } - opnum_init = get_next_op_number(CG(active_op_array)); - for (i = 0; i < list->children; ++i) { zend_ast *elem_ast = list->child[i]; zend_ast *value_ast = elem_ast->child[0]; @@ -7173,6 +5589,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ } if (i == 0) { + opnum_init = get_next_op_number(CG(active_op_array)); opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, &value_node, key_node_ptr TSRMLS_CC); opline->extended_value = list->children << ZEND_ARRAY_SIZE_SHIFT; } else { @@ -7194,6 +5611,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ /* Add a flag to INIT_ARRAY if we know this array cannot be packed */ if (!packed) { + ZEND_ASSERT(opnum_init != -1); opline = &CG(active_op_array)->opcodes[opnum_init]; opline->extended_value |= ZEND_ARRAY_NOT_PACKED; } @@ -7203,17 +5621,17 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ void zend_compile_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ { zend_ast *name_ast = ast->child[0]; - zend_string *orig_name = zend_ast_get_str(name_ast); - zend_bool is_fully_qualified; - zval resolved_name; zend_op *opline; - ZVAL_STR(&resolved_name, zend_resolve_const_name( - orig_name, name_ast->attr, &is_fully_qualified TSRMLS_CC)); + zend_bool is_fully_qualified; + zend_string *orig_name = zend_ast_get_str(name_ast); + zend_string *resolved_name = zend_resolve_const_name( + orig_name, name_ast->attr, &is_fully_qualified TSRMLS_CC); - if (zend_constant_ct_subst(result, &resolved_name, 1 TSRMLS_CC)) { - zval_dtor(&resolved_name); + if (zend_try_ct_eval_const(&result->u.constant, resolved_name, is_fully_qualified TSRMLS_CC)) { + result->op_type = IS_CONST; + zend_string_release(resolved_name); return; } @@ -7222,16 +5640,16 @@ void zend_compile_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ if (is_fully_qualified) { opline->op2.constant = zend_add_const_name_literal( - CG(active_op_array), &resolved_name, 0 TSRMLS_CC); + CG(active_op_array), resolved_name, 0 TSRMLS_CC); } else { opline->extended_value = IS_CONSTANT_UNQUALIFIED; if (CG(current_namespace)) { opline->extended_value |= IS_CONSTANT_IN_NAMESPACE; opline->op2.constant = zend_add_const_name_literal( - CG(active_op_array), &resolved_name, 1 TSRMLS_CC); + CG(active_op_array), resolved_name, 1 TSRMLS_CC); } else { opline->op2.constant = zend_add_const_name_literal( - CG(active_op_array), &resolved_name, 0 TSRMLS_CC); + CG(active_op_array), resolved_name, 0 TSRMLS_CC); } } zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC); @@ -7279,7 +5697,7 @@ void zend_compile_resolve_class_name(znode *result, zend_ast *ast TSRMLS_DC) /* "Cannot access self::class when no class scope is active"); } result->op_type = IS_CONST; - ZVAL_STR(&result->u.constant, zend_string_copy(CG(active_class_entry)->name)); + ZVAL_STR_COPY(&result->u.constant, CG(active_class_entry)->name); break; case ZEND_FETCH_CLASS_STATIC: case ZEND_FETCH_CLASS_PARENT: @@ -7402,7 +5820,7 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */ zend_ast *ast = *ast_ptr; zend_ast *class_ast = ast->child[0]; zend_ast *const_ast = ast->child[1]; - zend_string *class_name = zend_ast_get_str(class_ast); + zend_string *class_name; zend_string *const_name = zend_ast_get_str(const_ast); zval result; int fetch_type; @@ -7412,6 +5830,7 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */ "Dynamic class names are not allowed in compile-time class constant references"); } + class_name = zend_ast_get_str(class_ast); fetch_type = zend_get_class_fetch_type(class_name); if (ZEND_FETCH_CLASS_STATIC == fetch_type) { @@ -7429,9 +5848,6 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */ class_name->val, class_name->len, "::", 2, const_name->val, const_name->len); Z_TYPE_INFO(result) = IS_CONSTANT_EX; - if (IS_INTERNED(Z_STR(result))) { - Z_TYPE_FLAGS(result) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); - } Z_CONST_FLAGS(result) = fetch_type; zend_ast_destroy(ast); @@ -7445,21 +5861,20 @@ void zend_compile_const_expr_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */ { zend_ast *ast = *ast_ptr; zend_ast *name_ast = ast->child[0]; - zval *orig_name = zend_ast_get_zval(name_ast); + zend_string *orig_name = zend_ast_get_str(name_ast); zend_bool is_fully_qualified; - znode result; - zval resolved_name; + zval result, resolved_name; + ZVAL_STR(&resolved_name, zend_resolve_const_name( + orig_name, name_ast->attr, &is_fully_qualified TSRMLS_CC)); - if (zend_constant_ct_subst(&result, orig_name, 0 TSRMLS_CC)) { + if (zend_try_ct_eval_const(&result, Z_STR(resolved_name), is_fully_qualified TSRMLS_CC)) { + zend_string_release(Z_STR(resolved_name)); zend_ast_destroy(ast); - *ast_ptr = zend_ast_create_zval(&result.u.constant); + *ast_ptr = zend_ast_create_zval(&result); return; } - ZVAL_STR(&resolved_name, zend_resolve_const_name( - Z_STR_P(orig_name), name_ast->attr, &is_fully_qualified TSRMLS_CC)); - Z_TYPE_INFO(resolved_name) = IS_CONSTANT_EX; if (!is_fully_qualified) { Z_CONST_FLAGS(resolved_name) = IS_CONSTANT_UNQUALIFIED; @@ -7483,7 +5898,7 @@ void zend_compile_const_expr_resolve_class_name(zend_ast **ast_ptr TSRMLS_DC) /* zend_error_noreturn(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active"); } - ZVAL_STR(&result, zend_string_copy(CG(active_class_entry)->name)); + ZVAL_STR_COPY(&result, CG(active_class_entry)->name); break; case ZEND_FETCH_CLASS_STATIC: case ZEND_FETCH_CLASS_PARENT: @@ -7774,6 +6189,9 @@ void zend_compile_expr(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ case ZEND_AST_CONDITIONAL: zend_compile_conditional(result, ast TSRMLS_CC); return; + case ZEND_AST_COALESCE: + zend_compile_coalesce(result, ast TSRMLS_CC); + return; case ZEND_AST_PRINT: zend_compile_print(result, ast TSRMLS_CC); return; @@ -7940,15 +6358,20 @@ void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */ return; } break; - case ZEND_AST_CONST: { - znode result_node; + case ZEND_AST_CONST: + { + zend_ast *name_ast = ast->child[0]; + zend_bool is_fully_qualified; + zend_string *resolved_name = zend_resolve_const_name( + zend_ast_get_str(name_ast), name_ast->attr, &is_fully_qualified TSRMLS_CC); - if (!zend_constant_ct_subst(&result_node, zend_ast_get_zval(ast->child[0]), 0 TSRMLS_CC)) { + if (!zend_try_ct_eval_const(&result, resolved_name, is_fully_qualified TSRMLS_CC)) { + zend_string_release(resolved_name); return; } - zend_ast_destroy(ast); - *ast_ptr = zend_ast_create_zval(&result_node.u.constant); - return; + + zend_string_release(resolved_name); + break; } default: return; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 89bb2b8457..2594495c96 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -83,7 +83,7 @@ typedef struct _zend_ast_znode { } zend_ast_znode; ZEND_API zend_ast *zend_ast_create_znode(znode *node); -static inline znode *zend_ast_get_znode(zend_ast *ast) { +static zend_always_inline znode *zend_ast_get_znode(zend_ast *ast) { return &((zend_ast_znode *) ast)->node; } @@ -100,8 +100,6 @@ void zend_compile_var(znode *node, zend_ast *ast, uint32_t type TSRMLS_DC); void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC); void zend_const_expr_to_zval(zval *result, zend_ast *ast TSRMLS_DC); -typedef struct _zend_execute_data zend_execute_data; - #define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data TSRMLS_DC #define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data TSRMLS_CC @@ -223,6 +221,9 @@ typedef struct _zend_try_catch_element { /* op_array has finally blocks */ #define ZEND_ACC_HAS_FINALLY_BLOCK 0x20000000 +/* internal function is allocated at arena */ +#define ZEND_ACC_ARENA_ALLOCATED 0x20000000 + #define ZEND_CE_IS_TRAIT(ce) (((ce)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) char *zend_visibility_string(uint32_t fn_flags); @@ -363,8 +364,7 @@ struct _zend_execute_data { zend_uchar flags; zend_uchar frame_kind; zend_class_entry *called_scope; - zend_object *object; - zend_execute_data *prev_nested_call; + zval This; zend_execute_data *prev_execute_data; zval *return_value; zend_class_entry *scope; /* function scope (self) */ @@ -383,7 +383,7 @@ struct _zend_execute_data { #define ZEND_CALL_ARG(call, n) \ (((zval*)(call)) + ((n) + (ZEND_CALL_FRAME_SLOT - 1))) -#define EX(element) execute_data.element +#define EX(element) ((execute_data)->element) #define EX_VAR_2(ex, n) ((zval*)(((char*)(ex)) + ((int)(n)))) #define EX_VAR_NUM_2(ex, n) (((zval*)(ex)) + (ZEND_CALL_FRAME_SLOT + ((int)(n)))) @@ -449,14 +449,6 @@ void zend_do_free(znode *op1 TSRMLS_DC); ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time TSRMLS_DC); ZEND_API zend_class_entry *do_bind_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC); ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC); -ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC); -ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC); - -ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC); -ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC); - -ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC); -void zend_do_early_binding(TSRMLS_D); ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC); /* Functions for a null terminated pointer list, used for traits parsing and compilation */ @@ -499,10 +491,10 @@ ZEND_API void zend_function_dtor(zval *zv); ZEND_API void destroy_zend_class(zval *zv); void zend_class_add_ref(zval *zv); -ZEND_API zend_string *zend_mangle_property_name(const char *src1, int src1_length, const char *src2, int src2_length, int internal); -#define zend_unmangle_property_name(mangled_property, mangled_property_len, class_name, prop_name) \ - zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL) -ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int mangled_property_len, const char **class_name, const char **prop_name, int *prop_len); +ZEND_API zend_string *zend_mangle_property_name(const char *src1, size_t src1_length, const char *src2, size_t src2_length, int internal); +#define zend_unmangle_property_name(mangled_property, class_name, prop_name) \ + zend_unmangle_property_name_ex(mangled_property, class_name, prop_name, NULL) +ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char **class_name, const char **prop_name, size_t *prop_len); #define ZEND_FUNCTION_DTOR zend_function_dtor #define ZEND_CLASS_DTOR destroy_zend_class @@ -635,8 +627,6 @@ int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC); #define ZEND_FE_FETCH_BYREF 1 #define ZEND_FE_FETCH_WITH_KEY 2 -#define ZEND_FE_RESET_VARIABLE (1<<0) -#define ZEND_FE_RESET_REFERENCE (1<<1) #define EXT_TYPE_FREE_ON_RETURN (1<<2) #define ZEND_MEMBER_FUNC_CALL 1<<0 @@ -650,21 +640,28 @@ int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC); #define ZEND_SEND_BY_REF 1 #define ZEND_SEND_PREFER_REF 2 -#define CHECK_ARG_SEND_TYPE(zf, arg_num, m) \ - (EXPECTED((zf)->common.arg_info != NULL) && \ - (EXPECTED(arg_num <= (zf)->common.num_args) \ - ? ((zf)->common.arg_info[arg_num-1].pass_by_reference & (m)) \ - : (UNEXPECTED((zf)->common.fn_flags & ZEND_ACC_VARIADIC) != 0) && \ - ((zf)->common.arg_info[(zf)->common.num_args-1].pass_by_reference & (m)))) +static zend_always_inline int zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask) +{ + if (UNEXPECTED(zf->common.arg_info == NULL)) { + return 0; + } + if (UNEXPECTED(arg_num > zf->common.num_args)) { + if (EXPECTED((zf->common.fn_flags & ZEND_ACC_VARIADIC) == 0)) { + return 0; + } + arg_num = zf->common.num_args; + } + return UNEXPECTED((zf->common.arg_info[arg_num-1].pass_by_reference & mask) != 0); +} #define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF) + zend_check_arg_send_type(zf, arg_num, ZEND_SEND_BY_REF) #define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF) + zend_check_arg_send_type(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF) #define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF) + zend_check_arg_send_type(zf, arg_num, ZEND_SEND_PREFER_REF) #define ZEND_RETURN_VAL 0 #define ZEND_RETURN_REF 1 diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index bca35cf591..164901f898 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -246,7 +246,7 @@ static zend_constant *zend_get_special_constant(const char *name, uint name_len if ((c = zend_hash_find_ptr(EG(zend_constants), const_name)) == NULL) { c = emalloc(sizeof(zend_constant)); memset(c, 0, sizeof(zend_constant)); - ZVAL_STR(&c->value, zend_string_copy(EG(scope)->name)); + ZVAL_STR_COPY(&c->value, EG(scope)->name); zend_hash_add_ptr(EG(zend_constants), const_name, c); } zend_string_release(const_name); diff --git a/Zend/zend_dynamic_array.c b/Zend/zend_dynamic_array.c deleted file mode 100644 index db81b00a73..0000000000 --- a/Zend/zend_dynamic_array.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans <andi@zend.com> | - | Zeev Suraski <zeev@zend.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" - -typedef struct _dynamic_array { - char *array; - unsigned int element_size; - unsigned int current; - unsigned int allocated; -} dynamic_array; - -ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_size, unsigned int size) -{ - da->element_size = element_size; - da->allocated = size; - da->current = 0; - da->array = (char *) emalloc(size*element_size); - if (da->array == NULL) { - return 1; - } - return 0; -} - -ZEND_API void *zend_dynamic_array_push(dynamic_array *da) -{ - if (da->current == da->allocated) { - da->allocated *= 2; - da->array = (char *) erealloc(da->array, da->allocated*da->element_size); - } - return (void *)(da->array+(da->current++)*da->element_size); -} - -ZEND_API void *zend_dynamic_array_pop(dynamic_array *da) -{ - return (void *)(da->array+(--(da->current))*da->element_size); - -} - -ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index) -{ - if (index >= da->current) { - return NULL; - } - return (void *)(da->array+index*da->element_size); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index c5193ce7b6..b3770526db 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -28,6 +28,7 @@ #include "zend_exceptions.h" #include "zend_vm.h" #include "zend_dtrace.h" +#include "zend_smart_str.h" static zend_class_entry *default_exception_ce; static zend_class_entry *error_exception_ce; @@ -84,7 +85,7 @@ void zend_exception_restore(TSRMLS_D) /* {{{ */ } /* }}} */ -void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */ +ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */ { #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_THROWN_ENABLED()) { @@ -334,45 +335,78 @@ ZEND_METHOD(error_exception, getSeverity) } /* }}} */ -/* {{{ gettraceasstring() macros */ -#define TRACE_APPEND_CHR(chr) \ - str = zend_string_realloc(str, str->len + 1, 0); \ - str->val[str->len - 1] = chr - -#define TRACE_APPEND_STRL(v, l) \ - { \ - str = zend_string_realloc(str, str->len + (l), 0); \ - memcpy(str->val + str->len - (l), (v), (l)); \ - } - -#define TRACE_APPEND_STR(v) \ - TRACE_APPEND_STRL((v), sizeof((v))-1) - #define TRACE_APPEND_KEY(key) do { \ tmp = zend_hash_str_find(ht, key, sizeof(key)-1); \ if (tmp) { \ if (Z_TYPE_P(tmp) != IS_STRING) { \ zend_error(E_WARNING, "Value for %s is no string", key); \ - TRACE_APPEND_STR("[unknown]"); \ + smart_str_appends(str, "[unknown]"); \ } else { \ - TRACE_APPEND_STRL(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); \ + smart_str_append(str, Z_STR_P(tmp)); \ } \ } \ } while (0) +/* Windows uses VK_ESCAPE instead of \e */ +#ifndef VK_ESCAPE +#define VK_ESCAPE '\e' +#endif -#define TRACE_ARG_APPEND(vallen) do { \ - int len = str->len; \ - str = zend_string_realloc(str, len + vallen, 0); \ - memmove(str->val + len - l_added + 1 + vallen, str->val + len - l_added + 1, l_added); \ - } while (0) +static size_t compute_escaped_string_len(const char *s, size_t l) { + size_t i, len = l; + for (i = 0; i < l; ++i) { + char c = s[i]; + if (c == '\n' || c == '\r' || c == '\t' || + c == '\f' || c == '\v' || c == '\\' || c == VK_ESCAPE) { + len += 1; + } else if (c < 32 || c > 126) { + len += 3; + } + } + return len; +} -/* }}} */ +static void smart_str_append_escaped(smart_str *str, const char *s, size_t l) { + char *res; + size_t i, len = compute_escaped_string_len(s, l); + + smart_str_alloc(str, len, 0); + res = &str->s->val[str->s->len]; + str->s->len += len; + + for (i = 0; i < l; ++i) { + char c = s[i]; + if (c < 32 || c == '\\' || c > 126) { + *res++ = '\\'; + switch (c) { + case '\n': *res++ = 'n'; break; + case '\r': *res++ = 'r'; break; + case '\t': *res++ = 't'; break; + case '\f': *res++ = 'f'; break; + case '\v': *res++ = 'v'; break; + case '\\': *res++ = '\\'; break; + case VK_ESCAPE: *res++ = 'e'; break; + default: + *res++ = 'x'; + if ((c >> 4) < 10) { + *res++ = (c >> 4) + '0'; + } else { + *res++ = (c >> 4) + 'A' - 10; + } + if ((c & 0xf) < 10) { + *res++ = (c & 0xf) + '0'; + } else { + *res++ = (c & 0xf) + 'A' - 10; + } + } + } else { + *res++ = c; + } + } +} -static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{ */ +static void _build_trace_args(zval *arg, smart_str *str TSRMLS_DC) /* {{{ */ { - zend_string *str = *str_ptr; - /* the trivial way would be to do: * convert_to_string_ex(arg); * append it and kill the now tmp arg. @@ -382,159 +416,68 @@ static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{ ZVAL_DEREF(arg); switch (Z_TYPE_P(arg)) { case IS_NULL: - TRACE_APPEND_STR("NULL, "); + smart_str_appends(str, "NULL, "); break; - case IS_STRING: { - int l_added; - TRACE_APPEND_CHR('\''); + case IS_STRING: + smart_str_appendc(str, '\''); + smart_str_append_escaped(str, Z_STRVAL_P(arg), MIN(Z_STRLEN_P(arg), 15)); if (Z_STRLEN_P(arg) > 15) { - TRACE_APPEND_STRL(Z_STRVAL_P(arg), 15); - TRACE_APPEND_STR("...', "); - l_added = 15 + 6 + 1; /* +1 because of while (--l_added) */ + smart_str_appends(str, "...', "); } else { - l_added = Z_STRLEN_P(arg); - TRACE_APPEND_STRL(Z_STRVAL_P(arg), l_added); - TRACE_APPEND_STR("', "); - l_added += 3 + 1; - } - while (--l_added) { - unsigned char chr = str->val[str->len - l_added]; - if (chr < 32 || chr == '\\' || chr > 126) { - str->val[str->len - l_added] = '\\'; - - switch (chr) { - case '\n': - TRACE_ARG_APPEND(1); - str->val[str->len - l_added] = 'n'; - break; - case '\r': - TRACE_ARG_APPEND(1); - str->val[str->len - l_added] = 'r'; - break; - case '\t': - TRACE_ARG_APPEND(1); - str->val[str->len - l_added] = 't'; - break; - case '\f': - TRACE_ARG_APPEND(1); - str->val[str->len - l_added] = 'f'; - break; - case '\v': - TRACE_ARG_APPEND(1); - str->val[str->len - l_added] = 'v'; - break; -#ifndef PHP_WIN32 - case '\e': -#else - case VK_ESCAPE: -#endif - TRACE_ARG_APPEND(1); - str->val[str->len - l_added] = 'e'; - break; - case '\\': - TRACE_ARG_APPEND(1); - str->val[str->len - l_added] = '\\'; - break; - default: - TRACE_ARG_APPEND(3); - str->val[str->len - l_added - 2] = 'x'; - if ((chr >> 4) < 10) { - str->val[str->len - l_added - 1] = (chr >> 4) + '0'; - } else { - str->val[str->len - l_added - 1] = (chr >> 4) + 'A' - 10; - } - if (chr % 16 < 10) { - str->val[str->len - l_added] = chr % 16 + '0'; - } else { - str->val[str->len - l_added] = chr % 16 + 'A' - 10; - } - } - } + smart_str_appends(str, "', "); } break; - } case IS_FALSE: - TRACE_APPEND_STR("false, "); + smart_str_appends(str, "false, "); break; case IS_TRUE: - TRACE_APPEND_STR("true, "); + smart_str_appends(str, "true, "); break; - case IS_RESOURCE: { - zend_long lval = Z_RES_HANDLE_P(arg); - char s_tmp[MAX_LENGTH_OF_LONG + 1]; - int l_tmp = zend_sprintf(s_tmp, ZEND_LONG_FMT, lval); /* SAFE */ - TRACE_APPEND_STR("Resource id #"); - TRACE_APPEND_STRL(s_tmp, l_tmp); - TRACE_APPEND_STR(", "); + case IS_RESOURCE: + smart_str_appends(str, "Resource id #"); + smart_str_append_long(str, Z_RES_HANDLE_P(arg)); + smart_str_appends(str, ", "); break; - } - case IS_LONG: { - zend_long lval = Z_LVAL_P(arg); - char s_tmp[MAX_LENGTH_OF_LONG + 1]; - int l_tmp = zend_sprintf(s_tmp, ZEND_LONG_FMT, lval); /* SAFE */ - TRACE_APPEND_STRL(s_tmp, l_tmp); - TRACE_APPEND_STR(", "); + case IS_LONG: + smart_str_append_long(str, Z_LVAL_P(arg)); + smart_str_appends(str, ", "); break; - } case IS_DOUBLE: { double dval = Z_DVAL_P(arg); - char *s_tmp; - int l_tmp; - - s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); - l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */ - TRACE_APPEND_STRL(s_tmp, l_tmp); - /* %G already handles removing trailing zeros from the fractional part, yay */ + char *s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); + int l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */ + smart_str_appendl(str, s_tmp, l_tmp); + smart_str_appends(str, ", "); efree(s_tmp); - TRACE_APPEND_STR(", "); break; } case IS_ARRAY: - TRACE_APPEND_STR("Array, "); - break; - case IS_OBJECT: { - zend_string *class_name; - - TRACE_APPEND_STR("Object("); - - class_name = zend_get_object_classname(Z_OBJ_P(arg) TSRMLS_CC); - - TRACE_APPEND_STRL(class_name->val, class_name->len); - TRACE_APPEND_STR("), "); + smart_str_appends(str, "Array, "); break; - } - default: + case IS_OBJECT: + smart_str_appends(str, "Object("); + smart_str_append(str, zend_get_object_classname(Z_OBJ_P(arg) TSRMLS_CC)); + smart_str_appends(str, "), "); break; } - *str_ptr = str; } /* }}} */ -static void _build_trace_string(zval *frame, zend_ulong index, zend_string **str_ptr, int *num TSRMLS_DC) /* {{{ */ +static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num TSRMLS_DC) /* {{{ */ { - char *s_tmp; - int len; - zend_long line; - HashTable *ht; zval *file, *tmp; - zend_string *str = *str_ptr; - if (Z_TYPE_P(frame) != IS_ARRAY) { - zend_error(E_WARNING, "Expected array for frame %pu", index); - return; - } + smart_str_appendc(str, '#'); + smart_str_append_long(str, num); + smart_str_appendc(str, ' '); - ht = Z_ARRVAL_P(frame); - s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 1 + 1); - len = sprintf(s_tmp, "#%d ", (*num)++); - TRACE_APPEND_STRL(s_tmp, len); - efree(s_tmp); file = zend_hash_str_find(ht, "file", sizeof("file")-1); if (file) { if (Z_TYPE_P(file) != IS_STRING) { zend_error(E_WARNING, "Function name is no string"); - TRACE_APPEND_STR("[unknown function]"); + smart_str_appends(str, "[unknown function]"); } else{ + zend_long line; tmp = zend_hash_str_find(ht, "line", sizeof("line")-1); if (tmp) { if (Z_TYPE_P(tmp) == IS_LONG) { @@ -546,37 +489,36 @@ static void _build_trace_string(zval *frame, zend_ulong index, zend_string **str } else { line = 0; } - s_tmp = emalloc(Z_STRLEN_P(file) + MAX_LENGTH_OF_LONG + 4 + 1); - len = sprintf(s_tmp, "%s(" ZEND_LONG_FMT "): ", Z_STRVAL_P(file), line); - TRACE_APPEND_STRL(s_tmp, len); - efree(s_tmp); + smart_str_append(str, Z_STR_P(file)); + smart_str_appendc(str, '('); + smart_str_append_long(str, line); + smart_str_appends(str, "): "); } } else { - TRACE_APPEND_STR("[internal function]: "); + smart_str_appends(str, "[internal function]: "); } TRACE_APPEND_KEY("class"); TRACE_APPEND_KEY("type"); TRACE_APPEND_KEY("function"); - TRACE_APPEND_CHR('('); + smart_str_appendc(str, '('); tmp = zend_hash_str_find(ht, "args", sizeof("args")-1); if (tmp) { if (Z_TYPE_P(tmp) == IS_ARRAY) { - int last_len = str->len; + size_t last_len = str->s->len; zval *arg; ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(tmp), arg) { - _build_trace_args(arg, &str TSRMLS_CC); + _build_trace_args(arg, str TSRMLS_CC); } ZEND_HASH_FOREACH_END(); - if (last_len != str->len) { - str->len -= 2; /* remove last ', ' */ + if (last_len != str->s->len) { + str->s->len -= 2; /* remove last ', ' */ } } else { zend_error(E_WARNING, "args element is no array"); } } - TRACE_APPEND_STR(")\n"); - *str_ptr = str; + smart_str_appends(str, ")\n"); } /* }}} */ @@ -586,25 +528,27 @@ ZEND_METHOD(exception, getTraceAsString) { zval *trace, *frame; zend_ulong index; - zend_string *str; - int num = 0, len; - char s_tmp[MAX_LENGTH_OF_LONG + 7 + 1 + 1]; + smart_str str = {0}; + uint32_t num = 0; DEFAULT_0_PARAMS; - str = zend_string_alloc(0, 0); - trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC); ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(trace), index, frame) { - _build_trace_string(frame, index, &str, &num TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); + if (Z_TYPE_P(frame) != IS_ARRAY) { + zend_error(E_WARNING, "Expected array for frame %pu", index); + continue; + } - len = sprintf(s_tmp, "#%d {main}", num); - TRACE_APPEND_STRL(s_tmp, len); + _build_trace_string(&str, Z_ARRVAL_P(frame), num++ TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); - str->val[str->len] = '\0'; + smart_str_appendc(&str, '#'); + smart_str_append_long(&str, num); + smart_str_appends(&str, " {main}"); + smart_str_0(&str); - RETURN_NEW_STR(str); + RETURN_NEW_STR(str.s); } /* }}} */ @@ -620,10 +564,10 @@ ZEND_METHOD(exception, getPrevious) RETURN_ZVAL(previous, 1, 0); } /* }}} */ -int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ */ +size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) /* {{{ */ { va_list arg; - int len; + size_t len; va_start(arg, format); len = zend_vspprintf(message, max_len, format, arg); @@ -632,7 +576,7 @@ int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ * } /* }}} */ -zend_string *zend_strpprintf(int max_len, const char *format, ...) /* {{{ */ +zend_string *zend_strpprintf(size_t max_len, const char *format, ...) /* {{{ */ { va_list arg; zend_string *str; diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index 0c13b66281..3118ce1053 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -30,7 +30,7 @@ ZEND_API void zend_exception_set_previous(zend_object *exception, zend_object *a ZEND_API void zend_exception_save(TSRMLS_D); ZEND_API void zend_exception_restore(TSRMLS_D); -void zend_throw_exception_internal(zval *exception TSRMLS_DC); +ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC); void zend_register_default_exception(TSRMLS_D); @@ -53,8 +53,8 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC); ZEND_API void zend_exception_error(zend_object *exception, int severity TSRMLS_DC); /* do not export, in php it's available thru spprintf directly */ -int zend_spprintf(char **message, int max_len, const char *format, ...); -zend_string *zend_strpprintf(int max_len, const char *format, ...); +size_t zend_spprintf(char **message, size_t max_len, const char *format, ...); +zend_string *zend_strpprintf(size_t max_len, const char *format, ...); END_EXTERN_C() diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 17f0eef456..e019191a5e 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -38,6 +38,7 @@ #include "zend_generators.h" #include "zend_vm.h" #include "zend_dtrace.h" +#include "zend_inheritance.h" /* Virtual current working directory support */ #include "zend_virtual_cwd.h" @@ -99,15 +100,6 @@ static const zend_internal_function zend_pass_function = { #define FREE_OP(should_free) \ if (should_free.var) { \ - if ((zend_uintptr_t)should_free.var & 1L) { \ - zval_dtor((zval*)((zend_uintptr_t)should_free.var & ~1L)); \ - } else { \ - zval_ptr_dtor_nogc(should_free.var); \ - } \ - } - -#define FREE_OP_IF_VAR(should_free) \ - if (should_free.var != NULL && (((zend_uintptr_t)should_free.var & 1L) == 0)) { \ zval_ptr_dtor_nogc(should_free.var); \ } @@ -116,10 +108,6 @@ static const zend_internal_function zend_pass_function = { zval_ptr_dtor_nogc(should_free.var); \ } -#define TMP_FREE(z) (zval*)(((zend_uintptr_t)(z)) | 1L) - -#define IS_TMP_FREE(should_free) ((zend_uintptr_t)should_free.var & 1L) - /* End of zend_execute_locks.h */ #define CV_DEF_OF(i) (EX(func)->op_array.vars[i]) @@ -135,9 +123,6 @@ static const zend_internal_function zend_pass_function = { #define DECODE_CTOR(ce) \ ((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT))) -#undef EX -#define EX(element) execute_data->element - ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data, uint32_t var) { return EX_VAR(var); @@ -210,11 +195,6 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint return &EG(uninitialized_zval); } -static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_IS(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC) -{ - return &EG(uninitialized_zval); -} - static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC) { zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var)); @@ -297,9 +277,6 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_da { zval *ret = EX_VAR(var); - if (Z_TYPE_P(ret) == IS_UNDEF) { - return _get_zval_cv_lookup_BP_VAR_IS(ret, var, execute_data TSRMLS_CC); - } return ret; } @@ -307,9 +284,6 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_exec { zval *ret = EX_VAR(var); - if (Z_TYPE_P(ret) == IS_UNDEF) { - return _get_zval_cv_lookup_BP_VAR_IS(ret, var, execute_data TSRMLS_CC); - } ZVAL_DEREF(ret); return ret; } @@ -372,7 +346,7 @@ static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const zend_ break; case IS_TMP_VAR: ret = EX_VAR(node->var); - should_free->var = TMP_FREE(ret); + should_free->var = ret; return ret; break; case IS_VAR: @@ -402,7 +376,7 @@ static inline zval *_get_zval_ptr_deref(int op_type, const znode_op *node, const break; case IS_TMP_VAR: ret = EX_VAR(node->var); - should_free->var = TMP_FREE(ret); + should_free->var = ret; return ret; break; case IS_VAR: @@ -449,22 +423,22 @@ static inline zval *_get_zval_ptr_ptr(int op_type, const znode_op *node, const z } } -static zend_always_inline zval *_get_obj_zval_ptr_unused(TSRMLS_D) +static zend_always_inline zval *_get_obj_zval_ptr_unused(zend_execute_data *execute_data TSRMLS_DC) { - if (EXPECTED(Z_OBJ(EG(This)) != NULL)) { - return &EG(This); + if (EXPECTED(Z_OBJ(EX(This)) != NULL)) { + return &EX(This); } else { zend_error_noreturn(E_ERROR, "Using $this when not in object context"); return NULL; } } -static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) +static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { if (op_type == IS_UNUSED) { - if (EXPECTED(Z_OBJ(EG(This)) != NULL)) { + if (EXPECTED(Z_OBJ(EX(This)) != NULL)) { should_free->var = NULL; - return &EG(This); + return &EX(This); } else { zend_error_noreturn(E_ERROR, "Using $this when not in object context"); } @@ -472,12 +446,12 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_exec return get_zval_ptr(op_type, op, execute_data, should_free, type); } -static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) +static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { if (op_type == IS_UNUSED) { - if (EXPECTED(Z_OBJ(EG(This)) != NULL)) { + if (EXPECTED(Z_OBJ(EX(This)) != NULL)) { should_free->var = NULL; - return &EG(This); + return &EX(This); } else { zend_error_noreturn(E_ERROR, "Using $this when not in object context"); } @@ -636,6 +610,7 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC); zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "none", "", NULL TSRMLS_CC); + return 0; } else if (cur_arg_info->type_hint) { if (cur_arg_info->type_hint == IS_ARRAY) { zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "", NULL TSRMLS_CC); @@ -646,8 +621,9 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n zend_error(E_ERROR, "Unknown typehint"); #endif } + return 0; } - return 0; + return 1; } static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num TSRMLS_DC) @@ -675,17 +651,17 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval *p zval *object = object_ptr; ZVAL_DEREF(object); - if (Z_TYPE_P(object) != IS_OBJECT) { - if (object == &EG(error_zval)) { + if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (UNEXPECTED(object == &EG(error_zval))) { if (retval) { ZVAL_NULL(retval); } FREE_OP(free_value); return; } - if (Z_TYPE_P(object) == IS_NULL || + if (EXPECTED(Z_TYPE_P(object) == IS_NULL || Z_TYPE_P(object) == IS_FALSE || - (Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0)) { + (Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) { zend_object *obj; zval_ptr_dtor(object); @@ -752,10 +728,12 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval *p ZVAL_COPY(retval, value); } zval_ptr_dtor(value); - FREE_OP_IF_VAR(free_value); + if (value_type == IS_VAR) { + FREE_OP(free_value); + } } -static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *value, int value_type, zval *result TSRMLS_DC) +static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *value, zval *result TSRMLS_DC) { zend_string *old_str; @@ -769,13 +747,13 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu } old_str = Z_STR_P(str); - if (offset >= Z_STRLEN_P(str)) { + if ((size_t)offset >= Z_STRLEN_P(str)) { zend_long old_len = Z_STRLEN_P(str); Z_STR_P(str) = zend_string_realloc(Z_STR_P(str), offset + 1, 0); Z_TYPE_INFO_P(str) = IS_STRING_EX; memset(Z_STRVAL_P(str) + old_len, ' ', offset - old_len); Z_STRVAL_P(str)[offset+1] = 0; - } else if (IS_INTERNED(Z_STR_P(str))) { + } else if (!Z_REFCOUNTED_P(str)) { Z_STR_P(str) = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0); Z_TYPE_INFO_P(str) = IS_STRING_EX; } @@ -787,12 +765,6 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu zend_string_release(tmp); } else { Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0]; - if (value_type == IS_TMP_VAR) { - /* we can safely free final_value here - * because separation is done only - * in case value_type == IS_VAR */ - zval_dtor(value); - } } /* * the value of an assignment to a string offset is undefined @@ -811,144 +783,60 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu } } -static inline zval* zend_assign_tmp_to_variable(zval *variable_ptr, zval *value TSRMLS_DC) +static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC) { - ZVAL_DEREF(variable_ptr); - - if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { - zend_refcounted *garbage; - - if (Z_TYPE_P(variable_ptr) == IS_OBJECT && - UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) { - Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC); - return variable_ptr; - } + do { + if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { + zend_refcounted *garbage; - garbage = Z_COUNTED_P(variable_ptr); - if (UNEXPECTED(GC_REFCOUNT(garbage) > 1)) { - /* we need to split */ - GC_REFCOUNT(garbage)--; - /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */ - if ((Z_COLLECTABLE_P(variable_ptr)) && - UNEXPECTED(!GC_INFO(garbage))) { - gc_possible_root(garbage TSRMLS_CC); + if (Z_ISREF_P(variable_ptr)) { + variable_ptr = Z_REFVAL_P(variable_ptr); + if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) { + break; + } } - } else { - ZVAL_COPY_VALUE(variable_ptr, value); - _zval_dtor_func(garbage ZEND_FILE_LINE_CC); - return variable_ptr; - } - } - - ZVAL_COPY_VALUE(variable_ptr, value); - - return variable_ptr; -} - -static inline zval* zend_assign_const_to_variable(zval *variable_ptr, zval *value TSRMLS_DC) -{ - ZVAL_DEREF(variable_ptr); - - if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { - zend_refcounted *garbage; - - if (Z_TYPE_P(variable_ptr) == IS_OBJECT && - UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) { - Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC); - return variable_ptr; - } - - garbage = Z_COUNTED_P(variable_ptr); - if (UNEXPECTED(GC_REFCOUNT(garbage) > 1)) { - /* we need to split */ - GC_REFCOUNT(garbage)--; - /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */ - if (Z_COLLECTABLE_P(variable_ptr) && - UNEXPECTED(!GC_INFO(garbage))) { - gc_possible_root(garbage TSRMLS_CC); + if (Z_TYPE_P(variable_ptr) == IS_OBJECT && + UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) { + Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC); + return variable_ptr; } - } else { - ZVAL_COPY_VALUE(variable_ptr, value); - /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */ - if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) { - zval_copy_ctor_func(variable_ptr); + if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) { + return variable_ptr; } - _zval_dtor_func(garbage ZEND_FILE_LINE_CC); - return variable_ptr; - } - } - - ZVAL_COPY_VALUE(variable_ptr, value); - /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */ - if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) { - zval_copy_ctor_func(variable_ptr); - } - - return variable_ptr; -} - -static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRMLS_DC) -{ - zend_refcounted *garbage; - - if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) { - goto assign_simple; - } else if (UNEXPECTED(variable_ptr == value)) { - return variable_ptr; - } - if (Z_ISREF_P(variable_ptr)) { - variable_ptr = Z_REFVAL_P(variable_ptr); - if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) { - goto assign_simple; - } else if (UNEXPECTED(variable_ptr == value)) { - return variable_ptr; - } - } - - if (Z_TYPE_P(variable_ptr) == IS_OBJECT && - UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) { - Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC); - } else { - if (Z_REFCOUNT_P(variable_ptr)==1) { garbage = Z_COUNTED_P(variable_ptr); - if (UNEXPECTED(Z_REFCOUNTED_P(value))) { - if (EXPECTED(!Z_ISREF_P(value))) { - Z_ADDREF_P(value); - } else { - if (Z_REFCOUNT_P(value) == 1) { - ZVAL_UNREF(value); - } else { - value = Z_REFVAL_P(value); + if (--GC_REFCOUNT(garbage) == 0) { + ZVAL_COPY_VALUE(variable_ptr, value); + if (value_type == IS_CONST) { + /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */ + if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) { + zval_copy_ctor_func(variable_ptr); } - if (Z_REFCOUNTED_P(value)) { - if (UNEXPECTED(variable_ptr == value)) { - return variable_ptr; - } - Z_ADDREF_P(value); + } else if (value_type != IS_TMP_VAR) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) { + Z_ADDREF_P(variable_ptr); } } - } - ZVAL_COPY_VALUE(variable_ptr, value); - _zval_dtor_func(garbage ZEND_FILE_LINE_CC); - } else { /* we need to split */ - Z_DELREF_P(variable_ptr); - GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr); -assign_simple: - if (UNEXPECTED(Z_REFCOUNTED_P(value))) { - if (EXPECTED(!Z_ISREF_P(value))) { - Z_ADDREF_P(value); - } else { - if (Z_REFCOUNT_P(value) == 1) { - ZVAL_UNREF(value); - } else { - value = Z_REFVAL_P(value); - } - if (Z_REFCOUNTED_P(value)) { - Z_ADDREF_P(value); - } + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + return variable_ptr; + } else { /* we need to split */ + /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */ + if ((Z_COLLECTABLE_P(variable_ptr)) && + UNEXPECTED(!GC_INFO(garbage))) { + gc_possible_root(garbage TSRMLS_CC); } } - ZVAL_COPY_VALUE(variable_ptr, value); + } + } while (0); + + ZVAL_COPY_VALUE(variable_ptr, value); + if (value_type == IS_CONST) { + /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */ + if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) { + zval_copy_ctor_func(variable_ptr); + } + } else if (value_type != IS_TMP_VAR) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) { + Z_ADDREF_P(variable_ptr); } } return variable_ptr; @@ -1112,7 +1000,7 @@ static zend_always_inline zval *zend_fetch_dimension_address(zval *result, zval fetch_from_array: if (dim == NULL) { retval = zend_hash_next_index_insert(Z_ARRVAL_P(container), &EG(uninitialized_zval)); - if (retval == NULL) { + if (UNEXPECTED(retval == NULL)) { zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied"); retval = &EG(error_zval); } @@ -1121,16 +1009,13 @@ fetch_from_array: } if (is_ref) { ZVAL_MAKE_REF(retval); - Z_ADDREF_P(retval); - ZVAL_REF(result, Z_REF_P(retval)); - } else { - ZVAL_INDIRECT(result, retval); } + ZVAL_INDIRECT(result, retval); } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_long offset; if (type != BP_VAR_UNSET && UNEXPECTED(Z_STRLEN_P(container) == 0)) { - zval_dtor(container); + zval_ptr_dtor_nogc(container); convert_to_array: ZVAL_NEW_ARR(container); zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0); @@ -1168,8 +1053,13 @@ convert_to_array: } if (allow_str_offset) { - SEPARATE_STRING(container); - if (!IS_INTERNED(Z_STR_P(container))) zend_string_addref(Z_STR_P(container)); + if (Z_REFCOUNTED_P(container)) { + if (Z_REFCOUNT_P(container) > 1) { + Z_DELREF_P(container); + zval_copy_ctor_func(container); + } + Z_ADDREF_P(container); + } ZVAL_LONG(result, offset); return container; /* assignment to string offset */ } else { @@ -1186,7 +1076,7 @@ convert_to_array: ZVAL_NULL(result); zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name->val); - } else if (retval && Z_TYPE_P(retval) != IS_UNDEF) { + } else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) { if (!Z_ISREF_P(retval)) { if (Z_REFCOUNTED_P(retval) && Z_REFCOUNT_P(retval) > 1) { @@ -1207,18 +1097,15 @@ convert_to_array: if (result != retval) { if (is_ref) { ZVAL_MAKE_REF(retval); - Z_ADDREF_P(retval); - ZVAL_REF(result, Z_REF_P(retval)); - } else { - ZVAL_INDIRECT(result, retval); } + ZVAL_INDIRECT(result, retval); } } else { ZVAL_INDIRECT(result, &EG(error_zval)); } } } else if (EXPECTED(Z_TYPE_P(container) == IS_NULL)) { - if (container == &EG(error_zval)) { + if (UNEXPECTED(container == &EG(error_zval))) { ZVAL_INDIRECT(result, &EG(error_zval)); } else if (type != BP_VAR_UNSET) { goto convert_to_array; @@ -1307,7 +1194,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z offset = Z_LVAL_P(dim); } - if (UNEXPECTED(offset < 0) || UNEXPECTED(Z_STRLEN_P(container) <= offset)) { + if (UNEXPECTED(offset < 0) || UNEXPECTED(Z_STRLEN_P(container) <= (size_t)offset)) { if (type != BP_VAR_IS) { zend_error(E_NOTICE, "Uninitialized string offset: %pd", offset); } @@ -1327,14 +1214,13 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z } else { retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC); - if (result) { - if (retval) { - if (result != retval) { - ZVAL_COPY(result, retval); - } - } else { - ZVAL_NULL(result); + ZEND_ASSERT(result != NULL); + if (retval) { + if (result != retval) { + ZVAL_COPY(result, retval); } + } else { + ZVAL_NULL(result); } } } else { @@ -1362,15 +1248,15 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval zval *container = container_ptr; ZVAL_DEREF(container); - if (Z_TYPE_P(container) != IS_OBJECT) { - if (container == &EG(error_zval)) { + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (UNEXPECTED(container == &EG(error_zval))) { ZVAL_INDIRECT(result, &EG(error_zval)); return; } /* this should modify object only if it's empty */ if (type != BP_VAR_UNSET && - ((Z_TYPE_P(container) == IS_NULL || + EXPECTED((Z_TYPE_P(container) == IS_NULL || Z_TYPE_P(container) == IS_FALSE || (Z_TYPE_P(container) == IS_STRING && Z_STRLEN_P(container)==0)))) { zval_ptr_dtor_nogc(container); @@ -1382,7 +1268,7 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval } } - if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) { + if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) { zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot TSRMLS_CC); if (NULL == ptr) { if (Z_OBJ_HT_P(container)->read_property && @@ -1390,11 +1276,8 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval if (ptr != result) { if (is_ref && ptr != &EG(uninitialized_zval)) { ZVAL_MAKE_REF(ptr); - Z_ADDREF_P(ptr); - ZVAL_REF(result, Z_REF_P(ptr)); - } else { - ZVAL_INDIRECT(result, ptr); } + ZVAL_INDIRECT(result, ptr); } } else { zend_error_noreturn(E_ERROR, "Cannot access undefined property for object with overloaded property access"); @@ -1402,22 +1285,16 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval } else { if (is_ref) { ZVAL_MAKE_REF(ptr); - Z_ADDREF_P(ptr); - ZVAL_REF(result, Z_REF_P(ptr)); - } else { - ZVAL_INDIRECT(result, ptr); } + ZVAL_INDIRECT(result, ptr); } - } else if (Z_OBJ_HT_P(container)->read_property) { + } else if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) { zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result TSRMLS_CC); if (ptr != result) { if (is_ref && ptr != &EG(uninitialized_zval)) { ZVAL_MAKE_REF(ptr); - Z_ADDREF_P(ptr); - ZVAL_REF(result, Z_REF_P(ptr)); - } else { - ZVAL_INDIRECT(result, ptr); } + ZVAL_INDIRECT(result, ptr); } } else { zend_error(E_WARNING, "This object doesn't support property references"); @@ -1438,13 +1315,9 @@ static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_of if (nest_levels>1) { zend_op *brk_opline = &op_array->opcodes[jmp_to->brk]; - if (brk_opline->opcode == ZEND_SWITCH_FREE) { + if (brk_opline->opcode == ZEND_FREE) { if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_ptr_dtor(EX_VAR(brk_opline->op1.var)); - } - } else if (brk_opline->opcode == ZEND_FREE) { - if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_dtor(EX_VAR(brk_opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var)); } } } @@ -1491,7 +1364,7 @@ ZEND_API opcode_handler_t *zend_opcode_handlers; ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC) { - execute_data->func->internal_function.handler(execute_data->num_args, return_value TSRMLS_CC); + execute_data->func->internal_function.handler(execute_data, return_value TSRMLS_CC); } void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{{ */ @@ -1549,61 +1422,66 @@ void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* static zend_always_inline void i_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */ { - uint32_t first_extra_arg; + uint32_t first_extra_arg, num_args; ZEND_ASSERT(EX(func) == (zend_function*)op_array); - ZEND_ASSERT(EX(object) == Z_OBJ(EG(This))); - - EX(return_value) = return_value; - EX(frame_kind) = frame_kind; - ZVAL_UNDEF(&EX(old_error_reporting)); - EX(delayed_exception) = NULL; - EX(call) = NULL; EX(opline) = op_array->opcodes; - if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) { - /* Skip useless ZEND_RECV opcodes */ - EX(opline) += MIN(EX(num_args), op_array->required_num_args); - } + EX(call) = NULL; + EX(frame_kind) = frame_kind; + EX(return_value) = return_value; EX(scope) = EG(scope); + EX(delayed_exception) = NULL; + ZVAL_UNDEF(&EX(old_error_reporting)); + /* Handle arguments */ first_extra_arg = op_array->num_args; - if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) { first_extra_arg--; } - if (UNEXPECTED(EX(num_args) > first_extra_arg)) { - /* move extra args into separate array after all CV and TMP vars */ - zval *extra_args = EX_VAR_NUM(op_array->last_var + op_array->T); - - memmove(extra_args, EX_VAR_NUM(first_extra_arg), sizeof(zval) * (EX(num_args) - first_extra_arg)); - } + num_args = EX(num_args); + if (UNEXPECTED(num_args > first_extra_arg)) { + zval *end, *src, *dst; - do { - /* Initialize CV variables (skip arguments) */ - int num_args = MIN(op_array->num_args, EX(num_args)); - - if (EXPECTED(num_args < op_array->last_var)) { - zval *var = EX_VAR_NUM(num_args); - zval *end = EX_VAR_NUM(op_array->last_var); + if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) { + /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */ + EX(opline) += first_extra_arg; + } + /* move extra args into separate array after all CV and TMP vars */ + end = EX_VAR_NUM(first_extra_arg - 1); + src = end + (num_args - first_extra_arg); + dst = src + (op_array->last_var + op_array->T - first_extra_arg); + if (EXPECTED(src != dst)) { do { - ZVAL_UNDEF(var); - var++; - } while (var != end); + ZVAL_COPY_VALUE(dst, src); + ZVAL_UNDEF(src); + src--; + dst--; + } while (src != end); } - } while (0); + } else if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) { + /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */ + EX(opline) += num_args; + } + + /* Initialize CV variables (skip arguments) */ + if (EXPECTED(num_args < op_array->last_var)) { + zval *var = EX_VAR_NUM(num_args); + zval *end = EX_VAR_NUM(op_array->last_var); - if (op_array->this_var != -1 && EX(object)) { - ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object)); - GC_REFCOUNT(EX(object))++; + do { + ZVAL_UNDEF(var); + var++; + } while (var != end); + } + + if (op_array->this_var != -1 && Z_OBJ(EX(This))) { + ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This))); + GC_REFCOUNT(Z_OBJ(EX(This)))++; } if (!op_array->run_time_cache && op_array->last_cache_slot) { - if (op_array->function_name) { - op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*)); - } else { - op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*)); - } + op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*)); } EX(run_time_cache) = op_array->run_time_cache; @@ -1614,25 +1492,19 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */ { ZEND_ASSERT(EX(func) == (zend_function*)op_array); - ZEND_ASSERT(EX(object) == Z_OBJ(EG(This))); - - EX(return_value) = return_value; - EX(frame_kind) = frame_kind; - ZVAL_UNDEF(&EX(old_error_reporting)); - EX(delayed_exception) = NULL; - EX(call) = NULL; EX(opline) = op_array->opcodes; + EX(call) = NULL; + EX(frame_kind) = frame_kind; + EX(return_value) = return_value; EX(scope) = EG(scope); + EX(delayed_exception) = NULL; + ZVAL_UNDEF(&EX(old_error_reporting)); zend_attach_symbol_table(execute_data); if (!op_array->run_time_cache && op_array->last_cache_slot) { - if (op_array->function_name) { - op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*)); - } else { - op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*)); - } + op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*)); } EX(run_time_cache) = op_array->run_time_cache; @@ -1643,50 +1515,65 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu static zend_always_inline void i_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */ { ZEND_ASSERT(EX(func) == (zend_function*)op_array); - ZEND_ASSERT(EX(object) == Z_OBJ(EG(This))); - - EX(return_value) = return_value; - EX(frame_kind) = frame_kind; - ZVAL_UNDEF(&EX(old_error_reporting)); - EX(delayed_exception) = NULL; - EX(call) = NULL; EX(opline) = op_array->opcodes; + EX(call) = NULL; + EX(frame_kind) = frame_kind; + EX(return_value) = return_value; EX(scope) = EG(scope); + EX(delayed_exception) = NULL; + ZVAL_UNDEF(&EX(old_error_reporting)); if (UNEXPECTED(EX(symbol_table) != NULL)) { zend_attach_symbol_table(execute_data); } else { - uint32_t first_extra_arg = op_array->num_args; + uint32_t first_extra_arg, num_args; + /* Handle arguments */ + first_extra_arg = op_array->num_args; if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) { first_extra_arg--; } - if (UNEXPECTED(EX(num_args) > first_extra_arg)) { - /* move extra args into separate array after all CV and TMP vars */ - zval *extra_args = EX_VAR_NUM(op_array->last_var + op_array->T); - - memmove(extra_args, EX_VAR_NUM(first_extra_arg), sizeof(zval) * (EX(num_args) - first_extra_arg)); - } - - do { - /* Initialize CV variables (skip arguments) */ - int num_args = MIN(op_array->num_args, EX(num_args)); + num_args = EX(num_args); + if (UNEXPECTED(num_args > first_extra_arg)) { + zval *end, *src, *dst; - if (EXPECTED(num_args < op_array->last_var)) { - zval *var = EX_VAR_NUM(num_args); - zval *end = EX_VAR_NUM(op_array->last_var); + if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) { + /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */ + EX(opline) += first_extra_arg; + } + /* move extra args into separate array after all CV and TMP vars */ + end = EX_VAR_NUM(first_extra_arg - 1); + src = end + (num_args - first_extra_arg); + dst = src + (op_array->last_var + op_array->T - first_extra_arg); + if (EXPECTED(src != dst)) { do { - ZVAL_UNDEF(var); - var++; - } while (var != end); + ZVAL_COPY_VALUE(dst, src); + ZVAL_UNDEF(src); + src--; + dst--; + } while (src != end); } - } while (0); + } else if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) { + /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */ + EX(opline) += num_args; + } + + /* Initialize CV variables (skip arguments) */ + if (EXPECTED(num_args < op_array->last_var)) { + zval *var = EX_VAR_NUM(num_args); + zval *end = EX_VAR_NUM(op_array->last_var); + + do { + ZVAL_UNDEF(var); + var++; + } while (var != end); + } - if (op_array->this_var != -1 && EX(object)) { - ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object)); - GC_REFCOUNT(EX(object))++; + if (op_array->this_var != -1 && Z_OBJ(EX(This))) { + ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This))); + GC_REFCOUNT(Z_OBJ(EX(This)))++; } } @@ -1716,18 +1603,20 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data */ zend_execute_data *execute_data; uint32_t num_args = call->num_args; + size_t stack_size = (ZEND_CALL_FRAME_SLOT + MAX(op_array->last_var + op_array->T, num_args)) * sizeof(zval); EG(argument_stack) = zend_vm_stack_new_page( - MAX(ZEND_VM_STACK_PAGE_SIZE, - ZEND_CALL_FRAME_SLOT + MAX(op_array->last_var + op_array->T, num_args))); - EG(argument_stack)->prev = NULL; + EXPECTED(stack_size < ZEND_VM_STACK_FREE_PAGE_SIZE) ? + ZEND_VM_STACK_PAGE_SIZE : + ZEND_VM_STACK_PAGE_ALIGNED_SIZE(stack_size), + NULL); execute_data = zend_vm_stack_push_call_frame( (zend_function*)op_array, num_args, call->flags, call->called_scope, - call->object, + Z_OBJ(call->This), NULL TSRMLS_CC); EX(num_args) = num_args; @@ -1735,7 +1624,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data if (num_args > 0) { zval *arg_src = ZEND_CALL_ARG(call, 1); zval *arg_dst = ZEND_CALL_ARG(execute_data, 1); - int i; + uint32_t i; for (i = 0; i < num_args; i++) { ZVAL_COPY_VALUE(arg_dst + i, arg_src + i); @@ -1770,7 +1659,7 @@ static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call, int used_stack = (EG(argument_stack)->top - (zval*)call) + additional_args; /* copy call frame into new stack segment */ - zend_vm_stack_extend(used_stack TSRMLS_CC); + zend_vm_stack_extend(used_stack * sizeof(zval) TSRMLS_CC); new_call = (zend_execute_data*)EG(argument_stack)->top; EG(argument_stack)->top += used_stack; *new_call = *call; diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 614cb07b4f..3770f4cbe9 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -56,7 +56,7 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC if (Z_REFCOUNTED_P(zval_ptr)) { if (!Z_DELREF_P(zval_ptr)) { ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval)); - _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_CC); + _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC); } else { GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr); } @@ -137,7 +137,9 @@ ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *s ZEND_API int zval_update_constant_ex(zval *pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC); /* dedicated Zend executor functions - do not use! */ -#define ZEND_VM_STACK_PAGE_SIZE (16 * 1024) /* should be a power of 2 */ +#define ZEND_VM_STACK_PAGE_SLOTS (16 * 1024) /* should be a power of 2 */ + +#define ZEND_VM_STACK_PAGE_SIZE (ZEND_VM_STACK_PAGE_SLOTS * sizeof(zval)) struct _zend_vm_stack { zval *top; @@ -145,33 +147,30 @@ struct _zend_vm_stack { zend_vm_stack prev; }; -#define ZEND_VM_STACK_HEADER_SLOT \ +#define ZEND_VM_STACK_HEADER_SLOTS \ ((ZEND_MM_ALIGNED_SIZE(sizeof(struct _zend_vm_stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / ZEND_MM_ALIGNED_SIZE(sizeof(zval))) +#define ZEND_VM_STACK_FREE_PAGE_SIZE \ + ((ZEND_VM_STACK_PAGE_SLOTS - ZEND_VM_STACK_HEADER_SLOTS) * sizeof(zval)) + +#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size) \ + (((size) + (ZEND_VM_STACK_FREE_PAGE_SIZE - 1)) & ~ZEND_VM_STACK_PAGE_SIZE) + #define ZEND_VM_STACK_ELEMETS(stack) \ - (((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOT) - -#define ZEND_VM_STACK_GROW_IF_NEEDED(count) \ - do { \ - if (UNEXPECTED(((count) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) > \ - (size_t)(((char*)EG(argument_stack)->end) - \ - ((char*)EG(argument_stack)->top)))) { \ - zend_vm_stack_extend((count) TSRMLS_CC); \ - } \ - } while (0) + (((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS) -static zend_always_inline zend_vm_stack zend_vm_stack_new_page(int count) { - zend_vm_stack page = (zend_vm_stack)emalloc(count * ZEND_MM_ALIGNED_SIZE(sizeof(zval))); +static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) { + zend_vm_stack page = (zend_vm_stack)emalloc(size); page->top = ZEND_VM_STACK_ELEMETS(page); - page->end = (zval*)page + count; - page->prev = NULL; + page->end = (zval*)((char*)page + size); + page->prev = prev; return page; } static zend_always_inline void zend_vm_stack_init(TSRMLS_D) { - EG(argument_stack) = zend_vm_stack_new_page(ZEND_VM_STACK_PAGE_SIZE); + EG(argument_stack) = zend_vm_stack_new_page(ZEND_VM_STACK_PAGE_SIZE, NULL); EG(argument_stack)->top++; } @@ -186,16 +185,24 @@ static zend_always_inline void zend_vm_stack_destroy(TSRMLS_D) } } -static zend_always_inline void zend_vm_stack_extend(uint32_t count TSRMLS_DC) +static zend_always_inline void zend_vm_stack_extend(size_t size TSRMLS_DC) +{ + EG(argument_stack) = zend_vm_stack_new_page( + EXPECTED(size < ZEND_VM_STACK_FREE_PAGE_SIZE) ? + ZEND_VM_STACK_PAGE_SIZE : ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size), + EG(argument_stack)); +} + +static zend_always_inline zval* zend_vm_stack_alloc(size_t size TSRMLS_DC) { - uint32_t size = count * ZEND_MM_ALIGNED_SIZE(sizeof(zval)); - zend_vm_stack p = zend_vm_stack_new_page( - (size >= (ZEND_VM_STACK_PAGE_SIZE - ZEND_VM_STACK_HEADER_SLOT) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) ? - (size + ((ZEND_VM_STACK_HEADER_SLOT + ZEND_VM_STACK_PAGE_SIZE) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) - 1) & - ~((ZEND_VM_STACK_PAGE_SIZE * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) - 1) : - ZEND_VM_STACK_PAGE_SIZE); - p->prev = EG(argument_stack); - EG(argument_stack) = p; + char *top = (char*)EG(argument_stack)->top; + + if (UNEXPECTED(size > (size_t)(((char*)EG(argument_stack)->end) - top))) { + zend_vm_stack_extend(size TSRMLS_CC); + top = (char*)EG(argument_stack)->top; + } + EG(argument_stack)->top = (zval*)(top + size); + return (zval*)top; } static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_function *func, uint32_t num_args, zend_uchar flags, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC) @@ -206,15 +213,13 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_ if (ZEND_USER_CODE(func->type)) { used_stack += func->op_array.last_var + func->op_array.T - MIN(func->op_array.num_args, num_args); } - ZEND_VM_STACK_GROW_IF_NEEDED(used_stack); - call = (zend_execute_data*)EG(argument_stack)->top; - EG(argument_stack)->top += used_stack; + call = (zend_execute_data*)zend_vm_stack_alloc(used_stack * sizeof(zval) TSRMLS_CC); call->func = func; call->num_args = 0; call->flags = flags; call->called_scope = called_scope; - call->object = object; - call->prev_nested_call = prev; + ZVAL_OBJ(&call->This, object); + call->prev_execute_data = prev; return call; } @@ -249,13 +254,12 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call T static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *call TSRMLS_DC) { - if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (zval*)call)) { - zend_vm_stack p = EG(argument_stack); - + zend_vm_stack p = EG(argument_stack); + if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(p) == (zval*)call)) { EG(argument_stack) = p->prev; efree(p); } else { - EG(argument_stack)->top = (zval*)call; + p->top = (zval*)call; } } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 7842ecfb91..9fdb2ee4f5 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -42,7 +42,7 @@ ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data TSRMLS_DC); ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value TSRMLS_DC); /* true globals */ -ZEND_API const zend_fcall_info empty_fcall_info = { 0, NULL, {{0}, {{0}}, {0}}, NULL, NULL, 0, NULL, NULL, 0 }; +ZEND_API const zend_fcall_info empty_fcall_info = { 0, NULL, {{0}, {{0}}, {0}}, NULL, NULL, NULL, NULL, 0, 0 }; ZEND_API const zend_fcall_info_cache empty_fcall_info_cache = { 0, NULL, NULL, NULL, NULL }; #ifdef ZEND_WIN32 @@ -187,8 +187,6 @@ void init_executor(TSRMLS_D) /* {{{ */ EG(scope) = NULL; - ZVAL_OBJ(&EG(This), NULL); - EG(active) = 1; } /* }}} */ @@ -580,8 +578,8 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas if (!inline_change) { ZVAL_STRINGL(p, actual, actual_len); } else { - Z_TYPE_INFO_P(p) = IS_INTERNED(Z_STR_P(p)) ? - IS_INTERNED_STRING_EX : IS_STRING_EX; + Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ? + IS_STRING_EX : IS_INTERNED_STRING_EX; if (save && save->val != actual) { zend_string_release(save); } @@ -663,7 +661,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS zend_execute_data *call, dummy_execute_data; zend_fcall_info_cache fci_cache_local; zend_function *func; - zend_object *orig_object; zend_class_entry *orig_scope; zval tmp; @@ -685,7 +682,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS break; } - orig_object = Z_OBJ(EG(This)); orig_scope = EG(scope); /* Initialize execute_data */ @@ -703,7 +699,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS dummy_execute_data = *EG(current_execute_data); dummy_execute_data.prev_execute_data = EG(current_execute_data); dummy_execute_data.call = NULL; - dummy_execute_data.prev_nested_call = NULL; dummy_execute_data.opline = NULL; dummy_execute_data.func = NULL; EG(current_execute_data) = &dummy_execute_data; @@ -836,10 +831,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS EG(scope) = calling_scope; if (!fci->object || (func->common.fn_flags & ZEND_ACC_STATIC)) { - Z_OBJ(EG(This)) = call->object = NULL; + Z_OBJ(call->This) = NULL; + Z_TYPE_INFO(call->This) = IS_UNDEF; } else { - Z_OBJ(EG(This)) = fci->object; - Z_ADDREF(EG(This)); + ZVAL_OBJ(&call->This, fci->object); + GC_REFCOUNT(fci->object)++; } if (func->type == ZEND_USER_FUNCTION) { @@ -862,7 +858,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS EG(current_execute_data) = call; if (EXPECTED(zend_execute_internal == NULL)) { /* saves one function call if zend_execute_internal is not used */ - func->internal_function.handler(fci->param_count, fci->retval TSRMLS_CC); + func->internal_function.handler(call, fci->retval TSRMLS_CC); } else { zend_execute_internal(call, fci->retval TSRMLS_CC); } @@ -892,7 +888,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS if (fci->object) { call->prev_execute_data = EG(current_execute_data); EG(current_execute_data) = call; - fci->object->handlers->call_method(func->common.function_name, fci->object, fci->param_count, fci->retval TSRMLS_CC); + fci->object->handlers->call_method(func->common.function_name, fci->object, call, fci->retval TSRMLS_CC); EG(current_execute_data) = call->prev_execute_data; } else { zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); @@ -912,11 +908,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS } } - if (Z_OBJ(EG(This))) { - zval_ptr_dtor(&EG(This)); + if (fci->object && !(func->common.fn_flags & ZEND_ACC_STATIC)) { + OBJ_RELEASE(fci->object); } - Z_OBJ(EG(This)) = orig_object; EG(scope) = orig_scope; if (EG(current_execute_data) == &dummy_execute_data) { EG(current_execute_data) = dummy_execute_data.prev_execute_data; @@ -1011,12 +1006,12 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k if (name->val[0] == '\\') { ZVAL_STRINGL(&args[0], name->val + 1, name->len - 1); } else { - ZVAL_STR(&args[0], zend_string_copy(name)); + ZVAL_STR_COPY(&args[0], name); } fcall_info.size = sizeof(fcall_info); fcall_info.function_table = EG(function_table); - ZVAL_STR(&fcall_info.function_name, zend_string_copy(EG(autoload_func)->common.function_name)); + ZVAL_STR_COPY(&fcall_info.function_name, EG(autoload_func)->common.function_name); fcall_info.symbol_table = NULL; fcall_info.retval = &local_retval; fcall_info.param_count = 1; @@ -1502,7 +1497,7 @@ ZEND_API int zend_delete_global_variable(zend_string *name TSRMLS_DC) /* {{{ */ ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */ { - uint32_t i; + int i; zend_execute_data *ex; zend_array *symbol_table; diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index adc02a3eb0..b331f979fd 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -99,6 +99,7 @@ ZEND_API void gc_reset(TSRMLS_D) { GC_G(gc_runs) = 0; GC_G(collected) = 0; + GC_G(gc_full) = 0; #if GC_BENCH GC_G(root_buf_length) = 0; @@ -185,14 +186,6 @@ ZEND_API void gc_remove_from_buffer(zend_refcounted *ref TSRMLS_DC) { gc_root_buffer *root; - if (UNEXPECTED(/*GC_ADDRESS(GC_INFO(ref)) &&*/ - GC_GET_COLOR(GC_INFO(ref)) == GC_BLACK && - GC_ADDRESS(GC_INFO(ref)) >= GC_G(last_unused) - GC_G(buf))) { - /* The given zval is a garbage that is going to be deleted by - * currently running GC */ - return; - } - root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref)); GC_BENCH_INC(zval_remove_from_buffer); GC_REMOVE_FROM_ROOTS(root); @@ -492,8 +485,11 @@ tail_call: } else if (GC_G(first_unused) != GC_G(last_unused)) { buf = GC_G(first_unused); GC_G(first_unused)++; + } else { + /* TODO: find a perfect way to handle such case */ + GC_G(gc_full) = 1; } - /* TODO: what should we do if we don't have room ??? */ + if (buf) { buf->ref = ref; buf->next = GC_G(roots).next; @@ -609,6 +605,18 @@ static int gc_collect_roots(TSRMLS_D) } current = current->next; } + + if (GC_G(gc_full) == 1) { + current = GC_G(roots).next; + while (current != &GC_G(roots)) { + GC_SET_ADDRESS(GC_INFO(current->ref), 0); + GC_SET_BLACK(GC_INFO(current->ref)); + current = current->next; + } + gc_reset(TSRMLS_C); + return 0; + } + /* relink remaining roots into list to free */ if (GC_G(roots).next != &GC_G(roots)) { if (GC_G(to_free).next == &GC_G(to_free)) { diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h index 84b7ef3208..2eb8ea6ea3 100644 --- a/Zend/zend_gc.h +++ b/Zend/zend_gc.h @@ -83,6 +83,7 @@ typedef struct _gc_root_buffer { typedef struct _zend_gc_globals { zend_bool gc_enabled; zend_bool gc_active; + zend_bool gc_full; gc_root_buffer *buf; /* preallocated arrays of buffers */ gc_root_buffer roots; /* list of possible roots of cycles */ diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 449a374683..6ffd264a1d 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -57,19 +57,9 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato } else if (brk_cont->brk > op_num) { zend_op *brk_opline = op_array->opcodes + brk_cont->brk; - switch (brk_opline->opcode) { - case ZEND_SWITCH_FREE: - { - zval *var = EX_VAR_2(execute_data, brk_opline->op1.var); - zval_ptr_dtor(var); - } - break; - case ZEND_FREE: - { - zval *var = EX_VAR_2(execute_data, brk_opline->op1.var); - zval_dtor(var); - } - break; + if (brk_opline->opcode == ZEND_FREE) { + zval *var = EX_VAR_2(execute_data, brk_opline->op1.var); + zval_ptr_dtor_nogc(var); } } } @@ -78,10 +68,10 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato /* If yield was used as a function argument there may be active * method calls those objects need to be freed */ while (execute_data->call) { - if (execute_data->call->object) { - OBJ_RELEASE(execute_data->call->object); + if (Z_OBJ(execute_data->call->This)) { + OBJ_RELEASE(Z_OBJ(execute_data->call->This)); } - execute_data->call = execute_data->call->prev_nested_call; + execute_data->call = execute_data->call->prev_execute_data; } } /* }}} */ @@ -108,8 +98,8 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC); } - if (execute_data->object) { - OBJ_RELEASE(execute_data->object); + if (Z_OBJ(execute_data->This)) { + OBJ_RELEASE(Z_OBJ(execute_data->This)); } /* A fatal error / die occurred during the generator execution. Trying to clean @@ -261,8 +251,8 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array object_init_ex(return_value, zend_ce_generator); - if (Z_OBJ(EG(This))) { - Z_ADDREF(EG(This)); + if (Z_OBJ(call->This)) { + Z_ADDREF(call->This); } /* Save execution context in generator object. */ @@ -302,15 +292,11 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ { /* Backup executor globals */ zend_execute_data *original_execute_data = EG(current_execute_data); - zend_object *original_This; zend_class_entry *original_scope = EG(scope); zend_vm_stack original_stack = EG(argument_stack); - original_This = Z_OBJ(EG(This)); - /* Set executor globals */ EG(current_execute_data) = generator->execute_data; - Z_OBJ(EG(This)) = generator->execute_data->object; EG(scope) = generator->execute_data->scope; EG(argument_stack) = generator->stack; @@ -332,7 +318,6 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ /* Restore executor globals */ EG(current_execute_data) = original_execute_data; - Z_OBJ(EG(This)) = original_This; EG(scope) = original_scope; EG(argument_stack) = original_stack; diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 69e1cf9e68..d2be4ec5c2 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -174,8 +174,6 @@ struct _zend_executor_globals { zend_class_entry *scope; - zval This; - zend_long precision; int ticks_count; diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 5201e88bd4..6304737f04 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -97,9 +97,9 @@ static void zend_hash_do_resize(HashTable *ht); static const uint32_t uninitialized_bucket = {INVALID_IDX}; -ZEND_API void _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC) +ZEND_API void _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC) { - uint i = 3; + uint32_t i = 3; SET_INCONSISTENT(HT_OK); @@ -137,7 +137,7 @@ static void zend_hash_packed_grow(HashTable *ht) HANDLE_UNBLOCK_INTERRUPTIONS(); } -ZEND_API void zend_hash_real_init(HashTable *ht, int packed) +ZEND_API void zend_hash_real_init(HashTable *ht, zend_bool packed) { IS_CONSISTENT(ht); @@ -163,7 +163,7 @@ ZEND_API void zend_hash_to_packed(HashTable *ht) HANDLE_UNBLOCK_INTERRUPTIONS(); } -ZEND_API void _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) +ZEND_API void _zend_hash_init_ex(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) { _zend_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_CC); if (!bApplyProtection) { @@ -184,8 +184,8 @@ ZEND_API void zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProt static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zend_string *key) { zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; h = zend_string_hash_val(key); @@ -205,10 +205,10 @@ static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zen return NULL; } -static zend_always_inline Bucket *zend_hash_str_find_bucket(const HashTable *ht, const char *str, int len, zend_ulong h) +static zend_always_inline Bucket *zend_hash_str_find_bucket(const HashTable *ht, const char *str, size_t len, zend_ulong h) { - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; nIndex = h & ht->nTableMask; @@ -229,8 +229,8 @@ static zend_always_inline Bucket *zend_hash_str_find_bucket(const HashTable *ht, static zend_always_inline Bucket *zend_hash_index_find_bucket(const HashTable *ht, zend_ulong h) { - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; nIndex = h & ht->nTableMask; @@ -246,11 +246,11 @@ static zend_always_inline Bucket *zend_hash_index_find_bucket(const HashTable *h return NULL; } -static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_string *key, zval *pData, int flag ZEND_FILE_LINE_DC) +static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_string *key, zval *pData, uint32_t flag ZEND_FILE_LINE_DC) { zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; #ifdef ZEND_SIGNALS TSRMLS_FETCH(); @@ -310,7 +310,7 @@ static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_s return &p->val; } -ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, int flag ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, uint32_t flag ZEND_FILE_LINE_DC) { return _zend_hash_add_or_update_i(ht, key, pData, flag ZEND_FILE_LINE_RELAY_CC); } @@ -335,7 +335,7 @@ ZEND_API zval *_zend_hash_add_new(HashTable *ht, zend_string *key, zval *pData Z return _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC); } -ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *str, int len, zval *pData, int flag ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *str, size_t len, zval *pData, uint32_t flag ZEND_FILE_LINE_DC) { zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT); zval *ret = _zend_hash_add_or_update_i(ht, key, pData, flag ZEND_FILE_LINE_CC); @@ -343,7 +343,7 @@ ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *str, int return ret; } -ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC) { zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT); zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_UPDATE ZEND_FILE_LINE_CC); @@ -351,7 +351,7 @@ ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *str, int len, zv return ret; } -ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC) { zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT); zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_UPDATE | HASH_UPDATE_INDIRECT ZEND_FILE_LINE_CC); @@ -359,7 +359,7 @@ ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *str, int len return ret; } -ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC) { zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT); zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD ZEND_FILE_LINE_CC); @@ -367,7 +367,7 @@ ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *str, int len, zval return ret; } -ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC) { zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT); zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD_NEW ZEND_FILE_LINE_CC); @@ -393,7 +393,7 @@ ZEND_API zval *zend_hash_add_empty_element(HashTable *ht, zend_string *key) return zend_hash_add(ht, key, &dummy); } -ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *str, int len) +ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *str, size_t len) { zval dummy; @@ -402,85 +402,80 @@ ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *str, i return zend_hash_str_add(ht, str, len, &dummy); } -static zend_always_inline zval *_zend_hash_index_update_or_next_insert_i(HashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC) +static zend_always_inline zval *_zend_hash_index_add_or_update_i(HashTable *ht, zend_ulong h, zval *pData, uint32_t flag ZEND_FILE_LINE_DC) { - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; #ifdef ZEND_SIGNALS TSRMLS_FETCH(); #endif IS_CONSISTENT(ht); - - if (flag & HASH_NEXT_INSERT) { - h = ht->nNextFreeElement; - } - CHECK_INIT(ht, h >= 0 && h < ht->nTableSize); + CHECK_INIT(ht, h < ht->nTableSize); if (ht->u.flags & HASH_FLAG_PACKED) { - if (EXPECTED(h >= 0)) { - if (h < ht->nNumUsed) { - p = ht->arData + h; - if (Z_TYPE(p->val) != IS_UNDEF) { - if (flag & (HASH_NEXT_INSERT | HASH_ADD)) { - return NULL; - } - if (ht->pDestructor) { - ht->pDestructor(&p->val); - } - ZVAL_COPY_VALUE(&p->val, pData); - if ((zend_long)h >= (zend_long)ht->nNextFreeElement) { - ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX; - } - return &p->val; - } else { /* we have to keep the order :( */ - goto convert_to_hash; + if (h < ht->nNumUsed) { + p = ht->arData + h; + if (Z_TYPE(p->val) != IS_UNDEF) { + if (flag & HASH_ADD) { + return NULL; } - } else if (EXPECTED(h < ht->nTableSize)) { - p = ht->arData + h; - } else if (h < ht->nTableSize * 2 && - ht->nTableSize - ht->nNumOfElements < ht->nTableSize / 2) { - zend_hash_packed_grow(ht); - p = ht->arData + h; - } else { - goto convert_to_hash; - } - HANDLE_BLOCK_INTERRUPTIONS(); - /* incremental initialization of empty Buckets */ - if (h >= ht->nNumUsed) { - Bucket *q = ht->arData + ht->nNumUsed; - while (q != p) { - ZVAL_UNDEF(&q->val); - q++; + if (ht->pDestructor) { + ht->pDestructor(&p->val); } - ht->nNumUsed = h + 1; - } - ht->nNumOfElements++; - if (ht->nInternalPointer == INVALID_IDX) { - ht->nInternalPointer = h; + ZVAL_COPY_VALUE(&p->val, pData); + if ((zend_long)h >= (zend_long)ht->nNextFreeElement) { + ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX; + } + return &p->val; + } else { /* we have to keep the order :( */ + goto convert_to_hash; } - if ((zend_long)h >= (zend_long)ht->nNextFreeElement) { - ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX; + } else if (EXPECTED(h < ht->nTableSize)) { + p = ht->arData + h; + } else if (h < ht->nTableSize * 2 && + ht->nTableSize - ht->nNumOfElements < ht->nTableSize / 2) { + zend_hash_packed_grow(ht); + p = ht->arData + h; + } else { + goto convert_to_hash; + } + + HANDLE_BLOCK_INTERRUPTIONS(); + /* incremental initialization of empty Buckets */ + if (h >= ht->nNumUsed) { + Bucket *q = ht->arData + ht->nNumUsed; + while (q != p) { + ZVAL_UNDEF(&q->val); + q++; } - p->h = h; - p->key = NULL; - ZVAL_COPY_VALUE(&p->val, pData); - Z_NEXT(p->val) = INVALID_IDX; + ht->nNumUsed = h + 1; + } + ht->nNumOfElements++; + if (ht->nInternalPointer == INVALID_IDX) { + ht->nInternalPointer = h; + } + if ((zend_long)h >= (zend_long)ht->nNextFreeElement) { + ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX; + } + p->h = h; + p->key = NULL; + ZVAL_COPY_VALUE(&p->val, pData); + Z_NEXT(p->val) = INVALID_IDX; - HANDLE_UNBLOCK_INTERRUPTIONS(); + HANDLE_UNBLOCK_INTERRUPTIONS(); + + return &p->val; - return &p->val; - } else { convert_to_hash: - zend_hash_packed_to_hash(ht); - } + zend_hash_packed_to_hash(ht); } if ((flag & HASH_ADD_NEW) == 0) { p = zend_hash_index_find_bucket(ht, h); if (p) { - if (flag & (HASH_NEXT_INSERT | HASH_ADD)) { + if (flag & HASH_ADD) { return NULL; } ZEND_ASSERT(&p->val != pData); @@ -520,34 +515,34 @@ convert_to_hash: return &p->val; } -ZEND_API zval *_zend_hash_index_update_or_next_insert(HashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_hash_index_add_or_update(HashTable *ht, zend_ulong h, zval *pData, uint32_t flag ZEND_FILE_LINE_DC) { - return _zend_hash_index_update_or_next_insert_i(ht, h, pData, flag ZEND_FILE_LINE_RELAY_CC); + return _zend_hash_index_add_or_update_i(ht, h, pData, flag ZEND_FILE_LINE_RELAY_CC); } ZEND_API zval *_zend_hash_index_add(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC) { - return _zend_hash_index_update_or_next_insert_i(ht, h, pData, HASH_ADD ZEND_FILE_LINE_RELAY_CC); + return _zend_hash_index_add_or_update_i(ht, h, pData, HASH_ADD ZEND_FILE_LINE_RELAY_CC); } ZEND_API zval *_zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC) { - return _zend_hash_index_update_or_next_insert_i(ht, h, pData, HASH_ADD | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC); + return _zend_hash_index_add_or_update_i(ht, h, pData, HASH_ADD | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC); } ZEND_API zval *_zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC) { - return _zend_hash_index_update_or_next_insert_i(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_RELAY_CC); + return _zend_hash_index_add_or_update_i(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_RELAY_CC); } ZEND_API zval *_zend_hash_next_index_insert(HashTable *ht, zval *pData ZEND_FILE_LINE_DC) { - return _zend_hash_index_update_or_next_insert_i(ht, ht->nNextFreeElement, pData, HASH_NEXT_INSERT ZEND_FILE_LINE_RELAY_CC); + return _zend_hash_index_add_or_update_i(ht, ht->nNextFreeElement, pData, HASH_ADD ZEND_FILE_LINE_RELAY_CC); } ZEND_API zval *_zend_hash_next_index_insert_new(HashTable *ht, zval *pData ZEND_FILE_LINE_DC) { - return _zend_hash_index_update_or_next_insert_i(ht, ht->nNextFreeElement, pData, HASH_NEXT_INSERT | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC); + return _zend_hash_index_add_or_update_i(ht, ht->nNextFreeElement, pData, HASH_ADD | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC); } static void zend_hash_do_resize(HashTable *ht) @@ -576,7 +571,7 @@ static void zend_hash_do_resize(HashTable *ht) ZEND_API int zend_hash_rehash(HashTable *ht) { Bucket *p; - uint nIndex, i, j; + uint32_t nIndex, i, j; IS_CONSISTENT(ht); @@ -606,7 +601,7 @@ ZEND_API int zend_hash_rehash(HashTable *ht) return SUCCESS; } -static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint idx, Bucket *p, Bucket *prev) +static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint32_t idx, Bucket *p, Bucket *prev) { if (!(ht->u.flags & HASH_FLAG_PACKED)) { if (prev) { @@ -646,21 +641,20 @@ static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint idx, Buc } } -static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint idx, Bucket *p) +static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) { - uint nIndex; Bucket *prev = NULL; if (!(ht->u.flags & HASH_FLAG_PACKED)) { - nIndex = p->h & ht->nTableMask; - idx = ht->arHash[nIndex]; - if (p != ht->arData + idx) { - prev = ht->arData + idx; - while (ht->arData + Z_NEXT(prev->val) != p) { - idx = Z_NEXT(prev->val); - prev = ht->arData + idx; + uint32_t nIndex = p->h & ht->nTableMask; + uint32_t i = ht->arHash[nIndex]; + + if (i != idx) { + prev = ht->arData + i; + while (Z_NEXT(prev->val) != idx) { + i = Z_NEXT(prev->val); + prev = ht->arData + i; } - idx = Z_NEXT(prev->val); } } @@ -670,8 +664,8 @@ static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint idx, Bucket ZEND_API int zend_hash_del(HashTable *ht, zend_string *key) { zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; Bucket *prev = NULL; #ifdef ZEND_SIGNALS @@ -709,8 +703,8 @@ ZEND_API int zend_hash_del(HashTable *ht, zend_string *key) ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key) { zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; Bucket *prev = NULL; #ifdef ZEND_SIGNALS @@ -758,11 +752,11 @@ ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key) return FAILURE; } -ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, int len) +ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, size_t len) { zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; Bucket *prev = NULL; #ifdef ZEND_SIGNALS @@ -809,11 +803,11 @@ ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, int len) return FAILURE; } -ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, int len) +ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, size_t len) { zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; Bucket *prev = NULL; #ifdef ZEND_SIGNALS @@ -845,8 +839,8 @@ ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, int len) ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h) { - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; Bucket *prev = NULL; #ifdef ZEND_SIGNALS @@ -856,7 +850,7 @@ ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h) IS_CONSISTENT(ht); if (ht->u.flags & HASH_FLAG_PACKED) { - if (h >=0 && h < ht->nNumUsed) { + if (h < ht->nNumUsed) { p = ht->arData + h; if (Z_TYPE(p->val) != IS_UNDEF) { HANDLE_BLOCK_INTERRUPTIONS(); @@ -934,7 +928,7 @@ ZEND_API void zend_hash_destroy(HashTable *ht) ZEND_API void zend_hash_clean(HashTable *ht) { - uint idx; + uint32_t idx; Bucket *p; IS_CONSISTENT(ht); @@ -965,7 +959,7 @@ ZEND_API void zend_hash_clean(HashTable *ht) * next bucket. The hash *may* be altered during that time, the * returned value will still be valid. */ -static void zend_hash_apply_deleter(HashTable *ht, uint idx, Bucket *p) +static void zend_hash_apply_deleter(HashTable *ht, uint32_t idx, Bucket *p) { #ifdef ZEND_SIGNALS TSRMLS_FETCH(); @@ -979,7 +973,7 @@ static void zend_hash_apply_deleter(HashTable *ht, uint idx, Bucket *p) ZEND_API void zend_hash_graceful_destroy(HashTable *ht) { - uint idx; + uint32_t idx; Bucket *p; IS_CONSISTENT(ht); @@ -998,7 +992,7 @@ ZEND_API void zend_hash_graceful_destroy(HashTable *ht) ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht) { - uint idx; + uint32_t idx; Bucket *p; IS_CONSISTENT(ht); @@ -1029,7 +1023,7 @@ ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht) ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC) { - uint idx; + uint32_t idx; Bucket *p; int result; @@ -1055,7 +1049,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC) ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC) { - uint idx; + uint32_t idx; Bucket *p; int result; @@ -1081,7 +1075,7 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int num_args, ...) { - uint idx; + uint32_t idx; Bucket *p; va_list args; zend_hash_key hash_key; @@ -1116,7 +1110,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC) { - uint idx; + uint32_t idx; Bucket *p; int result; @@ -1144,7 +1138,7 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor) { - uint idx; + uint32_t idx; Bucket *p; zval *new_entry, *data; zend_bool setTargetPointer; @@ -1189,8 +1183,8 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun ZEND_API void zend_array_dup(HashTable *target, HashTable *source) { - uint idx, target_idx; - uint nIndex; + uint32_t idx, target_idx; + uint32_t nIndex; Bucket *p, *q; zval *data; @@ -1308,12 +1302,12 @@ ZEND_API void zend_array_dup(HashTable *target, HashTable *source) } -ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, int overwrite ZEND_FILE_LINE_DC) +ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite ZEND_FILE_LINE_DC) { - uint idx; + uint32_t idx; Bucket *p; zval *t; - int mode = (overwrite?HASH_UPDATE:HASH_ADD); + uint32_t mode = (overwrite?HASH_UPDATE:HASH_ADD); IS_CONSISTENT(source); IS_CONSISTENT(target); @@ -1357,7 +1351,7 @@ static zend_bool zend_hash_replace_checker_wrapper(HashTable *target, zval *sour ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam) { - uint idx; + uint32_t idx; Bucket *p; zval *t; @@ -1402,7 +1396,7 @@ ZEND_API zval *zend_hash_find(const HashTable *ht, zend_string *key) return p ? &p->val : NULL; } -ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *str, int len) +ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *str, size_t len) { zend_ulong h; Bucket *p; @@ -1418,7 +1412,7 @@ ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *str, int len) return p ? &p->val : NULL; } -ZEND_API int zend_hash_exists(const HashTable *ht, zend_string *key) +ZEND_API zend_bool zend_hash_exists(const HashTable *ht, zend_string *key) { Bucket *p; @@ -1432,7 +1426,7 @@ ZEND_API int zend_hash_exists(const HashTable *ht, zend_string *key) return p ? 1 : 0; } -ZEND_API int zend_hash_str_exists(const HashTable *ht, const char *str, int len) +ZEND_API zend_bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len) { zend_ulong h; Bucket *p; @@ -1455,7 +1449,7 @@ ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h) IS_CONSISTENT(ht); if (ht->u.flags & HASH_FLAG_PACKED) { - if (h >= 0 && h < ht->nNumUsed) { + if (h < ht->nNumUsed) { p = ht->arData + h; if (Z_TYPE(p->val) != IS_UNDEF) { return &p->val; @@ -1469,14 +1463,14 @@ ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h) } -ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_ulong h) +ZEND_API zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h) { Bucket *p; IS_CONSISTENT(ht); if (ht->u.flags & HASH_FLAG_PACKED) { - if (h >= 0 && h < ht->nNumUsed) { + if (h < ht->nNumUsed) { if (Z_TYPE(ht->arData[h].val) != IS_UNDEF) { return 1; } @@ -1489,61 +1483,9 @@ ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_ulong h) } -ZEND_API int zend_hash_get_pointer(const HashTable *ht, HashPointer *ptr) -{ - ptr->pos = ht->nInternalPointer; - ptr->ht = (HashTable*)ht; - if (ht->nInternalPointer != INVALID_IDX) { - ptr->h = ht->arData[ht->nInternalPointer].h; - return 1; - } else { - ptr->h = 0; - return 0; - } -} - -ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr) -{ - uint idx; - - if (ptr->pos == INVALID_IDX) { - ht->nInternalPointer = INVALID_IDX; - } else if (ptr->ht != ht) { - IS_CONSISTENT(ht); - for (idx = 0; idx < ht->nNumUsed; idx++) { - if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { - ht->nInternalPointer = idx; - return 0; - } - } - idx = INVALID_IDX; - return 0; - } else if (ht->nInternalPointer != ptr->pos) { - IS_CONSISTENT(ht); - if (ht->u.flags & HASH_FLAG_PACKED) { - if (ptr->h < ht->nNumUsed && - Z_TYPE(ht->arData[ptr->h].val) != IS_UNDEF) { - ht->nInternalPointer = ptr->h; - return 1; - } - } else { - idx = ht->arHash[ptr->h & ht->nTableMask]; - while (idx != INVALID_IDX) { - if (ht->arData[idx].h == ptr->h && idx == ptr->pos) { - ht->nInternalPointer = idx; - return 1; - } - idx = Z_NEXT(ht->arData[idx].val); - } - } - return 0; - } - return 1; -} - ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos) { - uint idx; + uint32_t idx; IS_CONSISTENT(ht); for (idx = 0; idx < ht->nNumUsed; idx++) { @@ -1561,7 +1503,7 @@ ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *p */ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos) { - uint idx; + uint32_t idx; IS_CONSISTENT(ht); @@ -1579,7 +1521,7 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos) { - uint idx = *pos; + uint32_t idx = *pos; IS_CONSISTENT(ht); @@ -1602,7 +1544,7 @@ ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos) ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos) { - uint idx = *pos; + uint32_t idx = *pos; IS_CONSISTENT(ht); @@ -1625,7 +1567,7 @@ ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos) /* This function should be made binary safe */ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, zend_bool duplicate, HashPosition *pos) { - uint idx = *pos; + uint32_t idx = *pos; Bucket *p; IS_CONSISTENT(ht); @@ -1648,7 +1590,7 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) { - uint idx = *pos; + uint32_t idx = *pos; Bucket *p; IS_CONSISTENT(ht); @@ -1657,8 +1599,7 @@ ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, } else { p = ht->arData + idx; if (p->key) { - ZVAL_STR(key, p->key); - zend_string_addref(p->key); + ZVAL_STR_COPY(key, p->key); } else { ZVAL_LONG(key, p->h); } @@ -1667,7 +1608,7 @@ ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos) { - uint idx = *pos; + uint32_t idx = *pos; Bucket *p; IS_CONSISTENT(ht); @@ -1685,7 +1626,7 @@ ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos) ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos) { - uint idx = *pos; + uint32_t idx = *pos; Bucket *p; IS_CONSISTENT(ht); @@ -1698,10 +1639,10 @@ ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos) } ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, - compare_func_t compar, int renumber TSRMLS_DC) + compare_func_t compar, zend_bool renumber TSRMLS_DC) { Bucket *p; - int i, j; + uint32_t i, j; IS_CONSISTENT(ht); @@ -1763,7 +1704,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) { - uint idx1, idx2; + uint32_t idx1, idx2; Bucket *p1, *p2 = NULL; int result; zval *pData1, *pData2; @@ -1867,9 +1808,9 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co } -ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, int flag TSRMLS_DC) +ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag TSRMLS_DC) { - uint idx; + uint32_t idx; Bucket *p, *res; IS_CONSISTENT(ht); @@ -1904,6 +1845,56 @@ ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, int return &res->val; } +ZEND_API int _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx) +{ + register const char *tmp = key; + const char *end; + + if (*tmp > '9') { + return 0; + } else if (*tmp < '0') { + if (*tmp != '-') { + return 0; + } + tmp++; + if (*tmp > '9' || *tmp < '0') { + return 0; + } + } + + /* possibly a numeric index */ + end = key + length; + + if ((*end != '\0') /* not a null terminated string */ + || (*tmp == '0' && length > 1) /* numbers with leading zeros */ + || (end - tmp > MAX_LENGTH_OF_LONG - 1) /* number too long */ + || (SIZEOF_ZEND_LONG == 4 && + end - tmp == MAX_LENGTH_OF_LONG - 1 && + *tmp > '2')) { /* overflow */ + return 0; + } + *idx = (*tmp - '0'); + while (1) { + ++tmp; + if (tmp == end) { + if (*key == '-') { + if (*idx-1 > ZEND_LONG_MAX) { /* overflow */ + return 0; + } + *idx = 0 - *idx; + } else if (*idx > ZEND_LONG_MAX) { /* overflow */ + return 0; + } + return 1; + } + if (*tmp <= '9' && *tmp >= '0') { + *idx = (*idx * 10) + (*tmp - '0'); + } else { + return 0; + } + } +} + /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index ae71312ade..97b89e926c 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -22,21 +22,18 @@ #ifndef ZEND_HASH_H #define ZEND_HASH_H -#include <sys/types.h> #include "zend.h" #define HASH_KEY_IS_STRING 1 #define HASH_KEY_IS_LONG 2 #define HASH_KEY_NON_EXISTENT 3 -#define HASH_KEY_NON_EXISTANT HASH_KEY_NON_EXISTENT /* Keeping old define (with typo) for backward compatibility */ #define HASH_UPDATE (1<<0) #define HASH_ADD (1<<1) -#define HASH_NEXT_INSERT (1<<2) -#define HASH_UPDATE_INDIRECT (1<<3) -#define HASH_ADD_NEW (1<<4) +#define HASH_UPDATE_INDIRECT (1<<2) +#define HASH_ADD_NEW (1<<3) -#define INVALID_IDX ((uint)-1) +#define INVALID_IDX ((uint32_t) -1) #define HASH_FLAG_PERSISTENT (1<<0) #define HASH_FLAG_APPLY_PROTECTION (1<<1) @@ -45,30 +42,30 @@ #define HASH_MASK_CONSISTENCY 0x60 typedef struct _zend_hash_key { - zend_ulong h; + zend_ulong h; zend_string *key; } zend_hash_key; typedef zend_bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam); -typedef uint HashPosition; +typedef uint32_t HashPosition; BEGIN_EXTERN_C() /* startup/shutdown */ -ZEND_API void _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); -ZEND_API void _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC); +ZEND_API void _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); +ZEND_API void _zend_hash_init_ex(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC); ZEND_API void zend_hash_destroy(HashTable *ht); ZEND_API void zend_hash_clean(HashTable *ht); #define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pDestructor), (persistent) ZEND_FILE_LINE_CC) #define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC) -ZEND_API void zend_hash_real_init(HashTable *ht, int packed); +ZEND_API void zend_hash_real_init(HashTable *ht, zend_bool packed); ZEND_API void zend_hash_packed_to_hash(HashTable *ht); ZEND_API void zend_hash_to_packed(HashTable *ht); /* additions/updates/changes */ -ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, int flag ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, uint32_t flag ZEND_FILE_LINE_DC); ZEND_API zval *_zend_hash_update(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC); ZEND_API zval *_zend_hash_update_ind(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC); ZEND_API zval *_zend_hash_add(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC); @@ -83,11 +80,11 @@ ZEND_API zval *_zend_hash_add_new(HashTable *ht, zend_string *key,zval *pData ZE #define zend_hash_add_new(ht, key, pData) \ _zend_hash_add_new(ht, key, pData ZEND_FILE_LINE_CC) -ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *key, int len, zval *pData, int flag ZEND_FILE_LINE_DC); -ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC); -ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC); -ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC); -ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *key, size_t len, zval *pData, uint32_t flag ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC); #define zend_hash_str_update(ht, key, len, pData) \ _zend_hash_str_update(ht, key, len, pData ZEND_FILE_LINE_CC) @@ -98,7 +95,7 @@ ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *key, int len, z #define zend_hash_str_add_new(ht, key, len, pData) \ _zend_hash_str_add_new(ht, key, len, pData ZEND_FILE_LINE_CC) -ZEND_API zval *_zend_hash_index_update_or_next_insert(HashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_hash_index_add_or_update(HashTable *ht, zend_ulong h, zval *pData, uint32_t flag ZEND_FILE_LINE_DC); ZEND_API zval *_zend_hash_index_add(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC); ZEND_API zval *_zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC); ZEND_API zval *_zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC); @@ -118,7 +115,7 @@ ZEND_API zval *_zend_hash_next_index_insert_new(HashTable *ht, zval *pData ZEND_ ZEND_API zval *zend_hash_index_add_empty_element(HashTable *ht, zend_ulong h); ZEND_API zval *zend_hash_add_empty_element(HashTable *ht, zend_string *key); -ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *key, int len); +ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *key, size_t len); #define ZEND_HASH_APPLY_KEEP 0 #define ZEND_HASH_APPLY_REMOVE 1<<0 @@ -146,19 +143,19 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR /* Deletes */ ZEND_API int zend_hash_del(HashTable *ht, zend_string *key); ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key); -ZEND_API int zend_hash_str_del(HashTable *ht, const char *key, int len); -ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *key, int len); +ZEND_API int zend_hash_str_del(HashTable *ht, const char *key, size_t len); +ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *key, size_t len); ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h); /* Data retreival */ ZEND_API zval *zend_hash_find(const HashTable *ht, zend_string *key); -ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *key, int len); +ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *key, size_t len); ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h); /* Misc */ -ZEND_API int zend_hash_exists(const HashTable *ht, zend_string *key); -ZEND_API int zend_hash_str_exists(const HashTable *ht, const char *str, int len); -ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_ulong h); +ZEND_API zend_bool zend_hash_exists(const HashTable *ht, zend_string *key); +ZEND_API zend_bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len); +ZEND_API zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h); /* traversing */ #define zend_hash_has_more_elements_ex(ht, pos) \ @@ -178,9 +175,6 @@ typedef struct _HashPointer { zend_ulong h; } HashPointer; -ZEND_API int zend_hash_get_pointer(const HashTable *ht, HashPointer *ptr); -ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr); - #define zend_hash_has_more_elements(ht) \ zend_hash_has_more_elements_ex(ht, &(ht)->nInternalPointer) #define zend_hash_move_forward(ht) \ @@ -202,11 +196,11 @@ ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr); /* Copying, merging and sorting */ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor); -ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, int overwrite ZEND_FILE_LINE_DC); +ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite ZEND_FILE_LINE_DC); ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam); -ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC); +ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, zend_bool renumber TSRMLS_DC); ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC); -ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, int flag TSRMLS_DC); +ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag TSRMLS_DC); #define zend_hash_merge(target, source, pCopyConstructor, overwrite) \ _zend_hash_merge(target, source, pCopyConstructor, overwrite ZEND_FILE_LINE_CC) @@ -227,6 +221,8 @@ void zend_hash_display_pListTail(const HashTable *ht); void zend_hash_display(const HashTable *ht); #endif +ZEND_API int _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx); + END_EXTERN_C() #define ZEND_INIT_SYMTABLE(ht) \ @@ -235,10 +231,9 @@ END_EXTERN_C() #define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \ zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) -static inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx) +static zend_always_inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx) { register const char *tmp = key; - const char *end; if (*tmp > '9') { return 0; @@ -251,48 +246,17 @@ static inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ return 0; } } - - /* possibly a numeric index */ - end = key + length; - - if ((*end != '\0') /* not a null terminated string */ - || (*tmp == '0' && length > 1) /* numbers with leading zeros */ - || (end - tmp > MAX_LENGTH_OF_LONG - 1) /* number too long */ - || (SIZEOF_ZEND_LONG == 4 && - end - tmp == MAX_LENGTH_OF_LONG - 1 && - *tmp > '2')) { /* overflow */ - return 0; - } - *idx = (*tmp - '0'); - while (1) { - ++tmp; - if (tmp == end) { - if (*key == '-') { - if (*idx-1 > ZEND_LONG_MAX) { /* overflow */ - return 0; - } - *idx = 0 - *idx; - } else if (*idx > ZEND_LONG_MAX) { /* overflow */ - return 0; - } - return 1; - } - if (*tmp <= '9' && *tmp >= '0') { - *idx = (*idx * 10) + (*tmp - '0'); - } else { - return 0; - } - } + return _zend_handle_numeric_str_ex(key, length, idx); } #define ZEND_HANDLE_NUMERIC_STR(key, length, idx) \ _zend_handle_numeric_str(key, length, &idx) #define ZEND_HANDLE_NUMERIC(key, idx) \ - _zend_handle_numeric_str((key)->val, (key)->len, &idx) + ZEND_HANDLE_NUMERIC_STR((key)->val, (key)->len, idx) -static inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key) +static zend_always_inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key) { zval *zv; @@ -301,7 +265,7 @@ static inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key) } -static inline int zend_hash_exists_ind(const HashTable *ht, zend_string *key) +static zend_always_inline int zend_hash_exists_ind(const HashTable *ht, zend_string *key) { zval *zv; @@ -311,7 +275,7 @@ static inline int zend_hash_exists_ind(const HashTable *ht, zend_string *key) } -static inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, int len) +static zend_always_inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, int len) { zval *zv; @@ -320,7 +284,7 @@ static inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, } -static inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData) +static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData) { zend_ulong idx; @@ -332,7 +296,7 @@ static inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval * } -static inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zval *pData) +static zend_always_inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zval *pData) { zend_ulong idx; @@ -344,7 +308,7 @@ static inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zv } -static inline int zend_symtable_del(HashTable *ht, zend_string *key) +static zend_always_inline int zend_symtable_del(HashTable *ht, zend_string *key) { zend_ulong idx; @@ -356,7 +320,7 @@ static inline int zend_symtable_del(HashTable *ht, zend_string *key) } -static inline int zend_symtable_del_ind(HashTable *ht, zend_string *key) +static zend_always_inline int zend_symtable_del_ind(HashTable *ht, zend_string *key) { zend_ulong idx; @@ -368,7 +332,7 @@ static inline int zend_symtable_del_ind(HashTable *ht, zend_string *key) } -static inline zval *zend_symtable_find(const HashTable *ht, zend_string *key) +static zend_always_inline zval *zend_symtable_find(const HashTable *ht, zend_string *key) { zend_ulong idx; @@ -380,7 +344,7 @@ static inline zval *zend_symtable_find(const HashTable *ht, zend_string *key) } -static inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key) +static zend_always_inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key) { zend_ulong idx; @@ -392,7 +356,7 @@ static inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key } -static inline int zend_symtable_exists(HashTable *ht, zend_string *key) +static zend_always_inline int zend_symtable_exists(HashTable *ht, zend_string *key) { zend_ulong idx; @@ -404,7 +368,7 @@ static inline int zend_symtable_exists(HashTable *ht, zend_string *key) } -static inline zval *zend_symtable_str_update(HashTable *ht, const char *str, int len, zval *pData) +static zend_always_inline zval *zend_symtable_str_update(HashTable *ht, const char *str, int len, zval *pData) { zend_ulong idx; @@ -416,7 +380,7 @@ static inline zval *zend_symtable_str_update(HashTable *ht, const char *str, int } -static inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, int len, zval *pData) +static zend_always_inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, int len, zval *pData) { zend_ulong idx; @@ -428,7 +392,7 @@ static inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, } -static inline int zend_symtable_str_del(HashTable *ht, const char *str, int len) +static zend_always_inline int zend_symtable_str_del(HashTable *ht, const char *str, int len) { zend_ulong idx; @@ -440,7 +404,7 @@ static inline int zend_symtable_str_del(HashTable *ht, const char *str, int len) } -static inline int zend_symtable_str_del_ind(HashTable *ht, const char *str, int len) +static zend_always_inline int zend_symtable_str_del_ind(HashTable *ht, const char *str, int len) { zend_ulong idx; @@ -452,7 +416,7 @@ static inline int zend_symtable_str_del_ind(HashTable *ht, const char *str, int } -static inline zval *zend_symtable_str_find(HashTable *ht, const char *str, int len) +static zend_always_inline zval *zend_symtable_str_find(HashTable *ht, const char *str, int len) { zend_ulong idx; @@ -464,7 +428,7 @@ static inline zval *zend_symtable_str_find(HashTable *ht, const char *str, int l } -static inline int zend_symtable_str_exists(HashTable *ht, const char *str, int len) +static zend_always_inline int zend_symtable_str_exists(HashTable *ht, const char *str, int len) { zend_ulong idx; @@ -475,7 +439,7 @@ static inline int zend_symtable_str_exists(HashTable *ht, const char *str, int l } } -static inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pData) +static zend_always_inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pData) { zval tmp, *zv; @@ -484,7 +448,7 @@ static inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pDa return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void *pData) +static zend_always_inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void *pData) { zval tmp, *zv; @@ -493,7 +457,7 @@ static inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, int len, void *pData) +static zend_always_inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, int len, void *pData) { zval tmp, *zv; @@ -502,7 +466,7 @@ static inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, int le return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *pData) +static zend_always_inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *pData) { zval tmp, *zv; @@ -511,7 +475,7 @@ static inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void * return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, int len, void *pData) +static zend_always_inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, int len, void *pData) { zval tmp, *zv; @@ -520,7 +484,7 @@ static inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, int return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pData, size_t size) +static zend_always_inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pData, size_t size) { zval tmp, *zv; @@ -533,7 +497,7 @@ static inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pDa return NULL; } -static inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, int len, void *pData, size_t size) +static zend_always_inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, int len, void *pData, size_t size) { zval tmp, *zv; @@ -546,7 +510,7 @@ static inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, int le return NULL; } -static inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *pData, size_t size) +static zend_always_inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *pData, size_t size) { void *p; @@ -555,7 +519,7 @@ static inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void * return zend_hash_update_ptr(ht, key, p); } -static inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, int len, void *pData, size_t size) +static zend_always_inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, int len, void *pData, size_t size) { void *p; @@ -564,7 +528,7 @@ static inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, int return zend_hash_str_update_ptr(ht, str, len, p); } -static inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData) +static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData) { zval tmp, *zv; @@ -573,7 +537,7 @@ static inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData) +static zend_always_inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData) { zval tmp, *zv; @@ -582,7 +546,7 @@ static inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData) return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void *pData, size_t size) +static zend_always_inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void *pData, size_t size) { void *p; @@ -591,7 +555,7 @@ static inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void return zend_hash_index_update_ptr(ht, h, p); } -static inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, size_t size) +static zend_always_inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, size_t size) { zval tmp, *zv; @@ -604,7 +568,7 @@ static inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, return NULL; } -static inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key) +static zend_always_inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key) { zval *zv; @@ -612,7 +576,7 @@ static inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key) return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, int len) +static zend_always_inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, int len) { zval *zv; @@ -620,7 +584,7 @@ static inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h) +static zend_always_inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h) { zval *zv; @@ -628,7 +592,7 @@ static inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h) return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, int len) +static zend_always_inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, int len) { zend_ulong idx; @@ -639,7 +603,7 @@ static inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, i } } -static inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPosition *pos) +static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPosition *pos) { zval *zv; diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c new file mode 100644 index 0000000000..f240ed7159 --- /dev/null +++ b/Zend/zend_inheritance.c @@ -0,0 +1,1559 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans <andi@zend.com> | + | Zeev Suraski <zeev@zend.com> | + +----------------------------------------------------------------------+ +*/ + +#include "zend.h" +#include "zend_API.h" +#include "zend_compile.h" +#include "zend_execute.h" +#include "zend_smart_str.h" + +static void ptr_dtor(zval *zv) /* {{{ */ +{ + efree(Z_PTR_P(zv)); +} +/* }}} */ + +static zend_property_info *zend_duplicate_property_info(zend_property_info *property_info TSRMLS_DC) /* {{{ */ +{ + zend_property_info* new_property_info; + + new_property_info = zend_arena_alloc(&CG(arena), sizeof(zend_property_info)); + memcpy(new_property_info, property_info, sizeof(zend_property_info)); + zend_string_addref(new_property_info->name); + if (new_property_info->doc_comment) { + zend_string_addref(new_property_info->doc_comment); + } + return new_property_info; +} +/* }}} */ + +static zend_property_info *zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */ +{ + zend_property_info* new_property_info = pemalloc(sizeof(zend_property_info), 1); + memcpy(new_property_info, property_info, sizeof(zend_property_info)); + zend_string_addref(new_property_info->name); + return new_property_info; +} +/* }}} */ + +static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + zend_function *function, *new_function; + + if (!ce->parent) { + return; + } + + /* You cannot change create_object */ + ce->create_object = ce->parent->create_object; + + /* Inherit special functions if needed */ + if (!ce->get_iterator) { + ce->get_iterator = ce->parent->get_iterator; + } + if (!ce->iterator_funcs.funcs) { + ce->iterator_funcs.funcs = ce->parent->iterator_funcs.funcs; + } + if (!ce->__get) { + ce->__get = ce->parent->__get; + } + if (!ce->__set) { + ce->__set = ce->parent->__set; + } + if (!ce->__unset) { + ce->__unset = ce->parent->__unset; + } + if (!ce->__isset) { + ce->__isset = ce->parent->__isset; + } + if (!ce->__call) { + ce->__call = ce->parent->__call; + } + if (!ce->__callstatic) { + ce->__callstatic = ce->parent->__callstatic; + } + if (!ce->__tostring) { + ce->__tostring = ce->parent->__tostring; + } + if (!ce->clone) { + ce->clone = ce->parent->clone; + } + if(!ce->serialize) { + ce->serialize = ce->parent->serialize; + } + if(!ce->unserialize) { + ce->unserialize = ce->parent->unserialize; + } + if (!ce->destructor) { + ce->destructor = ce->parent->destructor; + } + if (!ce->__debugInfo) { + ce->__debugInfo = ce->parent->__debugInfo; + } + if (ce->constructor) { + if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) { + zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()", + ce->parent->name->val, ce->parent->constructor->common.function_name->val, + ce->name->val, ce->constructor->common.function_name->val + ); + } + return; + } + + if ((function = zend_hash_str_find_ptr(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1)) != NULL) { + /* inherit parent's constructor */ + if (function->type == ZEND_INTERNAL_FUNCTION) { + if (ce->type & ZEND_INTERNAL_CLASS) { + new_function = pemalloc(sizeof(zend_internal_function), 1); + memcpy(new_function, function, sizeof(zend_internal_function)); + } else { + new_function = zend_arena_alloc(&CG(arena), sizeof(zend_internal_function)); + memcpy(new_function, function, sizeof(zend_internal_function)); + new_function->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED; + } + } else { + new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); + memcpy(new_function, function, sizeof(zend_op_array)); + } + zend_hash_str_update_ptr(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1, new_function); + function_add_ref(new_function); + } else { + /* Don't inherit the old style constructor if we already have the new style constructor */ + zend_string *lc_class_name; + zend_string *lc_parent_class_name; + + lc_class_name = zend_string_alloc(ce->name->len, 0); + zend_str_tolower_copy(lc_class_name->val, ce->name->val, ce->name->len); + if (!zend_hash_exists(&ce->function_table, lc_class_name)) { + lc_parent_class_name = zend_string_alloc(ce->parent->name->len, 0); + zend_str_tolower_copy(lc_parent_class_name->val, ce->parent->name->val, ce->parent->name->len); + if (!zend_hash_exists(&ce->function_table, lc_parent_class_name) && + (function = zend_hash_find_ptr(&ce->parent->function_table, lc_parent_class_name)) != NULL) { + if (function->common.fn_flags & ZEND_ACC_CTOR) { + /* inherit parent's constructor */ + if (function->type == ZEND_INTERNAL_FUNCTION) { + if (ce->type & ZEND_INTERNAL_CLASS) { + new_function = pemalloc(sizeof(zend_internal_function), 1); + memcpy(new_function, function, sizeof(zend_internal_function)); + } else { + new_function = zend_arena_alloc(&CG(arena), sizeof(zend_internal_function)); + memcpy(new_function, function, sizeof(zend_internal_function)); + new_function->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED; + } + } else { + new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); + memcpy(new_function, function, sizeof(zend_op_array)); + } + zend_hash_update_ptr(&ce->function_table, lc_parent_class_name, new_function); + function_add_ref(new_function); + } + } + zend_string_release(lc_parent_class_name); + } + zend_string_free(lc_class_name); + } + ce->constructor = ce->parent->constructor; +} +/* }}} */ + +char *zend_visibility_string(uint32_t fn_flags) /* {{{ */ +{ + if (fn_flags & ZEND_ACC_PRIVATE) { + return "private"; + } + if (fn_flags & ZEND_ACC_PROTECTED) { + return "protected"; + } + if (fn_flags & ZEND_ACC_PUBLIC) { + return "public"; + } + return ""; +} +/* }}} */ + +static zend_function *do_inherit_method(zend_function *old_function, zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + zend_function *new_function; + + if (old_function->type == ZEND_INTERNAL_FUNCTION) { + if (ce->type & ZEND_INTERNAL_CLASS) { + new_function = pemalloc(sizeof(zend_internal_function), 1); + memcpy(new_function, old_function, sizeof(zend_internal_function)); + } else { + new_function = zend_arena_alloc(&CG(arena), sizeof(zend_internal_function)); + memcpy(new_function, old_function, sizeof(zend_internal_function)); + new_function->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED; + } + } else { + new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); + memcpy(new_function, old_function, sizeof(zend_op_array)); + } + /* The class entry of the derived function intentionally remains the same + * as that of the parent class. That allows us to know in which context + * we're running, and handle private method calls properly. + */ + function_add_ref(new_function); + return new_function; +} +/* }}} */ + +static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */ +{ + uint32_t i, num_args; + + /* If it's a user function then arg_info == NULL means we don't have any parameters but + * we still need to do the arg number checks. We are only willing to ignore this for internal + * functions because extensions don't always define arg_info. + */ + if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) { + return 1; + } + + /* Checks for constructors only if they are declared in an interface, + * or explicitly marked as abstract + */ + if ((fe->common.fn_flags & ZEND_ACC_CTOR) + && ((proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0 + && (proto->common.fn_flags & ZEND_ACC_ABSTRACT) == 0)) { + return 1; + } + + /* If both methods are private do not enforce a signature */ + if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) { + return 1; + } + + /* check number of arguments */ + if (proto->common.required_num_args < fe->common.required_num_args + || proto->common.num_args > fe->common.num_args) { + return 0; + } + + /* by-ref constraints on return values are covariant */ + if ((proto->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + && !(fe->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + return 0; + } + + if ((proto->common.fn_flags & ZEND_ACC_VARIADIC) + && !(fe->common.fn_flags & ZEND_ACC_VARIADIC)) { + return 0; + } + + /* For variadic functions any additional (optional) arguments that were added must be + * checked against the signature of the variadic argument, so in this case we have to + * go through all the parameters of the function and not just those present in the + * prototype. */ + num_args = proto->common.num_args; + if ((proto->common.fn_flags & ZEND_ACC_VARIADIC) + && fe->common.num_args > proto->common.num_args) { + num_args = fe->common.num_args; + } + + for (i = 0; i < num_args; i++) { + zend_arg_info *fe_arg_info = &fe->common.arg_info[i]; + + zend_arg_info *proto_arg_info; + if (i < proto->common.num_args) { + proto_arg_info = &proto->common.arg_info[i]; + } else { + proto_arg_info = &proto->common.arg_info[proto->common.num_args-1]; + } + + if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) { + /* Only one has a type hint and the other one doesn't */ + return 0; + } + + if (fe_arg_info->class_name) { + zend_string *fe_class_name, *proto_class_name; + + if (!strcasecmp(fe_arg_info->class_name, "parent") && proto->common.scope) { + fe_class_name = zend_string_copy(proto->common.scope->name); + } else if (!strcasecmp(fe_arg_info->class_name, "self") && fe->common.scope) { + fe_class_name = zend_string_copy(fe->common.scope->name); + } else { + fe_class_name = zend_string_init( + fe_arg_info->class_name, + fe_arg_info->class_name_len, 0); + } + + if (!strcasecmp(proto_arg_info->class_name, "parent") && proto->common.scope && proto->common.scope->parent) { + proto_class_name = zend_string_copy(proto->common.scope->parent->name); + } else if (!strcasecmp(proto_arg_info->class_name, "self") && proto->common.scope) { + proto_class_name = zend_string_copy(proto->common.scope->name); + } else { + proto_class_name = zend_string_init( + proto_arg_info->class_name, + proto_arg_info->class_name_len, 0); + } + + if (strcasecmp(fe_class_name->val, proto_class_name->val)!=0) { + const char *colon; + + if (fe->common.type != ZEND_USER_FUNCTION) { + zend_string_release(proto_class_name); + zend_string_release(fe_class_name); + return 0; + } else if (strchr(proto_class_name->val, '\\') != NULL || + (colon = zend_memrchr(fe_class_name->val, '\\', fe_class_name->len)) == NULL || + strcasecmp(colon+1, proto_class_name->val) != 0) { + zend_class_entry *fe_ce, *proto_ce; + + fe_ce = zend_lookup_class(fe_class_name TSRMLS_CC); + proto_ce = zend_lookup_class(proto_class_name TSRMLS_CC); + + /* Check for class alias */ + if (!fe_ce || !proto_ce || + fe_ce->type == ZEND_INTERNAL_CLASS || + proto_ce->type == ZEND_INTERNAL_CLASS || + fe_ce != proto_ce) { + zend_string_release(proto_class_name); + zend_string_release(fe_class_name); + return 0; + } + } + } + zend_string_release(proto_class_name); + zend_string_release(fe_class_name); + } + if (fe_arg_info->type_hint != proto_arg_info->type_hint) { + /* Incompatible type hint */ + return 0; + } + + /* by-ref constraints on arguments are invariant */ + if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) { + return 0; + } + } + + return 1; +} +/* }}} */ + +static zend_string *zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{ */ +{ + smart_str str = {0}; + + if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) { + smart_str_appends(&str, "& "); + } + + if (fptr->common.scope) { + smart_str_append(&str, fptr->common.scope->name); + smart_str_appends(&str, "::"); + } + + smart_str_append(&str, fptr->common.function_name); + smart_str_appendc(&str, '('); + + if (fptr->common.arg_info) { + uint32_t i, required; + zend_arg_info *arg_info = fptr->common.arg_info; + + required = fptr->common.required_num_args; + for (i = 0; i < fptr->common.num_args;) { + if (arg_info->class_name) { + const char *class_name; + uint32_t class_name_len; + if (!strcasecmp(arg_info->class_name, "self") && fptr->common.scope) { + class_name = fptr->common.scope->name->val; + class_name_len = fptr->common.scope->name->len; + } else if (!strcasecmp(arg_info->class_name, "parent") && fptr->common.scope->parent) { + class_name = fptr->common.scope->parent->name->val; + class_name_len = fptr->common.scope->parent->name->len; + } else { + class_name = arg_info->class_name; + class_name_len = arg_info->class_name_len; + } + + smart_str_appendl(&str, class_name, class_name_len); + smart_str_appendc(&str, ' '); + } else if (arg_info->type_hint) { + const char *type_name = zend_get_type_by_const(arg_info->type_hint); + smart_str_appends(&str, type_name); + smart_str_appendc(&str, ' '); + } + + if (arg_info->pass_by_reference) { + smart_str_appendc(&str, '&'); + } + + if (arg_info->is_variadic) { + smart_str_appends(&str, "..."); + } + + smart_str_appendc(&str, '$'); + + if (arg_info->name) { + smart_str_appendl(&str, arg_info->name, arg_info->name_len); + } else { + smart_str_appends(&str, "param"); + smart_str_append_unsigned(&str, i); + } + + if (i >= required && !arg_info->is_variadic) { + smart_str_appends(&str, " = "); + if (fptr->type == ZEND_USER_FUNCTION) { + zend_op *precv = NULL; + { + uint32_t idx = i; + zend_op *op = fptr->op_array.opcodes; + zend_op *end = op + fptr->op_array.last; + + ++idx; + while (op < end) { + if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT) + && op->op1.num == (zend_ulong)idx) + { + precv = op; + } + ++op; + } + } + if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) { + zval *zv = precv->op2.zv; + + if (Z_TYPE_P(zv) == IS_CONSTANT) { + smart_str_append(&str, Z_STR_P(zv)); + } else if (Z_TYPE_P(zv) == IS_FALSE) { + smart_str_appends(&str, "false"); + } else if (Z_TYPE_P(zv) == IS_TRUE) { + smart_str_appends(&str, "true"); + } else if (Z_TYPE_P(zv) == IS_NULL) { + smart_str_appends(&str, "NULL"); + } else if (Z_TYPE_P(zv) == IS_STRING) { + smart_str_appendc(&str, '\''); + smart_str_appendl(&str, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 10)); + if (Z_STRLEN_P(zv) > 10) { + smart_str_appends(&str, "..."); + } + smart_str_appendc(&str, '\''); + } else if (Z_TYPE_P(zv) == IS_ARRAY) { + smart_str_appends(&str, "Array"); + } else if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { + smart_str_appends(&str, "<expression>"); + } else { + zend_string *zv_str = zval_get_string(zv); + smart_str_append(&str, zv_str); + zend_string_release(zv_str); + } + } + } else { + smart_str_appends(&str, "NULL"); + } + } + + if (++i < fptr->common.num_args) { + smart_str_appends(&str, ", "); + } + arg_info++; + } + } + + smart_str_appendc(&str, ')'); + smart_str_0(&str); + + return str.s; +} +/* }}} */ + +static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) /* {{{ */ +{ + uint32_t child_flags; + uint32_t parent_flags = parent->common.fn_flags; + + if ((parent->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0 + && parent->common.fn_flags & ZEND_ACC_ABSTRACT + && parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope) + && child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) { + zend_error_noreturn(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)", + parent->common.scope->name->val, + child->common.function_name->val, + child->common.prototype ? child->common.prototype->common.scope->name->val : child->common.scope->name->val); + } + + if (parent_flags & ZEND_ACC_FINAL) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val); + } + + child_flags = child->common.fn_flags; + /* You cannot change from static to non static and vice versa. + */ + if ((child_flags & ZEND_ACC_STATIC) != (parent_flags & ZEND_ACC_STATIC)) { + if (child->common.fn_flags & ZEND_ACC_STATIC) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child)); + } else { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child)); + } + } + + /* Disallow making an inherited method abstract. */ + if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child)); + } + + if (parent_flags & ZEND_ACC_CHANGED) { + child->common.fn_flags |= ZEND_ACC_CHANGED; + } else { + /* Prevent derived classes from restricting access that was available in parent classes + */ + if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) { + zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); + } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK)) + && ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) { + child->common.fn_flags |= ZEND_ACC_CHANGED; + } + } + + if (parent_flags & ZEND_ACC_PRIVATE) { + child->common.prototype = NULL; + } else if (parent_flags & ZEND_ACC_ABSTRACT) { + child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT; + child->common.prototype = parent; + } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) { + /* ctors only have a prototype if it comes from an interface */ + child->common.prototype = parent->common.prototype ? parent->common.prototype : parent; + } + + if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) { + if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_get_function_declaration(child->common.prototype TSRMLS_CC)->val); + } + } else if (EG(error_reporting) & E_STRICT || Z_TYPE(EG(user_error_handler)) != IS_UNDEF) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ + if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) { + zend_string *method_prototype = zend_get_function_declaration(parent TSRMLS_CC); + zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, method_prototype->val); + zend_string_free(method_prototype); + } + } +} +/* }}} */ + +static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_string *key, zend_class_entry *child_ce) /* {{{ */ +{ + uint32_t parent_flags = parent->common.fn_flags; + zend_function *child; + TSRMLS_FETCH(); + + if ((child = zend_hash_find_ptr(child_function_table, key)) == NULL) { + if (parent_flags & (ZEND_ACC_ABSTRACT)) { + child_ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; + } + return 1; /* method doesn't exist in child, copy from parent */ + } + + do_inheritance_check_on_method(child, parent TSRMLS_CC); + + return 0; +} +/* }}} */ + +static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + zend_property_info *child_info; + zend_class_entry *parent_ce = ce->parent; + + if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) { + if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) { + child_info->flags |= ZEND_ACC_CHANGED; + } else { + if(ce->type & ZEND_INTERNAL_CLASS) { + child_info = zend_duplicate_property_info_internal(parent_info); + } else { + child_info = zend_duplicate_property_info(parent_info TSRMLS_CC); + } + zend_hash_update_ptr(&ce->properties_info, key, child_info); + child_info->flags &= ~ZEND_ACC_PRIVATE; /* it's not private anymore */ + child_info->flags |= ZEND_ACC_SHADOW; /* but it's a shadow of private */ + } + return 0; /* don't copy access information to child */ + } + + if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) { + if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s", + (parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name->val, key->val, + (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name->val, key->val); + + } + + if(parent_info->flags & ZEND_ACC_CHANGED) { + child_info->flags |= ZEND_ACC_CHANGED; + } + + if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) { + zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name->val, key->val, zend_visibility_string(parent_info->flags), parent_ce->name->val, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); + } else if ((child_info->flags & ZEND_ACC_STATIC) == 0) { + zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset])); + ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset]; + ZVAL_UNDEF(&ce->default_properties_table[child_info->offset]); + child_info->offset = parent_info->offset; + } + return 0; /* Don't copy from parent */ + } else { + return 1; /* Copy from parent */ + } +} +/* }}} */ + +static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */ +{ + if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce TSRMLS_CC) == FAILURE) { + zend_error(E_CORE_ERROR, "Class %s could not implement interface %s", ce->name->val, iface->name->val); + } + if (ce == iface) { + zend_error(E_ERROR, "Interface %s cannot implement itself", ce->name->val); + } +} +/* }}} */ + +ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC) /* {{{ */ +{ + /* expects interface to be contained in ce's interface list already */ + uint32_t i, ce_num, if_num = iface->num_interfaces; + zend_class_entry *entry; + + if (if_num==0) { + return; + } + ce_num = ce->num_interfaces; + + if (ce->type == ZEND_INTERNAL_CLASS) { + ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num)); + } else { + ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num)); + } + + /* Inherit the interfaces, only if they're not already inherited by the class */ + while (if_num--) { + entry = iface->interfaces[if_num]; + for (i = 0; i < ce_num; i++) { + if (ce->interfaces[i] == entry) { + break; + } + } + if (i == ce_num) { + ce->interfaces[ce->num_interfaces++] = entry; + } + } + + /* and now call the implementing handlers */ + while (ce_num < ce->num_interfaces) { + do_implement_interface(ce, ce->interfaces[ce_num++] TSRMLS_CC); + } +} +/* }}} */ + +#ifdef ZTS +# define zval_property_ctor(parent_ce, ce) \ + (((parent_ce)->type != (ce)->type) ? ZVAL_COPY_CTOR : zval_add_ref) +#else +# define zval_property_ctor(parent_ce, ce) \ + zval_add_ref +#endif + +static void do_inherit_class_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */ +{ + if (!Z_ISREF_P(zv)) { + if (parent_ce->type == ZEND_INTERNAL_CLASS) { + ZVAL_NEW_PERSISTENT_REF(zv, zv); + } else { + ZVAL_NEW_REF(zv, zv); + } + } + if (Z_CONSTANT_P(Z_REFVAL_P(zv))) { + ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; + } + if (zend_hash_add(&ce->constants_table, name, zv)) { + Z_ADDREF_P(zv); + } +} +/* }}} */ + +ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */ +{ + zend_property_info *property_info; + zend_function *func; + zend_string *key; + zval *zv; + + if ((ce->ce_flags & ZEND_ACC_INTERFACE) + && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) { + zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name->val, parent_ce->name->val); + } + if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) { + zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name->val, parent_ce->name->val); + } + + ce->parent = parent_ce; + /* Copy serialize/unserialize callbacks */ + if (!ce->serialize) { + ce->serialize = parent_ce->serialize; + } + if (!ce->unserialize) { + ce->unserialize = parent_ce->unserialize; + } + + /* Inherit interfaces */ + zend_do_inherit_interfaces(ce, parent_ce TSRMLS_CC); + + /* Inherit properties */ + if (parent_ce->default_properties_count) { + int i = ce->default_properties_count + parent_ce->default_properties_count; + + ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS); + if (ce->default_properties_count) { + while (i-- > parent_ce->default_properties_count) { + ce->default_properties_table[i] = ce->default_properties_table[i - parent_ce->default_properties_count]; + } + } + for (i = 0; i < parent_ce->default_properties_count; i++) { +#ifdef ZTS + if (parent_ce->type != ce->type) { + ZVAL_DUP(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]); + if (Z_OPT_CONSTANT(ce->default_properties_table[i])) { + ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; + } + continue; + } +#endif + + ZVAL_COPY(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]); + if (Z_OPT_CONSTANT(ce->default_properties_table[i])) { + ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; + } + } + ce->default_properties_count += parent_ce->default_properties_count; + } + + if (parent_ce->type != ce->type) { + /* User class extends internal class */ + zend_update_class_constants(parent_ce TSRMLS_CC); + if (parent_ce->default_static_members_count) { + int i = ce->default_static_members_count + parent_ce->default_static_members_count; + + ce->default_static_members_table = erealloc(ce->default_static_members_table, sizeof(zval) * i); + if (ce->default_static_members_count) { + while (i-- > parent_ce->default_static_members_count) { + ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count]; + } + } + for (i = 0; i < parent_ce->default_static_members_count; i++) { + ZVAL_MAKE_REF(&CE_STATIC_MEMBERS(parent_ce)[i]); + ce->default_static_members_table[i] = CE_STATIC_MEMBERS(parent_ce)[i]; + Z_ADDREF(ce->default_static_members_table[i]); + if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) { + ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; + } + } + ce->default_static_members_count += parent_ce->default_static_members_count; + ce->static_members_table = ce->default_static_members_table; + } + } else { + if (parent_ce->default_static_members_count) { + int i = ce->default_static_members_count + parent_ce->default_static_members_count; + + ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS); + if (ce->default_static_members_count) { + while (i-- > parent_ce->default_static_members_count) { + ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count]; + } + } + for (i = 0; i < parent_ce->default_static_members_count; i++) { + ZVAL_MAKE_REF(&parent_ce->default_static_members_table[i]); + ce->default_static_members_table[i] = parent_ce->default_static_members_table[i]; + Z_ADDREF(ce->default_static_members_table[i]); + if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) { + ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; + } + } + ce->default_static_members_count += parent_ce->default_static_members_count; + if (ce->type == ZEND_USER_CLASS) { + ce->static_members_table = ce->default_static_members_table; + } + } + } + + ZEND_HASH_FOREACH_PTR(&ce->properties_info, property_info) { + if (property_info->ce == ce) { + if (property_info->flags & ZEND_ACC_STATIC) { + property_info->offset += parent_ce->default_static_members_count; + } else { + property_info->offset += parent_ce->default_properties_count; + } + } + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) { + if (do_inherit_property_access_check(&ce->properties_info, property_info, key, ce TSRMLS_CC)) { + if (ce->type & ZEND_INTERNAL_CLASS) { + property_info = zend_duplicate_property_info_internal(property_info); + } else { + property_info = zend_duplicate_property_info(property_info TSRMLS_CC); + } + zend_hash_add_new_ptr(&ce->properties_info, key, property_info); + } + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_FOREACH_STR_KEY_VAL(&parent_ce->constants_table, key, zv) { + do_inherit_class_constant(key, zv, ce, parent_ce TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) { + if (do_inherit_method_check(&ce->function_table, func, key, ce)) { + zend_function *new_func = do_inherit_method(func, ce TSRMLS_CC); + zend_hash_add_new_ptr(&ce->function_table, key, new_func); + } + } ZEND_HASH_FOREACH_END(); + + do_inherit_parent_constructor(ce TSRMLS_CC); + + if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) { + ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; + } else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) { + /* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */ + zend_verify_abstract_class(ce TSRMLS_CC); + } + ce->ce_flags |= parent_ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS; +} +/* }}} */ + +static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */ +{ + zval *old_constant; + + if ((old_constant = zend_hash_find(child_constants_table, name)) != NULL) { + if (!Z_ISREF_P(old_constant) || + !Z_ISREF_P(parent_constant) || + Z_REFVAL_P(old_constant) != Z_REFVAL_P(parent_constant)) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", name->val, iface->name->val); + } + return 0; + } + return 1; +} +/* }}} */ + +static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */ +{ + if (do_inherit_constant_check(&ce->constants_table, zv, name, iface)) { + ZVAL_MAKE_REF(zv); + Z_ADDREF_P(zv); + if (Z_CONSTANT_P(Z_REFVAL_P(zv))) { + ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; + } + zend_hash_update(&ce->constants_table, name, zv); + } +} +/* }}} */ + +ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */ +{ + uint32_t i, ignore = 0; + uint32_t current_iface_num = ce->num_interfaces; + uint32_t parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0; + zend_function *func; + zend_string *key; + zval *zv; + + for (i = 0; i < ce->num_interfaces; i++) { + if (ce->interfaces[i] == NULL) { + memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i)); + i--; + } else if (ce->interfaces[i] == iface) { + if (i < parent_iface_num) { + ignore = 1; + } else { + zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name->val, iface->name->val); + } + } + } + if (ignore) { + /* Check for attempt to redeclare interface constants */ + ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, zv) { + do_inherit_constant_check(&iface->constants_table, zv, key, iface); + } ZEND_HASH_FOREACH_END(); + } else { + if (ce->num_interfaces >= current_iface_num) { + if (ce->type == ZEND_INTERNAL_CLASS) { + ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num)); + } else { + ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num)); + } + } + ce->interfaces[ce->num_interfaces++] = iface; + + ZEND_HASH_FOREACH_STR_KEY_VAL(&iface->constants_table, key, zv) { + do_inherit_iface_constant(key, zv, ce, iface TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_FOREACH_STR_KEY_PTR(&iface->function_table, key, func) { + if (do_inherit_method_check(&ce->function_table, func, key, ce)) { + zend_function *new_func = do_inherit_method(func, ce TSRMLS_CC); + zend_hash_add_new_ptr(&ce->function_table, key, new_func); + } + } ZEND_HASH_FOREACH_END(); + + do_implement_interface(ce, iface TSRMLS_CC); + zend_do_inherit_interfaces(ce, iface TSRMLS_CC); + } +} +/* }}} */ + +ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */ +{ + uint32_t i, ignore = 0; + uint32_t current_trait_num = ce->num_traits; + uint32_t parent_trait_num = ce->parent ? ce->parent->num_traits : 0; + + for (i = 0; i < ce->num_traits; i++) { + if (ce->traits[i] == NULL) { + memmove(ce->traits + i, ce->traits + i + 1, sizeof(zend_class_entry*) * (--ce->num_traits - i)); + i--; + } else if (ce->traits[i] == trait) { + if (i < parent_trait_num) { + ignore = 1; + } + } + } + if (!ignore) { + if (ce->num_traits >= current_trait_num) { + if (ce->type == ZEND_INTERNAL_CLASS) { + ce->traits = (zend_class_entry **) realloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num)); + } else { + ce->traits = (zend_class_entry **) erealloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num)); + } + } + ce->traits[ce->num_traits++] = trait; + } +} +/* }}} */ + +static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn TSRMLS_DC) /* {{{ */ +{ + uint32_t fn_flags = fn->common.scope->ce_flags; + uint32_t other_flags = other_fn->common.scope->ce_flags; + + return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC) + && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)) + && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) == + (other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */ +} +/* }}} */ + +static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe TSRMLS_DC) /* {{{ */ +{ + if (!strncmp(mname->val, ZEND_CLONE_FUNC_NAME, mname->len)) { + ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE; + } else if (!strncmp(mname->val, ZEND_CONSTRUCTOR_FUNC_NAME, mname->len)) { + if (ce->constructor) { + zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val); + } + ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR; + } else if (!strncmp(mname->val, ZEND_DESTRUCTOR_FUNC_NAME, mname->len)) { + ce->destructor = fe; fe->common.fn_flags |= ZEND_ACC_DTOR; + } else if (!strncmp(mname->val, ZEND_GET_FUNC_NAME, mname->len)) { + ce->__get = fe; + } else if (!strncmp(mname->val, ZEND_SET_FUNC_NAME, mname->len)) { + ce->__set = fe; + } else if (!strncmp(mname->val, ZEND_CALL_FUNC_NAME, mname->len)) { + ce->__call = fe; + } else if (!strncmp(mname->val, ZEND_UNSET_FUNC_NAME, mname->len)) { + ce->__unset = fe; + } else if (!strncmp(mname->val, ZEND_ISSET_FUNC_NAME, mname->len)) { + ce->__isset = fe; + } else if (!strncmp(mname->val, ZEND_CALLSTATIC_FUNC_NAME, mname->len)) { + ce->__callstatic = fe; + } else if (!strncmp(mname->val, ZEND_TOSTRING_FUNC_NAME, mname->len)) { + ce->__tostring = fe; + } else if (!strncmp(mname->val, ZEND_DEBUGINFO_FUNC_NAME, mname->len)) { + ce->__debugInfo = fe; + } else if (ce->name->len == mname->len) { + zend_string *lowercase_name = zend_string_alloc(ce->name->len, 0); + zend_str_tolower_copy(lowercase_name->val, ce->name->val, ce->name->len); + lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC); + if (!memcmp(mname->val, lowercase_name->val, mname->len)) { + if (ce->constructor) { + zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val); + } + ce->constructor = fe; + fe->common.fn_flags |= ZEND_ACC_CTOR; + } + zend_string_release(lowercase_name); + } +} +/* }}} */ + +static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_string *key, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */ +{ + zend_function *existing_fn = NULL; + zend_function *new_fn; + + if ((existing_fn = zend_hash_find_ptr(&ce->function_table, key)) != NULL) { + if (existing_fn->common.scope == ce) { + /* members from the current class override trait methods */ + /* use temporary *overriden HashTable to detect hidden conflict */ + if (*overriden) { + if ((existing_fn = zend_hash_find_ptr(*overriden, key)) != NULL) { + if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { + /* Make sure the trait method is compatible with previosly declared abstract method */ + if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_get_function_declaration(fn TSRMLS_CC)->val, + zend_get_function_declaration(existing_fn TSRMLS_CC)->val); + } + } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { + /* Make sure the abstract declaration is compatible with previous declaration */ + if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_get_function_declaration(fn TSRMLS_CC)->val, + zend_get_function_declaration(existing_fn TSRMLS_CC)->val); + } + return; + } + } + } else { + ALLOC_HASHTABLE(*overriden); + zend_hash_init_ex(*overriden, 8, NULL, ptr_dtor, 0, 0); + } + zend_hash_update_mem(*overriden, key, fn, sizeof(zend_function)); + return; + } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { + /* Make sure the trait method is compatible with previosly declared abstract method */ + if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_get_function_declaration(fn TSRMLS_CC)->val, + zend_get_function_declaration(existing_fn TSRMLS_CC)->val); + } + } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { + /* Make sure the abstract declaration is compatible with previous declaration */ + if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_get_function_declaration(fn TSRMLS_CC)->val, + zend_get_function_declaration(existing_fn TSRMLS_CC)->val); + } + return; + } else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + /* two traits can't define the same non-abstract method */ +#if 1 + zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", + name, ce->name->val); +#else /* TODO: better error message */ + zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s", + fn->common.scope->name->val, fn->common.function_name->val, + ce->name->val, name, + existing_fn->common.scope->name->val, existing_fn->common.function_name->val); +#endif + } else { + /* inherited members are overridden by members inserted by traits */ + /* check whether the trait method fulfills the inheritance requirements */ + do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); + } + } + + function_add_ref(fn); + new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); + memcpy(new_fn, fn, sizeof(zend_op_array)); + fn = zend_hash_update_ptr(&ce->function_table, key, new_fn); + zend_add_magic_methods(ce, key, fn TSRMLS_CC); +} +/* }}} */ + +static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /* {{{ */ +{ + if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + + fn->common.scope = ce; + + if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { + ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; + } + if (fn->op_array.static_variables) { + ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; + } + } +} +/* }}} */ + +static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, zend_class_entry *ce, HashTable **overriden, HashTable *exclude_table TSRMLS_DC) /* {{{ */ +{ + zend_trait_alias *alias, **alias_ptr; + zend_string *lcname; + zend_function fn_copy; + + /* apply aliases which are qualified with a class name, there should not be any ambiguity */ + if (ce->trait_aliases) { + alias_ptr = ce->trait_aliases; + alias = *alias_ptr; + while (alias) { + /* Scope unset or equal to the function we compare to, and the alias applies to fn */ + if (alias->alias != NULL + && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) + && alias->trait_method->method_name->len == fnname->len + && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) { + fn_copy = *fn; + + /* if it is 0, no modifieres has been changed */ + if (alias->modifiers) { + fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK)); + } + + lcname = zend_string_alloc(alias->alias->len, 0); + zend_str_tolower_copy(lcname->val, alias->alias->val, alias->alias->len); + zend_add_trait_method(ce, alias->alias->val, lcname, &fn_copy, overriden TSRMLS_CC); + zend_string_release(lcname); + + /* Record the trait from which this alias was resolved. */ + if (!alias->trait_method->ce) { + alias->trait_method->ce = fn->common.scope; + } + } + alias_ptr++; + alias = *alias_ptr; + } + } + + if (exclude_table == NULL || zend_hash_find(exclude_table, fnname) == NULL) { + /* is not in hashtable, thus, function is not to be excluded */ + fn_copy = *fn; + + /* apply aliases which have not alias name, just setting visibility */ + if (ce->trait_aliases) { + alias_ptr = ce->trait_aliases; + alias = *alias_ptr; + while (alias) { + /* Scope unset or equal to the function we compare to, and the alias applies to fn */ + if (alias->alias == NULL && alias->modifiers != 0 + && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) + && (alias->trait_method->method_name->len == fnname->len) + && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) { + + fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK)); + + /** Record the trait from which this alias was resolved. */ + if (!alias->trait_method->ce) { + alias->trait_method->ce = fn->common.scope; + } + } + alias_ptr++; + alias = *alias_ptr; + } + } + + zend_add_trait_method(ce, fn->common.function_name->val, fnname, &fn_copy, overriden TSRMLS_CC); + } + + return ZEND_HASH_APPLY_KEEP; +} +/* }}} */ + +static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */ +{ + uint32_t i; + + if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) { + zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name->val); + } + + for (i = 0; i < ce->num_traits; i++) { + if (ce->traits[i] == trait) { + return; + } + } + zend_error_noreturn(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name->val, ce->name->val); +} +/* }}} */ + +static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + size_t i, j = 0; + zend_trait_precedence *cur_precedence; + zend_trait_method_reference *cur_method_ref; + zend_string *lcname; + zend_bool method_exists; + + /* resolve class references */ + if (ce->trait_precedences) { + i = 0; + while ((cur_precedence = ce->trait_precedences[i])) { + /** Resolve classes for all precedence operations. */ + if (cur_precedence->exclude_from_classes) { + cur_method_ref = cur_precedence->trait_method; + if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name, + ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val); + } + zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC); + + /** Ensure that the prefered method is actually available. */ + lcname = zend_string_alloc(cur_method_ref->method_name->len, 0); + zend_str_tolower_copy(lcname->val, + cur_method_ref->method_name->val, + cur_method_ref->method_name->len); + method_exists = zend_hash_exists(&cur_method_ref->ce->function_table, + lcname); + zend_string_free(lcname); + if (!method_exists) { + zend_error_noreturn(E_COMPILE_ERROR, + "A precedence rule was defined for %s::%s but this method does not exist", + cur_method_ref->ce->name->val, + cur_method_ref->method_name->val); + } + + /** With the other traits, we are more permissive. + We do not give errors for those. This allows to be more + defensive in such definitions. + However, we want to make sure that the insteadof declaration + is consistent in itself. + */ + j = 0; + while (cur_precedence->exclude_from_classes[j].class_name) { + zend_string* class_name = cur_precedence->exclude_from_classes[j].class_name; + + if (!(cur_precedence->exclude_from_classes[j].ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name->val); + } + zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j].ce TSRMLS_CC); + + /* make sure that the trait method is not from a class mentioned in + exclude_from_classes, for consistency */ + if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i].ce) { + zend_error_noreturn(E_COMPILE_ERROR, + "Inconsistent insteadof definition. " + "The method %s is to be used from %s, but %s is also on the exclude list", + cur_method_ref->method_name->val, + cur_precedence->trait_method->ce->name->val, + cur_precedence->trait_method->ce->name->val); + } + + zend_string_release(class_name); + j++; + } + } + i++; + } + } + + if (ce->trait_aliases) { + i = 0; + while (ce->trait_aliases[i]) { + /** For all aliases with an explicit class name, resolve the class now. */ + if (ce->trait_aliases[i]->trait_method->class_name) { + cur_method_ref = ce->trait_aliases[i]->trait_method; + if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val); + } + zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC); + + /** And, ensure that the referenced method is resolvable, too. */ + lcname = zend_string_alloc(cur_method_ref->method_name->len, 0); + zend_str_tolower_copy(lcname->val, + cur_method_ref->method_name->val, + cur_method_ref->method_name->len); + method_exists = zend_hash_exists(&cur_method_ref->ce->function_table, + lcname); + zend_string_free(lcname); + + if (!method_exists) { + zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name->val, cur_method_ref->method_name->val); + } + } + i++; + } + } +} +/* }}} */ + +static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_trait_precedence **precedences, zend_class_entry *trait) /* {{{ */ +{ + size_t i = 0, j; + + if (!precedences) { + return; + } + while (precedences[i]) { + if (precedences[i]->exclude_from_classes) { + j = 0; + while (precedences[i]->exclude_from_classes[j].ce) { + if (precedences[i]->exclude_from_classes[j].ce == trait) { + zend_string *lcname = zend_string_alloc(precedences[i]->trait_method->method_name->len, 0); + + zend_str_tolower_copy(lcname->val, + precedences[i]->trait_method->method_name->val, + precedences[i]->trait_method->method_name->len); + if (zend_hash_add_empty_element(exclude_table, lcname) == NULL) { + zend_string_release(lcname); + zend_error_noreturn(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name->val, trait->name->val); + } + zend_string_release(lcname); + } + ++j; + } + } + ++i; + } +} +/* }}} */ + +static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + uint32_t i; + HashTable *overriden = NULL; + zend_string *key; + zend_function *fn; + + for (i = 0; i < ce->num_traits; i++) { + if (ce->trait_precedences) { + HashTable exclude_table; + + /* TODO: revisit this start size, may be its not optimal */ + zend_hash_init_ex(&exclude_table, 8, NULL, NULL, 0, 0); + + zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]); + + /* copies functions, applies defined aliasing, and excludes unused trait methods */ + ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) { + zend_traits_copy_functions(key, fn, ce, &overriden, &exclude_table TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + + zend_hash_destroy(&exclude_table); + } else { + ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) { + zend_traits_copy_functions(key, fn, ce, &overriden, NULL TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + } + } + + ZEND_HASH_FOREACH_PTR(&ce->function_table, fn) { + zend_fixup_trait_method(fn, ce); + } ZEND_HASH_FOREACH_END(); + + if (overriden) { + zend_hash_destroy(overriden); + FREE_HASHTABLE(overriden); + } +} +/* }}} */ + +static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, zend_string *prop_name, zend_class_entry *coliding_ce) /* {{{ */ +{ + size_t i; + + if (coliding_ce == ce) { + for (i = 0; i < current_trait; i++) { + if (zend_hash_exists(&ce->traits[i]->properties_info, prop_name)) { + return ce->traits[i]; + } + } + } + + return coliding_ce; +} +/* }}} */ + +static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + size_t i; + zend_property_info *property_info; + zend_property_info *coliding_prop; + zval compare_result; + zend_string* prop_name; + const char* class_name_unused; + zend_bool not_compatible; + zval* prop_value; + uint32_t flags; + zend_string *doc_comment; + + /* In the following steps the properties are inserted into the property table + * for that, a very strict approach is applied: + * - check for compatibility, if not compatible with any property in class -> fatal + * - if compatible, then strict notice + */ + for (i = 0; i < ce->num_traits; i++) { + ZEND_HASH_FOREACH_PTR(&ce->traits[i]->properties_info, property_info) { + /* first get the unmangeld name if necessary, + * then check whether the property is already there + */ + flags = property_info->flags; + if ((flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) { + prop_name = zend_string_copy(property_info->name); + } else { + const char *pname; + size_t pname_len; + + /* for private and protected we need to unmangle the names */ + zend_unmangle_property_name_ex(property_info->name, + &class_name_unused, &pname, &pname_len); + prop_name = zend_string_init(pname, pname_len, 0); + } + + /* next: check for conflicts with current class */ + if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) { + if (coliding_prop->flags & ZEND_ACC_SHADOW) { + zend_hash_del(&ce->properties_info, prop_name); + flags |= ZEND_ACC_CHANGED; + } else { + if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC)) + == (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) { + /* flags are identical, now the value needs to be checked */ + if (flags & ZEND_ACC_STATIC) { + not_compatible = (FAILURE == compare_function(&compare_result, + &ce->default_static_members_table[coliding_prop->offset], + &ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC)) + || (Z_LVAL(compare_result) != 0); + } else { + not_compatible = (FAILURE == compare_function(&compare_result, + &ce->default_properties_table[coliding_prop->offset], + &ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC)) + || (Z_LVAL(compare_result) != 0); + } + } else { + /* the flags are not identical, thus, we assume properties are not compatible */ + not_compatible = 1; + } + + if (not_compatible) { + zend_error_noreturn(E_COMPILE_ERROR, + "%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed", + find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val, + property_info->ce->name->val, + prop_name->val, + ce->name->val); + } else { + zend_error(E_STRICT, + "%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed", + find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val, + property_info->ce->name->val, + prop_name->val, + ce->name->val); + zend_string_release(prop_name); + continue; + } + } + } + + /* property not found, so lets add it */ + if (flags & ZEND_ACC_STATIC) { + prop_value = &ce->traits[i]->default_static_members_table[property_info->offset]; + } else { + prop_value = &ce->traits[i]->default_properties_table[property_info->offset]; + } + if (Z_REFCOUNTED_P(prop_value)) Z_ADDREF_P(prop_value); + + doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL; + zend_declare_property_ex(ce, prop_name, + prop_value, flags, + doc_comment TSRMLS_CC); + zend_string_release(prop_name); + } ZEND_HASH_FOREACH_END(); + } +} +/* }}} */ + +static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + int i = 0; + zend_trait_alias* cur_alias; + zend_string* lc_method_name; + + if (ce->trait_aliases) { + while (ce->trait_aliases[i]) { + cur_alias = ce->trait_aliases[i]; + /** The trait for this alias has not been resolved, this means, this + alias was not applied. Abort with an error. */ + if (!cur_alias->trait_method->ce) { + if (cur_alias->alias) { + /** Plain old inconsistency/typo/bug */ + zend_error_noreturn(E_COMPILE_ERROR, + "An alias (%s) was defined for method %s(), but this method does not exist", + cur_alias->alias->val, + cur_alias->trait_method->method_name->val); + } else { + /** Here are two possible cases: + 1) this is an attempt to modifiy the visibility + of a method introduce as part of another alias. + Since that seems to violate the DRY principle, + we check against it and abort. + 2) it is just a plain old inconsitency/typo/bug + as in the case where alias is set. */ + + lc_method_name = zend_string_alloc(cur_alias->trait_method->method_name->len, 0); + zend_str_tolower_copy( + lc_method_name->val, + cur_alias->trait_method->method_name->val, + cur_alias->trait_method->method_name->len); + if (zend_hash_exists(&ce->function_table, + lc_method_name)) { + zend_string_free(lc_method_name); + zend_error_noreturn(E_COMPILE_ERROR, + "The modifiers for the trait alias %s() need to be changed in the same statment in which the alias is defined. Error", + cur_alias->trait_method->method_name->val); + } else { + zend_string_free(lc_method_name); + zend_error_noreturn(E_COMPILE_ERROR, + "The modifiers of the trait method %s() are changed, but this method does not exist. Error", + cur_alias->trait_method->method_name->val); + + } + } + } + i++; + } + } +} +/* }}} */ + +ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + + if (ce->num_traits <= 0) { + return; + } + + /* complete initialization of trait strutures in ce */ + zend_traits_init_trait_structures(ce TSRMLS_CC); + + /* first care about all methods to be flattened into the class */ + zend_do_traits_method_binding(ce TSRMLS_CC); + + /* Aliases which have not been applied indicate typos/bugs. */ + zend_do_check_for_inconsistent_traits_aliasing(ce TSRMLS_CC); + + /* then flatten the properties into it, to, mostly to notfiy developer about problems */ + zend_do_traits_property_binding(ce TSRMLS_CC); + + /* verify that all abstract methods from traits have been implemented */ + zend_verify_abstract_class(ce TSRMLS_CC); + + /* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */ + if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) { + ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; + } +} +/* }}} */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + */ diff --git a/Zend/zend_dynamic_array.h b/Zend/zend_inheritance.h index e69eb18768..647b492371 100644 --- a/Zend/zend_dynamic_array.h +++ b/Zend/zend_inheritance.h @@ -5,7 +5,7 @@ | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | + | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | @@ -17,26 +17,25 @@ +----------------------------------------------------------------------+ */ -/* $Id$ */ +#ifndef ZEND_INHERITANCE_H +#define ZEND_INHERITANCE_H -#ifndef ZEND_DYNAMIC_ARRAY_H -#define ZEND_DYNAMIC_ARRAY_H - -typedef struct _dynamic_array { - char *array; - unsigned int element_size; - unsigned int last_used; - unsigned int allocated; -} dynamic_array; +#include "zend.h" BEGIN_EXTERN_C() -ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_size, unsigned int size); -ZEND_API void *zend_dynamic_array_push(dynamic_array *da); -ZEND_API void *zend_dynamic_array_pop(dynamic_array *da); -ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index); + +ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC); +ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC); + +ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC); +ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC); + +ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC); +void zend_do_early_binding(TSRMLS_D); + END_EXTERN_C() -#endif /* ZEND_DYNAMIC_ARRAY_H */ +#endif /* * Local variables: diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 8c55f3d7c1..26507ad23b 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -325,7 +325,8 @@ static int zend_implement_traversable(zend_class_entry *interface, zend_class_en /* {{{ zend_implement_aggregate */ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) { - int i, t = -1; + uint32_t i; + int t = -1; if (class_type->get_iterator) { if (class_type->type == ZEND_INTERNAL_CLASS) { @@ -406,7 +407,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en /* }}}*/ /* {{{ zend_user_serialize */ -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) { zend_class_entry * ce = Z_OBJCE_P(object); zval retval; @@ -443,7 +444,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t /* }}} */ /* {{{ zend_user_unserialize */ -ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) +ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) { zval zdata; @@ -463,7 +464,7 @@ ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const uns } /* }}} */ -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(object); zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name->val); @@ -471,7 +472,7 @@ ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uin } /* }}} */ -ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name->val); return FAILURE; diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index 88e1dfe05b..9bfef0990d 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -61,11 +61,11 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c ZEND_API void zend_register_interfaces(TSRMLS_D); -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC); -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC); END_EXTERN_C() diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c index 7c08ac59b5..c2f51c4dd6 100644 --- a/Zend/zend_iterators.c +++ b/Zend/zend_iterators.c @@ -84,29 +84,13 @@ ZEND_API void zend_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) zend_objects_store_del(&iter->std TSRMLS_CC); } -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap( - zval *array_ptr, zend_object_iterator **iter TSRMLS_DC) +ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr TSRMLS_DC) { - switch (Z_TYPE_P(array_ptr)) { - case IS_OBJECT: - if (Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) { - *iter = (zend_object_iterator *)Z_OBJ_P(array_ptr); - return ZEND_ITER_OBJECT; - } - if (Z_OBJPROP_P(array_ptr)) { - return ZEND_ITER_PLAIN_OBJECT; - } - return ZEND_ITER_INVALID; - - case IS_ARRAY: - if (Z_ARRVAL_P(array_ptr)) { - return ZEND_ITER_PLAIN_ARRAY; - } - return ZEND_ITER_INVALID; - - default: - return ZEND_ITER_INVALID; + if (Z_TYPE_P(array_ptr) && + Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) { + return (zend_object_iterator *)Z_OBJ_P(array_ptr); } + return NULL; } /* diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h index b0105d52e2..a1148db214 100644 --- a/Zend/zend_iterators.h +++ b/Zend/zend_iterators.h @@ -71,16 +71,9 @@ typedef struct _zend_class_iterator_funcs { union _zend_function *zf_rewind; } zend_class_iterator_funcs; -enum zend_object_iterator_kind { - ZEND_ITER_INVALID, - ZEND_ITER_PLAIN_ARRAY, - ZEND_ITER_PLAIN_OBJECT, - ZEND_ITER_OBJECT -}; - BEGIN_EXTERN_C() /* given a zval, returns stuff that can be used to iterate it. */ -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(zval *array_ptr, zend_object_iterator **iter TSRMLS_DC); +ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr TSRMLS_DC); /* given an iterator, wrap it up as a zval for use by the engine opcodes */ ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC); diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 6bfef2219e..97fc4de546 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -67,6 +67,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*); %right T_YIELD %left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL %left '?' ':' +%right T_COALESCE %left T_BOOLEAN_OR %left T_BOOLEAN_AND %left '|' @@ -221,6 +222,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*); %token T_NS_C "__NAMESPACE__ (T_NS_C)" %token T_NS_SEPARATOR "\\ (T_NS_SEPARATOR)" %token T_ELLIPSIS "... (T_ELLIPSIS)" +%token T_COALESCE "?? (T_COALESCE)" %token T_POW "** (T_POW)" %token T_POW_EQUAL "**= (T_POW_EQUAL)" @@ -827,6 +829,8 @@ expr_without_variable: { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); } | expr '?' ':' expr { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, NULL, $4); } + | expr T_COALESCE expr + { $$ = zend_ast_create(ZEND_AST_COALESCE, $1, $3); } | internal_functions_in_yacc { $$ = $1; } | T_INT_CAST expr { $$ = zend_ast_create_cast(IS_LONG, $2); } | T_DOUBLE_CAST expr { $$ = zend_ast_create_cast(IS_DOUBLE, $2); } diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index 5bb92e5706..1f5cc3f55a 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 */ +/* Generated by re2c 0.13.6 */ #line 1 "Zend/zend_language_scanner.l" /* +----------------------------------------------------------------------+ @@ -128,7 +128,7 @@ BEGIN_EXTERN_C() static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C); - assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)); + ZEND_ASSERT(internal_encoding); return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC); } @@ -146,7 +146,7 @@ LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC); static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C); - assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)); + ZEND_ASSERT(internal_encoding); return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC); } @@ -845,7 +845,7 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start)); SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start)); SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start)); - SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start)); + SCNG(yy_limit) = new_yy_start + length; SCNG(yy_start) = new_yy_start; } @@ -1072,28 +1072,27 @@ yyc_INITIAL: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - - YYDEBUG(0, *YYCURSOR); + YYDEBUG(1, *YYCURSOR); YYFILL(8); yych = *YYCURSOR; - if (yych != '<') goto yy4; - YYDEBUG(2, *YYCURSOR); + if (yych != '<') goto yy5; + YYDEBUG(3, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '?') { - if (yych == '%') goto yy7; - if (yych >= '?') goto yy5; + if (yych == '%') goto yy8; + if (yych >= '?') goto yy6; } else { if (yych <= 'S') { - if (yych >= 'S') goto yy9; + if (yych >= 'S') goto yy10; } else { - if (yych == 's') goto yy9; + if (yych == 's') goto yy10; } } -yy3: - YYDEBUG(3, *YYCURSOR); +yy4: + YYDEBUG(4, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1663 "Zend/zend_language_scanner.l" +#line 1667 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1154,25 +1153,25 @@ inline_html: HANDLE_NEWLINES(yytext, yyleng); return T_INLINE_HTML; } -#line 1158 "Zend/zend_language_scanner.c" -yy4: - YYDEBUG(4, *YYCURSOR); - yych = *++YYCURSOR; - goto yy3; +#line 1157 "Zend/zend_language_scanner.c" yy5: YYDEBUG(5, *YYCURSOR); + yych = *++YYCURSOR; + goto yy4; +yy6: + YYDEBUG(6, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'O') { - if (yych == '=') goto yy45; + if (yych == '=') goto yy46; } else { - if (yych <= 'P') goto yy47; - if (yych == 'p') goto yy47; + if (yych <= 'P') goto yy48; + if (yych == 'p') goto yy48; } -yy6: - YYDEBUG(6, *YYCURSOR); +yy7: + YYDEBUG(7, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1654 "Zend/zend_language_scanner.l" +#line 1658 "Zend/zend_language_scanner.l" { if (CG(short_tags)) { BEGIN(ST_IN_SCRIPTING); @@ -1181,14 +1180,14 @@ yy6: goto inline_char_handler; } } -#line 1185 "Zend/zend_language_scanner.c" -yy7: - YYDEBUG(7, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy43; +#line 1184 "Zend/zend_language_scanner.c" +yy8: YYDEBUG(8, *YYCURSOR); + ++YYCURSOR; + if ((yych = *YYCURSOR) == '=') goto yy44; + YYDEBUG(9, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1637 "Zend/zend_language_scanner.l" +#line 1641 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { BEGIN(ST_IN_SCRIPTING); @@ -1197,193 +1196,193 @@ yy7: goto inline_char_handler; } } -#line 1201 "Zend/zend_language_scanner.c" -yy9: - YYDEBUG(9, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy11; - if (yych == 'c') goto yy11; +#line 1200 "Zend/zend_language_scanner.c" yy10: YYDEBUG(10, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy12; + if (yych == 'c') goto yy12; +yy11: + YYDEBUG(11, *YYCURSOR); YYCURSOR = YYMARKER; - if (yyaccept <= 0) { - goto yy3; + if (yyaccept == 0) { + goto yy4; } else { - goto yy6; + goto yy7; } -yy11: - YYDEBUG(11, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy12; - if (yych != 'r') goto yy10; yy12: YYDEBUG(12, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy13; - if (yych != 'i') goto yy10; + if (yych == 'R') goto yy13; + if (yych != 'r') goto yy11; yy13: YYDEBUG(13, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy14; - if (yych != 'p') goto yy10; + if (yych == 'I') goto yy14; + if (yych != 'i') goto yy11; yy14: YYDEBUG(14, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy15; - if (yych != 't') goto yy10; + if (yych == 'P') goto yy15; + if (yych != 'p') goto yy11; yy15: YYDEBUG(15, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy10; - if (yych == 'l') goto yy10; - goto yy17; + if (yych == 'T') goto yy16; + if (yych != 't') goto yy11; yy16: YYDEBUG(16, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy11; + if (yych == 'l') goto yy11; + goto yy18; +yy17: + YYDEBUG(17, *YYCURSOR); ++YYCURSOR; YYFILL(8); yych = *YYCURSOR; -yy17: - YYDEBUG(17, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy16; - } - if (yych == 'L') goto yy18; - if (yych != 'l') goto yy10; yy18: YYDEBUG(18, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy19; - if (yych != 'a') goto yy10; + if (yybm[0+yych] & 128) { + goto yy17; + } + if (yych == 'L') goto yy19; + if (yych != 'l') goto yy11; yy19: YYDEBUG(19, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy20; - if (yych != 'n') goto yy10; + if (yych == 'A') goto yy20; + if (yych != 'a') goto yy11; yy20: YYDEBUG(20, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'G') goto yy21; - if (yych != 'g') goto yy10; + if (yych == 'N') goto yy21; + if (yych != 'n') goto yy11; yy21: YYDEBUG(21, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy22; - if (yych != 'u') goto yy10; + if (yych == 'G') goto yy22; + if (yych != 'g') goto yy11; yy22: YYDEBUG(22, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy23; - if (yych != 'a') goto yy10; + if (yych == 'U') goto yy23; + if (yych != 'u') goto yy11; yy23: YYDEBUG(23, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'G') goto yy24; - if (yych != 'g') goto yy10; + if (yych == 'A') goto yy24; + if (yych != 'a') goto yy11; yy24: YYDEBUG(24, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy25; - if (yych != 'e') goto yy10; + if (yych == 'G') goto yy25; + if (yych != 'g') goto yy11; yy25: YYDEBUG(25, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy26; + if (yych != 'e') goto yy11; +yy26: + YYDEBUG(26, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(26, *YYCURSOR); + YYDEBUG(27, *YYCURSOR); if (yych <= '\r') { - if (yych <= 0x08) goto yy10; - if (yych <= '\n') goto yy25; - if (yych <= '\f') goto yy10; - goto yy25; + if (yych <= 0x08) goto yy11; + if (yych <= '\n') goto yy26; + if (yych <= '\f') goto yy11; + goto yy26; } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy10; - goto yy25; + if (yych <= 0x1F) goto yy11; + goto yy26; } else { - if (yych != '=') goto yy10; + if (yych != '=') goto yy11; } } -yy27: - YYDEBUG(27, *YYCURSOR); +yy28: + YYDEBUG(28, *YYCURSOR); ++YYCURSOR; YYFILL(5); yych = *YYCURSOR; - YYDEBUG(28, *YYCURSOR); + YYDEBUG(29, *YYCURSOR); if (yych <= '!') { if (yych <= '\f') { - if (yych <= 0x08) goto yy10; - if (yych <= '\n') goto yy27; - goto yy10; + if (yych <= 0x08) goto yy11; + if (yych <= '\n') goto yy28; + goto yy11; } else { - if (yych <= '\r') goto yy27; - if (yych == ' ') goto yy27; - goto yy10; + if (yych <= '\r') goto yy28; + if (yych == ' ') goto yy28; + goto yy11; } } else { if (yych <= 'O') { - if (yych <= '"') goto yy30; - if (yych == '\'') goto yy31; - goto yy10; + if (yych <= '"') goto yy31; + if (yych == '\'') goto yy32; + goto yy11; } else { - if (yych <= 'P') goto yy29; - if (yych != 'p') goto yy10; + if (yych <= 'P') goto yy30; + if (yych != 'p') goto yy11; } } -yy29: - YYDEBUG(29, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy42; - if (yych == 'h') goto yy42; - goto yy10; yy30: YYDEBUG(30, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy39; - if (yych == 'p') goto yy39; - goto yy10; + if (yych == 'H') goto yy43; + if (yych == 'h') goto yy43; + goto yy11; yy31: YYDEBUG(31, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy32; - if (yych != 'p') goto yy10; + if (yych == 'P') goto yy40; + if (yych == 'p') goto yy40; + goto yy11; yy32: YYDEBUG(32, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy33; - if (yych != 'h') goto yy10; + if (yych == 'P') goto yy33; + if (yych != 'p') goto yy11; yy33: YYDEBUG(33, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy34; - if (yych != 'p') goto yy10; + if (yych == 'H') goto yy34; + if (yych != 'h') goto yy11; yy34: YYDEBUG(34, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '\'') goto yy10; + if (yych == 'P') goto yy35; + if (yych != 'p') goto yy11; yy35: YYDEBUG(35, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '\'') goto yy11; +yy36: + YYDEBUG(36, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(36, *YYCURSOR); + YYDEBUG(37, *YYCURSOR); if (yych <= '\r') { - if (yych <= 0x08) goto yy10; - if (yych <= '\n') goto yy35; - if (yych <= '\f') goto yy10; - goto yy35; + if (yych <= 0x08) goto yy11; + if (yych <= '\n') goto yy36; + if (yych <= '\f') goto yy11; + goto yy36; } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy10; - goto yy35; + if (yych <= 0x1F) goto yy11; + goto yy36; } else { - if (yych != '>') goto yy10; + if (yych != '>') goto yy11; } } - YYDEBUG(37, *YYCURSOR); - ++YYCURSOR; YYDEBUG(38, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(39, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1606 "Zend/zend_language_scanner.l" +#line 1610 "Zend/zend_language_scanner.l" { YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1)); @@ -1397,34 +1396,34 @@ yy35: BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1401 "Zend/zend_language_scanner.c" -yy39: - YYDEBUG(39, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy40; - if (yych != 'h') goto yy10; +#line 1400 "Zend/zend_language_scanner.c" yy40: YYDEBUG(40, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy41; - if (yych != 'p') goto yy10; + if (yych == 'H') goto yy41; + if (yych != 'h') goto yy11; yy41: YYDEBUG(41, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '"') goto yy35; - goto yy10; + if (yych == 'P') goto yy42; + if (yych != 'p') goto yy11; yy42: YYDEBUG(42, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy35; - if (yych == 'p') goto yy35; - goto yy10; + if (yych == '"') goto yy36; + goto yy11; yy43: YYDEBUG(43, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych == 'P') goto yy36; + if (yych == 'p') goto yy36; + goto yy11; +yy44: YYDEBUG(44, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(45, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1621 "Zend/zend_language_scanner.l" +#line 1625 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { BEGIN(ST_IN_SCRIPTING); @@ -1433,56 +1432,56 @@ yy43: goto inline_char_handler; } } -#line 1437 "Zend/zend_language_scanner.c" -yy45: - YYDEBUG(45, *YYCURSOR); - ++YYCURSOR; +#line 1436 "Zend/zend_language_scanner.c" +yy46: YYDEBUG(46, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(47, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1631 "Zend/zend_language_scanner.l" +#line 1635 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } -#line 1448 "Zend/zend_language_scanner.c" -yy47: - YYDEBUG(47, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy48; - if (yych != 'h') goto yy10; +#line 1447 "Zend/zend_language_scanner.c" yy48: YYDEBUG(48, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy49; - if (yych != 'p') goto yy10; + if (yych == 'H') goto yy49; + if (yych != 'h') goto yy11; yy49: YYDEBUG(49, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'P') goto yy50; + if (yych != 'p') goto yy11; +yy50: + YYDEBUG(50, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= '\f') { - if (yych <= 0x08) goto yy10; - if (yych >= '\v') goto yy10; + if (yych <= 0x08) goto yy11; + if (yych >= '\v') goto yy11; } else { - if (yych <= '\r') goto yy52; - if (yych != ' ') goto yy10; + if (yych <= '\r') goto yy53; + if (yych != ' ') goto yy11; } -yy50: - YYDEBUG(50, *YYCURSOR); - ++YYCURSOR; yy51: YYDEBUG(51, *YYCURSOR); + ++YYCURSOR; +yy52: + YYDEBUG(52, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1647 "Zend/zend_language_scanner.l" +#line 1651 "Zend/zend_language_scanner.l" { HANDLE_NEWLINE(yytext[yyleng-1]); BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1481 "Zend/zend_language_scanner.c" -yy52: - YYDEBUG(52, *YYCURSOR); +#line 1480 "Zend/zend_language_scanner.c" +yy53: + YYDEBUG(53, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy50; - goto yy51; + if ((yych = *YYCURSOR) == '\n') goto yy51; + goto yy52; } /* *********************************** */ yyc_ST_BACKQUOTE: @@ -1521,34 +1520,34 @@ yyc_ST_BACKQUOTE: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(53, *YYCURSOR); + YYDEBUG(54, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '_') { - if (yych != '$') goto yy60; + if (yych != '$') goto yy61; } else { - if (yych <= '`') goto yy58; - if (yych == '{') goto yy57; - goto yy60; + if (yych <= '`') goto yy59; + if (yych == '{') goto yy58; + goto yy61; } - YYDEBUG(55, *YYCURSOR); + YYDEBUG(56, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '_') { - if (yych <= '@') goto yy56; - if (yych <= 'Z') goto yy63; - if (yych >= '_') goto yy63; + if (yych <= '@') goto yy57; + if (yych <= 'Z') goto yy64; + if (yych >= '_') goto yy64; } else { if (yych <= 'z') { - if (yych >= 'a') goto yy63; + if (yych >= 'a') goto yy64; } else { - if (yych <= '{') goto yy66; - if (yych >= 0x7F) goto yy63; + if (yych <= '{') goto yy67; + if (yych >= 0x7F) goto yy64; } } -yy56: - YYDEBUG(56, *YYCURSOR); +yy57: + YYDEBUG(57, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2106 "Zend/zend_language_scanner.l" +#line 2110 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1589,118 +1588,118 @@ yy56: zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1593 "Zend/zend_language_scanner.c" -yy57: - YYDEBUG(57, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '$') goto yy61; - goto yy56; +#line 1592 "Zend/zend_language_scanner.c" yy58: YYDEBUG(58, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych == '$') goto yy62; + goto yy57; +yy59: YYDEBUG(59, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(60, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2050 "Zend/zend_language_scanner.l" +#line 2054 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '`'; } -#line 1609 "Zend/zend_language_scanner.c" -yy60: - YYDEBUG(60, *YYCURSOR); - yych = *++YYCURSOR; - goto yy56; +#line 1608 "Zend/zend_language_scanner.c" yy61: YYDEBUG(61, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + goto yy57; +yy62: YYDEBUG(62, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(63, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2037 "Zend/zend_language_scanner.l" +#line 2041 "Zend/zend_language_scanner.l" { Z_LVAL_P(zendlval) = (zend_long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1626 "Zend/zend_language_scanner.c" -yy63: - YYDEBUG(63, *YYCURSOR); +#line 1625 "Zend/zend_language_scanner.c" +yy64: + YYDEBUG(64, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(64, *YYCURSOR); + YYDEBUG(65, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy63; + goto yy64; } - if (yych == '-') goto yy68; - if (yych == '[') goto yy70; -yy65: - YYDEBUG(65, *YYCURSOR); + if (yych == '-') goto yy69; + if (yych == '[') goto yy71; +yy66: + YYDEBUG(66, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1744 "Zend/zend_language_scanner.l" +#line 1748 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 1647 "Zend/zend_language_scanner.c" -yy66: - YYDEBUG(66, *YYCURSOR); - ++YYCURSOR; +#line 1646 "Zend/zend_language_scanner.c" +yy67: YYDEBUG(67, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(68, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1460 "Zend/zend_language_scanner.l" +#line 1464 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1658 "Zend/zend_language_scanner.c" -yy68: - YYDEBUG(68, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '>') goto yy72; +#line 1657 "Zend/zend_language_scanner.c" yy69: YYDEBUG(69, *YYCURSOR); - YYCURSOR = YYMARKER; - goto yy65; + yych = *++YYCURSOR; + if (yych == '>') goto yy73; yy70: YYDEBUG(70, *YYCURSOR); - ++YYCURSOR; + YYCURSOR = YYMARKER; + goto yy66; +yy71: YYDEBUG(71, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(72, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1737 "Zend/zend_language_scanner.l" +#line 1741 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 1679 "Zend/zend_language_scanner.c" -yy72: - YYDEBUG(72, *YYCURSOR); +#line 1678 "Zend/zend_language_scanner.c" +yy73: + YYDEBUG(73, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '_') { - if (yych <= '@') goto yy69; - if (yych <= 'Z') goto yy73; - if (yych <= '^') goto yy69; + if (yych <= '@') goto yy70; + if (yych <= 'Z') goto yy74; + if (yych <= '^') goto yy70; } else { - if (yych <= '`') goto yy69; - if (yych <= 'z') goto yy73; - if (yych <= '~') goto yy69; + if (yych <= '`') goto yy70; + if (yych <= 'z') goto yy74; + if (yych <= '~') goto yy70; } -yy73: - YYDEBUG(73, *YYCURSOR); - ++YYCURSOR; +yy74: YYDEBUG(74, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(75, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1728 "Zend/zend_language_scanner.l" +#line 1732 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 1704 "Zend/zend_language_scanner.c" +#line 1703 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_DOUBLE_QUOTES: @@ -1739,36 +1738,36 @@ yyc_ST_DOUBLE_QUOTES: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(75, *YYCURSOR); + YYDEBUG(76, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '#') { - if (yych == '"') goto yy80; - goto yy82; + if (yych == '"') goto yy81; + goto yy83; } else { - if (yych <= '$') goto yy77; - if (yych == '{') goto yy79; - goto yy82; + if (yych <= '$') goto yy78; + if (yych == '{') goto yy80; + goto yy83; } -yy77: - YYDEBUG(77, *YYCURSOR); +yy78: + YYDEBUG(78, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '_') { - if (yych <= '@') goto yy78; - if (yych <= 'Z') goto yy85; - if (yych >= '_') goto yy85; + if (yych <= '@') goto yy79; + if (yych <= 'Z') goto yy86; + if (yych >= '_') goto yy86; } else { if (yych <= 'z') { - if (yych >= 'a') goto yy85; + if (yych >= 'a') goto yy86; } else { - if (yych <= '{') goto yy88; - if (yych >= 0x7F) goto yy85; + if (yych <= '{') goto yy89; + if (yych >= 0x7F) goto yy86; } } -yy78: - YYDEBUG(78, *YYCURSOR); +yy79: + YYDEBUG(79, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2056 "Zend/zend_language_scanner.l" +#line 2060 "Zend/zend_language_scanner.l" { if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) { YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1; @@ -1817,129 +1816,129 @@ double_quotes_scan_done: zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1821 "Zend/zend_language_scanner.c" -yy79: - YYDEBUG(79, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '$') goto yy83; - goto yy78; +#line 1820 "Zend/zend_language_scanner.c" yy80: YYDEBUG(80, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych == '$') goto yy84; + goto yy79; +yy81: YYDEBUG(81, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(82, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2045 "Zend/zend_language_scanner.l" +#line 2049 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '"'; } -#line 1837 "Zend/zend_language_scanner.c" -yy82: - YYDEBUG(82, *YYCURSOR); - yych = *++YYCURSOR; - goto yy78; +#line 1836 "Zend/zend_language_scanner.c" yy83: YYDEBUG(83, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + goto yy79; +yy84: YYDEBUG(84, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(85, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2037 "Zend/zend_language_scanner.l" +#line 2041 "Zend/zend_language_scanner.l" { Z_LVAL_P(zendlval) = (zend_long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1854 "Zend/zend_language_scanner.c" -yy85: - YYDEBUG(85, *YYCURSOR); +#line 1853 "Zend/zend_language_scanner.c" +yy86: + YYDEBUG(86, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(86, *YYCURSOR); + YYDEBUG(87, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy85; + goto yy86; } - if (yych == '-') goto yy90; - if (yych == '[') goto yy92; -yy87: - YYDEBUG(87, *YYCURSOR); + if (yych == '-') goto yy91; + if (yych == '[') goto yy93; +yy88: + YYDEBUG(88, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1744 "Zend/zend_language_scanner.l" +#line 1748 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 1875 "Zend/zend_language_scanner.c" -yy88: - YYDEBUG(88, *YYCURSOR); - ++YYCURSOR; +#line 1874 "Zend/zend_language_scanner.c" +yy89: YYDEBUG(89, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(90, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1460 "Zend/zend_language_scanner.l" +#line 1464 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1886 "Zend/zend_language_scanner.c" -yy90: - YYDEBUG(90, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '>') goto yy94; +#line 1885 "Zend/zend_language_scanner.c" yy91: YYDEBUG(91, *YYCURSOR); - YYCURSOR = YYMARKER; - goto yy87; + yych = *++YYCURSOR; + if (yych == '>') goto yy95; yy92: YYDEBUG(92, *YYCURSOR); - ++YYCURSOR; + YYCURSOR = YYMARKER; + goto yy88; +yy93: YYDEBUG(93, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(94, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1737 "Zend/zend_language_scanner.l" +#line 1741 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 1907 "Zend/zend_language_scanner.c" -yy94: - YYDEBUG(94, *YYCURSOR); +#line 1906 "Zend/zend_language_scanner.c" +yy95: + YYDEBUG(95, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '_') { - if (yych <= '@') goto yy91; - if (yych <= 'Z') goto yy95; - if (yych <= '^') goto yy91; + if (yych <= '@') goto yy92; + if (yych <= 'Z') goto yy96; + if (yych <= '^') goto yy92; } else { - if (yych <= '`') goto yy91; - if (yych <= 'z') goto yy95; - if (yych <= '~') goto yy91; + if (yych <= '`') goto yy92; + if (yych <= 'z') goto yy96; + if (yych <= '~') goto yy92; } -yy95: - YYDEBUG(95, *YYCURSOR); - ++YYCURSOR; +yy96: YYDEBUG(96, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(97, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1728 "Zend/zend_language_scanner.l" +#line 1732 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 1932 "Zend/zend_language_scanner.c" +#line 1931 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_END_HEREDOC: - YYDEBUG(97, *YYCURSOR); + YYDEBUG(98, *YYCURSOR); YYFILL(1); yych = *YYCURSOR; - YYDEBUG(99, *YYCURSOR); - ++YYCURSOR; YYDEBUG(100, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(101, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2023 "Zend/zend_language_scanner.l" +#line 2027 "Zend/zend_language_scanner.l" { zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack)); @@ -1952,7 +1951,7 @@ yyc_ST_END_HEREDOC: BEGIN(ST_IN_SCRIPTING); return T_END_HEREDOC; } -#line 1956 "Zend/zend_language_scanner.c" +#line 1955 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_HEREDOC: { @@ -1990,31 +1989,31 @@ yyc_ST_HEREDOC: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(101, *YYCURSOR); + YYDEBUG(102, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; - if (yych == '$') goto yy103; - if (yych == '{') goto yy105; - goto yy106; -yy103: - YYDEBUG(103, *YYCURSOR); + if (yych == '$') goto yy104; + if (yych == '{') goto yy106; + goto yy107; +yy104: + YYDEBUG(104, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '_') { - if (yych <= '@') goto yy104; - if (yych <= 'Z') goto yy109; - if (yych >= '_') goto yy109; + if (yych <= '@') goto yy105; + if (yych <= 'Z') goto yy110; + if (yych >= '_') goto yy110; } else { if (yych <= 'z') { - if (yych >= 'a') goto yy109; + if (yych >= 'a') goto yy110; } else { - if (yych <= '{') goto yy112; - if (yych >= 0x7F) goto yy109; + if (yych <= '{') goto yy113; + if (yych >= 0x7F) goto yy110; } } -yy104: - YYDEBUG(104, *YYCURSOR); +yy105: + YYDEBUG(105, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2148 "Zend/zend_language_scanner.l" +#line 2152 "Zend/zend_language_scanner.l" { int newline = 0; @@ -2087,107 +2086,107 @@ heredoc_scan_done: zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 2091 "Zend/zend_language_scanner.c" -yy105: - YYDEBUG(105, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '$') goto yy107; - goto yy104; +#line 2090 "Zend/zend_language_scanner.c" yy106: YYDEBUG(106, *YYCURSOR); yych = *++YYCURSOR; - goto yy104; + if (yych == '$') goto yy108; + goto yy105; yy107: YYDEBUG(107, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + goto yy105; +yy108: YYDEBUG(108, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(109, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2037 "Zend/zend_language_scanner.l" +#line 2041 "Zend/zend_language_scanner.l" { Z_LVAL_P(zendlval) = (zend_long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 2113 "Zend/zend_language_scanner.c" -yy109: - YYDEBUG(109, *YYCURSOR); +#line 2112 "Zend/zend_language_scanner.c" +yy110: + YYDEBUG(110, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(110, *YYCURSOR); + YYDEBUG(111, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy109; + goto yy110; } - if (yych == '-') goto yy114; - if (yych == '[') goto yy116; -yy111: - YYDEBUG(111, *YYCURSOR); + if (yych == '-') goto yy115; + if (yych == '[') goto yy117; +yy112: + YYDEBUG(112, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1744 "Zend/zend_language_scanner.l" +#line 1748 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 2134 "Zend/zend_language_scanner.c" -yy112: - YYDEBUG(112, *YYCURSOR); - ++YYCURSOR; +#line 2133 "Zend/zend_language_scanner.c" +yy113: YYDEBUG(113, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(114, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1460 "Zend/zend_language_scanner.l" +#line 1464 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 2145 "Zend/zend_language_scanner.c" -yy114: - YYDEBUG(114, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '>') goto yy118; +#line 2144 "Zend/zend_language_scanner.c" yy115: YYDEBUG(115, *YYCURSOR); - YYCURSOR = YYMARKER; - goto yy111; + yych = *++YYCURSOR; + if (yych == '>') goto yy119; yy116: YYDEBUG(116, *YYCURSOR); - ++YYCURSOR; + YYCURSOR = YYMARKER; + goto yy112; +yy117: YYDEBUG(117, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(118, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1737 "Zend/zend_language_scanner.l" +#line 1741 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 2166 "Zend/zend_language_scanner.c" -yy118: - YYDEBUG(118, *YYCURSOR); +#line 2165 "Zend/zend_language_scanner.c" +yy119: + YYDEBUG(119, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '_') { - if (yych <= '@') goto yy115; - if (yych <= 'Z') goto yy119; - if (yych <= '^') goto yy115; + if (yych <= '@') goto yy116; + if (yych <= 'Z') goto yy120; + if (yych <= '^') goto yy116; } else { - if (yych <= '`') goto yy115; - if (yych <= 'z') goto yy119; - if (yych <= '~') goto yy115; + if (yych <= '`') goto yy116; + if (yych <= 'z') goto yy120; + if (yych <= '~') goto yy116; } -yy119: - YYDEBUG(119, *YYCURSOR); - ++YYCURSOR; +yy120: YYDEBUG(120, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(121, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1728 "Zend/zend_language_scanner.l" +#line 1732 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 2191 "Zend/zend_language_scanner.c" +#line 2190 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_IN_SCRIPTING: @@ -2226,7 +2225,7 @@ yyc_ST_IN_SCRIPTING: 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }; - YYDEBUG(121, *YYCURSOR); + YYDEBUG(122, *YYCURSOR); YYFILL(16); yych = *YYCURSOR; YYDEBUG(-1, yych); @@ -2259,32 +2258,32 @@ yyc_ST_IN_SCRIPTING: case 0x1C: case 0x1D: case 0x1E: - case 0x1F: goto yy184; + case 0x1F: goto yy185; case '\t': case '\n': case '\r': - case ' ': goto yy140; - case '!': goto yy154; - case '"': goto yy180; - case '#': goto yy176; - case '$': goto yy165; - case '%': goto yy159; - case '&': goto yy160; - case '\'': goto yy178; - case '(': goto yy148; + case ' ': goto yy141; + case '!': goto yy156; + case '"': goto yy181; + case '#': goto yy177; + case '$': goto yy167; + case '%': goto yy161; + case '&': goto yy162; + case '\'': goto yy179; + case '(': goto yy150; case ')': case ',': case ';': case '@': case '[': case ']': - case '~': goto yy166; - case '*': goto yy157; - case '+': goto yy153; - case '-': goto yy138; - case '.': goto yy145; - case '/': goto yy158; - case '0': goto yy172; + case '~': goto yy168; + case '*': goto yy159; + case '+': goto yy155; + case '-': goto yy139; + case '.': goto yy146; + case '/': goto yy160; + case '0': goto yy173; case '1': case '2': case '3': @@ -2293,599 +2292,601 @@ yyc_ST_IN_SCRIPTING: case '6': case '7': case '8': - case '9': goto yy174; - case ':': goto yy142; - case '<': goto yy155; - case '=': goto yy151; - case '>': goto yy156; - case '?': goto yy167; + case '9': goto yy175; + case ':': goto yy143; + case '<': goto yy157; + case '=': goto yy153; + case '>': goto yy158; + case '?': goto yy147; case 'A': - case 'a': goto yy133; + case 'a': goto yy134; case 'B': - case 'b': goto yy135; + case 'b': goto yy136; case 'C': - case 'c': goto yy127; + case 'c': goto yy128; case 'D': - case 'd': goto yy125; + case 'd': goto yy126; case 'E': - case 'e': goto yy123; + case 'e': goto yy124; case 'F': - case 'f': goto yy126; + case 'f': goto yy127; case 'G': - case 'g': goto yy136; + case 'g': goto yy137; case 'I': - case 'i': goto yy131; + case 'i': goto yy132; case 'L': - case 'l': goto yy152; + case 'l': goto yy154; case 'N': - case 'n': goto yy146; + case 'n': goto yy148; case 'O': - case 'o': goto yy163; + case 'o': goto yy165; case 'P': - case 'p': goto yy137; + case 'p': goto yy138; case 'R': - case 'r': goto yy128; + case 'r': goto yy129; case 'S': - case 's': goto yy134; + case 's': goto yy135; case 'T': - case 't': goto yy130; + case 't': goto yy131; case 'U': - case 'u': goto yy149; + case 'u': goto yy151; case 'V': - case 'v': goto yy147; + case 'v': goto yy149; case 'W': - case 'w': goto yy132; + case 'w': goto yy133; case 'X': - case 'x': goto yy164; + case 'x': goto yy166; case 'Y': - case 'y': goto yy129; - case '\\': goto yy143; - case '^': goto yy162; - case '_': goto yy150; - case '`': goto yy182; - case '{': goto yy168; - case '|': goto yy161; - case '}': goto yy170; - default: goto yy175; - } -yy123: - YYDEBUG(123, *YYCURSOR); + case 'y': goto yy130; + case '\\': goto yy144; + case '^': goto yy164; + case '_': goto yy152; + case '`': goto yy183; + case '{': goto yy169; + case '|': goto yy163; + case '}': goto yy171; + default: goto yy176; + } +yy124: + YYDEBUG(124, *YYCURSOR); ++YYCURSOR; YYDEBUG(-1, yych); switch ((yych = *YYCURSOR)) { case 'C': - case 'c': goto yy742; + case 'c': goto yy745; case 'L': - case 'l': goto yy743; + case 'l': goto yy746; case 'M': - case 'm': goto yy744; + case 'm': goto yy747; case 'N': - case 'n': goto yy745; + case 'n': goto yy748; case 'V': - case 'v': goto yy746; + case 'v': goto yy749; case 'X': - case 'x': goto yy747; - default: goto yy187; + case 'x': goto yy750; + default: goto yy188; } -yy124: - YYDEBUG(124, *YYCURSOR); +yy125: + YYDEBUG(125, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1767 "Zend/zend_language_scanner.l" +#line 1771 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); return T_STRING; } -#line 2379 "Zend/zend_language_scanner.c" -yy125: - YYDEBUG(125, *YYCURSOR); +#line 2378 "Zend/zend_language_scanner.c" +yy126: + YYDEBUG(126, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'H') { - if (yych == 'E') goto yy724; - goto yy187; + if (yych == 'E') goto yy727; + goto yy188; } else { - if (yych <= 'I') goto yy725; - if (yych <= 'N') goto yy187; - goto yy726; + if (yych <= 'I') goto yy728; + if (yych <= 'N') goto yy188; + goto yy729; } } else { if (yych <= 'h') { - if (yych == 'e') goto yy724; - goto yy187; + if (yych == 'e') goto yy727; + goto yy188; } else { - if (yych <= 'i') goto yy725; - if (yych == 'o') goto yy726; - goto yy187; + if (yych <= 'i') goto yy728; + if (yych == 'o') goto yy729; + goto yy188; } } -yy126: - YYDEBUG(126, *YYCURSOR); +yy127: + YYDEBUG(127, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'N') { - if (yych == 'I') goto yy700; - goto yy187; + if (yych == 'I') goto yy703; + goto yy188; } else { - if (yych <= 'O') goto yy701; - if (yych <= 'T') goto yy187; - goto yy702; + if (yych <= 'O') goto yy704; + if (yych <= 'T') goto yy188; + goto yy705; } } else { if (yych <= 'n') { - if (yych == 'i') goto yy700; - goto yy187; + if (yych == 'i') goto yy703; + goto yy188; } else { - if (yych <= 'o') goto yy701; - if (yych == 'u') goto yy702; - goto yy187; + if (yych <= 'o') goto yy704; + if (yych == 'u') goto yy705; + goto yy188; } } -yy127: - YYDEBUG(127, *YYCURSOR); +yy128: + YYDEBUG(128, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'K') { - if (yych == 'A') goto yy665; - goto yy187; + if (yych == 'A') goto yy668; + goto yy188; } else { - if (yych <= 'L') goto yy666; - if (yych <= 'N') goto yy187; - goto yy667; + if (yych <= 'L') goto yy669; + if (yych <= 'N') goto yy188; + goto yy670; } } else { if (yych <= 'k') { - if (yych == 'a') goto yy665; - goto yy187; + if (yych == 'a') goto yy668; + goto yy188; } else { - if (yych <= 'l') goto yy666; - if (yych == 'o') goto yy667; - goto yy187; + if (yych <= 'l') goto yy669; + if (yych == 'o') goto yy670; + goto yy188; } } -yy128: - YYDEBUG(128, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy647; - if (yych == 'e') goto yy647; - goto yy187; yy129: YYDEBUG(129, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy642; - if (yych == 'i') goto yy642; - goto yy187; + if (yych == 'E') goto yy650; + if (yych == 'e') goto yy650; + goto yy188; yy130: YYDEBUG(130, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'I') goto yy645; + if (yych == 'i') goto yy645; + goto yy188; +yy131: + YYDEBUG(131, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= 'R') { - if (yych == 'H') goto yy630; - if (yych <= 'Q') goto yy187; - goto yy631; + if (yych == 'H') goto yy633; + if (yych <= 'Q') goto yy188; + goto yy634; } else { if (yych <= 'h') { - if (yych <= 'g') goto yy187; - goto yy630; + if (yych <= 'g') goto yy188; + goto yy633; } else { - if (yych == 'r') goto yy631; - goto yy187; + if (yych == 'r') goto yy634; + goto yy188; } } -yy131: - YYDEBUG(131, *YYCURSOR); +yy132: + YYDEBUG(132, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= 'L') { - if (yych == 'F') goto yy577; - goto yy187; + if (yych == 'F') goto yy580; + goto yy188; } else { - if (yych <= 'M') goto yy579; - if (yych <= 'N') goto yy580; - if (yych <= 'R') goto yy187; - goto yy581; + if (yych <= 'M') goto yy582; + if (yych <= 'N') goto yy583; + if (yych <= 'R') goto yy188; + goto yy584; } } else { if (yych <= 'm') { - if (yych == 'f') goto yy577; - if (yych <= 'l') goto yy187; - goto yy579; + if (yych == 'f') goto yy580; + if (yych <= 'l') goto yy188; + goto yy582; } else { - if (yych <= 'n') goto yy580; - if (yych == 's') goto yy581; - goto yy187; + if (yych <= 'n') goto yy583; + if (yych == 's') goto yy584; + goto yy188; } } -yy132: - YYDEBUG(132, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy572; - if (yych == 'h') goto yy572; - goto yy187; yy133: YYDEBUG(133, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'H') goto yy575; + if (yych == 'h') goto yy575; + goto yy188; +yy134: + YYDEBUG(134, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= 'M') { - if (yych == 'B') goto yy554; - goto yy187; + if (yych == 'B') goto yy557; + goto yy188; } else { - if (yych <= 'N') goto yy555; - if (yych <= 'Q') goto yy187; - if (yych <= 'R') goto yy556; - goto yy557; + if (yych <= 'N') goto yy558; + if (yych <= 'Q') goto yy188; + if (yych <= 'R') goto yy559; + goto yy560; } } else { if (yych <= 'n') { - if (yych == 'b') goto yy554; - if (yych <= 'm') goto yy187; - goto yy555; + if (yych == 'b') goto yy557; + if (yych <= 'm') goto yy188; + goto yy558; } else { - if (yych <= 'q') goto yy187; - if (yych <= 'r') goto yy556; - if (yych <= 's') goto yy557; - goto yy187; + if (yych <= 'q') goto yy188; + if (yych <= 'r') goto yy559; + if (yych <= 's') goto yy560; + goto yy188; } } -yy134: - YYDEBUG(134, *YYCURSOR); +yy135: + YYDEBUG(135, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'W') { - if (yych == 'T') goto yy542; - if (yych <= 'V') goto yy187; - goto yy543; + if (yych == 'T') goto yy545; + if (yych <= 'V') goto yy188; + goto yy546; } else { if (yych <= 't') { - if (yych <= 's') goto yy187; - goto yy542; + if (yych <= 's') goto yy188; + goto yy545; } else { - if (yych == 'w') goto yy543; - goto yy187; + if (yych == 'w') goto yy546; + goto yy188; } } -yy135: - YYDEBUG(135, *YYCURSOR); +yy136: + YYDEBUG(136, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ';') { if (yych <= '"') { - if (yych <= '!') goto yy187; - goto yy534; + if (yych <= '!') goto yy188; + goto yy537; } else { - if (yych == '\'') goto yy535; - goto yy187; + if (yych == '\'') goto yy538; + goto yy188; } } else { if (yych <= 'R') { - if (yych <= '<') goto yy533; - if (yych <= 'Q') goto yy187; - goto yy536; + if (yych <= '<') goto yy536; + if (yych <= 'Q') goto yy188; + goto yy539; } else { - if (yych == 'r') goto yy536; - goto yy187; + if (yych == 'r') goto yy539; + goto yy188; } } -yy136: - YYDEBUG(136, *YYCURSOR); +yy137: + YYDEBUG(137, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'L') goto yy523; - if (yych <= 'N') goto yy187; - goto yy524; + if (yych == 'L') goto yy526; + if (yych <= 'N') goto yy188; + goto yy527; } else { if (yych <= 'l') { - if (yych <= 'k') goto yy187; - goto yy523; + if (yych <= 'k') goto yy188; + goto yy526; } else { - if (yych == 'o') goto yy524; - goto yy187; + if (yych == 'o') goto yy527; + goto yy188; } } -yy137: - YYDEBUG(137, *YYCURSOR); +yy138: + YYDEBUG(138, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { - if (yych == 'R') goto yy499; - if (yych <= 'T') goto yy187; - goto yy500; + if (yych == 'R') goto yy502; + if (yych <= 'T') goto yy188; + goto yy503; } else { if (yych <= 'r') { - if (yych <= 'q') goto yy187; - goto yy499; + if (yych <= 'q') goto yy188; + goto yy502; } else { - if (yych == 'u') goto yy500; - goto yy187; + if (yych == 'u') goto yy503; + goto yy188; } } -yy138: - YYDEBUG(138, *YYCURSOR); +yy139: + YYDEBUG(139, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '<') { - if (yych == '-') goto yy495; + if (yych == '-') goto yy498; } else { - if (yych <= '=') goto yy493; - if (yych <= '>') goto yy497; + if (yych <= '=') goto yy496; + if (yych <= '>') goto yy500; } -yy139: - YYDEBUG(139, *YYCURSOR); +yy140: + YYDEBUG(140, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1449 "Zend/zend_language_scanner.l" +#line 1453 "Zend/zend_language_scanner.l" { return yytext[0]; } -#line 2615 "Zend/zend_language_scanner.c" -yy140: - YYDEBUG(140, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy492; +#line 2614 "Zend/zend_language_scanner.c" yy141: YYDEBUG(141, *YYCURSOR); + ++YYCURSOR; + yych = *YYCURSOR; + goto yy495; +yy142: + YYDEBUG(142, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1172 "Zend/zend_language_scanner.l" { HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 2629 "Zend/zend_language_scanner.c" -yy142: - YYDEBUG(142, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == ':') goto yy489; - goto yy139; +#line 2628 "Zend/zend_language_scanner.c" yy143: YYDEBUG(143, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych == ':') goto yy492; + goto yy140; +yy144: YYDEBUG(144, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(145, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1197 "Zend/zend_language_scanner.l" { return T_NS_SEPARATOR; } -#line 2644 "Zend/zend_language_scanner.c" -yy145: - YYDEBUG(145, *YYCURSOR); +#line 2643 "Zend/zend_language_scanner.c" +yy146: + YYDEBUG(146, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { - if (yych == '.') goto yy486; - goto yy139; + if (yych == '.') goto yy489; + goto yy140; } else { - if (yych <= '9') goto yy482; - if (yych == '=') goto yy484; - goto yy139; + if (yych <= '9') goto yy485; + if (yych == '=') goto yy487; + goto yy140; } -yy146: - YYDEBUG(146, *YYCURSOR); +yy147: + YYDEBUG(147, *YYCURSOR); + yych = *++YYCURSOR; + if (yych <= '=') goto yy140; + if (yych <= '>') goto yy265; + if (yych <= '?') goto yy483; + goto yy140; +yy148: + YYDEBUG(148, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { - if (yych == 'A') goto yy470; - if (yych <= 'D') goto yy187; - goto yy471; + if (yych == 'A') goto yy471; + if (yych <= 'D') goto yy188; + goto yy472; } else { if (yych <= 'a') { - if (yych <= '`') goto yy187; - goto yy470; + if (yych <= '`') goto yy188; + goto yy471; } else { - if (yych == 'e') goto yy471; - goto yy187; + if (yych == 'e') goto yy472; + goto yy188; } } -yy147: - YYDEBUG(147, *YYCURSOR); +yy149: + YYDEBUG(149, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy467; - if (yych == 'a') goto yy467; - goto yy187; -yy148: - YYDEBUG(148, *YYCURSOR); + if (yych == 'A') goto yy468; + if (yych == 'a') goto yy468; + goto yy188; +yy150: + YYDEBUG(150, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { if (yych <= 'D') { if (yych <= ' ') { - if (yych == '\t') goto yy392; - if (yych <= 0x1F) goto yy139; - goto yy392; + if (yych == '\t') goto yy393; + if (yych <= 0x1F) goto yy140; + goto yy393; } else { - if (yych <= '@') goto yy139; - if (yych == 'C') goto yy139; - goto yy392; + if (yych <= '@') goto yy140; + if (yych == 'C') goto yy140; + goto yy393; } } else { if (yych <= 'I') { - if (yych == 'F') goto yy392; - if (yych <= 'H') goto yy139; - goto yy392; + if (yych == 'F') goto yy393; + if (yych <= 'H') goto yy140; + goto yy393; } else { - if (yych == 'O') goto yy392; - if (yych <= 'Q') goto yy139; - goto yy392; + if (yych == 'O') goto yy393; + if (yych <= 'Q') goto yy140; + goto yy393; } } } else { if (yych <= 'f') { if (yych <= 'b') { - if (yych == 'U') goto yy392; - if (yych <= '`') goto yy139; - goto yy392; + if (yych == 'U') goto yy393; + if (yych <= '`') goto yy140; + goto yy393; } else { - if (yych == 'd') goto yy392; - if (yych <= 'e') goto yy139; - goto yy392; + if (yych == 'd') goto yy393; + if (yych <= 'e') goto yy140; + goto yy393; } } else { if (yych <= 'o') { - if (yych == 'i') goto yy392; - if (yych <= 'n') goto yy139; - goto yy392; + if (yych == 'i') goto yy393; + if (yych <= 'n') goto yy140; + goto yy393; } else { if (yych <= 's') { - if (yych <= 'q') goto yy139; - goto yy392; + if (yych <= 'q') goto yy140; + goto yy393; } else { - if (yych == 'u') goto yy392; - goto yy139; + if (yych == 'u') goto yy393; + goto yy140; } } } } -yy149: - YYDEBUG(149, *YYCURSOR); +yy151: + YYDEBUG(151, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { - if (yych == 'N') goto yy383; - if (yych <= 'R') goto yy187; - goto yy384; + if (yych == 'N') goto yy384; + if (yych <= 'R') goto yy188; + goto yy385; } else { if (yych <= 'n') { - if (yych <= 'm') goto yy187; - goto yy383; + if (yych <= 'm') goto yy188; + goto yy384; } else { - if (yych == 's') goto yy384; - goto yy187; + if (yych == 's') goto yy385; + goto yy188; } } -yy150: - YYDEBUG(150, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '_') goto yy301; - goto yy187; -yy151: - YYDEBUG(151, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '<') goto yy139; - if (yych <= '=') goto yy295; - if (yych <= '>') goto yy297; - goto yy139; yy152: YYDEBUG(152, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy291; - if (yych == 'i') goto yy291; - goto yy187; + if (yych == '_') goto yy302; + goto yy188; yy153: YYDEBUG(153, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '+') goto yy289; - if (yych == '=') goto yy287; - goto yy139; + if (yych <= '<') goto yy140; + if (yych <= '=') goto yy296; + if (yych <= '>') goto yy298; + goto yy140; yy154: YYDEBUG(154, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '=') goto yy284; - goto yy139; + if (yych == 'I') goto yy292; + if (yych == 'i') goto yy292; + goto yy188; yy155: YYDEBUG(155, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ';') { - if (yych == '/') goto yy256; - goto yy139; - } else { - if (yych <= '<') goto yy254; - if (yych <= '=') goto yy257; - if (yych <= '>') goto yy259; - goto yy139; - } + yych = *++YYCURSOR; + if (yych == '+') goto yy290; + if (yych == '=') goto yy288; + goto yy140; yy156: YYDEBUG(156, *YYCURSOR); yych = *++YYCURSOR; - if (yych <= '<') goto yy139; - if (yych <= '=') goto yy250; - if (yych <= '>') goto yy248; - goto yy139; + if (yych == '=') goto yy285; + goto yy140; yy157: YYDEBUG(157, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '*') goto yy242; - if (yych == '=') goto yy244; - goto yy139; + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= ';') { + if (yych == '/') goto yy253; + goto yy140; + } else { + if (yych <= '<') goto yy251; + if (yych <= '=') goto yy254; + if (yych <= '>') goto yy256; + goto yy140; + } yy158: YYDEBUG(158, *YYCURSOR); yych = *++YYCURSOR; - if (yych <= '.') { - if (yych == '*') goto yy234; - goto yy139; - } else { - if (yych <= '/') goto yy236; - if (yych == '=') goto yy237; - goto yy139; - } + if (yych <= '<') goto yy140; + if (yych <= '=') goto yy247; + if (yych <= '>') goto yy245; + goto yy140; yy159: YYDEBUG(159, *YYCURSOR); yych = *++YYCURSOR; - if (yych <= '<') goto yy139; - if (yych <= '=') goto yy230; - if (yych <= '>') goto yy228; - goto yy139; + if (yych == '*') goto yy239; + if (yych == '=') goto yy241; + goto yy140; yy160: YYDEBUG(160, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '&') goto yy224; - if (yych == '=') goto yy226; - goto yy139; + if (yych <= '.') { + if (yych == '*') goto yy231; + goto yy140; + } else { + if (yych <= '/') goto yy233; + if (yych == '=') goto yy234; + goto yy140; + } yy161: YYDEBUG(161, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '=') goto yy222; - if (yych == '|') goto yy220; - goto yy139; + if (yych <= '<') goto yy140; + if (yych <= '=') goto yy227; + if (yych <= '>') goto yy225; + goto yy140; yy162: YYDEBUG(162, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '=') goto yy218; - goto yy139; + if (yych == '&') goto yy221; + if (yych == '=') goto yy223; + goto yy140; yy163: YYDEBUG(163, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy216; - if (yych == 'r') goto yy216; - goto yy187; + if (yych == '=') goto yy219; + if (yych == '|') goto yy217; + goto yy140; yy164: YYDEBUG(164, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy213; - if (yych == 'o') goto yy213; - goto yy187; + if (yych == '=') goto yy215; + goto yy140; yy165: YYDEBUG(165, *YYCURSOR); yych = *++YYCURSOR; - if (yych <= '_') { - if (yych <= '@') goto yy139; - if (yych <= 'Z') goto yy210; - if (yych <= '^') goto yy139; - goto yy210; - } else { - if (yych <= '`') goto yy139; - if (yych <= 'z') goto yy210; - if (yych <= '~') goto yy139; - goto yy210; - } + if (yych == 'R') goto yy213; + if (yych == 'r') goto yy213; + goto yy188; yy166: YYDEBUG(166, *YYCURSOR); yych = *++YYCURSOR; - goto yy139; + if (yych == 'O') goto yy210; + if (yych == 'o') goto yy210; + goto yy188; yy167: YYDEBUG(167, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '>') goto yy206; - goto yy139; + if (yych <= '_') { + if (yych <= '@') goto yy140; + if (yych <= 'Z') goto yy207; + if (yych <= '^') goto yy140; + goto yy207; + } else { + if (yych <= '`') goto yy140; + if (yych <= 'z') goto yy207; + if (yych <= '~') goto yy140; + goto yy207; + } yy168: YYDEBUG(168, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + goto yy140; +yy169: YYDEBUG(169, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(170, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1454 "Zend/zend_language_scanner.l" +#line 1458 "Zend/zend_language_scanner.l" { yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return '{'; } -#line 2883 "Zend/zend_language_scanner.c" -yy170: - YYDEBUG(170, *YYCURSOR); - ++YYCURSOR; +#line 2884 "Zend/zend_language_scanner.c" +yy171: YYDEBUG(171, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(172, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1466 "Zend/zend_language_scanner.l" +#line 1470 "Zend/zend_language_scanner.l" { RESET_DOC_COMMENT(); if (!zend_stack_is_empty(&SCNG(state_stack))) { @@ -2893,35 +2894,35 @@ yy170: } return '}'; } -#line 2897 "Zend/zend_language_scanner.c" -yy172: - YYDEBUG(172, *YYCURSOR); +#line 2898 "Zend/zend_language_scanner.c" +yy173: + YYDEBUG(173, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'E') { if (yych <= '9') { - if (yych == '.') goto yy188; - if (yych >= '0') goto yy191; + if (yych == '.') goto yy189; + if (yych >= '0') goto yy192; } else { - if (yych == 'B') goto yy199; - if (yych >= 'E') goto yy193; + if (yych == 'B') goto yy200; + if (yych >= 'E') goto yy194; } } else { if (yych <= 'b') { - if (yych == 'X') goto yy198; - if (yych >= 'b') goto yy199; + if (yych == 'X') goto yy199; + if (yych >= 'b') goto yy200; } else { if (yych <= 'e') { - if (yych >= 'e') goto yy193; + if (yych >= 'e') goto yy194; } else { - if (yych == 'x') goto yy198; + if (yych == 'x') goto yy199; } } } -yy173: - YYDEBUG(173, *YYCURSOR); +yy174: + YYDEBUG(174, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1514 "Zend/zend_language_scanner.l" +#line 1518 "Zend/zend_language_scanner.l" { if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, NULL, 0)); @@ -2939,35 +2940,35 @@ yy173: } return T_LNUMBER; } -#line 2943 "Zend/zend_language_scanner.c" -yy174: - YYDEBUG(174, *YYCURSOR); +#line 2944 "Zend/zend_language_scanner.c" +yy175: + YYDEBUG(175, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { - if (yych == '.') goto yy188; - if (yych <= '/') goto yy173; - goto yy191; + if (yych == '.') goto yy189; + if (yych <= '/') goto yy174; + goto yy192; } else { if (yych <= 'E') { - if (yych <= 'D') goto yy173; - goto yy193; + if (yych <= 'D') goto yy174; + goto yy194; } else { - if (yych == 'e') goto yy193; - goto yy173; + if (yych == 'e') goto yy194; + goto yy174; } } -yy175: - YYDEBUG(175, *YYCURSOR); - yych = *++YYCURSOR; - goto yy187; yy176: YYDEBUG(176, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + goto yy188; yy177: YYDEBUG(177, *YYCURSOR); + ++YYCURSOR; +yy178: + YYDEBUG(178, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1773 "Zend/zend_language_scanner.l" +#line 1777 "Zend/zend_language_scanner.l" { while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR++) { @@ -3001,14 +3002,14 @@ yy177: return T_COMMENT; } -#line 3005 "Zend/zend_language_scanner.c" -yy178: - YYDEBUG(178, *YYCURSOR); - ++YYCURSOR; +#line 3006 "Zend/zend_language_scanner.c" yy179: YYDEBUG(179, *YYCURSOR); + ++YYCURSOR; +yy180: + YYDEBUG(180, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1857 "Zend/zend_language_scanner.l" +#line 1861 "Zend/zend_language_scanner.l" { register char *s, *t; char *end; @@ -3077,14 +3078,14 @@ yy179: } return T_CONSTANT_ENCAPSED_STRING; } -#line 3081 "Zend/zend_language_scanner.c" -yy180: - YYDEBUG(180, *YYCURSOR); - ++YYCURSOR; +#line 3082 "Zend/zend_language_scanner.c" yy181: YYDEBUG(181, *YYCURSOR); + ++YYCURSOR; +yy182: + YYDEBUG(182, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1927 "Zend/zend_language_scanner.l" +#line 1931 "Zend/zend_language_scanner.l" { int bprefix = (yytext[0] != '"') ? 1 : 0; @@ -3125,24 +3126,24 @@ yy181: BEGIN(ST_DOUBLE_QUOTES); return '"'; } -#line 3129 "Zend/zend_language_scanner.c" -yy182: - YYDEBUG(182, *YYCURSOR); - ++YYCURSOR; +#line 3130 "Zend/zend_language_scanner.c" +yy183: YYDEBUG(183, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(184, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2017 "Zend/zend_language_scanner.l" +#line 2021 "Zend/zend_language_scanner.l" { BEGIN(ST_BACKQUOTE); return '`'; } -#line 3140 "Zend/zend_language_scanner.c" -yy184: - YYDEBUG(184, *YYCURSOR); - ++YYCURSOR; +#line 3141 "Zend/zend_language_scanner.c" +yy185: YYDEBUG(185, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(186, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2279 "Zend/zend_language_scanner.l" +#line 2283 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -3151,131 +3152,131 @@ yy184: zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 3155 "Zend/zend_language_scanner.c" -yy186: - YYDEBUG(186, *YYCURSOR); +#line 3156 "Zend/zend_language_scanner.c" +yy187: + YYDEBUG(187, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy187: - YYDEBUG(187, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy186; - } - goto yy124; yy188: YYDEBUG(188, *YYCURSOR); + if (yybm[0+yych] & 4) { + goto yy187; + } + goto yy125; +yy189: + YYDEBUG(189, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(189, *YYCURSOR); + YYDEBUG(190, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy188; + goto yy189; } - if (yych == 'E') goto yy193; - if (yych == 'e') goto yy193; -yy190: - YYDEBUG(190, *YYCURSOR); + if (yych == 'E') goto yy194; + if (yych == 'e') goto yy194; +yy191: + YYDEBUG(191, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1569 "Zend/zend_language_scanner.l" +#line 1573 "Zend/zend_language_scanner.l" { ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL)); return T_DNUMBER; } -#line 3187 "Zend/zend_language_scanner.c" -yy191: - YYDEBUG(191, *YYCURSOR); +#line 3188 "Zend/zend_language_scanner.c" +yy192: + YYDEBUG(192, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(192, *YYCURSOR); + YYDEBUG(193, *YYCURSOR); if (yych <= '9') { - if (yych == '.') goto yy188; - if (yych <= '/') goto yy173; - goto yy191; + if (yych == '.') goto yy189; + if (yych <= '/') goto yy174; + goto yy192; } else { if (yych <= 'E') { - if (yych <= 'D') goto yy173; + if (yych <= 'D') goto yy174; } else { - if (yych != 'e') goto yy173; + if (yych != 'e') goto yy174; } } -yy193: - YYDEBUG(193, *YYCURSOR); +yy194: + YYDEBUG(194, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') { - if (yych == '+') goto yy195; + if (yych == '+') goto yy196; } else { - if (yych <= '-') goto yy195; - if (yych <= '/') goto yy194; - if (yych <= '9') goto yy196; + if (yych <= '-') goto yy196; + if (yych <= '/') goto yy195; + if (yych <= '9') goto yy197; } -yy194: - YYDEBUG(194, *YYCURSOR); +yy195: + YYDEBUG(195, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 2) { if (yyaccept <= 1) { - if (yyaccept <= 0) { - goto yy124; + if (yyaccept == 0) { + goto yy125; } else { - goto yy139; + goto yy140; } } else { - goto yy173; + goto yy174; } } else { if (yyaccept <= 4) { - if (yyaccept <= 3) { - goto yy190; + if (yyaccept == 3) { + goto yy191; } else { - goto yy235; + goto yy232; } } else { - goto yy255; + goto yy252; } } -yy195: - YYDEBUG(195, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy194; - if (yych >= ':') goto yy194; yy196: YYDEBUG(196, *YYCURSOR); + yych = *++YYCURSOR; + if (yych <= '/') goto yy195; + if (yych >= ':') goto yy195; +yy197: + YYDEBUG(197, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(197, *YYCURSOR); - if (yych <= '/') goto yy190; - if (yych <= '9') goto yy196; - goto yy190; -yy198: YYDEBUG(198, *YYCURSOR); - yych = *++YYCURSOR; - if (yybm[0+yych] & 32) { - goto yy203; - } - goto yy194; + if (yych <= '/') goto yy191; + if (yych <= '9') goto yy197; + goto yy191; yy199: YYDEBUG(199, *YYCURSOR); yych = *++YYCURSOR; - if (yybm[0+yych] & 16) { - goto yy200; + if (yybm[0+yych] & 32) { + goto yy204; } - goto yy194; + goto yy195; yy200: YYDEBUG(200, *YYCURSOR); + yych = *++YYCURSOR; + if (yybm[0+yych] & 16) { + goto yy201; + } + goto yy195; +yy201: + YYDEBUG(201, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(201, *YYCURSOR); + YYDEBUG(202, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy200; + goto yy201; } - YYDEBUG(202, *YYCURSOR); + YYDEBUG(203, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1491 "Zend/zend_language_scanner.l" +#line 1495 "Zend/zend_language_scanner.l" { char *bin = yytext + 2; /* Skip "0b" */ int len = yyleng - 2; @@ -3298,19 +3299,19 @@ yy200: return T_DNUMBER; } } -#line 3302 "Zend/zend_language_scanner.c" -yy203: - YYDEBUG(203, *YYCURSOR); +#line 3303 "Zend/zend_language_scanner.c" +yy204: + YYDEBUG(204, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(204, *YYCURSOR); + YYDEBUG(205, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy203; + goto yy204; } - YYDEBUG(205, *YYCURSOR); + YYDEBUG(206, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1532 "Zend/zend_language_scanner.l" +#line 1536 "Zend/zend_language_scanner.l" { char *hex = yytext + 2; /* Skip "0x" */ int len = yyleng - 2; @@ -3333,150 +3334,127 @@ yy203: return T_DNUMBER; } } -#line 3337 "Zend/zend_language_scanner.c" -yy206: - YYDEBUG(206, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy208; - if (yych == '\r') goto yy209; +#line 3338 "Zend/zend_language_scanner.c" yy207: YYDEBUG(207, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1840 "Zend/zend_language_scanner.l" - { - BEGIN(INITIAL); - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ -} -#line 3351 "Zend/zend_language_scanner.c" -yy208: - YYDEBUG(208, *YYCURSOR); - yych = *++YYCURSOR; - goto yy207; -yy209: - YYDEBUG(209, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy208; - goto yy207; -yy210: - YYDEBUG(210, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(211, *YYCURSOR); + YYDEBUG(208, *YYCURSOR); if (yych <= '^') { if (yych <= '9') { - if (yych >= '0') goto yy210; + if (yych >= '0') goto yy207; } else { - if (yych <= '@') goto yy212; - if (yych <= 'Z') goto yy210; + if (yych <= '@') goto yy209; + if (yych <= 'Z') goto yy207; } } else { if (yych <= '`') { - if (yych <= '_') goto yy210; + if (yych <= '_') goto yy207; } else { - if (yych <= 'z') goto yy210; - if (yych >= 0x7F) goto yy210; + if (yych <= 'z') goto yy207; + if (yych >= 0x7F) goto yy207; } } -yy212: - YYDEBUG(212, *YYCURSOR); +yy209: + YYDEBUG(209, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1744 "Zend/zend_language_scanner.l" +#line 1748 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 3390 "Zend/zend_language_scanner.c" -yy213: - YYDEBUG(213, *YYCURSOR); +#line 3368 "Zend/zend_language_scanner.c" +yy210: + YYDEBUG(210, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy214; - if (yych != 'r') goto yy187; -yy214: - YYDEBUG(214, *YYCURSOR); + if (yych == 'R') goto yy211; + if (yych != 'r') goto yy188; +yy211: + YYDEBUG(211, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(215, *YYCURSOR); + YYDEBUG(212, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1437 "Zend/zend_language_scanner.l" +#line 1441 "Zend/zend_language_scanner.l" { return T_LOGICAL_XOR; } -#line 3408 "Zend/zend_language_scanner.c" -yy216: - YYDEBUG(216, *YYCURSOR); +#line 3386 "Zend/zend_language_scanner.c" +yy213: + YYDEBUG(213, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(217, *YYCURSOR); + YYDEBUG(214, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1429 "Zend/zend_language_scanner.l" +#line 1433 "Zend/zend_language_scanner.l" { return T_LOGICAL_OR; } -#line 3421 "Zend/zend_language_scanner.c" -yy218: - YYDEBUG(218, *YYCURSOR); +#line 3399 "Zend/zend_language_scanner.c" +yy215: + YYDEBUG(215, *YYCURSOR); ++YYCURSOR; - YYDEBUG(219, *YYCURSOR); + YYDEBUG(216, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1417 "Zend/zend_language_scanner.l" +#line 1421 "Zend/zend_language_scanner.l" { return T_XOR_EQUAL; } -#line 3431 "Zend/zend_language_scanner.c" -yy220: - YYDEBUG(220, *YYCURSOR); +#line 3409 "Zend/zend_language_scanner.c" +yy217: + YYDEBUG(217, *YYCURSOR); ++YYCURSOR; - YYDEBUG(221, *YYCURSOR); + YYDEBUG(218, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1421 "Zend/zend_language_scanner.l" +#line 1425 "Zend/zend_language_scanner.l" { return T_BOOLEAN_OR; } -#line 3441 "Zend/zend_language_scanner.c" -yy222: - YYDEBUG(222, *YYCURSOR); +#line 3419 "Zend/zend_language_scanner.c" +yy219: + YYDEBUG(219, *YYCURSOR); ++YYCURSOR; - YYDEBUG(223, *YYCURSOR); + YYDEBUG(220, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1413 "Zend/zend_language_scanner.l" +#line 1417 "Zend/zend_language_scanner.l" { return T_OR_EQUAL; } -#line 3451 "Zend/zend_language_scanner.c" -yy224: - YYDEBUG(224, *YYCURSOR); +#line 3429 "Zend/zend_language_scanner.c" +yy221: + YYDEBUG(221, *YYCURSOR); ++YYCURSOR; - YYDEBUG(225, *YYCURSOR); + YYDEBUG(222, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1425 "Zend/zend_language_scanner.l" +#line 1429 "Zend/zend_language_scanner.l" { return T_BOOLEAN_AND; } -#line 3461 "Zend/zend_language_scanner.c" -yy226: - YYDEBUG(226, *YYCURSOR); +#line 3439 "Zend/zend_language_scanner.c" +yy223: + YYDEBUG(223, *YYCURSOR); ++YYCURSOR; - YYDEBUG(227, *YYCURSOR); + YYDEBUG(224, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1409 "Zend/zend_language_scanner.l" +#line 1413 "Zend/zend_language_scanner.l" { return T_AND_EQUAL; } -#line 3471 "Zend/zend_language_scanner.c" -yy228: - YYDEBUG(228, *YYCURSOR); +#line 3449 "Zend/zend_language_scanner.c" +yy225: + YYDEBUG(225, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy232; - if (yych == '\r') goto yy233; -yy229: - YYDEBUG(229, *YYCURSOR); + if ((yych = *YYCURSOR) == '\n') goto yy229; + if (yych == '\r') goto yy230; +yy226: + YYDEBUG(226, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1846 "Zend/zend_language_scanner.l" +#line 1850 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { BEGIN(INITIAL); @@ -3486,35 +3464,35 @@ yy229: return yytext[0]; } } -#line 3490 "Zend/zend_language_scanner.c" -yy230: - YYDEBUG(230, *YYCURSOR); +#line 3468 "Zend/zend_language_scanner.c" +yy227: + YYDEBUG(227, *YYCURSOR); ++YYCURSOR; - YYDEBUG(231, *YYCURSOR); + YYDEBUG(228, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1397 "Zend/zend_language_scanner.l" +#line 1401 "Zend/zend_language_scanner.l" { return T_MOD_EQUAL; } -#line 3500 "Zend/zend_language_scanner.c" -yy232: - YYDEBUG(232, *YYCURSOR); +#line 3478 "Zend/zend_language_scanner.c" +yy229: + YYDEBUG(229, *YYCURSOR); yych = *++YYCURSOR; - goto yy229; -yy233: - YYDEBUG(233, *YYCURSOR); + goto yy226; +yy230: + YYDEBUG(230, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy232; - goto yy229; -yy234: - YYDEBUG(234, *YYCURSOR); + if (yych == '\n') goto yy229; + goto yy226; +yy231: + YYDEBUG(231, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); - if (yych == '*') goto yy239; -yy235: - YYDEBUG(235, *YYCURSOR); + if (yych == '*') goto yy236; +yy232: + YYDEBUG(232, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1807 "Zend/zend_language_scanner.l" +#line 1811 "Zend/zend_language_scanner.l" { int doc_com; @@ -3547,302 +3525,324 @@ yy235: return T_COMMENT; } -#line 3551 "Zend/zend_language_scanner.c" -yy236: - YYDEBUG(236, *YYCURSOR); +#line 3529 "Zend/zend_language_scanner.c" +yy233: + YYDEBUG(233, *YYCURSOR); yych = *++YYCURSOR; - goto yy177; -yy237: - YYDEBUG(237, *YYCURSOR); + goto yy178; +yy234: + YYDEBUG(234, *YYCURSOR); ++YYCURSOR; - YYDEBUG(238, *YYCURSOR); + YYDEBUG(235, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1389 "Zend/zend_language_scanner.l" +#line 1393 "Zend/zend_language_scanner.l" { return T_DIV_EQUAL; } -#line 3565 "Zend/zend_language_scanner.c" -yy239: - YYDEBUG(239, *YYCURSOR); +#line 3543 "Zend/zend_language_scanner.c" +yy236: + YYDEBUG(236, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { - goto yy240; + goto yy237; } - goto yy194; -yy240: - YYDEBUG(240, *YYCURSOR); + goto yy195; +yy237: + YYDEBUG(237, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(241, *YYCURSOR); + YYDEBUG(238, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy240; + goto yy237; } - goto yy235; -yy242: - YYDEBUG(242, *YYCURSOR); + goto yy232; +yy239: + YYDEBUG(239, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy246; - YYDEBUG(243, *YYCURSOR); + if ((yych = *YYCURSOR) == '=') goto yy243; + YYDEBUG(240, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1381 "Zend/zend_language_scanner.l" +#line 1385 "Zend/zend_language_scanner.l" { return T_POW; } -#line 3593 "Zend/zend_language_scanner.c" -yy244: - YYDEBUG(244, *YYCURSOR); +#line 3571 "Zend/zend_language_scanner.c" +yy241: + YYDEBUG(241, *YYCURSOR); ++YYCURSOR; - YYDEBUG(245, *YYCURSOR); + YYDEBUG(242, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1377 "Zend/zend_language_scanner.l" +#line 1381 "Zend/zend_language_scanner.l" { return T_MUL_EQUAL; } -#line 3603 "Zend/zend_language_scanner.c" -yy246: - YYDEBUG(246, *YYCURSOR); +#line 3581 "Zend/zend_language_scanner.c" +yy243: + YYDEBUG(243, *YYCURSOR); ++YYCURSOR; - YYDEBUG(247, *YYCURSOR); + YYDEBUG(244, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1385 "Zend/zend_language_scanner.l" +#line 1389 "Zend/zend_language_scanner.l" { return T_POW_EQUAL; } -#line 3613 "Zend/zend_language_scanner.c" -yy248: - YYDEBUG(248, *YYCURSOR); +#line 3591 "Zend/zend_language_scanner.c" +yy245: + YYDEBUG(245, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy252; - YYDEBUG(249, *YYCURSOR); + if ((yych = *YYCURSOR) == '=') goto yy249; + YYDEBUG(246, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1445 "Zend/zend_language_scanner.l" +#line 1449 "Zend/zend_language_scanner.l" { return T_SR; } -#line 3624 "Zend/zend_language_scanner.c" -yy250: - YYDEBUG(250, *YYCURSOR); +#line 3602 "Zend/zend_language_scanner.c" +yy247: + YYDEBUG(247, *YYCURSOR); ++YYCURSOR; - YYDEBUG(251, *YYCURSOR); + YYDEBUG(248, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1365 "Zend/zend_language_scanner.l" +#line 1369 "Zend/zend_language_scanner.l" { return T_IS_GREATER_OR_EQUAL; } -#line 3634 "Zend/zend_language_scanner.c" -yy252: - YYDEBUG(252, *YYCURSOR); +#line 3612 "Zend/zend_language_scanner.c" +yy249: + YYDEBUG(249, *YYCURSOR); ++YYCURSOR; - YYDEBUG(253, *YYCURSOR); + YYDEBUG(250, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1405 "Zend/zend_language_scanner.l" +#line 1409 "Zend/zend_language_scanner.l" { return T_SR_EQUAL; } -#line 3644 "Zend/zend_language_scanner.c" -yy254: - YYDEBUG(254, *YYCURSOR); +#line 3622 "Zend/zend_language_scanner.c" +yy251: + YYDEBUG(251, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ';') goto yy255; - if (yych <= '<') goto yy270; - if (yych <= '=') goto yy268; -yy255: - YYDEBUG(255, *YYCURSOR); + if (yych <= ';') goto yy252; + if (yych <= '<') goto yy271; + if (yych <= '=') goto yy269; +yy252: + YYDEBUG(252, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1441 "Zend/zend_language_scanner.l" +#line 1445 "Zend/zend_language_scanner.l" { return T_SL; } -#line 3659 "Zend/zend_language_scanner.c" +#line 3637 "Zend/zend_language_scanner.c" +yy253: + YYDEBUG(253, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'S') goto yy258; + if (yych == 's') goto yy258; + goto yy195; +yy254: + YYDEBUG(254, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(255, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1365 "Zend/zend_language_scanner.l" + { + return T_IS_SMALLER_OR_EQUAL; +} +#line 3653 "Zend/zend_language_scanner.c" yy256: YYDEBUG(256, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy261; - if (yych == 's') goto yy261; - goto yy194; + ++YYCURSOR; yy257: YYDEBUG(257, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(258, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1361 "Zend/zend_language_scanner.l" { - return T_IS_SMALLER_OR_EQUAL; + return T_IS_NOT_EQUAL; } -#line 3675 "Zend/zend_language_scanner.c" +#line 3664 "Zend/zend_language_scanner.c" +yy258: + YYDEBUG(258, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy259; + if (yych != 'c') goto yy195; yy259: YYDEBUG(259, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych == 'R') goto yy260; + if (yych != 'r') goto yy195; yy260: YYDEBUG(260, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1357 "Zend/zend_language_scanner.l" - { - return T_IS_NOT_EQUAL; -} -#line 3686 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'I') goto yy261; + if (yych != 'i') goto yy195; yy261: YYDEBUG(261, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy262; - if (yych != 'c') goto yy194; + if (yych == 'P') goto yy262; + if (yych != 'p') goto yy195; yy262: YYDEBUG(262, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy263; - if (yych != 'r') goto yy194; + if (yych == 'T') goto yy263; + if (yych != 't') goto yy195; yy263: YYDEBUG(263, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy264; - if (yych != 'i') goto yy194; -yy264: - YYDEBUG(264, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy265; - if (yych != 'p') goto yy194; -yy265: - YYDEBUG(265, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy266; - if (yych != 't') goto yy194; -yy266: - YYDEBUG(266, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(267, *YYCURSOR); + YYDEBUG(264, *YYCURSOR); if (yych <= '\r') { - if (yych <= 0x08) goto yy194; - if (yych <= '\n') goto yy266; - if (yych <= '\f') goto yy194; - goto yy266; + if (yych <= 0x08) goto yy195; + if (yych <= '\n') goto yy263; + if (yych <= '\f') goto yy195; + goto yy263; } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy194; - goto yy266; + if (yych <= 0x1F) goto yy195; + goto yy263; } else { - if (yych == '>') goto yy206; - goto yy194; + if (yych != '>') goto yy195; } } +yy265: + YYDEBUG(265, *YYCURSOR); + ++YYCURSOR; + if ((yych = *YYCURSOR) == '\n') goto yy267; + if (yych == '\r') goto yy268; +yy266: + YYDEBUG(266, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1844 "Zend/zend_language_scanner.l" + { + BEGIN(INITIAL); + return T_CLOSE_TAG; /* implicit ';' at php-end tag */ +} +#line 3722 "Zend/zend_language_scanner.c" +yy267: + YYDEBUG(267, *YYCURSOR); + yych = *++YYCURSOR; + goto yy266; yy268: YYDEBUG(268, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych == '\n') goto yy267; + goto yy266; +yy269: YYDEBUG(269, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(270, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1401 "Zend/zend_language_scanner.l" +#line 1405 "Zend/zend_language_scanner.l" { return T_SL_EQUAL; } #line 3741 "Zend/zend_language_scanner.c" -yy270: - YYDEBUG(270, *YYCURSOR); +yy271: + YYDEBUG(271, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(271, *YYCURSOR); + YYDEBUG(272, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy270; + goto yy271; } if (yych <= 'Z') { if (yych <= '&') { - if (yych == '"') goto yy275; - goto yy194; + if (yych == '"') goto yy276; + goto yy195; } else { - if (yych <= '\'') goto yy274; - if (yych <= '@') goto yy194; + if (yych <= '\'') goto yy275; + if (yych <= '@') goto yy195; } } else { if (yych <= '`') { - if (yych != '_') goto yy194; + if (yych != '_') goto yy195; } else { - if (yych <= 'z') goto yy272; - if (yych <= '~') goto yy194; + if (yych <= 'z') goto yy273; + if (yych <= '~') goto yy195; } } -yy272: - YYDEBUG(272, *YYCURSOR); +yy273: + YYDEBUG(273, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(273, *YYCURSOR); + YYDEBUG(274, *YYCURSOR); if (yych <= '@') { if (yych <= '\f') { - if (yych == '\n') goto yy279; - goto yy194; + if (yych == '\n') goto yy280; + goto yy195; } else { - if (yych <= '\r') goto yy281; - if (yych <= '/') goto yy194; - if (yych <= '9') goto yy272; - goto yy194; + if (yych <= '\r') goto yy282; + if (yych <= '/') goto yy195; + if (yych <= '9') goto yy273; + goto yy195; } } else { if (yych <= '_') { - if (yych <= 'Z') goto yy272; - if (yych <= '^') goto yy194; - goto yy272; + if (yych <= 'Z') goto yy273; + if (yych <= '^') goto yy195; + goto yy273; } else { - if (yych <= '`') goto yy194; - if (yych <= 'z') goto yy272; - if (yych <= '~') goto yy194; - goto yy272; + if (yych <= '`') goto yy195; + if (yych <= 'z') goto yy273; + if (yych <= '~') goto yy195; + goto yy273; } } -yy274: - YYDEBUG(274, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\'') goto yy194; - if (yych <= '/') goto yy283; - if (yych <= '9') goto yy194; - goto yy283; yy275: YYDEBUG(275, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '"') goto yy194; - if (yych <= '/') goto yy277; - if (yych <= '9') goto yy194; - goto yy277; + if (yych == '\'') goto yy195; + if (yych <= '/') goto yy284; + if (yych <= '9') goto yy195; + goto yy284; yy276: YYDEBUG(276, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '"') goto yy195; + if (yych <= '/') goto yy278; + if (yych <= '9') goto yy195; + goto yy278; +yy277: + YYDEBUG(277, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; -yy277: - YYDEBUG(277, *YYCURSOR); +yy278: + YYDEBUG(278, *YYCURSOR); if (yych <= 'Z') { if (yych <= '/') { - if (yych != '"') goto yy194; + if (yych != '"') goto yy195; } else { - if (yych <= '9') goto yy276; - if (yych <= '@') goto yy194; - goto yy276; + if (yych <= '9') goto yy277; + if (yych <= '@') goto yy195; + goto yy277; } } else { if (yych <= '`') { - if (yych == '_') goto yy276; - goto yy194; + if (yych == '_') goto yy277; + goto yy195; } else { - if (yych <= 'z') goto yy276; - if (yych <= '~') goto yy194; - goto yy276; + if (yych <= 'z') goto yy277; + if (yych <= '~') goto yy195; + goto yy277; } } -yy278: - YYDEBUG(278, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy279; - if (yych == '\r') goto yy281; - goto yy194; yy279: YYDEBUG(279, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych == '\n') goto yy280; + if (yych == '\r') goto yy282; + goto yy195; yy280: YYDEBUG(280, *YYCURSOR); + ++YYCURSOR; +yy281: + YYDEBUG(281, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1969 "Zend/zend_language_scanner.l" +#line 1973 "Zend/zend_language_scanner.l" { char *s; int bprefix = (yytext[0] != '<') ? 1 : 0; @@ -3890,3238 +3890,3248 @@ yy280: return T_START_HEREDOC; } #line 3893 "Zend/zend_language_scanner.c" -yy281: - YYDEBUG(281, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy279; - goto yy280; yy282: YYDEBUG(282, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '\n') goto yy280; + goto yy281; +yy283: + YYDEBUG(283, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; -yy283: - YYDEBUG(283, *YYCURSOR); +yy284: + YYDEBUG(284, *YYCURSOR); if (yych <= 'Z') { if (yych <= '/') { - if (yych == '\'') goto yy278; - goto yy194; + if (yych == '\'') goto yy279; + goto yy195; } else { - if (yych <= '9') goto yy282; - if (yych <= '@') goto yy194; - goto yy282; + if (yych <= '9') goto yy283; + if (yych <= '@') goto yy195; + goto yy283; } } else { if (yych <= '`') { - if (yych == '_') goto yy282; - goto yy194; + if (yych == '_') goto yy283; + goto yy195; } else { - if (yych <= 'z') goto yy282; - if (yych <= '~') goto yy194; - goto yy282; + if (yych <= 'z') goto yy283; + if (yych <= '~') goto yy195; + goto yy283; } } -yy284: - YYDEBUG(284, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '=') goto yy260; +yy285: YYDEBUG(285, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych != '=') goto yy257; YYDEBUG(286, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(287, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1349 "Zend/zend_language_scanner.l" +#line 1353 "Zend/zend_language_scanner.l" { return T_IS_NOT_IDENTICAL; } #line 3937 "Zend/zend_language_scanner.c" -yy287: - YYDEBUG(287, *YYCURSOR); - ++YYCURSOR; +yy288: YYDEBUG(288, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(289, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1369 "Zend/zend_language_scanner.l" +#line 1373 "Zend/zend_language_scanner.l" { return T_PLUS_EQUAL; } #line 3947 "Zend/zend_language_scanner.c" -yy289: - YYDEBUG(289, *YYCURSOR); - ++YYCURSOR; +yy290: YYDEBUG(290, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(291, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1337 "Zend/zend_language_scanner.l" +#line 1341 "Zend/zend_language_scanner.l" { return T_INC; } #line 3957 "Zend/zend_language_scanner.c" -yy291: - YYDEBUG(291, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy292; - if (yych != 's') goto yy187; yy292: YYDEBUG(292, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy293; - if (yych != 't') goto yy187; + if (yych == 'S') goto yy293; + if (yych != 's') goto yy188; yy293: YYDEBUG(293, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy294; + if (yych != 't') goto yy188; +yy294: + YYDEBUG(294, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(294, *YYCURSOR); + YYDEBUG(295, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1325 "Zend/zend_language_scanner.l" +#line 1329 "Zend/zend_language_scanner.l" { return T_LIST; } #line 3980 "Zend/zend_language_scanner.c" -yy295: - YYDEBUG(295, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy299; +yy296: YYDEBUG(296, *YYCURSOR); + ++YYCURSOR; + if ((yych = *YYCURSOR) == '=') goto yy300; + YYDEBUG(297, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1353 "Zend/zend_language_scanner.l" +#line 1357 "Zend/zend_language_scanner.l" { return T_IS_EQUAL; } #line 3991 "Zend/zend_language_scanner.c" -yy297: - YYDEBUG(297, *YYCURSOR); - ++YYCURSOR; +yy298: YYDEBUG(298, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(299, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1321 "Zend/zend_language_scanner.l" +#line 1325 "Zend/zend_language_scanner.l" { return T_DOUBLE_ARROW; } #line 4001 "Zend/zend_language_scanner.c" -yy299: - YYDEBUG(299, *YYCURSOR); - ++YYCURSOR; +yy300: YYDEBUG(300, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(301, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1345 "Zend/zend_language_scanner.l" +#line 1349 "Zend/zend_language_scanner.l" { return T_IS_IDENTICAL; } #line 4011 "Zend/zend_language_scanner.c" -yy301: - YYDEBUG(301, *YYCURSOR); +yy302: + YYDEBUG(302, *YYCURSOR); yych = *++YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 'C': - case 'c': goto yy303; + case 'c': goto yy304; case 'D': - case 'd': goto yy308; + case 'd': goto yy309; case 'F': - case 'f': goto yy305; + case 'f': goto yy306; case 'H': - case 'h': goto yy302; + case 'h': goto yy303; case 'L': - case 'l': goto yy307; + case 'l': goto yy308; case 'M': - case 'm': goto yy306; + case 'm': goto yy307; case 'N': - case 'n': goto yy309; + case 'n': goto yy310; case 'T': - case 't': goto yy304; - default: goto yy187; + case 't': goto yy305; + default: goto yy188; } -yy302: - YYDEBUG(302, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy370; - if (yych == 'a') goto yy370; - goto yy187; yy303: YYDEBUG(303, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy363; - if (yych == 'l') goto yy363; - goto yy187; + if (yych == 'A') goto yy371; + if (yych == 'a') goto yy371; + goto yy188; yy304: YYDEBUG(304, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy356; - if (yych == 'r') goto yy356; - goto yy187; + if (yych == 'L') goto yy364; + if (yych == 'l') goto yy364; + goto yy188; yy305: YYDEBUG(305, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'R') goto yy357; + if (yych == 'r') goto yy357; + goto yy188; +yy306: + YYDEBUG(306, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= 'U') { - if (yych == 'I') goto yy340; - if (yych <= 'T') goto yy187; - goto yy341; + if (yych == 'I') goto yy341; + if (yych <= 'T') goto yy188; + goto yy342; } else { if (yych <= 'i') { - if (yych <= 'h') goto yy187; - goto yy340; + if (yych <= 'h') goto yy188; + goto yy341; } else { - if (yych == 'u') goto yy341; - goto yy187; + if (yych == 'u') goto yy342; + goto yy188; } } -yy306: - YYDEBUG(306, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy332; - if (yych == 'e') goto yy332; - goto yy187; yy307: YYDEBUG(307, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy326; - if (yych == 'i') goto yy326; - goto yy187; + if (yych == 'E') goto yy333; + if (yych == 'e') goto yy333; + goto yy188; yy308: YYDEBUG(308, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy321; - if (yych == 'i') goto yy321; - goto yy187; + if (yych == 'I') goto yy327; + if (yych == 'i') goto yy327; + goto yy188; yy309: YYDEBUG(309, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy310; - if (yych != 'a') goto yy187; + if (yych == 'I') goto yy322; + if (yych == 'i') goto yy322; + goto yy188; yy310: YYDEBUG(310, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy311; - if (yych != 'm') goto yy187; + if (yych == 'A') goto yy311; + if (yych != 'a') goto yy188; yy311: YYDEBUG(311, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy312; - if (yych != 'e') goto yy187; + if (yych == 'M') goto yy312; + if (yych != 'm') goto yy188; yy312: YYDEBUG(312, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy313; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy313; + if (yych != 'e') goto yy188; yy313: YYDEBUG(313, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy314; - if (yych != 'p') goto yy187; + if (yych == 'S') goto yy314; + if (yych != 's') goto yy188; yy314: YYDEBUG(314, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy315; - if (yych != 'a') goto yy187; + if (yych == 'P') goto yy315; + if (yych != 'p') goto yy188; yy315: YYDEBUG(315, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy316; - if (yych != 'c') goto yy187; + if (yych == 'A') goto yy316; + if (yych != 'a') goto yy188; yy316: YYDEBUG(316, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy317; - if (yych != 'e') goto yy187; + if (yych == 'C') goto yy317; + if (yych != 'c') goto yy188; yy317: YYDEBUG(317, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'E') goto yy318; + if (yych != 'e') goto yy188; +yy318: YYDEBUG(318, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(319, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(320, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(320, *YYCURSOR); + YYDEBUG(321, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1602 "Zend/zend_language_scanner.l" +#line 1606 "Zend/zend_language_scanner.l" { return T_NS_C; } #line 4145 "Zend/zend_language_scanner.c" -yy321: - YYDEBUG(321, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy322; - if (yych != 'r') goto yy187; yy322: YYDEBUG(322, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'R') goto yy323; + if (yych != 'r') goto yy188; +yy323: YYDEBUG(323, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(324, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(325, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(325, *YYCURSOR); + YYDEBUG(326, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1598 "Zend/zend_language_scanner.l" +#line 1602 "Zend/zend_language_scanner.l" { return T_DIR; } #line 4169 "Zend/zend_language_scanner.c" -yy326: - YYDEBUG(326, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy327; - if (yych != 'n') goto yy187; yy327: YYDEBUG(327, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy328; - if (yych != 'e') goto yy187; + if (yych == 'N') goto yy328; + if (yych != 'n') goto yy188; yy328: YYDEBUG(328, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'E') goto yy329; + if (yych != 'e') goto yy188; +yy329: YYDEBUG(329, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(330, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(331, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(331, *YYCURSOR); + YYDEBUG(332, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1590 "Zend/zend_language_scanner.l" +#line 1594 "Zend/zend_language_scanner.l" { return T_LINE; } #line 4198 "Zend/zend_language_scanner.c" -yy332: - YYDEBUG(332, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy333; - if (yych != 't') goto yy187; yy333: YYDEBUG(333, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy334; - if (yych != 'h') goto yy187; + if (yych == 'T') goto yy334; + if (yych != 't') goto yy188; yy334: YYDEBUG(334, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy335; - if (yych != 'o') goto yy187; + if (yych == 'H') goto yy335; + if (yych != 'h') goto yy188; yy335: YYDEBUG(335, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy336; - if (yych != 'd') goto yy187; + if (yych == 'O') goto yy336; + if (yych != 'o') goto yy188; yy336: YYDEBUG(336, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'D') goto yy337; + if (yych != 'd') goto yy188; +yy337: YYDEBUG(337, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(338, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(339, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(339, *YYCURSOR); + YYDEBUG(340, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1586 "Zend/zend_language_scanner.l" +#line 1590 "Zend/zend_language_scanner.l" { return T_METHOD_C; } #line 4237 "Zend/zend_language_scanner.c" -yy340: - YYDEBUG(340, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy351; - if (yych == 'l') goto yy351; - goto yy187; yy341: YYDEBUG(341, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy342; - if (yych != 'n') goto yy187; + if (yych == 'L') goto yy352; + if (yych == 'l') goto yy352; + goto yy188; yy342: YYDEBUG(342, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy343; - if (yych != 'c') goto yy187; + if (yych == 'N') goto yy343; + if (yych != 'n') goto yy188; yy343: YYDEBUG(343, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy344; - if (yych != 't') goto yy187; + if (yych == 'C') goto yy344; + if (yych != 'c') goto yy188; yy344: YYDEBUG(344, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy345; - if (yych != 'i') goto yy187; + if (yych == 'T') goto yy345; + if (yych != 't') goto yy188; yy345: YYDEBUG(345, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy346; - if (yych != 'o') goto yy187; + if (yych == 'I') goto yy346; + if (yych != 'i') goto yy188; yy346: YYDEBUG(346, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy347; - if (yych != 'n') goto yy187; + if (yych == 'O') goto yy347; + if (yych != 'o') goto yy188; yy347: YYDEBUG(347, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'N') goto yy348; + if (yych != 'n') goto yy188; +yy348: YYDEBUG(348, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(349, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(350, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(350, *YYCURSOR); + YYDEBUG(351, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1582 "Zend/zend_language_scanner.l" +#line 1586 "Zend/zend_language_scanner.l" { return T_FUNC_C; } #line 4292 "Zend/zend_language_scanner.c" -yy351: - YYDEBUG(351, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy352; - if (yych != 'e') goto yy187; yy352: YYDEBUG(352, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'E') goto yy353; + if (yych != 'e') goto yy188; +yy353: YYDEBUG(353, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(354, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(355, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(355, *YYCURSOR); + YYDEBUG(356, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1594 "Zend/zend_language_scanner.l" +#line 1598 "Zend/zend_language_scanner.l" { return T_FILE; } #line 4316 "Zend/zend_language_scanner.c" -yy356: - YYDEBUG(356, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy357; - if (yych != 'a') goto yy187; yy357: YYDEBUG(357, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy358; - if (yych != 'i') goto yy187; + if (yych == 'A') goto yy358; + if (yych != 'a') goto yy188; yy358: YYDEBUG(358, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy359; - if (yych != 't') goto yy187; + if (yych == 'I') goto yy359; + if (yych != 'i') goto yy188; yy359: YYDEBUG(359, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'T') goto yy360; + if (yych != 't') goto yy188; +yy360: YYDEBUG(360, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(361, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(362, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(362, *YYCURSOR); + YYDEBUG(363, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1578 "Zend/zend_language_scanner.l" +#line 1582 "Zend/zend_language_scanner.l" { return T_TRAIT_C; } #line 4350 "Zend/zend_language_scanner.c" -yy363: - YYDEBUG(363, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy364; - if (yych != 'a') goto yy187; yy364: YYDEBUG(364, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy365; - if (yych != 's') goto yy187; + if (yych == 'A') goto yy365; + if (yych != 'a') goto yy188; yy365: YYDEBUG(365, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy366; - if (yych != 's') goto yy187; + if (yych != 's') goto yy188; yy366: YYDEBUG(366, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'S') goto yy367; + if (yych != 's') goto yy188; +yy367: YYDEBUG(367, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych != '_') goto yy188; YYDEBUG(368, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy188; + YYDEBUG(369, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(369, *YYCURSOR); + YYDEBUG(370, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1574 "Zend/zend_language_scanner.l" +#line 1578 "Zend/zend_language_scanner.l" { return T_CLASS_C; } #line 4384 "Zend/zend_language_scanner.c" -yy370: - YYDEBUG(370, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy371; - if (yych != 'l') goto yy187; yy371: YYDEBUG(371, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy372; - if (yych != 't') goto yy187; + if (yych == 'L') goto yy372; + if (yych != 'l') goto yy188; yy372: YYDEBUG(372, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'T') goto yy373; + if (yych != 't') goto yy188; +yy373: YYDEBUG(373, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy374; - if (yych != 'c') goto yy187; -yy374: + if (yych != '_') goto yy188; YYDEBUG(374, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy375; - if (yych != 'o') goto yy187; + if (yych == 'C') goto yy375; + if (yych != 'c') goto yy188; yy375: YYDEBUG(375, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy376; - if (yych != 'm') goto yy187; + if (yych == 'O') goto yy376; + if (yych != 'o') goto yy188; yy376: YYDEBUG(376, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy377; - if (yych != 'p') goto yy187; + if (yych == 'M') goto yy377; + if (yych != 'm') goto yy188; yy377: YYDEBUG(377, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy378; - if (yych != 'i') goto yy187; + if (yych == 'P') goto yy378; + if (yych != 'p') goto yy188; yy378: YYDEBUG(378, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy379; - if (yych != 'l') goto yy187; + if (yych == 'I') goto yy379; + if (yych != 'i') goto yy188; yy379: YYDEBUG(379, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy380; - if (yych != 'e') goto yy187; + if (yych == 'L') goto yy380; + if (yych != 'l') goto yy188; yy380: YYDEBUG(380, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy381; - if (yych != 'r') goto yy187; + if (yych == 'E') goto yy381; + if (yych != 'e') goto yy188; yy381: YYDEBUG(381, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'R') goto yy382; + if (yych != 'r') goto yy188; +yy382: + YYDEBUG(382, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(382, *YYCURSOR); + YYDEBUG(383, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1289 "Zend/zend_language_scanner.l" +#line 1293 "Zend/zend_language_scanner.l" { return T_HALT_COMPILER; } #line 4450 "Zend/zend_language_scanner.c" -yy383: - YYDEBUG(383, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy387; - if (yych == 's') goto yy387; - goto yy187; yy384: YYDEBUG(384, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy385; - if (yych != 'e') goto yy187; + if (yych == 'S') goto yy388; + if (yych == 's') goto yy388; + goto yy188; yy385: YYDEBUG(385, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy386; + if (yych != 'e') goto yy188; +yy386: + YYDEBUG(386, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(386, *YYCURSOR); + YYDEBUG(387, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1269 "Zend/zend_language_scanner.l" +#line 1273 "Zend/zend_language_scanner.l" { return T_USE; } #line 4474 "Zend/zend_language_scanner.c" -yy387: - YYDEBUG(387, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy388; - if (yych != 'e') goto yy187; yy388: YYDEBUG(388, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy389; - if (yych != 't') goto yy187; + if (yych == 'E') goto yy389; + if (yych != 'e') goto yy188; yy389: YYDEBUG(389, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy390; + if (yych != 't') goto yy188; +yy390: + YYDEBUG(390, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(390, *YYCURSOR); + YYDEBUG(391, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1317 "Zend/zend_language_scanner.l" +#line 1321 "Zend/zend_language_scanner.l" { return T_UNSET; } #line 4497 "Zend/zend_language_scanner.c" -yy391: - YYDEBUG(391, *YYCURSOR); +yy392: + YYDEBUG(392, *YYCURSOR); ++YYCURSOR; YYFILL(7); yych = *YYCURSOR; -yy392: - YYDEBUG(392, *YYCURSOR); +yy393: + YYDEBUG(393, *YYCURSOR); if (yych <= 'S') { if (yych <= 'D') { if (yych <= ' ') { - if (yych == '\t') goto yy391; - if (yych <= 0x1F) goto yy194; - goto yy391; + if (yych == '\t') goto yy392; + if (yych <= 0x1F) goto yy195; + goto yy392; } else { if (yych <= 'A') { - if (yych <= '@') goto yy194; - goto yy396; + if (yych <= '@') goto yy195; + goto yy397; } else { - if (yych <= 'B') goto yy394; - if (yych <= 'C') goto yy194; - goto yy399; + if (yych <= 'B') goto yy395; + if (yych <= 'C') goto yy195; + goto yy400; } } } else { if (yych <= 'I') { - if (yych == 'F') goto yy400; - if (yych <= 'H') goto yy194; - goto yy401; + if (yych == 'F') goto yy401; + if (yych <= 'H') goto yy195; + goto yy402; } else { if (yych <= 'O') { - if (yych <= 'N') goto yy194; - goto yy395; + if (yych <= 'N') goto yy195; + goto yy396; } else { - if (yych <= 'Q') goto yy194; - if (yych <= 'R') goto yy398; - goto yy397; + if (yych <= 'Q') goto yy195; + if (yych <= 'R') goto yy399; + goto yy398; } } } } else { if (yych <= 'f') { if (yych <= 'a') { - if (yych == 'U') goto yy393; - if (yych <= '`') goto yy194; - goto yy396; + if (yych == 'U') goto yy394; + if (yych <= '`') goto yy195; + goto yy397; } else { if (yych <= 'c') { - if (yych <= 'b') goto yy394; - goto yy194; + if (yych <= 'b') goto yy395; + goto yy195; } else { - if (yych <= 'd') goto yy399; - if (yych <= 'e') goto yy194; - goto yy400; + if (yych <= 'd') goto yy400; + if (yych <= 'e') goto yy195; + goto yy401; } } } else { if (yych <= 'q') { if (yych <= 'i') { - if (yych <= 'h') goto yy194; - goto yy401; + if (yych <= 'h') goto yy195; + goto yy402; } else { - if (yych == 'o') goto yy395; - goto yy194; + if (yych == 'o') goto yy396; + goto yy195; } } else { if (yych <= 's') { - if (yych <= 'r') goto yy398; - goto yy397; + if (yych <= 'r') goto yy399; + goto yy398; } else { - if (yych != 'u') goto yy194; + if (yych != 'u') goto yy195; } } } } -yy393: - YYDEBUG(393, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy460; - if (yych == 'n') goto yy460; - goto yy194; yy394: YYDEBUG(394, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'N') goto yy461; + if (yych == 'n') goto yy461; + goto yy195; +yy395: + YYDEBUG(395, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'I') goto yy447; - if (yych <= 'N') goto yy194; - goto yy448; + if (yych == 'I') goto yy448; + if (yych <= 'N') goto yy195; + goto yy449; } else { if (yych <= 'i') { - if (yych <= 'h') goto yy194; - goto yy447; + if (yych <= 'h') goto yy195; + goto yy448; } else { - if (yych == 'o') goto yy448; - goto yy194; + if (yych == 'o') goto yy449; + goto yy195; } } -yy395: - YYDEBUG(395, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy439; - if (yych == 'b') goto yy439; - goto yy194; yy396: YYDEBUG(396, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy432; - if (yych == 'r') goto yy432; - goto yy194; + if (yych == 'B') goto yy440; + if (yych == 'b') goto yy440; + goto yy195; yy397: YYDEBUG(397, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy424; - if (yych == 't') goto yy424; - goto yy194; + if (yych == 'R') goto yy433; + if (yych == 'r') goto yy433; + goto yy195; yy398: YYDEBUG(398, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy422; - if (yych == 'e') goto yy422; - goto yy194; + if (yych == 'T') goto yy425; + if (yych == 't') goto yy425; + goto yy195; yy399: YYDEBUG(399, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy418; - if (yych == 'o') goto yy418; - goto yy194; + if (yych == 'E') goto yy423; + if (yych == 'e') goto yy423; + goto yy195; yy400: YYDEBUG(400, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy411; - if (yych == 'l') goto yy411; - goto yy194; + if (yych == 'O') goto yy419; + if (yych == 'o') goto yy419; + goto yy195; yy401: YYDEBUG(401, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy402; - if (yych != 'n') goto yy194; + if (yych == 'L') goto yy412; + if (yych == 'l') goto yy412; + goto yy195; yy402: YYDEBUG(402, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy403; - if (yych != 't') goto yy194; + if (yych == 'N') goto yy403; + if (yych != 'n') goto yy195; yy403: YYDEBUG(403, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy404; - if (yych != 'e') goto yy406; + if (yych == 'T') goto yy404; + if (yych != 't') goto yy195; yy404: YYDEBUG(404, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'G') goto yy409; - if (yych == 'g') goto yy409; - goto yy194; + if (yych == 'E') goto yy405; + if (yych != 'e') goto yy407; yy405: YYDEBUG(405, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'G') goto yy410; + if (yych == 'g') goto yy410; + goto yy195; +yy406: + YYDEBUG(406, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy406: - YYDEBUG(406, *YYCURSOR); +yy407: + YYDEBUG(407, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy405; - goto yy194; + if (yych == '\t') goto yy406; + goto yy195; } else { - if (yych <= ' ') goto yy405; - if (yych != ')') goto yy194; + if (yych <= ' ') goto yy406; + if (yych != ')') goto yy195; } - YYDEBUG(407, *YYCURSOR); - ++YYCURSOR; YYDEBUG(408, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(409, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1217 "Zend/zend_language_scanner.l" +#line 1221 "Zend/zend_language_scanner.l" { return T_INT_CAST; } #line 4673 "Zend/zend_language_scanner.c" -yy409: - YYDEBUG(409, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy410; - if (yych != 'e') goto yy194; yy410: YYDEBUG(410, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy405; - if (yych == 'r') goto yy405; - goto yy194; + if (yych == 'E') goto yy411; + if (yych != 'e') goto yy195; yy411: YYDEBUG(411, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy412; - if (yych != 'o') goto yy194; + if (yych == 'R') goto yy406; + if (yych == 'r') goto yy406; + goto yy195; yy412: YYDEBUG(412, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy413; - if (yych != 'a') goto yy194; + if (yych == 'O') goto yy413; + if (yych != 'o') goto yy195; yy413: YYDEBUG(413, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy414; - if (yych != 't') goto yy194; + if (yych == 'A') goto yy414; + if (yych != 'a') goto yy195; yy414: YYDEBUG(414, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy415; + if (yych != 't') goto yy195; +yy415: + YYDEBUG(415, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(415, *YYCURSOR); + YYDEBUG(416, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy414; - goto yy194; + if (yych == '\t') goto yy415; + goto yy195; } else { - if (yych <= ' ') goto yy414; - if (yych != ')') goto yy194; + if (yych <= ' ') goto yy415; + if (yych != ')') goto yy195; } - YYDEBUG(416, *YYCURSOR); - ++YYCURSOR; YYDEBUG(417, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(418, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1221 "Zend/zend_language_scanner.l" +#line 1225 "Zend/zend_language_scanner.l" { return T_DOUBLE_CAST; } #line 4721 "Zend/zend_language_scanner.c" -yy418: - YYDEBUG(418, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy419; - if (yych != 'u') goto yy194; yy419: YYDEBUG(419, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy420; - if (yych != 'b') goto yy194; + if (yych == 'U') goto yy420; + if (yych != 'u') goto yy195; yy420: YYDEBUG(420, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy421; - if (yych != 'l') goto yy194; + if (yych == 'B') goto yy421; + if (yych != 'b') goto yy195; yy421: YYDEBUG(421, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy414; - if (yych == 'e') goto yy414; - goto yy194; + if (yych == 'L') goto yy422; + if (yych != 'l') goto yy195; yy422: YYDEBUG(422, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy423; - if (yych != 'a') goto yy194; + if (yych == 'E') goto yy415; + if (yych == 'e') goto yy415; + goto yy195; yy423: YYDEBUG(423, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy414; - if (yych == 'l') goto yy414; - goto yy194; + if (yych == 'A') goto yy424; + if (yych != 'a') goto yy195; yy424: YYDEBUG(424, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy425; - if (yych != 'r') goto yy194; + if (yych == 'L') goto yy415; + if (yych == 'l') goto yy415; + goto yy195; yy425: YYDEBUG(425, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy426; - if (yych != 'i') goto yy194; + if (yych == 'R') goto yy426; + if (yych != 'r') goto yy195; yy426: YYDEBUG(426, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy427; - if (yych != 'n') goto yy194; + if (yych == 'I') goto yy427; + if (yych != 'i') goto yy195; yy427: YYDEBUG(427, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'G') goto yy428; - if (yych != 'g') goto yy194; + if (yych == 'N') goto yy428; + if (yych != 'n') goto yy195; yy428: YYDEBUG(428, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'G') goto yy429; + if (yych != 'g') goto yy195; +yy429: + YYDEBUG(429, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(429, *YYCURSOR); + YYDEBUG(430, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy428; - goto yy194; + if (yych == '\t') goto yy429; + goto yy195; } else { - if (yych <= ' ') goto yy428; - if (yych != ')') goto yy194; + if (yych <= ' ') goto yy429; + if (yych != ')') goto yy195; } - YYDEBUG(430, *YYCURSOR); - ++YYCURSOR; YYDEBUG(431, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(432, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1225 "Zend/zend_language_scanner.l" +#line 1229 "Zend/zend_language_scanner.l" { return T_STRING_CAST; } #line 4795 "Zend/zend_language_scanner.c" -yy432: - YYDEBUG(432, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy433; - if (yych != 'r') goto yy194; yy433: YYDEBUG(433, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy434; - if (yych != 'a') goto yy194; + if (yych == 'R') goto yy434; + if (yych != 'r') goto yy195; yy434: YYDEBUG(434, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy435; - if (yych != 'y') goto yy194; + if (yych == 'A') goto yy435; + if (yych != 'a') goto yy195; yy435: YYDEBUG(435, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'Y') goto yy436; + if (yych != 'y') goto yy195; +yy436: + YYDEBUG(436, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(436, *YYCURSOR); + YYDEBUG(437, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy435; - goto yy194; + if (yych == '\t') goto yy436; + goto yy195; } else { - if (yych <= ' ') goto yy435; - if (yych != ')') goto yy194; + if (yych <= ' ') goto yy436; + if (yych != ')') goto yy195; } - YYDEBUG(437, *YYCURSOR); - ++YYCURSOR; YYDEBUG(438, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(439, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1229 "Zend/zend_language_scanner.l" +#line 1233 "Zend/zend_language_scanner.l" { return T_ARRAY_CAST; } #line 4832 "Zend/zend_language_scanner.c" -yy439: - YYDEBUG(439, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'J') goto yy440; - if (yych != 'j') goto yy194; yy440: YYDEBUG(440, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy441; - if (yych != 'e') goto yy194; + if (yych == 'J') goto yy441; + if (yych != 'j') goto yy195; yy441: YYDEBUG(441, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy442; - if (yych != 'c') goto yy194; + if (yych == 'E') goto yy442; + if (yych != 'e') goto yy195; yy442: YYDEBUG(442, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy443; - if (yych != 't') goto yy194; + if (yych == 'C') goto yy443; + if (yych != 'c') goto yy195; yy443: YYDEBUG(443, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy444; + if (yych != 't') goto yy195; +yy444: + YYDEBUG(444, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(444, *YYCURSOR); + YYDEBUG(445, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy443; - goto yy194; + if (yych == '\t') goto yy444; + goto yy195; } else { - if (yych <= ' ') goto yy443; - if (yych != ')') goto yy194; + if (yych <= ' ') goto yy444; + if (yych != ')') goto yy195; } - YYDEBUG(445, *YYCURSOR); - ++YYCURSOR; YYDEBUG(446, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(447, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1233 "Zend/zend_language_scanner.l" +#line 1237 "Zend/zend_language_scanner.l" { return T_OBJECT_CAST; } #line 4874 "Zend/zend_language_scanner.c" -yy447: - YYDEBUG(447, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy457; - if (yych == 'n') goto yy457; - goto yy194; yy448: YYDEBUG(448, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy449; - if (yych != 'o') goto yy194; + if (yych == 'N') goto yy458; + if (yych == 'n') goto yy458; + goto yy195; yy449: YYDEBUG(449, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy450; - if (yych != 'l') goto yy194; + if (yych == 'O') goto yy450; + if (yych != 'o') goto yy195; yy450: YYDEBUG(450, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy455; - if (yych == 'e') goto yy455; - goto yy452; + if (yych == 'L') goto yy451; + if (yych != 'l') goto yy195; yy451: YYDEBUG(451, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy456; + if (yych == 'e') goto yy456; + goto yy453; +yy452: + YYDEBUG(452, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy452: - YYDEBUG(452, *YYCURSOR); +yy453: + YYDEBUG(453, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy451; - goto yy194; + if (yych == '\t') goto yy452; + goto yy195; } else { - if (yych <= ' ') goto yy451; - if (yych != ')') goto yy194; + if (yych <= ' ') goto yy452; + if (yych != ')') goto yy195; } - YYDEBUG(453, *YYCURSOR); - ++YYCURSOR; YYDEBUG(454, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(455, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1237 "Zend/zend_language_scanner.l" +#line 1241 "Zend/zend_language_scanner.l" { return T_BOOL_CAST; } #line 4919 "Zend/zend_language_scanner.c" -yy455: - YYDEBUG(455, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy456; - if (yych != 'a') goto yy194; yy456: YYDEBUG(456, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy451; - if (yych == 'n') goto yy451; - goto yy194; + if (yych == 'A') goto yy457; + if (yych != 'a') goto yy195; yy457: YYDEBUG(457, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy458; - if (yych != 'a') goto yy194; + if (yych == 'N') goto yy452; + if (yych == 'n') goto yy452; + goto yy195; yy458: YYDEBUG(458, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy459; - if (yych != 'r') goto yy194; + if (yych == 'A') goto yy459; + if (yych != 'a') goto yy195; yy459: YYDEBUG(459, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy428; - if (yych == 'y') goto yy428; - goto yy194; + if (yych == 'R') goto yy460; + if (yych != 'r') goto yy195; yy460: YYDEBUG(460, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy461; - if (yych != 's') goto yy194; + if (yych == 'Y') goto yy429; + if (yych == 'y') goto yy429; + goto yy195; yy461: YYDEBUG(461, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy462; - if (yych != 'e') goto yy194; + if (yych == 'S') goto yy462; + if (yych != 's') goto yy195; yy462: YYDEBUG(462, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy463; - if (yych != 't') goto yy194; + if (yych == 'E') goto yy463; + if (yych != 'e') goto yy195; yy463: YYDEBUG(463, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy464; + if (yych != 't') goto yy195; +yy464: + YYDEBUG(464, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(464, *YYCURSOR); + YYDEBUG(465, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy463; - goto yy194; + if (yych == '\t') goto yy464; + goto yy195; } else { - if (yych <= ' ') goto yy463; - if (yych != ')') goto yy194; + if (yych <= ' ') goto yy464; + if (yych != ')') goto yy195; } - YYDEBUG(465, *YYCURSOR); - ++YYCURSOR; YYDEBUG(466, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(467, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1241 "Zend/zend_language_scanner.l" +#line 1245 "Zend/zend_language_scanner.l" { return T_UNSET_CAST; } #line 4983 "Zend/zend_language_scanner.c" -yy467: - YYDEBUG(467, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy468; - if (yych != 'r') goto yy187; yy468: YYDEBUG(468, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'R') goto yy469; + if (yych != 'r') goto yy188; +yy469: + YYDEBUG(469, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(469, *YYCURSOR); + YYDEBUG(470, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1213 "Zend/zend_language_scanner.l" +#line 1217 "Zend/zend_language_scanner.l" { return T_VAR; } #line 5001 "Zend/zend_language_scanner.c" -yy470: - YYDEBUG(470, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy474; - if (yych == 'm') goto yy474; - goto yy187; yy471: YYDEBUG(471, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy472; - if (yych != 'w') goto yy187; + if (yych == 'M') goto yy475; + if (yych == 'm') goto yy475; + goto yy188; yy472: YYDEBUG(472, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'W') goto yy473; + if (yych != 'w') goto yy188; +yy473: + YYDEBUG(473, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(473, *YYCURSOR); + YYDEBUG(474, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1205 "Zend/zend_language_scanner.l" +#line 1209 "Zend/zend_language_scanner.l" { return T_NEW; } #line 5025 "Zend/zend_language_scanner.c" -yy474: - YYDEBUG(474, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy475; - if (yych != 'e') goto yy187; yy475: YYDEBUG(475, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy476; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy476; + if (yych != 'e') goto yy188; yy476: YYDEBUG(476, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy477; - if (yych != 'p') goto yy187; + if (yych == 'S') goto yy477; + if (yych != 's') goto yy188; yy477: YYDEBUG(477, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy478; - if (yych != 'a') goto yy187; + if (yych == 'P') goto yy478; + if (yych != 'p') goto yy188; yy478: YYDEBUG(478, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy479; - if (yych != 'c') goto yy187; + if (yych == 'A') goto yy479; + if (yych != 'a') goto yy188; yy479: YYDEBUG(479, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy480; - if (yych != 'e') goto yy187; + if (yych == 'C') goto yy480; + if (yych != 'c') goto yy188; yy480: YYDEBUG(480, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy481; + if (yych != 'e') goto yy188; +yy481: + YYDEBUG(481, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(481, *YYCURSOR); + YYDEBUG(482, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1265 "Zend/zend_language_scanner.l" +#line 1269 "Zend/zend_language_scanner.l" { return T_NAMESPACE; } #line 5068 "Zend/zend_language_scanner.c" -yy482: - YYDEBUG(482, *YYCURSOR); +yy483: + YYDEBUG(483, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(484, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1205 "Zend/zend_language_scanner.l" + { + return T_COALESCE; +} +#line 5078 "Zend/zend_language_scanner.c" +yy485: + YYDEBUG(485, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(483, *YYCURSOR); + YYDEBUG(486, *YYCURSOR); if (yych <= 'D') { - if (yych <= '/') goto yy190; - if (yych <= '9') goto yy482; - goto yy190; + if (yych <= '/') goto yy191; + if (yych <= '9') goto yy485; + goto yy191; } else { - if (yych <= 'E') goto yy193; - if (yych == 'e') goto yy193; - goto yy190; + if (yych <= 'E') goto yy194; + if (yych == 'e') goto yy194; + goto yy191; } -yy484: - YYDEBUG(484, *YYCURSOR); +yy487: + YYDEBUG(487, *YYCURSOR); ++YYCURSOR; - YYDEBUG(485, *YYCURSOR); + YYDEBUG(488, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1393 "Zend/zend_language_scanner.l" +#line 1397 "Zend/zend_language_scanner.l" { return T_CONCAT_EQUAL; } -#line 5094 "Zend/zend_language_scanner.c" -yy486: - YYDEBUG(486, *YYCURSOR); +#line 5104 "Zend/zend_language_scanner.c" +yy489: + YYDEBUG(489, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '.') goto yy194; - YYDEBUG(487, *YYCURSOR); + if (yych != '.') goto yy195; + YYDEBUG(490, *YYCURSOR); ++YYCURSOR; - YYDEBUG(488, *YYCURSOR); + YYDEBUG(491, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1201 "Zend/zend_language_scanner.l" { return T_ELLIPSIS; } -#line 5107 "Zend/zend_language_scanner.c" -yy489: - YYDEBUG(489, *YYCURSOR); +#line 5117 "Zend/zend_language_scanner.c" +yy492: + YYDEBUG(492, *YYCURSOR); ++YYCURSOR; - YYDEBUG(490, *YYCURSOR); + YYDEBUG(493, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1193 "Zend/zend_language_scanner.l" { return T_PAAMAYIM_NEKUDOTAYIM; } -#line 5117 "Zend/zend_language_scanner.c" -yy491: - YYDEBUG(491, *YYCURSOR); +#line 5127 "Zend/zend_language_scanner.c" +yy494: + YYDEBUG(494, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy492: - YYDEBUG(492, *YYCURSOR); +yy495: + YYDEBUG(495, *YYCURSOR); if (yych <= '\f') { - if (yych <= 0x08) goto yy141; - if (yych <= '\n') goto yy491; - goto yy141; + if (yych <= 0x08) goto yy142; + if (yych <= '\n') goto yy494; + goto yy142; } else { - if (yych <= '\r') goto yy491; - if (yych == ' ') goto yy491; - goto yy141; + if (yych <= '\r') goto yy494; + if (yych == ' ') goto yy494; + goto yy142; } -yy493: - YYDEBUG(493, *YYCURSOR); +yy496: + YYDEBUG(496, *YYCURSOR); ++YYCURSOR; - YYDEBUG(494, *YYCURSOR); + YYDEBUG(497, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1373 "Zend/zend_language_scanner.l" +#line 1377 "Zend/zend_language_scanner.l" { return T_MINUS_EQUAL; } -#line 5143 "Zend/zend_language_scanner.c" -yy495: - YYDEBUG(495, *YYCURSOR); +#line 5153 "Zend/zend_language_scanner.c" +yy498: + YYDEBUG(498, *YYCURSOR); ++YYCURSOR; - YYDEBUG(496, *YYCURSOR); + YYDEBUG(499, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1341 "Zend/zend_language_scanner.l" +#line 1345 "Zend/zend_language_scanner.l" { return T_DEC; } -#line 5153 "Zend/zend_language_scanner.c" -yy497: - YYDEBUG(497, *YYCURSOR); +#line 5163 "Zend/zend_language_scanner.c" +yy500: + YYDEBUG(500, *YYCURSOR); ++YYCURSOR; - YYDEBUG(498, *YYCURSOR); + YYDEBUG(501, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1167 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); return T_OBJECT_OPERATOR; } -#line 5164 "Zend/zend_language_scanner.c" -yy499: - YYDEBUG(499, *YYCURSOR); +#line 5174 "Zend/zend_language_scanner.c" +yy502: + YYDEBUG(502, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'I') goto yy506; - if (yych <= 'N') goto yy187; - goto yy507; + if (yych == 'I') goto yy509; + if (yych <= 'N') goto yy188; + goto yy510; } else { if (yych <= 'i') { - if (yych <= 'h') goto yy187; - goto yy506; + if (yych <= 'h') goto yy188; + goto yy509; } else { - if (yych == 'o') goto yy507; - goto yy187; + if (yych == 'o') goto yy510; + goto yy188; } } -yy500: - YYDEBUG(500, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy501; - if (yych != 'b') goto yy187; -yy501: - YYDEBUG(501, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy502; - if (yych != 'l') goto yy187; -yy502: - YYDEBUG(502, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy503; - if (yych != 'i') goto yy187; yy503: YYDEBUG(503, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy504; - if (yych != 'c') goto yy187; + if (yych == 'B') goto yy504; + if (yych != 'b') goto yy188; yy504: YYDEBUG(504, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy505; + if (yych != 'l') goto yy188; +yy505: + YYDEBUG(505, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy506; + if (yych != 'i') goto yy188; +yy506: + YYDEBUG(506, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy507; + if (yych != 'c') goto yy188; +yy507: + YYDEBUG(507, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(505, *YYCURSOR); + YYDEBUG(508, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1313 "Zend/zend_language_scanner.l" +#line 1317 "Zend/zend_language_scanner.l" { return T_PUBLIC; } -#line 5213 "Zend/zend_language_scanner.c" -yy506: - YYDEBUG(506, *YYCURSOR); +#line 5223 "Zend/zend_language_scanner.c" +yy509: + YYDEBUG(509, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'V') { - if (yych == 'N') goto yy515; - if (yych <= 'U') goto yy187; - goto yy516; + if (yych == 'N') goto yy518; + if (yych <= 'U') goto yy188; + goto yy519; } else { if (yych <= 'n') { - if (yych <= 'm') goto yy187; - goto yy515; + if (yych <= 'm') goto yy188; + goto yy518; } else { - if (yych == 'v') goto yy516; - goto yy187; + if (yych == 'v') goto yy519; + goto yy188; } } -yy507: - YYDEBUG(507, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy508; - if (yych != 't') goto yy187; -yy508: - YYDEBUG(508, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy509; - if (yych != 'e') goto yy187; -yy509: - YYDEBUG(509, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy510; - if (yych != 'c') goto yy187; yy510: YYDEBUG(510, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy511; - if (yych != 't') goto yy187; + if (yych != 't') goto yy188; yy511: YYDEBUG(511, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy512; - if (yych != 'e') goto yy187; + if (yych != 'e') goto yy188; yy512: YYDEBUG(512, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy513; - if (yych != 'd') goto yy187; + if (yych == 'C') goto yy513; + if (yych != 'c') goto yy188; yy513: YYDEBUG(513, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'T') goto yy514; + if (yych != 't') goto yy188; +yy514: YYDEBUG(514, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1309 "Zend/zend_language_scanner.l" - { - return T_PROTECTED; -} -#line 5272 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'E') goto yy515; + if (yych != 'e') goto yy188; yy515: YYDEBUG(515, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy521; - if (yych == 't') goto yy521; - goto yy187; + if (yych == 'D') goto yy516; + if (yych != 'd') goto yy188; yy516: YYDEBUG(516, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy517; - if (yych != 'a') goto yy187; -yy517: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy187; + } YYDEBUG(517, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy518; - if (yych != 't') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1313 "Zend/zend_language_scanner.l" + { + return T_PROTECTED; +} +#line 5282 "Zend/zend_language_scanner.c" yy518: YYDEBUG(518, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy519; - if (yych != 'e') goto yy187; + if (yych == 'T') goto yy524; + if (yych == 't') goto yy524; + goto yy188; yy519: YYDEBUG(519, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy520; + if (yych != 'a') goto yy188; +yy520: + YYDEBUG(520, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy521; + if (yych != 't') goto yy188; +yy521: + YYDEBUG(521, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy522; + if (yych != 'e') goto yy188; +yy522: + YYDEBUG(522, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(520, *YYCURSOR); + YYDEBUG(523, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1305 "Zend/zend_language_scanner.l" +#line 1309 "Zend/zend_language_scanner.l" { return T_PRIVATE; } -#line 5306 "Zend/zend_language_scanner.c" -yy521: - YYDEBUG(521, *YYCURSOR); +#line 5316 "Zend/zend_language_scanner.c" +yy524: + YYDEBUG(524, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(522, *YYCURSOR); + YYDEBUG(525, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1143 "Zend/zend_language_scanner.l" { return T_PRINT; } -#line 5319 "Zend/zend_language_scanner.c" -yy523: - YYDEBUG(523, *YYCURSOR); +#line 5329 "Zend/zend_language_scanner.c" +yy526: + YYDEBUG(526, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy528; - if (yych == 'o') goto yy528; - goto yy187; -yy524: - YYDEBUG(524, *YYCURSOR); + if (yych == 'O') goto yy531; + if (yych == 'o') goto yy531; + goto yy188; +yy527: + YYDEBUG(527, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy525; - if (yych != 't') goto yy187; -yy525: - YYDEBUG(525, *YYCURSOR); + if (yych == 'T') goto yy528; + if (yych != 't') goto yy188; +yy528: + YYDEBUG(528, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy526; - if (yych != 'o') goto yy187; -yy526: - YYDEBUG(526, *YYCURSOR); + if (yych == 'O') goto yy529; + if (yych != 'o') goto yy188; +yy529: + YYDEBUG(529, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(527, *YYCURSOR); + YYDEBUG(530, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1135 "Zend/zend_language_scanner.l" { return T_GOTO; } -#line 5348 "Zend/zend_language_scanner.c" -yy528: - YYDEBUG(528, *YYCURSOR); +#line 5358 "Zend/zend_language_scanner.c" +yy531: + YYDEBUG(531, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy529; - if (yych != 'b') goto yy187; -yy529: - YYDEBUG(529, *YYCURSOR); + if (yych == 'B') goto yy532; + if (yych != 'b') goto yy188; +yy532: + YYDEBUG(532, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy530; - if (yych != 'a') goto yy187; -yy530: - YYDEBUG(530, *YYCURSOR); + if (yych == 'A') goto yy533; + if (yych != 'a') goto yy188; +yy533: + YYDEBUG(533, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy531; - if (yych != 'l') goto yy187; -yy531: - YYDEBUG(531, *YYCURSOR); + if (yych == 'L') goto yy534; + if (yych != 'l') goto yy188; +yy534: + YYDEBUG(534, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(532, *YYCURSOR); + YYDEBUG(535, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1277 "Zend/zend_language_scanner.l" +#line 1281 "Zend/zend_language_scanner.l" { return T_GLOBAL; } -#line 5376 "Zend/zend_language_scanner.c" -yy533: - YYDEBUG(533, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '<') goto yy541; - goto yy194; -yy534: - YYDEBUG(534, *YYCURSOR); - yych = *++YYCURSOR; - goto yy181; -yy535: - YYDEBUG(535, *YYCURSOR); - yych = *++YYCURSOR; - goto yy179; +#line 5386 "Zend/zend_language_scanner.c" yy536: YYDEBUG(536, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy537; - if (yych != 'e') goto yy187; + if (yych == '<') goto yy544; + goto yy195; yy537: YYDEBUG(537, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy538; - if (yych != 'a') goto yy187; + goto yy182; yy538: YYDEBUG(538, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'K') goto yy539; - if (yych != 'k') goto yy187; + goto yy180; yy539: YYDEBUG(539, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy540; + if (yych != 'e') goto yy188; +yy540: + YYDEBUG(540, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy541; + if (yych != 'a') goto yy188; +yy541: + YYDEBUG(541, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'K') goto yy542; + if (yych != 'k') goto yy188; +yy542: + YYDEBUG(542, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(540, *YYCURSOR); + YYDEBUG(543, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1127 "Zend/zend_language_scanner.l" { return T_BREAK; } -#line 5417 "Zend/zend_language_scanner.c" -yy541: - YYDEBUG(541, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '<') goto yy270; - goto yy194; -yy542: - YYDEBUG(542, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy549; - if (yych == 'a') goto yy549; - goto yy187; -yy543: - YYDEBUG(543, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy544; - if (yych != 'i') goto yy187; +#line 5427 "Zend/zend_language_scanner.c" yy544: YYDEBUG(544, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy545; - if (yych != 't') goto yy187; + if (yych == '<') goto yy271; + goto yy195; yy545: YYDEBUG(545, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy546; - if (yych != 'c') goto yy187; + if (yych == 'A') goto yy552; + if (yych == 'a') goto yy552; + goto yy188; yy546: YYDEBUG(546, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy547; - if (yych != 'h') goto yy187; + if (yych == 'I') goto yy547; + if (yych != 'i') goto yy188; yy547: YYDEBUG(547, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'T') goto yy548; + if (yych != 't') goto yy188; +yy548: YYDEBUG(548, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1111 "Zend/zend_language_scanner.l" - { - return T_SWITCH; -} -#line 5461 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'C') goto yy549; + if (yych != 'c') goto yy188; yy549: YYDEBUG(549, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy550; - if (yych != 't') goto yy187; + if (yych == 'H') goto yy550; + if (yych != 'h') goto yy188; yy550: YYDEBUG(550, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy551; - if (yych != 'i') goto yy187; -yy551: - YYDEBUG(551, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy552; - if (yych != 'c') goto yy187; -yy552: - YYDEBUG(552, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(553, *YYCURSOR); + YYDEBUG(551, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1293 "Zend/zend_language_scanner.l" +#line 1111 "Zend/zend_language_scanner.l" { - return T_STATIC; + return T_SWITCH; } -#line 5489 "Zend/zend_language_scanner.c" +#line 5471 "Zend/zend_language_scanner.c" +yy552: + YYDEBUG(552, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy553; + if (yych != 't') goto yy188; +yy553: + YYDEBUG(553, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy554; + if (yych != 'i') goto yy188; yy554: YYDEBUG(554, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy565; - if (yych == 's') goto yy565; - goto yy187; + if (yych == 'C') goto yy555; + if (yych != 'c') goto yy188; yy555: YYDEBUG(555, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy563; - if (yych == 'd') goto yy563; - goto yy187; -yy556: - YYDEBUG(556, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy559; - if (yych == 'r') goto yy559; - goto yy187; -yy557: - YYDEBUG(557, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(558, *YYCURSOR); + YYDEBUG(556, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1107 "Zend/zend_language_scanner.l" +#line 1297 "Zend/zend_language_scanner.l" { - return T_AS; + return T_STATIC; } -#line 5520 "Zend/zend_language_scanner.c" +#line 5499 "Zend/zend_language_scanner.c" +yy557: + YYDEBUG(557, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'S') goto yy568; + if (yych == 's') goto yy568; + goto yy188; +yy558: + YYDEBUG(558, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'D') goto yy566; + if (yych == 'd') goto yy566; + goto yy188; yy559: YYDEBUG(559, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy560; - if (yych != 'a') goto yy187; + if (yych == 'R') goto yy562; + if (yych == 'r') goto yy562; + goto yy188; yy560: YYDEBUG(560, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy561; - if (yych != 'y') goto yy187; -yy561: - YYDEBUG(561, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(562, *YYCURSOR); + YYDEBUG(561, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1329 "Zend/zend_language_scanner.l" +#line 1107 "Zend/zend_language_scanner.l" { - return T_ARRAY; + return T_AS; } -#line 5543 "Zend/zend_language_scanner.c" +#line 5530 "Zend/zend_language_scanner.c" +yy562: + YYDEBUG(562, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy563; + if (yych != 'a') goto yy188; yy563: YYDEBUG(563, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'Y') goto yy564; + if (yych != 'y') goto yy188; +yy564: + YYDEBUG(564, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(564, *YYCURSOR); + YYDEBUG(565, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1433 "Zend/zend_language_scanner.l" +#line 1333 "Zend/zend_language_scanner.l" { - return T_LOGICAL_AND; + return T_ARRAY; } -#line 5556 "Zend/zend_language_scanner.c" -yy565: - YYDEBUG(565, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy566; - if (yych != 't') goto yy187; +#line 5553 "Zend/zend_language_scanner.c" yy566: YYDEBUG(566, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy567; - if (yych != 'r') goto yy187; -yy567: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy187; + } YYDEBUG(567, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy568; - if (yych != 'a') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1437 "Zend/zend_language_scanner.l" + { + return T_LOGICAL_AND; +} +#line 5566 "Zend/zend_language_scanner.c" yy568: YYDEBUG(568, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy569; - if (yych != 'c') goto yy187; + if (yych == 'T') goto yy569; + if (yych != 't') goto yy188; yy569: YYDEBUG(569, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy570; - if (yych != 't') goto yy187; + if (yych == 'R') goto yy570; + if (yych != 'r') goto yy188; yy570: YYDEBUG(570, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy571; + if (yych != 'a') goto yy188; +yy571: + YYDEBUG(571, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy572; + if (yych != 'c') goto yy188; +yy572: + YYDEBUG(572, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy573; + if (yych != 't') goto yy188; +yy573: + YYDEBUG(573, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(571, *YYCURSOR); + YYDEBUG(574, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1297 "Zend/zend_language_scanner.l" +#line 1301 "Zend/zend_language_scanner.l" { return T_ABSTRACT; } -#line 5594 "Zend/zend_language_scanner.c" -yy572: - YYDEBUG(572, *YYCURSOR); +#line 5604 "Zend/zend_language_scanner.c" +yy575: + YYDEBUG(575, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy573; - if (yych != 'i') goto yy187; -yy573: - YYDEBUG(573, *YYCURSOR); + if (yych == 'I') goto yy576; + if (yych != 'i') goto yy188; +yy576: + YYDEBUG(576, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy574; - if (yych != 'l') goto yy187; -yy574: - YYDEBUG(574, *YYCURSOR); + if (yych == 'L') goto yy577; + if (yych != 'l') goto yy188; +yy577: + YYDEBUG(577, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy575; - if (yych != 'e') goto yy187; -yy575: - YYDEBUG(575, *YYCURSOR); + if (yych == 'E') goto yy578; + if (yych != 'e') goto yy188; +yy578: + YYDEBUG(578, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(576, *YYCURSOR); + YYDEBUG(579, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1067 "Zend/zend_language_scanner.l" { return T_WHILE; } -#line 5622 "Zend/zend_language_scanner.c" -yy577: - YYDEBUG(577, *YYCURSOR); +#line 5632 "Zend/zend_language_scanner.c" +yy580: + YYDEBUG(580, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(578, *YYCURSOR); + YYDEBUG(581, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1051 "Zend/zend_language_scanner.l" { return T_IF; } -#line 5635 "Zend/zend_language_scanner.c" -yy579: - YYDEBUG(579, *YYCURSOR); +#line 5645 "Zend/zend_language_scanner.c" +yy582: + YYDEBUG(582, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy621; - if (yych == 'p') goto yy621; - goto yy187; -yy580: - YYDEBUG(580, *YYCURSOR); + if (yych == 'P') goto yy624; + if (yych == 'p') goto yy624; + goto yy188; +yy583: + YYDEBUG(583, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'C') { - if (yych <= 'B') goto yy187; - goto yy588; + if (yych <= 'B') goto yy188; + goto yy591; } else { - if (yych <= 'R') goto yy187; - if (yych <= 'S') goto yy586; - goto yy587; + if (yych <= 'R') goto yy188; + if (yych <= 'S') goto yy589; + goto yy590; } } else { if (yych <= 'r') { - if (yych == 'c') goto yy588; - goto yy187; + if (yych == 'c') goto yy591; + goto yy188; } else { - if (yych <= 's') goto yy586; - if (yych <= 't') goto yy587; - goto yy187; + if (yych <= 's') goto yy589; + if (yych <= 't') goto yy590; + goto yy188; } } -yy581: - YYDEBUG(581, *YYCURSOR); +yy584: + YYDEBUG(584, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy582; - if (yych != 's') goto yy187; -yy582: - YYDEBUG(582, *YYCURSOR); + if (yych == 'S') goto yy585; + if (yych != 's') goto yy188; +yy585: + YYDEBUG(585, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy583; - if (yych != 'e') goto yy187; -yy583: - YYDEBUG(583, *YYCURSOR); + if (yych == 'E') goto yy586; + if (yych != 'e') goto yy188; +yy586: + YYDEBUG(586, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy584; - if (yych != 't') goto yy187; -yy584: - YYDEBUG(584, *YYCURSOR); + if (yych == 'T') goto yy587; + if (yych != 't') goto yy188; +yy587: + YYDEBUG(587, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(585, *YYCURSOR); + YYDEBUG(588, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1281 "Zend/zend_language_scanner.l" +#line 1285 "Zend/zend_language_scanner.l" { return T_ISSET; } -#line 5691 "Zend/zend_language_scanner.c" -yy586: - YYDEBUG(586, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy607; - if (yych == 't') goto yy607; - goto yy187; -yy587: - YYDEBUG(587, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy600; - if (yych == 'e') goto yy600; - goto yy187; -yy588: - YYDEBUG(588, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy589; - if (yych != 'l') goto yy187; +#line 5701 "Zend/zend_language_scanner.c" yy589: YYDEBUG(589, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy590; - if (yych != 'u') goto yy187; + if (yych == 'T') goto yy610; + if (yych == 't') goto yy610; + goto yy188; yy590: YYDEBUG(590, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy591; - if (yych != 'd') goto yy187; + if (yych == 'E') goto yy603; + if (yych == 'e') goto yy603; + goto yy188; yy591: YYDEBUG(591, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy592; - if (yych != 'e') goto yy187; + if (yych == 'L') goto yy592; + if (yych != 'l') goto yy188; yy592: YYDEBUG(592, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'U') goto yy593; + if (yych != 'u') goto yy188; +yy593: + YYDEBUG(593, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'D') goto yy594; + if (yych != 'd') goto yy188; +yy594: + YYDEBUG(594, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy595; + if (yych != 'e') goto yy188; +yy595: + YYDEBUG(595, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '9') { - if (yych >= '0') goto yy186; + if (yych >= '0') goto yy187; } else { - if (yych <= '@') goto yy593; - if (yych <= 'Z') goto yy186; + if (yych <= '@') goto yy596; + if (yych <= 'Z') goto yy187; } } else { if (yych <= '`') { - if (yych <= '_') goto yy594; + if (yych <= '_') goto yy597; } else { - if (yych <= 'z') goto yy186; - if (yych >= 0x7F) goto yy186; + if (yych <= 'z') goto yy187; + if (yych >= 0x7F) goto yy187; } } -yy593: - YYDEBUG(593, *YYCURSOR); +yy596: + YYDEBUG(596, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1249 "Zend/zend_language_scanner.l" +#line 1253 "Zend/zend_language_scanner.l" { return T_INCLUDE; } -#line 5749 "Zend/zend_language_scanner.c" -yy594: - YYDEBUG(594, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy595; - if (yych != 'o') goto yy187; -yy595: - YYDEBUG(595, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy596; - if (yych != 'n') goto yy187; -yy596: - YYDEBUG(596, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy597; - if (yych != 'c') goto yy187; +#line 5759 "Zend/zend_language_scanner.c" yy597: YYDEBUG(597, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy598; - if (yych != 'e') goto yy187; + if (yych == 'O') goto yy598; + if (yych != 'o') goto yy188; yy598: YYDEBUG(598, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'N') goto yy599; + if (yych != 'n') goto yy188; +yy599: YYDEBUG(599, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1253 "Zend/zend_language_scanner.l" - { - return T_INCLUDE_ONCE; -} -#line 5782 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'C') goto yy600; + if (yych != 'c') goto yy188; yy600: YYDEBUG(600, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy601; - if (yych != 'r') goto yy187; + if (yych == 'E') goto yy601; + if (yych != 'e') goto yy188; yy601: YYDEBUG(601, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'F') goto yy602; - if (yych != 'f') goto yy187; -yy602: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy187; + } YYDEBUG(602, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy603; - if (yych != 'a') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1257 "Zend/zend_language_scanner.l" + { + return T_INCLUDE_ONCE; +} +#line 5792 "Zend/zend_language_scanner.c" yy603: YYDEBUG(603, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy604; - if (yych != 'c') goto yy187; + if (yych == 'R') goto yy604; + if (yych != 'r') goto yy188; yy604: YYDEBUG(604, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy605; - if (yych != 'e') goto yy187; + if (yych == 'F') goto yy605; + if (yych != 'f') goto yy188; yy605: YYDEBUG(605, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy606; + if (yych != 'a') goto yy188; +yy606: + YYDEBUG(606, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy607; + if (yych != 'c') goto yy188; +yy607: + YYDEBUG(607, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy608; + if (yych != 'e') goto yy188; +yy608: + YYDEBUG(608, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(606, *YYCURSOR); + YYDEBUG(609, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1151 "Zend/zend_language_scanner.l" { return T_INTERFACE; } -#line 5820 "Zend/zend_language_scanner.c" -yy607: - YYDEBUG(607, *YYCURSOR); +#line 5830 "Zend/zend_language_scanner.c" +yy610: + YYDEBUG(610, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { - if (yych == 'A') goto yy608; - if (yych <= 'D') goto yy187; - goto yy609; + if (yych == 'A') goto yy611; + if (yych <= 'D') goto yy188; + goto yy612; } else { if (yych <= 'a') { - if (yych <= '`') goto yy187; + if (yych <= '`') goto yy188; } else { - if (yych == 'e') goto yy609; - goto yy187; + if (yych == 'e') goto yy612; + goto yy188; } } -yy608: - YYDEBUG(608, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy615; - if (yych == 'n') goto yy615; - goto yy187; -yy609: - YYDEBUG(609, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy610; - if (yych != 'a') goto yy187; -yy610: - YYDEBUG(610, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy611; - if (yych != 'd') goto yy187; yy611: YYDEBUG(611, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy612; - if (yych != 'o') goto yy187; + if (yych == 'N') goto yy618; + if (yych == 'n') goto yy618; + goto yy188; yy612: YYDEBUG(612, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy613; - if (yych != 'f') goto yy187; + if (yych == 'A') goto yy613; + if (yych != 'a') goto yy188; yy613: YYDEBUG(613, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'D') goto yy614; + if (yych != 'd') goto yy188; +yy614: YYDEBUG(614, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1273 "Zend/zend_language_scanner.l" - { - return T_INSTEADOF; -} -#line 5874 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'O') goto yy615; + if (yych != 'o') goto yy188; yy615: YYDEBUG(615, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy616; - if (yych != 'c') goto yy187; + if (yych == 'F') goto yy616; + if (yych != 'f') goto yy188; yy616: YYDEBUG(616, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy617; - if (yych != 'e') goto yy187; -yy617: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy187; + } YYDEBUG(617, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy618; - if (yych != 'o') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1277 "Zend/zend_language_scanner.l" + { + return T_INSTEADOF; +} +#line 5884 "Zend/zend_language_scanner.c" yy618: YYDEBUG(618, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy619; - if (yych != 'f') goto yy187; + if (yych == 'C') goto yy619; + if (yych != 'c') goto yy188; yy619: YYDEBUG(619, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy620; + if (yych != 'e') goto yy188; +yy620: + YYDEBUG(620, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'O') goto yy621; + if (yych != 'o') goto yy188; +yy621: + YYDEBUG(621, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'F') goto yy622; + if (yych != 'f') goto yy188; +yy622: + YYDEBUG(622, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(620, *YYCURSOR); + YYDEBUG(623, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1103 "Zend/zend_language_scanner.l" { return T_INSTANCEOF; } -#line 5907 "Zend/zend_language_scanner.c" -yy621: - YYDEBUG(621, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy622; - if (yych != 'l') goto yy187; -yy622: - YYDEBUG(622, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy623; - if (yych != 'e') goto yy187; -yy623: - YYDEBUG(623, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy624; - if (yych != 'm') goto yy187; +#line 5917 "Zend/zend_language_scanner.c" yy624: YYDEBUG(624, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy625; - if (yych != 'e') goto yy187; + if (yych == 'L') goto yy625; + if (yych != 'l') goto yy188; yy625: YYDEBUG(625, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy626; - if (yych != 'n') goto yy187; + if (yych == 'E') goto yy626; + if (yych != 'e') goto yy188; yy626: YYDEBUG(626, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy627; - if (yych != 't') goto yy187; + if (yych == 'M') goto yy627; + if (yych != 'm') goto yy188; yy627: YYDEBUG(627, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy628; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy628; + if (yych != 'e') goto yy188; yy628: YYDEBUG(628, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy629; + if (yych != 'n') goto yy188; +yy629: + YYDEBUG(629, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy630; + if (yych != 't') goto yy188; +yy630: + YYDEBUG(630, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'S') goto yy631; + if (yych != 's') goto yy188; +yy631: + YYDEBUG(631, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(629, *YYCURSOR); + YYDEBUG(632, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1163 "Zend/zend_language_scanner.l" { return T_IMPLEMENTS; } -#line 5955 "Zend/zend_language_scanner.c" -yy630: - YYDEBUG(630, *YYCURSOR); +#line 5965 "Zend/zend_language_scanner.c" +yy633: + YYDEBUG(633, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy638; - if (yych == 'r') goto yy638; - goto yy187; -yy631: - YYDEBUG(631, *YYCURSOR); + if (yych == 'R') goto yy641; + if (yych == 'r') goto yy641; + goto yy188; +yy634: + YYDEBUG(634, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { - if (yych == 'A') goto yy634; - if (yych <= 'X') goto yy187; + if (yych == 'A') goto yy637; + if (yych <= 'X') goto yy188; } else { if (yych <= 'a') { - if (yych <= '`') goto yy187; - goto yy634; + if (yych <= '`') goto yy188; + goto yy637; } else { - if (yych != 'y') goto yy187; + if (yych != 'y') goto yy188; } } - YYDEBUG(632, *YYCURSOR); + YYDEBUG(635, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(633, *YYCURSOR); + YYDEBUG(636, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1035 "Zend/zend_language_scanner.l" { return T_TRY; } -#line 5987 "Zend/zend_language_scanner.c" -yy634: - YYDEBUG(634, *YYCURSOR); +#line 5997 "Zend/zend_language_scanner.c" +yy637: + YYDEBUG(637, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy635; - if (yych != 'i') goto yy187; -yy635: - YYDEBUG(635, *YYCURSOR); + if (yych == 'I') goto yy638; + if (yych != 'i') goto yy188; +yy638: + YYDEBUG(638, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy636; - if (yych != 't') goto yy187; -yy636: - YYDEBUG(636, *YYCURSOR); + if (yych == 'T') goto yy639; + if (yych != 't') goto yy188; +yy639: + YYDEBUG(639, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(637, *YYCURSOR); + YYDEBUG(640, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1155 "Zend/zend_language_scanner.l" { return T_TRAIT; } -#line 6010 "Zend/zend_language_scanner.c" -yy638: - YYDEBUG(638, *YYCURSOR); +#line 6020 "Zend/zend_language_scanner.c" +yy641: + YYDEBUG(641, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy639; - if (yych != 'o') goto yy187; -yy639: - YYDEBUG(639, *YYCURSOR); + if (yych == 'O') goto yy642; + if (yych != 'o') goto yy188; +yy642: + YYDEBUG(642, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy640; - if (yych != 'w') goto yy187; -yy640: - YYDEBUG(640, *YYCURSOR); + if (yych == 'W') goto yy643; + if (yych != 'w') goto yy188; +yy643: + YYDEBUG(643, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(641, *YYCURSOR); + YYDEBUG(644, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1047 "Zend/zend_language_scanner.l" { return T_THROW; } -#line 6033 "Zend/zend_language_scanner.c" -yy642: - YYDEBUG(642, *YYCURSOR); +#line 6043 "Zend/zend_language_scanner.c" +yy645: + YYDEBUG(645, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy643; - if (yych != 'e') goto yy187; -yy643: - YYDEBUG(643, *YYCURSOR); + if (yych == 'E') goto yy646; + if (yych != 'e') goto yy188; +yy646: + YYDEBUG(646, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy644; - if (yych != 'l') goto yy187; -yy644: - YYDEBUG(644, *YYCURSOR); + if (yych == 'L') goto yy647; + if (yych != 'l') goto yy188; +yy647: + YYDEBUG(647, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy645; - if (yych != 'd') goto yy187; -yy645: - YYDEBUG(645, *YYCURSOR); + if (yych == 'D') goto yy648; + if (yych != 'd') goto yy188; +yy648: + YYDEBUG(648, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(646, *YYCURSOR); + YYDEBUG(649, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1031 "Zend/zend_language_scanner.l" { return T_YIELD; } -#line 6061 "Zend/zend_language_scanner.c" -yy647: - YYDEBUG(647, *YYCURSOR); +#line 6071 "Zend/zend_language_scanner.c" +yy650: + YYDEBUG(650, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { - if (yych == 'Q') goto yy649; - if (yych <= 'S') goto yy187; + if (yych == 'Q') goto yy652; + if (yych <= 'S') goto yy188; } else { if (yych <= 'q') { - if (yych <= 'p') goto yy187; - goto yy649; + if (yych <= 'p') goto yy188; + goto yy652; } else { - if (yych != 't') goto yy187; + if (yych != 't') goto yy188; } } - YYDEBUG(648, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy661; - if (yych == 'u') goto yy661; - goto yy187; -yy649: - YYDEBUG(649, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy650; - if (yych != 'u') goto yy187; -yy650: - YYDEBUG(650, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy651; - if (yych != 'i') goto yy187; -yy651: YYDEBUG(651, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy652; - if (yych != 'r') goto yy187; + if (yych == 'U') goto yy664; + if (yych == 'u') goto yy664; + goto yy188; yy652: YYDEBUG(652, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy653; - if (yych != 'e') goto yy187; + if (yych == 'U') goto yy653; + if (yych != 'u') goto yy188; yy653: YYDEBUG(653, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy654; + if (yych != 'i') goto yy188; +yy654: + YYDEBUG(654, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'R') goto yy655; + if (yych != 'r') goto yy188; +yy655: + YYDEBUG(655, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy656; + if (yych != 'e') goto yy188; +yy656: + YYDEBUG(656, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '9') { - if (yych >= '0') goto yy186; + if (yych >= '0') goto yy187; } else { - if (yych <= '@') goto yy654; - if (yych <= 'Z') goto yy186; + if (yych <= '@') goto yy657; + if (yych <= 'Z') goto yy187; } } else { if (yych <= '`') { - if (yych <= '_') goto yy655; + if (yych <= '_') goto yy658; } else { - if (yych <= 'z') goto yy186; - if (yych >= 0x7F) goto yy186; + if (yych <= 'z') goto yy187; + if (yych >= 0x7F) goto yy187; } } -yy654: - YYDEBUG(654, *YYCURSOR); +yy657: + YYDEBUG(657, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1257 "Zend/zend_language_scanner.l" +#line 1261 "Zend/zend_language_scanner.l" { return T_REQUIRE; } -#line 6126 "Zend/zend_language_scanner.c" -yy655: - YYDEBUG(655, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy656; - if (yych != 'o') goto yy187; -yy656: - YYDEBUG(656, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy657; - if (yych != 'n') goto yy187; -yy657: - YYDEBUG(657, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy658; - if (yych != 'c') goto yy187; +#line 6136 "Zend/zend_language_scanner.c" yy658: YYDEBUG(658, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy659; - if (yych != 'e') goto yy187; + if (yych == 'O') goto yy659; + if (yych != 'o') goto yy188; yy659: YYDEBUG(659, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy660; + if (yych != 'n') goto yy188; +yy660: + YYDEBUG(660, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy661; + if (yych != 'c') goto yy188; +yy661: + YYDEBUG(661, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy662; + if (yych != 'e') goto yy188; +yy662: + YYDEBUG(662, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(660, *YYCURSOR); + YYDEBUG(663, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1261 "Zend/zend_language_scanner.l" +#line 1265 "Zend/zend_language_scanner.l" { return T_REQUIRE_ONCE; } -#line 6159 "Zend/zend_language_scanner.c" -yy661: - YYDEBUG(661, *YYCURSOR); +#line 6169 "Zend/zend_language_scanner.c" +yy664: + YYDEBUG(664, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy662; - if (yych != 'r') goto yy187; -yy662: - YYDEBUG(662, *YYCURSOR); + if (yych == 'R') goto yy665; + if (yych != 'r') goto yy188; +yy665: + YYDEBUG(665, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy663; - if (yych != 'n') goto yy187; -yy663: - YYDEBUG(663, *YYCURSOR); + if (yych == 'N') goto yy666; + if (yych != 'n') goto yy188; +yy666: + YYDEBUG(666, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(664, *YYCURSOR); + YYDEBUG(667, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1027 "Zend/zend_language_scanner.l" { return T_RETURN; } -#line 6182 "Zend/zend_language_scanner.c" -yy665: - YYDEBUG(665, *YYCURSOR); +#line 6192 "Zend/zend_language_scanner.c" +yy668: + YYDEBUG(668, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'L') { - if (yych <= 'K') goto yy187; - goto yy688; + if (yych <= 'K') goto yy188; + goto yy691; } else { - if (yych <= 'R') goto yy187; - if (yych <= 'S') goto yy687; - goto yy686; + if (yych <= 'R') goto yy188; + if (yych <= 'S') goto yy690; + goto yy689; } } else { if (yych <= 'r') { - if (yych == 'l') goto yy688; - goto yy187; + if (yych == 'l') goto yy691; + goto yy188; } else { - if (yych <= 's') goto yy687; - if (yych <= 't') goto yy686; - goto yy187; + if (yych <= 's') goto yy690; + if (yych <= 't') goto yy689; + goto yy188; } } -yy666: - YYDEBUG(666, *YYCURSOR); +yy669: + YYDEBUG(669, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'A') goto yy678; - if (yych <= 'N') goto yy187; - goto yy679; + if (yych == 'A') goto yy681; + if (yych <= 'N') goto yy188; + goto yy682; } else { if (yych <= 'a') { - if (yych <= '`') goto yy187; - goto yy678; + if (yych <= '`') goto yy188; + goto yy681; } else { - if (yych == 'o') goto yy679; - goto yy187; + if (yych == 'o') goto yy682; + goto yy188; } } -yy667: - YYDEBUG(667, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy668; - if (yych != 'n') goto yy187; -yy668: - YYDEBUG(668, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= 'R') goto yy187; - if (yych >= 'T') goto yy670; - } else { - if (yych <= 'r') goto yy187; - if (yych <= 's') goto yy669; - if (yych <= 't') goto yy670; - goto yy187; - } -yy669: - YYDEBUG(669, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy676; - if (yych == 't') goto yy676; - goto yy187; yy670: YYDEBUG(670, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy671; - if (yych != 'i') goto yy187; + if (yych == 'N') goto yy671; + if (yych != 'n') goto yy188; yy671: YYDEBUG(671, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy672; - if (yych != 'n') goto yy187; + if (yych <= 'T') { + if (yych <= 'R') goto yy188; + if (yych >= 'T') goto yy673; + } else { + if (yych <= 'r') goto yy188; + if (yych <= 's') goto yy672; + if (yych <= 't') goto yy673; + goto yy188; + } yy672: YYDEBUG(672, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy673; - if (yych != 'u') goto yy187; + if (yych == 'T') goto yy679; + if (yych == 't') goto yy679; + goto yy188; yy673: YYDEBUG(673, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy674; - if (yych != 'e') goto yy187; + if (yych == 'I') goto yy674; + if (yych != 'i') goto yy188; yy674: YYDEBUG(674, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy675; + if (yych != 'n') goto yy188; +yy675: + YYDEBUG(675, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'U') goto yy676; + if (yych != 'u') goto yy188; +yy676: + YYDEBUG(676, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy677; + if (yych != 'e') goto yy188; +yy677: + YYDEBUG(677, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(675, *YYCURSOR); + YYDEBUG(678, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1131 "Zend/zend_language_scanner.l" { return T_CONTINUE; } -#line 6276 "Zend/zend_language_scanner.c" -yy676: - YYDEBUG(676, *YYCURSOR); +#line 6286 "Zend/zend_language_scanner.c" +yy679: + YYDEBUG(679, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(677, *YYCURSOR); + YYDEBUG(680, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1023 "Zend/zend_language_scanner.l" { return T_CONST; } -#line 6289 "Zend/zend_language_scanner.c" -yy678: - YYDEBUG(678, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy683; - if (yych == 's') goto yy683; - goto yy187; -yy679: - YYDEBUG(679, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy680; - if (yych != 'n') goto yy187; -yy680: - YYDEBUG(680, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy681; - if (yych != 'e') goto yy187; +#line 6299 "Zend/zend_language_scanner.c" yy681: YYDEBUG(681, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'S') goto yy686; + if (yych == 's') goto yy686; + goto yy188; +yy682: YYDEBUG(682, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1209 "Zend/zend_language_scanner.l" - { - return T_CLONE; -} -#line 6318 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'N') goto yy683; + if (yych != 'n') goto yy188; yy683: YYDEBUG(683, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy684; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy684; + if (yych != 'e') goto yy188; yy684: YYDEBUG(684, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } YYDEBUG(685, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1147 "Zend/zend_language_scanner.l" +#line 1213 "Zend/zend_language_scanner.l" { - return T_CLASS; + return T_CLONE; } -#line 6336 "Zend/zend_language_scanner.c" +#line 6328 "Zend/zend_language_scanner.c" yy686: YYDEBUG(686, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy697; - if (yych == 'c') goto yy697; - goto yy187; + if (yych == 'S') goto yy687; + if (yych != 's') goto yy188; yy687: YYDEBUG(687, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy695; - if (yych == 'e') goto yy695; - goto yy187; -yy688: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy187; + } YYDEBUG(688, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy689; - if (yych != 'l') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1147 "Zend/zend_language_scanner.l" + { + return T_CLASS; +} +#line 6346 "Zend/zend_language_scanner.c" yy689: YYDEBUG(689, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy690; - if (yych != 'a') goto yy187; + if (yych == 'C') goto yy700; + if (yych == 'c') goto yy700; + goto yy188; yy690: YYDEBUG(690, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy691; - if (yych != 'b') goto yy187; + if (yych == 'E') goto yy698; + if (yych == 'e') goto yy698; + goto yy188; yy691: YYDEBUG(691, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'L') goto yy692; - if (yych != 'l') goto yy187; + if (yych != 'l') goto yy188; yy692: YYDEBUG(692, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy693; - if (yych != 'e') goto yy187; + if (yych == 'A') goto yy693; + if (yych != 'a') goto yy188; yy693: YYDEBUG(693, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'B') goto yy694; + if (yych != 'b') goto yy188; +yy694: YYDEBUG(694, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1333 "Zend/zend_language_scanner.l" - { - return T_CALLABLE; -} -#line 6386 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'L') goto yy695; + if (yych != 'l') goto yy188; yy695: YYDEBUG(695, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy696; + if (yych != 'e') goto yy188; +yy696: + YYDEBUG(696, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(696, *YYCURSOR); + YYDEBUG(697, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1119 "Zend/zend_language_scanner.l" +#line 1337 "Zend/zend_language_scanner.l" { - return T_CASE; + return T_CALLABLE; } -#line 6399 "Zend/zend_language_scanner.c" -yy697: - YYDEBUG(697, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy698; - if (yych != 'h') goto yy187; +#line 6396 "Zend/zend_language_scanner.c" yy698: YYDEBUG(698, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } YYDEBUG(699, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1039 "Zend/zend_language_scanner.l" +#line 1119 "Zend/zend_language_scanner.l" { - return T_CATCH; + return T_CASE; } -#line 6417 "Zend/zend_language_scanner.c" +#line 6409 "Zend/zend_language_scanner.c" yy700: YYDEBUG(700, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy717; - if (yych == 'n') goto yy717; - goto yy187; + if (yych == 'H') goto yy701; + if (yych != 'h') goto yy188; yy701: YYDEBUG(701, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy710; - if (yych == 'r') goto yy710; - goto yy187; -yy702: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy187; + } YYDEBUG(702, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy703; - if (yych != 'n') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1039 "Zend/zend_language_scanner.l" + { + return T_CATCH; +} +#line 6427 "Zend/zend_language_scanner.c" yy703: YYDEBUG(703, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy704; - if (yych != 'c') goto yy187; + if (yych == 'N') goto yy720; + if (yych == 'n') goto yy720; + goto yy188; yy704: YYDEBUG(704, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy705; - if (yych != 't') goto yy187; + if (yych == 'R') goto yy713; + if (yych == 'r') goto yy713; + goto yy188; yy705: YYDEBUG(705, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy706; - if (yych != 'i') goto yy187; + if (yych == 'N') goto yy706; + if (yych != 'n') goto yy188; yy706: YYDEBUG(706, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy707; - if (yych != 'o') goto yy187; + if (yych == 'C') goto yy707; + if (yych != 'c') goto yy188; yy707: YYDEBUG(707, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy708; - if (yych != 'n') goto yy187; + if (yych == 'T') goto yy708; + if (yych != 't') goto yy188; yy708: YYDEBUG(708, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy709; + if (yych != 'i') goto yy188; +yy709: + YYDEBUG(709, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'O') goto yy710; + if (yych != 'o') goto yy188; +yy710: + YYDEBUG(710, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy711; + if (yych != 'n') goto yy188; +yy711: + YYDEBUG(711, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(709, *YYCURSOR); + YYDEBUG(712, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1019 "Zend/zend_language_scanner.l" { return T_FUNCTION; } -#line 6472 "Zend/zend_language_scanner.c" -yy710: - YYDEBUG(710, *YYCURSOR); +#line 6482 "Zend/zend_language_scanner.c" +yy713: + YYDEBUG(713, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy711; - if (yych <= '9') goto yy186; + if (yych <= '/') goto yy714; + if (yych <= '9') goto yy187; } else { - if (yych == 'E') goto yy712; - if (yych <= 'Z') goto yy186; + if (yych == 'E') goto yy715; + if (yych <= 'Z') goto yy187; } } else { if (yych <= 'd') { - if (yych != '`') goto yy186; + if (yych != '`') goto yy187; } else { - if (yych <= 'e') goto yy712; - if (yych <= 'z') goto yy186; - if (yych >= 0x7F) goto yy186; + if (yych <= 'e') goto yy715; + if (yych <= 'z') goto yy187; + if (yych >= 0x7F) goto yy187; } } -yy711: - YYDEBUG(711, *YYCURSOR); +yy714: + YYDEBUG(714, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1079 "Zend/zend_language_scanner.l" { return T_FOR; } -#line 6500 "Zend/zend_language_scanner.c" -yy712: - YYDEBUG(712, *YYCURSOR); +#line 6510 "Zend/zend_language_scanner.c" +yy715: + YYDEBUG(715, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy713; - if (yych != 'a') goto yy187; -yy713: - YYDEBUG(713, *YYCURSOR); + if (yych == 'A') goto yy716; + if (yych != 'a') goto yy188; +yy716: + YYDEBUG(716, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy714; - if (yych != 'c') goto yy187; -yy714: - YYDEBUG(714, *YYCURSOR); + if (yych == 'C') goto yy717; + if (yych != 'c') goto yy188; +yy717: + YYDEBUG(717, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy715; - if (yych != 'h') goto yy187; -yy715: - YYDEBUG(715, *YYCURSOR); + if (yych == 'H') goto yy718; + if (yych != 'h') goto yy188; +yy718: + YYDEBUG(718, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(716, *YYCURSOR); + YYDEBUG(719, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1087 "Zend/zend_language_scanner.l" { return T_FOREACH; } -#line 6528 "Zend/zend_language_scanner.c" -yy717: - YYDEBUG(717, *YYCURSOR); +#line 6538 "Zend/zend_language_scanner.c" +yy720: + YYDEBUG(720, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy718; - if (yych != 'a') goto yy187; -yy718: - YYDEBUG(718, *YYCURSOR); + if (yych == 'A') goto yy721; + if (yych != 'a') goto yy188; +yy721: + YYDEBUG(721, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy719; - if (yych != 'l') goto yy187; -yy719: - YYDEBUG(719, *YYCURSOR); + if (yych == 'L') goto yy722; + if (yych != 'l') goto yy188; +yy722: + YYDEBUG(722, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy720; - if (yych <= '9') goto yy186; + if (yych <= '/') goto yy723; + if (yych <= '9') goto yy187; } else { - if (yych == 'L') goto yy721; - if (yych <= 'Z') goto yy186; + if (yych == 'L') goto yy724; + if (yych <= 'Z') goto yy187; } } else { if (yych <= 'k') { - if (yych != '`') goto yy186; + if (yych != '`') goto yy187; } else { - if (yych <= 'l') goto yy721; - if (yych <= 'z') goto yy186; - if (yych >= 0x7F) goto yy186; + if (yych <= 'l') goto yy724; + if (yych <= 'z') goto yy187; + if (yych >= 0x7F) goto yy187; } } -yy720: - YYDEBUG(720, *YYCURSOR); +yy723: + YYDEBUG(723, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1301 "Zend/zend_language_scanner.l" +#line 1305 "Zend/zend_language_scanner.l" { return T_FINAL; } -#line 6566 "Zend/zend_language_scanner.c" -yy721: - YYDEBUG(721, *YYCURSOR); +#line 6576 "Zend/zend_language_scanner.c" +yy724: + YYDEBUG(724, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy722; - if (yych != 'y') goto yy187; -yy722: - YYDEBUG(722, *YYCURSOR); + if (yych == 'Y') goto yy725; + if (yych != 'y') goto yy188; +yy725: + YYDEBUG(725, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(723, *YYCURSOR); + YYDEBUG(726, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1043 "Zend/zend_language_scanner.l" { return T_FINALLY; } -#line 6584 "Zend/zend_language_scanner.c" -yy724: - YYDEBUG(724, *YYCURSOR); +#line 6594 "Zend/zend_language_scanner.c" +yy727: + YYDEBUG(727, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'F') { - if (yych == 'C') goto yy730; - if (yych <= 'E') goto yy187; - goto yy731; + if (yych == 'C') goto yy733; + if (yych <= 'E') goto yy188; + goto yy734; } else { if (yych <= 'c') { - if (yych <= 'b') goto yy187; - goto yy730; + if (yych <= 'b') goto yy188; + goto yy733; } else { - if (yych == 'f') goto yy731; - goto yy187; + if (yych == 'f') goto yy734; + goto yy188; } } -yy725: - YYDEBUG(725, *YYCURSOR); +yy728: + YYDEBUG(728, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy728; - if (yych == 'e') goto yy728; - goto yy187; -yy726: - YYDEBUG(726, *YYCURSOR); + if (yych == 'E') goto yy731; + if (yych == 'e') goto yy731; + goto yy188; +yy729: + YYDEBUG(729, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(727, *YYCURSOR); + YYDEBUG(730, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1075 "Zend/zend_language_scanner.l" { return T_DO; } -#line 6619 "Zend/zend_language_scanner.c" -yy728: - YYDEBUG(728, *YYCURSOR); +#line 6629 "Zend/zend_language_scanner.c" +yy731: + YYDEBUG(731, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(729, *YYCURSOR); + YYDEBUG(732, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1015 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6632 "Zend/zend_language_scanner.c" -yy730: - YYDEBUG(730, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy737; - if (yych == 'l') goto yy737; - goto yy187; -yy731: - YYDEBUG(731, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy732; - if (yych != 'a') goto yy187; -yy732: - YYDEBUG(732, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy733; - if (yych != 'u') goto yy187; +#line 6642 "Zend/zend_language_scanner.c" yy733: YYDEBUG(733, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy734; - if (yych != 'l') goto yy187; + if (yych == 'L') goto yy740; + if (yych == 'l') goto yy740; + goto yy188; yy734: YYDEBUG(734, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy735; - if (yych != 't') goto yy187; + if (yych == 'A') goto yy735; + if (yych != 'a') goto yy188; yy735: YYDEBUG(735, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'U') goto yy736; + if (yych != 'u') goto yy188; +yy736: + YYDEBUG(736, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy737; + if (yych != 'l') goto yy188; +yy737: + YYDEBUG(737, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy738; + if (yych != 't') goto yy188; +yy738: + YYDEBUG(738, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(736, *YYCURSOR); + YYDEBUG(739, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1123 "Zend/zend_language_scanner.l" { return T_DEFAULT; } -#line 6671 "Zend/zend_language_scanner.c" -yy737: - YYDEBUG(737, *YYCURSOR); +#line 6681 "Zend/zend_language_scanner.c" +yy740: + YYDEBUG(740, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy738; - if (yych != 'a') goto yy187; -yy738: - YYDEBUG(738, *YYCURSOR); + if (yych == 'A') goto yy741; + if (yych != 'a') goto yy188; +yy741: + YYDEBUG(741, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy739; - if (yych != 'r') goto yy187; -yy739: - YYDEBUG(739, *YYCURSOR); + if (yych == 'R') goto yy742; + if (yych != 'r') goto yy188; +yy742: + YYDEBUG(742, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy740; - if (yych != 'e') goto yy187; -yy740: - YYDEBUG(740, *YYCURSOR); + if (yych == 'E') goto yy743; + if (yych != 'e') goto yy188; +yy743: + YYDEBUG(743, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(741, *YYCURSOR); + YYDEBUG(744, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1095 "Zend/zend_language_scanner.l" { return T_DECLARE; } -#line 6699 "Zend/zend_language_scanner.c" -yy742: - YYDEBUG(742, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy804; - if (yych == 'h') goto yy804; - goto yy187; -yy743: - YYDEBUG(743, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy798; - if (yych == 's') goto yy798; - goto yy187; -yy744: - YYDEBUG(744, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy794; - if (yych == 'p') goto yy794; - goto yy187; +#line 6709 "Zend/zend_language_scanner.c" yy745: YYDEBUG(745, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy760; - if (yych == 'd') goto yy760; - goto yy187; + if (yych == 'H') goto yy807; + if (yych == 'h') goto yy807; + goto yy188; yy746: YYDEBUG(746, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy757; - if (yych == 'a') goto yy757; - goto yy187; + if (yych == 'S') goto yy801; + if (yych == 's') goto yy801; + goto yy188; yy747: YYDEBUG(747, *YYCURSOR); yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych == 'I') goto yy748; - if (yych <= 'S') goto yy187; - goto yy749; - } else { - if (yych <= 'i') { - if (yych <= 'h') goto yy187; - } else { - if (yych == 't') goto yy749; - goto yy187; - } - } + if (yych == 'P') goto yy797; + if (yych == 'p') goto yy797; + goto yy188; yy748: YYDEBUG(748, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy755; - if (yych == 't') goto yy755; - goto yy187; + if (yych == 'D') goto yy763; + if (yych == 'd') goto yy763; + goto yy188; yy749: YYDEBUG(749, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy750; - if (yych != 'e') goto yy187; + if (yych == 'A') goto yy760; + if (yych == 'a') goto yy760; + goto yy188; yy750: YYDEBUG(750, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy751; - if (yych != 'n') goto yy187; + if (yych <= 'T') { + if (yych == 'I') goto yy751; + if (yych <= 'S') goto yy188; + goto yy752; + } else { + if (yych <= 'i') { + if (yych <= 'h') goto yy188; + } else { + if (yych == 't') goto yy752; + goto yy188; + } + } yy751: YYDEBUG(751, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy752; - if (yych != 'd') goto yy187; + if (yych == 'T') goto yy758; + if (yych == 't') goto yy758; + goto yy188; yy752: YYDEBUG(752, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy753; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy753; + if (yych != 'e') goto yy188; yy753: YYDEBUG(753, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy754; + if (yych != 'n') goto yy188; +yy754: + YYDEBUG(754, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'D') goto yy755; + if (yych != 'd') goto yy188; +yy755: + YYDEBUG(755, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'S') goto yy756; + if (yych != 's') goto yy188; +yy756: + YYDEBUG(756, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(754, *YYCURSOR); + YYDEBUG(757, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1159 "Zend/zend_language_scanner.l" { return T_EXTENDS; } -#line 6783 "Zend/zend_language_scanner.c" -yy755: - YYDEBUG(755, *YYCURSOR); +#line 6793 "Zend/zend_language_scanner.c" +yy758: + YYDEBUG(758, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(756, *YYCURSOR); + YYDEBUG(759, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1011 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6796 "Zend/zend_language_scanner.c" -yy757: - YYDEBUG(757, *YYCURSOR); +#line 6806 "Zend/zend_language_scanner.c" +yy760: + YYDEBUG(760, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy758; - if (yych != 'l') goto yy187; -yy758: - YYDEBUG(758, *YYCURSOR); + if (yych == 'L') goto yy761; + if (yych != 'l') goto yy188; +yy761: + YYDEBUG(761, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(759, *YYCURSOR); + YYDEBUG(762, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1245 "Zend/zend_language_scanner.l" +#line 1249 "Zend/zend_language_scanner.l" { return T_EVAL; } -#line 6814 "Zend/zend_language_scanner.c" -yy760: - YYDEBUG(760, *YYCURSOR); +#line 6824 "Zend/zend_language_scanner.c" +yy763: + YYDEBUG(763, *YYCURSOR); yych = *++YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 'D': - case 'd': goto yy761; + case 'd': goto yy764; case 'F': - case 'f': goto yy762; + case 'f': goto yy765; case 'I': - case 'i': goto yy763; + case 'i': goto yy766; case 'S': - case 's': goto yy764; + case 's': goto yy767; case 'W': - case 'w': goto yy765; - default: goto yy187; + case 'w': goto yy768; + default: goto yy188; } -yy761: - YYDEBUG(761, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy787; - if (yych == 'e') goto yy787; - goto yy187; -yy762: - YYDEBUG(762, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy779; - if (yych == 'o') goto yy779; - goto yy187; -yy763: - YYDEBUG(763, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'F') goto yy777; - if (yych == 'f') goto yy777; - goto yy187; yy764: YYDEBUG(764, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy771; - if (yych == 'w') goto yy771; - goto yy187; + if (yych == 'E') goto yy790; + if (yych == 'e') goto yy790; + goto yy188; yy765: YYDEBUG(765, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy766; - if (yych != 'h') goto yy187; + if (yych == 'O') goto yy782; + if (yych == 'o') goto yy782; + goto yy188; yy766: YYDEBUG(766, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy767; - if (yych != 'i') goto yy187; + if (yych == 'F') goto yy780; + if (yych == 'f') goto yy780; + goto yy188; yy767: YYDEBUG(767, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy768; - if (yych != 'l') goto yy187; + if (yych == 'W') goto yy774; + if (yych == 'w') goto yy774; + goto yy188; yy768: YYDEBUG(768, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy769; - if (yych != 'e') goto yy187; + if (yych == 'H') goto yy769; + if (yych != 'h') goto yy188; yy769: YYDEBUG(769, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy770; + if (yych != 'i') goto yy188; +yy770: + YYDEBUG(770, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy771; + if (yych != 'l') goto yy188; +yy771: + YYDEBUG(771, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy772; + if (yych != 'e') goto yy188; +yy772: + YYDEBUG(772, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(770, *YYCURSOR); + YYDEBUG(773, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1071 "Zend/zend_language_scanner.l" { return T_ENDWHILE; } -#line 6888 "Zend/zend_language_scanner.c" -yy771: - YYDEBUG(771, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy772; - if (yych != 'i') goto yy187; -yy772: - YYDEBUG(772, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy773; - if (yych != 't') goto yy187; -yy773: - YYDEBUG(773, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy774; - if (yych != 'c') goto yy187; +#line 6898 "Zend/zend_language_scanner.c" yy774: YYDEBUG(774, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy775; - if (yych != 'h') goto yy187; + if (yych == 'I') goto yy775; + if (yych != 'i') goto yy188; yy775: YYDEBUG(775, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy776; + if (yych != 't') goto yy188; +yy776: + YYDEBUG(776, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy777; + if (yych != 'c') goto yy188; +yy777: + YYDEBUG(777, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'H') goto yy778; + if (yych != 'h') goto yy188; +yy778: + YYDEBUG(778, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(776, *YYCURSOR); + YYDEBUG(779, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1115 "Zend/zend_language_scanner.l" { return T_ENDSWITCH; } -#line 6921 "Zend/zend_language_scanner.c" -yy777: - YYDEBUG(777, *YYCURSOR); +#line 6931 "Zend/zend_language_scanner.c" +yy780: + YYDEBUG(780, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(778, *YYCURSOR); + YYDEBUG(781, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1059 "Zend/zend_language_scanner.l" { return T_ENDIF; } -#line 6934 "Zend/zend_language_scanner.c" -yy779: - YYDEBUG(779, *YYCURSOR); +#line 6944 "Zend/zend_language_scanner.c" +yy782: + YYDEBUG(782, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy780; - if (yych != 'r') goto yy187; -yy780: - YYDEBUG(780, *YYCURSOR); + if (yych == 'R') goto yy783; + if (yych != 'r') goto yy188; +yy783: + YYDEBUG(783, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy781; - if (yych <= '9') goto yy186; + if (yych <= '/') goto yy784; + if (yych <= '9') goto yy187; } else { - if (yych == 'E') goto yy782; - if (yych <= 'Z') goto yy186; + if (yych == 'E') goto yy785; + if (yych <= 'Z') goto yy187; } } else { if (yych <= 'd') { - if (yych != '`') goto yy186; + if (yych != '`') goto yy187; } else { - if (yych <= 'e') goto yy782; - if (yych <= 'z') goto yy186; - if (yych >= 0x7F) goto yy186; + if (yych <= 'e') goto yy785; + if (yych <= 'z') goto yy187; + if (yych >= 0x7F) goto yy187; } } -yy781: - YYDEBUG(781, *YYCURSOR); +yy784: + YYDEBUG(784, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1083 "Zend/zend_language_scanner.l" { return T_ENDFOR; } -#line 6967 "Zend/zend_language_scanner.c" -yy782: - YYDEBUG(782, *YYCURSOR); +#line 6977 "Zend/zend_language_scanner.c" +yy785: + YYDEBUG(785, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy783; - if (yych != 'a') goto yy187; -yy783: - YYDEBUG(783, *YYCURSOR); + if (yych == 'A') goto yy786; + if (yych != 'a') goto yy188; +yy786: + YYDEBUG(786, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy784; - if (yych != 'c') goto yy187; -yy784: - YYDEBUG(784, *YYCURSOR); + if (yych == 'C') goto yy787; + if (yych != 'c') goto yy188; +yy787: + YYDEBUG(787, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy785; - if (yych != 'h') goto yy187; -yy785: - YYDEBUG(785, *YYCURSOR); + if (yych == 'H') goto yy788; + if (yych != 'h') goto yy188; +yy788: + YYDEBUG(788, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(786, *YYCURSOR); + YYDEBUG(789, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1091 "Zend/zend_language_scanner.l" { return T_ENDFOREACH; } -#line 6995 "Zend/zend_language_scanner.c" -yy787: - YYDEBUG(787, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy788; - if (yych != 'c') goto yy187; -yy788: - YYDEBUG(788, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy789; - if (yych != 'l') goto yy187; -yy789: - YYDEBUG(789, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy790; - if (yych != 'a') goto yy187; +#line 7005 "Zend/zend_language_scanner.c" yy790: YYDEBUG(790, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy791; - if (yych != 'r') goto yy187; + if (yych == 'C') goto yy791; + if (yych != 'c') goto yy188; yy791: YYDEBUG(791, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy792; - if (yych != 'e') goto yy187; + if (yych == 'L') goto yy792; + if (yych != 'l') goto yy188; yy792: YYDEBUG(792, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy793; + if (yych != 'a') goto yy188; +yy793: + YYDEBUG(793, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'R') goto yy794; + if (yych != 'r') goto yy188; +yy794: + YYDEBUG(794, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy795; + if (yych != 'e') goto yy188; +yy795: + YYDEBUG(795, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(793, *YYCURSOR); + YYDEBUG(796, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1099 "Zend/zend_language_scanner.l" { return T_ENDDECLARE; } -#line 7033 "Zend/zend_language_scanner.c" -yy794: - YYDEBUG(794, *YYCURSOR); +#line 7043 "Zend/zend_language_scanner.c" +yy797: + YYDEBUG(797, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy795; - if (yych != 't') goto yy187; -yy795: - YYDEBUG(795, *YYCURSOR); + if (yych == 'T') goto yy798; + if (yych != 't') goto yy188; +yy798: + YYDEBUG(798, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy796; - if (yych != 'y') goto yy187; -yy796: - YYDEBUG(796, *YYCURSOR); + if (yych == 'Y') goto yy799; + if (yych != 'y') goto yy188; +yy799: + YYDEBUG(799, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(797, *YYCURSOR); + YYDEBUG(800, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1285 "Zend/zend_language_scanner.l" +#line 1289 "Zend/zend_language_scanner.l" { return T_EMPTY; } -#line 7056 "Zend/zend_language_scanner.c" -yy798: - YYDEBUG(798, *YYCURSOR); +#line 7066 "Zend/zend_language_scanner.c" +yy801: + YYDEBUG(801, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy799; - if (yych != 'e') goto yy187; -yy799: - YYDEBUG(799, *YYCURSOR); + if (yych == 'E') goto yy802; + if (yych != 'e') goto yy188; +yy802: + YYDEBUG(802, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy800; - if (yych <= '9') goto yy186; + if (yych <= '/') goto yy803; + if (yych <= '9') goto yy187; } else { - if (yych == 'I') goto yy801; - if (yych <= 'Z') goto yy186; + if (yych == 'I') goto yy804; + if (yych <= 'Z') goto yy187; } } else { if (yych <= 'h') { - if (yych != '`') goto yy186; + if (yych != '`') goto yy187; } else { - if (yych <= 'i') goto yy801; - if (yych <= 'z') goto yy186; - if (yych >= 0x7F) goto yy186; + if (yych <= 'i') goto yy804; + if (yych <= 'z') goto yy187; + if (yych >= 0x7F) goto yy187; } } -yy800: - YYDEBUG(800, *YYCURSOR); +yy803: + YYDEBUG(803, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1063 "Zend/zend_language_scanner.l" { return T_ELSE; } -#line 7089 "Zend/zend_language_scanner.c" -yy801: - YYDEBUG(801, *YYCURSOR); +#line 7099 "Zend/zend_language_scanner.c" +yy804: + YYDEBUG(804, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy802; - if (yych != 'f') goto yy187; -yy802: - YYDEBUG(802, *YYCURSOR); + if (yych == 'F') goto yy805; + if (yych != 'f') goto yy188; +yy805: + YYDEBUG(805, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(803, *YYCURSOR); + YYDEBUG(806, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1055 "Zend/zend_language_scanner.l" { return T_ELSEIF; } -#line 7107 "Zend/zend_language_scanner.c" -yy804: - YYDEBUG(804, *YYCURSOR); +#line 7117 "Zend/zend_language_scanner.c" +yy807: + YYDEBUG(807, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy805; - if (yych != 'o') goto yy187; -yy805: - YYDEBUG(805, *YYCURSOR); + if (yych == 'O') goto yy808; + if (yych != 'o') goto yy188; +yy808: + YYDEBUG(808, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; + goto yy187; } - YYDEBUG(806, *YYCURSOR); + YYDEBUG(809, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1139 "Zend/zend_language_scanner.l" { return T_ECHO; } -#line 7125 "Zend/zend_language_scanner.c" +#line 7135 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_LOOKING_FOR_PROPERTY: @@ -7160,52 +7170,52 @@ yyc_ST_LOOKING_FOR_PROPERTY: 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, }; - YYDEBUG(807, *YYCURSOR); + YYDEBUG(810, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '-') { if (yych <= '\r') { - if (yych <= 0x08) goto yy815; - if (yych <= '\n') goto yy809; - if (yych <= '\f') goto yy815; + if (yych <= 0x08) goto yy818; + if (yych <= '\n') goto yy812; + if (yych <= '\f') goto yy818; } else { - if (yych == ' ') goto yy809; - if (yych <= ',') goto yy815; - goto yy811; + if (yych == ' ') goto yy812; + if (yych <= ',') goto yy818; + goto yy814; } } else { if (yych <= '_') { - if (yych <= '@') goto yy815; - if (yych <= 'Z') goto yy813; - if (yych <= '^') goto yy815; - goto yy813; + if (yych <= '@') goto yy818; + if (yych <= 'Z') goto yy816; + if (yych <= '^') goto yy818; + goto yy816; } else { - if (yych <= '`') goto yy815; - if (yych <= 'z') goto yy813; - if (yych <= '~') goto yy815; - goto yy813; + if (yych <= '`') goto yy818; + if (yych <= 'z') goto yy816; + if (yych <= '~') goto yy818; + goto yy816; } } -yy809: - YYDEBUG(809, *YYCURSOR); +yy812: + YYDEBUG(812, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy821; -yy810: - YYDEBUG(810, *YYCURSOR); + goto yy824; +yy813: + YYDEBUG(813, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1172 "Zend/zend_language_scanner.l" { HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 7203 "Zend/zend_language_scanner.c" -yy811: - YYDEBUG(811, *YYCURSOR); +#line 7213 "Zend/zend_language_scanner.c" +yy814: + YYDEBUG(814, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '>') goto yy818; -yy812: - YYDEBUG(812, *YYCURSOR); + if ((yych = *YYCURSOR) == '>') goto yy821; +yy815: + YYDEBUG(815, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1187 "Zend/zend_language_scanner.l" { @@ -7213,14 +7223,14 @@ yy812: yy_pop_state(TSRMLS_C); goto restart; } -#line 7217 "Zend/zend_language_scanner.c" -yy813: - YYDEBUG(813, *YYCURSOR); +#line 7227 "Zend/zend_language_scanner.c" +yy816: + YYDEBUG(816, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy817; -yy814: - YYDEBUG(814, *YYCURSOR); + goto yy820; +yy817: + YYDEBUG(817, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1181 "Zend/zend_language_scanner.l" { @@ -7228,43 +7238,43 @@ yy814: zend_copy_value(zendlval, yytext, yyleng); return T_STRING; } -#line 7232 "Zend/zend_language_scanner.c" -yy815: - YYDEBUG(815, *YYCURSOR); +#line 7242 "Zend/zend_language_scanner.c" +yy818: + YYDEBUG(818, *YYCURSOR); yych = *++YYCURSOR; - goto yy812; -yy816: - YYDEBUG(816, *YYCURSOR); + goto yy815; +yy819: + YYDEBUG(819, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy817: - YYDEBUG(817, *YYCURSOR); +yy820: + YYDEBUG(820, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy816; + goto yy819; } - goto yy814; -yy818: - YYDEBUG(818, *YYCURSOR); + goto yy817; +yy821: + YYDEBUG(821, *YYCURSOR); ++YYCURSOR; - YYDEBUG(819, *YYCURSOR); + YYDEBUG(822, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1177 "Zend/zend_language_scanner.l" { return T_OBJECT_OPERATOR; } -#line 7257 "Zend/zend_language_scanner.c" -yy820: - YYDEBUG(820, *YYCURSOR); +#line 7267 "Zend/zend_language_scanner.c" +yy823: + YYDEBUG(823, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy821: - YYDEBUG(821, *YYCURSOR); +yy824: + YYDEBUG(824, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy820; + goto yy823; } - goto yy810; + goto yy813; } /* *********************************** */ yyc_ST_LOOKING_FOR_VARNAME: @@ -7303,74 +7313,74 @@ yyc_ST_LOOKING_FOR_VARNAME: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(822, *YYCURSOR); + YYDEBUG(825, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '_') { - if (yych <= '@') goto yy826; - if (yych <= 'Z') goto yy824; - if (yych <= '^') goto yy826; + if (yych <= '@') goto yy829; + if (yych <= 'Z') goto yy827; + if (yych <= '^') goto yy829; } else { - if (yych <= '`') goto yy826; - if (yych <= 'z') goto yy824; - if (yych <= '~') goto yy826; + if (yych <= '`') goto yy829; + if (yych <= 'z') goto yy827; + if (yych <= '~') goto yy829; } -yy824: - YYDEBUG(824, *YYCURSOR); +yy827: + YYDEBUG(827, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '_') { if (yych <= '@') { - if (yych <= '/') goto yy825; - if (yych <= '9') goto yy828; + if (yych <= '/') goto yy828; + if (yych <= '9') goto yy831; } else { - if (yych <= '[') goto yy828; - if (yych >= '_') goto yy828; + if (yych <= '[') goto yy831; + if (yych >= '_') goto yy831; } } else { if (yych <= '|') { - if (yych <= '`') goto yy825; - if (yych <= 'z') goto yy828; + if (yych <= '`') goto yy828; + if (yych <= 'z') goto yy831; } else { - if (yych != '~') goto yy828; + if (yych != '~') goto yy831; } } -yy825: - YYDEBUG(825, *YYCURSOR); +yy828: + YYDEBUG(828, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1484 "Zend/zend_language_scanner.l" +#line 1488 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); goto restart; } -#line 7349 "Zend/zend_language_scanner.c" -yy826: - YYDEBUG(826, *YYCURSOR); +#line 7359 "Zend/zend_language_scanner.c" +yy829: + YYDEBUG(829, *YYCURSOR); yych = *++YYCURSOR; - goto yy825; -yy827: - YYDEBUG(827, *YYCURSOR); + goto yy828; +yy830: + YYDEBUG(830, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy828: - YYDEBUG(828, *YYCURSOR); +yy831: + YYDEBUG(831, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy827; + goto yy830; } - if (yych == '[') goto yy830; - if (yych == '}') goto yy830; - YYDEBUG(829, *YYCURSOR); + if (yych == '[') goto yy833; + if (yych == '}') goto yy833; + YYDEBUG(832, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy825; -yy830: - YYDEBUG(830, *YYCURSOR); + goto yy828; +yy833: + YYDEBUG(833, *YYCURSOR); ++YYCURSOR; - YYDEBUG(831, *YYCURSOR); + YYDEBUG(834, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1475 "Zend/zend_language_scanner.l" +#line 1479 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); zend_copy_value(zendlval, yytext, yyleng); @@ -7378,18 +7388,18 @@ yy830: yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return T_STRING_VARNAME; } -#line 7382 "Zend/zend_language_scanner.c" +#line 7392 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_NOWDOC: - YYDEBUG(832, *YYCURSOR); + YYDEBUG(835, *YYCURSOR); YYFILL(1); yych = *YYCURSOR; - YYDEBUG(834, *YYCURSOR); + YYDEBUG(837, *YYCURSOR); ++YYCURSOR; - YYDEBUG(835, *YYCURSOR); + YYDEBUG(838, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2222 "Zend/zend_language_scanner.l" +#line 2226 "Zend/zend_language_scanner.l" { int newline = 0; @@ -7445,7 +7455,7 @@ nowdoc_scan_done: HANDLE_NEWLINES(yytext, yyleng - newline); return T_ENCAPSED_AND_WHITESPACE; } -#line 7449 "Zend/zend_language_scanner.c" +#line 7459 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_VAR_OFFSET: { @@ -7483,76 +7493,76 @@ yyc_ST_VAR_OFFSET: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, }; - YYDEBUG(836, *YYCURSOR); + YYDEBUG(839, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '/') { if (yych <= ' ') { if (yych <= '\f') { - if (yych <= 0x08) goto yy850; - if (yych <= '\n') goto yy846; - goto yy850; + if (yych <= 0x08) goto yy853; + if (yych <= '\n') goto yy849; + goto yy853; } else { - if (yych <= '\r') goto yy846; - if (yych <= 0x1F) goto yy850; - goto yy846; + if (yych <= '\r') goto yy849; + if (yych <= 0x1F) goto yy853; + goto yy849; } } else { if (yych <= '$') { - if (yych <= '"') goto yy845; - if (yych <= '#') goto yy846; - goto yy841; + if (yych <= '"') goto yy848; + if (yych <= '#') goto yy849; + goto yy844; } else { - if (yych == '\'') goto yy846; - goto yy845; + if (yych == '\'') goto yy849; + goto yy848; } } } else { if (yych <= '\\') { if (yych <= '@') { - if (yych <= '0') goto yy838; - if (yych <= '9') goto yy840; - goto yy845; + if (yych <= '0') goto yy841; + if (yych <= '9') goto yy843; + goto yy848; } else { - if (yych <= 'Z') goto yy848; - if (yych <= '[') goto yy845; - goto yy846; + if (yych <= 'Z') goto yy851; + if (yych <= '[') goto yy848; + goto yy849; } } else { if (yych <= '_') { - if (yych <= ']') goto yy843; - if (yych <= '^') goto yy845; - goto yy848; + if (yych <= ']') goto yy846; + if (yych <= '^') goto yy848; + goto yy851; } else { - if (yych <= '`') goto yy845; - if (yych <= 'z') goto yy848; - if (yych <= '~') goto yy845; - goto yy848; + if (yych <= '`') goto yy848; + if (yych <= 'z') goto yy851; + if (yych <= '~') goto yy848; + goto yy851; } } } -yy838: - YYDEBUG(838, *YYCURSOR); +yy841: + YYDEBUG(841, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'W') { if (yych <= '9') { - if (yych >= '0') goto yy862; + if (yych >= '0') goto yy865; } else { - if (yych == 'B') goto yy859; + if (yych == 'B') goto yy862; } } else { if (yych <= 'b') { - if (yych <= 'X') goto yy861; - if (yych >= 'b') goto yy859; + if (yych <= 'X') goto yy864; + if (yych >= 'b') goto yy862; } else { - if (yych == 'x') goto yy861; + if (yych == 'x') goto yy864; } } -yy839: - YYDEBUG(839, *YYCURSOR); +yy842: + YYDEBUG(842, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1555 "Zend/zend_language_scanner.l" +#line 1559 "Zend/zend_language_scanner.l" { /* Offset could be treated as a long */ if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, NULL, 10)); @@ -7561,53 +7571,53 @@ yy839: } return T_NUM_STRING; } -#line 7565 "Zend/zend_language_scanner.c" -yy840: - YYDEBUG(840, *YYCURSOR); +#line 7575 "Zend/zend_language_scanner.c" +yy843: + YYDEBUG(843, *YYCURSOR); yych = *++YYCURSOR; - goto yy858; -yy841: - YYDEBUG(841, *YYCURSOR); + goto yy861; +yy844: + YYDEBUG(844, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '_') { - if (yych <= '@') goto yy842; - if (yych <= 'Z') goto yy854; - if (yych >= '_') goto yy854; + if (yych <= '@') goto yy845; + if (yych <= 'Z') goto yy857; + if (yych >= '_') goto yy857; } else { - if (yych <= '`') goto yy842; - if (yych <= 'z') goto yy854; - if (yych >= 0x7F) goto yy854; + if (yych <= '`') goto yy845; + if (yych <= 'z') goto yy857; + if (yych >= 0x7F) goto yy857; } -yy842: - YYDEBUG(842, *YYCURSOR); +yy845: + YYDEBUG(845, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1754 "Zend/zend_language_scanner.l" +#line 1758 "Zend/zend_language_scanner.l" { /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ return yytext[0]; } -#line 7590 "Zend/zend_language_scanner.c" -yy843: - YYDEBUG(843, *YYCURSOR); +#line 7600 "Zend/zend_language_scanner.c" +yy846: + YYDEBUG(846, *YYCURSOR); ++YYCURSOR; - YYDEBUG(844, *YYCURSOR); + YYDEBUG(847, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1749 "Zend/zend_language_scanner.l" +#line 1753 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); return ']'; } -#line 7601 "Zend/zend_language_scanner.c" -yy845: - YYDEBUG(845, *YYCURSOR); +#line 7611 "Zend/zend_language_scanner.c" +yy848: + YYDEBUG(848, *YYCURSOR); yych = *++YYCURSOR; - goto yy842; -yy846: - YYDEBUG(846, *YYCURSOR); + goto yy845; +yy849: + YYDEBUG(849, *YYCURSOR); ++YYCURSOR; - YYDEBUG(847, *YYCURSOR); + YYDEBUG(850, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1759 "Zend/zend_language_scanner.l" +#line 1763 "Zend/zend_language_scanner.l" { /* Invalid rule to return a more explicit parse error with proper line number */ yyless(0); @@ -7615,27 +7625,27 @@ yy846: ZVAL_NULL(zendlval); return T_ENCAPSED_AND_WHITESPACE; } -#line 7619 "Zend/zend_language_scanner.c" -yy848: - YYDEBUG(848, *YYCURSOR); +#line 7629 "Zend/zend_language_scanner.c" +yy851: + YYDEBUG(851, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy853; -yy849: - YYDEBUG(849, *YYCURSOR); + goto yy856; +yy852: + YYDEBUG(852, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1767 "Zend/zend_language_scanner.l" +#line 1771 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); return T_STRING; } -#line 7633 "Zend/zend_language_scanner.c" -yy850: - YYDEBUG(850, *YYCURSOR); +#line 7643 "Zend/zend_language_scanner.c" +yy853: + YYDEBUG(853, *YYCURSOR); ++YYCURSOR; - YYDEBUG(851, *YYCURSOR); + YYDEBUG(854, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2279 "Zend/zend_language_scanner.l" +#line 2283 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -7644,115 +7654,115 @@ yy850: zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 7648 "Zend/zend_language_scanner.c" -yy852: - YYDEBUG(852, *YYCURSOR); +#line 7658 "Zend/zend_language_scanner.c" +yy855: + YYDEBUG(855, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy853: - YYDEBUG(853, *YYCURSOR); +yy856: + YYDEBUG(856, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy852; + goto yy855; } - goto yy849; -yy854: - YYDEBUG(854, *YYCURSOR); + goto yy852; +yy857: + YYDEBUG(857, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(855, *YYCURSOR); + YYDEBUG(858, *YYCURSOR); if (yych <= '^') { if (yych <= '9') { - if (yych >= '0') goto yy854; + if (yych >= '0') goto yy857; } else { - if (yych <= '@') goto yy856; - if (yych <= 'Z') goto yy854; + if (yych <= '@') goto yy859; + if (yych <= 'Z') goto yy857; } } else { if (yych <= '`') { - if (yych <= '_') goto yy854; + if (yych <= '_') goto yy857; } else { - if (yych <= 'z') goto yy854; - if (yych >= 0x7F) goto yy854; + if (yych <= 'z') goto yy857; + if (yych >= 0x7F) goto yy857; } } -yy856: - YYDEBUG(856, *YYCURSOR); +yy859: + YYDEBUG(859, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1744 "Zend/zend_language_scanner.l" +#line 1748 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 7689 "Zend/zend_language_scanner.c" -yy857: - YYDEBUG(857, *YYCURSOR); +#line 7699 "Zend/zend_language_scanner.c" +yy860: + YYDEBUG(860, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy858: - YYDEBUG(858, *YYCURSOR); +yy861: + YYDEBUG(861, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy857; + goto yy860; } - goto yy839; -yy859: - YYDEBUG(859, *YYCURSOR); + goto yy842; +yy862: + YYDEBUG(862, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 128) { - goto yy867; + goto yy870; } -yy860: - YYDEBUG(860, *YYCURSOR); +yy863: + YYDEBUG(863, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy839; -yy861: - YYDEBUG(861, *YYCURSOR); + goto yy842; +yy864: + YYDEBUG(864, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { - goto yy865; + goto yy868; } - goto yy860; -yy862: - YYDEBUG(862, *YYCURSOR); + goto yy863; +yy865: + YYDEBUG(865, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(863, *YYCURSOR); - if (yych <= '/') goto yy864; - if (yych <= '9') goto yy862; -yy864: - YYDEBUG(864, *YYCURSOR); + YYDEBUG(866, *YYCURSOR); + if (yych <= '/') goto yy867; + if (yych <= '9') goto yy865; +yy867: + YYDEBUG(867, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1564 "Zend/zend_language_scanner.l" +#line 1568 "Zend/zend_language_scanner.l" { /* Offset must be treated as a string */ ZVAL_STRINGL(zendlval, yytext, yyleng); return T_NUM_STRING; } -#line 7734 "Zend/zend_language_scanner.c" -yy865: - YYDEBUG(865, *YYCURSOR); +#line 7744 "Zend/zend_language_scanner.c" +yy868: + YYDEBUG(868, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(866, *YYCURSOR); + YYDEBUG(869, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy865; + goto yy868; } - goto yy864; -yy867: - YYDEBUG(867, *YYCURSOR); + goto yy867; +yy870: + YYDEBUG(870, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(868, *YYCURSOR); + YYDEBUG(871, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy867; + goto yy870; } - goto yy864; + goto yy867; } } -#line 2288 "Zend/zend_language_scanner.l" +#line 2292 "Zend/zend_language_scanner.l" } diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index dc91090823..3da8406c62 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -126,7 +126,7 @@ BEGIN_EXTERN_C() static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C); - assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)); + ZEND_ASSERT(internal_encoding); return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC); } @@ -144,7 +144,7 @@ LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC); static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C); - assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)); + ZEND_ASSERT(internal_encoding); return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC); } @@ -843,7 +843,7 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start)); SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start)); SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start)); - SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start)); + SCNG(yy_limit) = new_yy_start + length; SCNG(yy_start) = new_yy_start; } @@ -1202,6 +1202,10 @@ NEWLINE ("\r"|"\n"|"\r\n") return T_ELLIPSIS; } +<ST_IN_SCRIPTING>"??" { + return T_COALESCE; +} + <ST_IN_SCRIPTING>"new" { return T_NEW; } diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h index 5926e3c61d..1118239c8d 100644 --- a/Zend/zend_language_scanner_defs.h +++ b/Zend/zend_language_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 */ +/* Generated by re2c 0.13.6 */ #line 3 "Zend/zend_language_scanner_defs.h" enum YYCONDTYPE { diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index ad74bd56cb..0fb49abf5b 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -126,32 +126,26 @@ ZEND_API void zend_llist_clean(zend_llist *l) } -ZEND_API void *zend_llist_remove_tail(zend_llist *l) +ZEND_API void zend_llist_remove_tail(zend_llist *l) { - zend_llist_element *old_tail; - void *data; - - if ((old_tail = l->tail)) { - if (old_tail->prev) { - old_tail->prev->next = NULL; - } else { - l->head = NULL; - } - - data = old_tail->data; - - l->tail = old_tail->prev; - if (l->dtor) { - l->dtor(data); - } - pefree(old_tail, l->persistent); - - --l->count; + zend_llist_element *old_tail = l->tail; + if (!old_tail) { + return; + } - return data; + if (old_tail->prev) { + old_tail->prev->next = NULL; + } else { + l->head = NULL; } - return NULL; + l->tail = old_tail->prev; + --l->count; + + if (l->dtor) { + l->dtor(old_tail->data); + } + pefree(old_tail, l->persistent); } diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h index b05ece8077..602884c27d 100644 --- a/Zend/zend_llist.h +++ b/Zend/zend_llist.h @@ -53,7 +53,7 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element); ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)); ZEND_API void zend_llist_destroy(zend_llist *l); ZEND_API void zend_llist_clean(zend_llist *l); -ZEND_API void *zend_llist_remove_tail(zend_llist *l); +ZEND_API void zend_llist_remove_tail(zend_llist *l); ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src); ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC); ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)); diff --git a/Zend/zend_long.h b/Zend/zend_long.h index 153b4d24f2..0fcc3116ae 100644 --- a/Zend/zend_long.h +++ b/Zend/zend_long.h @@ -110,6 +110,17 @@ typedef int32_t zend_off_t; # define ZEND_ABS abs #endif +#if SIZEOF_ZEND_LONG == 4 +# define MAX_LENGTH_OF_LONG 11 +# define LONG_MIN_DIGITS "2147483648" +#elif SIZEOF_ZEND_LONG == 8 +# define MAX_LENGTH_OF_LONG 20 +# define LONG_MIN_DIGITS "9223372036854775808" +#else +# error "Unknown SIZEOF_ZEND_LONG" +#endif + +static const char long_min_digits[] = LONG_MIN_DIGITS; #endif /* ZEND_LONG_H */ diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h index 11744c2699..158be22007 100644 --- a/Zend/zend_multiply.h +++ b/Zend/zend_multiply.h @@ -19,6 +19,9 @@ /* $Id$ */ +#ifndef ZEND_MULTIPLY_H +#define ZEND_MULTIPLY_H + #if defined(__i386__) && defined(__GNUC__) #define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ @@ -108,3 +111,138 @@ } while (0) #endif + +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow) +{ + size_t res = nmemb; + zend_ulong m_overflow = 0; + + __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1" + : "=&a"(res), "=&d" (m_overflow) + : "%0"(res), + "rm"(size), + "rm"(offset)); + + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif defined(__GNUC__) && defined(__x86_64__) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow) +{ + size_t res = nmemb; + zend_ulong m_overflow = 0; + +#ifdef __ILP32__ /* x32 */ +# define LP_SUFF "l" +#else /* amd64 */ +# define LP_SUFF "q" +#endif + + __asm__ ("mul" LP_SUFF " %3\n\t" + "add %4,%0\n\t" + "adc $0,%1" + : "=&a"(res), "=&d" (m_overflow) + : "%0"(res), + "rm"(size), + "rm"(offset)); + +#undef LP_SUFF + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif defined(__GNUC__) && defined(__arm__) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow) +{ + size_t res; + zend_ulong m_overflow; + + __asm__ ("umlal %0,%1,%2,%3" + : "=r"(res), "=r"(m_overflow) + : "r"(nmemb), + "r"(size), + "0"(offset), + "1"(0)); + + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif defined(__GNUC__) && defined(__aarch64__) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow) +{ + size_t res; + zend_ulong m_overflow; + + __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr" + : "=&r"(res), "=&r"(m_overflow) + : "r"(nmemb), + "r"(size), + "r"(offset)); + + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif SIZEOF_SIZE_T == 4 && defined(HAVE_ZEND_LONG64) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow) +{ + zend_ulong64 res = (zend_ulong64)nmemb * (zend_ulong64)size + (zend_ulong64)offset; + + if (UNEXPECTED(res > (zend_ulong64)0xFFFFFFFFL)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return (size_t) res; +} + +#else + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow) +{ + size_t res = nmemb * size + offset; + double _d = (double)nmemb * (double)size + (double)offset; + double _delta = (double)res - _d; + + if (UNEXPECTED((_d + _delta ) != _d)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} +#endif + +#endif /* ZEND_MULTIPLY_H */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + */ diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index ea32244b1b..5ee9847b6c 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -385,9 +385,9 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui } /* }}} */ -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) /* {{{ */ +ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC) /* {{{ */ { - return zend_get_property_info_quick(ce, Z_STR_P(member), silent, NULL TSRMLS_CC); + return zend_get_property_info_quick(ce, member, silent, NULL TSRMLS_CC); } /* }}} */ @@ -397,10 +397,10 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf const char *class_name = NULL; const char *prop_name; zend_string *member; - int prop_name_len; + size_t prop_name_len; if (prop_info_name->val[0] == 0) { - zend_unmangle_property_name_ex(prop_info_name->val, prop_info_name->len, &class_name, &prop_name, &prop_name_len); + zend_unmangle_property_name_ex(prop_info_name, &class_name, &prop_name, &prop_name_len); member = zend_string_init(prop_name, prop_name_len, 0); } else { member = zend_string_copy(prop_info_name); @@ -434,10 +434,12 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_property_info info.name = Z_STR_P(member); } else if(property_info->name->val[0] == '\0'){ const char *class_name = NULL, *prop_name = NULL; - zend_unmangle_property_name(property_info->name->val, property_info->name->len, &class_name, &prop_name); + size_t prop_name_len; + zend_unmangle_property_name_ex(property_info->name, &class_name, + &prop_name, &prop_name_len); if (class_name) { /* use unmangled name for protected properties */ - str = info.name = zend_string_init(prop_name, strlen(prop_name), 0); + str = info.name = zend_string_init(prop_name, prop_name_len, 0); property_info = &info; } } @@ -659,12 +661,12 @@ found: } } } else if (EXPECTED(property_info != NULL)) { + zval tmp; + write_std_property: - /* if we assign referenced variable, we should separate it */ if (Z_REFCOUNTED_P(value)) { if (Z_ISREF_P(value)) { - zval tmp; - + /* if we assign referenced variable, we should separate it */ ZVAL_DUP(&tmp, Z_REFVAL_P(value)); value = &tmp; } else { @@ -813,10 +815,6 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type, (guard = zend_get_property_guard(zobj, property_info, member)) == NULL || (property_info && ((*guard) & IN_GET))) { - /* we don't have access controls - will just add it */ - if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) { - zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name->val, Z_STRVAL_P(member)); - } ZVAL_NULL(&tmp); if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && property_info->offset >= 0) { @@ -828,6 +826,12 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type, } retval = zend_hash_update(zobj->properties, property_info->name, &tmp); } + + /* Notice is thrown after creation of the property, to avoid EG(std_property_info) + * being overwritten in an error handler. */ + if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) { + zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name->val, Z_STRVAL_P(member)); + } } else { /* we do have getter - fail and let it try again with usual get/set */ retval = NULL; @@ -919,7 +923,7 @@ static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ { - zend_internal_function *func = (zend_internal_function *)EG(current_execute_data)->func; + zend_internal_function *func = (zend_internal_function *)EX(func); zval method_name, method_args; zval method_result; zend_class_entry *ce = Z_OBJCE_P(getThis()); @@ -1137,7 +1141,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ { - zend_internal_function *func = (zend_internal_function *)EG(current_execute_data)->func; + zend_internal_function *func = (zend_internal_function *)EX(func); zval method_name, method_args; zval method_result; zend_class_entry *ce = EG(scope); @@ -1229,9 +1233,9 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st zend_string_free(lc_function_name); } if (ce->__call && - Z_OBJ(EG(This)) && - Z_OBJ_HT(EG(This))->get_class_entry && - instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) { + Z_OBJ(EG(current_execute_data)->This) && + Z_OBJ_HT(EG(current_execute_data)->This)->get_class_entry && + instanceof_function(Z_OBJCE(EG(current_execute_data)->This), ce TSRMLS_CC)) { return zend_get_user_call_function(ce, function_name); } else if (ce->__callstatic) { return zend_get_user_callstatic_function(ce, function_name); diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index ee6c9d9e5b..bc8500c3ec 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -159,7 +159,7 @@ ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot TSRMLS_DC); ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot TSRMLS_DC); ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object TSRMLS_DC); -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC); +ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC); ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC); ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC); ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC); diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h index df22a26cc9..362d79a68c 100644 --- a/Zend/zend_objects_API.h +++ b/Zend/zend_objects_API.h @@ -37,14 +37,7 @@ } while (0) -#define OBJ_RELEASE(obj) do { \ - zend_object *_obj = (obj); \ - if (--GC_REFCOUNT(_obj) == 0) { \ - zend_objects_store_del(_obj TSRMLS_CC); \ - } else { \ - gc_possible_root(&_obj->gc TSRMLS_CC); \ - } \ - } while (0) +#define OBJ_RELEASE(obj) zend_object_release(obj TSRMLS_CC) typedef struct _zend_objects_store { zend_object **object_buckets; @@ -78,6 +71,15 @@ ZEND_API zend_object *zend_object_create_proxy(zval *object, zval *member TSRMLS ZEND_API zend_object_handlers *zend_get_std_object_handlers(void); END_EXTERN_C() +static zend_always_inline void zend_object_release(zend_object *obj TSRMLS_DC) +{ + if (--GC_REFCOUNT(obj) == 0) { + zend_objects_store_del(obj TSRMLS_CC); + } else if (UNEXPECTED(!GC_INFO(obj))) { + gc_possible_root(&obj->gc TSRMLS_CC); + } +} + #endif /* ZEND_OBJECTS_H */ /* diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index db1f1cf9cc..5902abd4c5 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -100,16 +100,12 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC) { - switch (function->type) { - case ZEND_USER_FUNCTION: - destroy_op_array((zend_op_array *) function TSRMLS_CC); - break; - case ZEND_INTERNAL_FUNCTION: - if (function->common.function_name) { - zend_string_release(function->common.function_name); - } - /* do nothing */ - break; + if (function->type == ZEND_USER_FUNCTION) { + destroy_op_array(&function->op_array TSRMLS_CC); + } else { + ZEND_ASSERT(function->type == ZEND_INTERNAL_FUNCTION); + ZEND_ASSERT(function->common.function_name); + zend_string_release(function->common.function_name); } } @@ -118,11 +114,18 @@ ZEND_API void zend_function_dtor(zval *zv) zend_function *function = Z_PTR_P(zv); TSRMLS_FETCH(); - destroy_zend_function(function TSRMLS_CC); - if (function->type == ZEND_INTERNAL_FUNCTION) { - pefree(function, 1); - } else if (!function->common.function_name) { - efree_size(function, sizeof(zend_op_array)); + if (function->type == ZEND_USER_FUNCTION) { + ZEND_ASSERT(function->common.function_name); + destroy_op_array(&function->op_array TSRMLS_CC); + /* op_arrays are allocated on arena, so we don't have to free them */ +//??? efree_size(function, sizeof(zend_op_array)); + } else { + ZEND_ASSERT(function->type == ZEND_INTERNAL_FUNCTION); + ZEND_ASSERT(function->common.function_name); + zend_string_release(function->common.function_name); + if (!(function->common.fn_flags & ZEND_ACC_ARENA_ALLOCATED)) { + pefree(function, 1); + } } } @@ -444,7 +447,7 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num TSRMLS_DC) { - uint32_t i; + int i; for (i = 0; i < op_array->last_try_catch; i++) { if ((op_num < op_array->try_catch_array[i].finally_op || @@ -738,7 +741,7 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC) case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: case ZEND_NEW: case ZEND_FE_RESET: case ZEND_FE_FETCH: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index dad13d90de..b0a0e7519e 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -540,6 +540,7 @@ ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */ { switch (Z_TYPE_P(op)) { + case IS_UNDEF: case IS_NULL: case IS_FALSE: { TSRMLS_FETCH(); @@ -822,11 +823,10 @@ ZEND_API zend_string *_zval_get_string_func(zval *op TSRMLS_DC) /* {{{ */ { try_again: switch (Z_TYPE_P(op)) { + case IS_UNDEF: case IS_NULL: case IS_FALSE: return STR_EMPTY_ALLOC(); - case IS_STRING: - return zend_string_copy(Z_STR_P(op)); case IS_TRUE: return zend_string_init("1", 1, 0); case IS_RESOURCE: { @@ -866,6 +866,8 @@ try_again: case IS_REFERENCE: op = Z_REFVAL_P(op); goto try_again; + case IS_STRING: + return zend_string_copy(Z_STR_P(op)); EMPTY_SWITCH_DEFAULT_CASE() } return NULL; @@ -1447,6 +1449,18 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) / op1_lval = Z_LVAL_P(op1); } + /* prevent wrapping quirkiness on some processors where << 64 + x == << x */ + if (Z_LVAL_P(op2) >= SIZEOF_ZEND_LONG * 8) { + ZVAL_LONG(result, 0); + return SUCCESS; + } + + if (Z_LVAL_P(op2) < 0) { + zend_error(E_WARNING, "Bit shift by negative number"); + ZVAL_FALSE(result); + return FAILURE; + } + ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); return SUCCESS; } @@ -1467,6 +1481,18 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) op1_lval = Z_LVAL_P(op1); } + /* prevent wrapping quirkiness on some processors where >> 64 + x == >> x */ + if (Z_LVAL_P(op2) >= SIZEOF_ZEND_LONG * 8) { + ZVAL_LONG(result, (Z_LVAL_P(op1) < 0) ? -1 : 0); + return SUCCESS; + } + + if (Z_LVAL_P(op2) < 0) { + zend_error(E_WARNING, "Bit shift by negative number"); + ZVAL_FALSE(result); + return FAILURE; + } + ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); return SUCCESS; } @@ -1539,7 +1565,7 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{ zend_error_noreturn(E_ERROR, "String size overflow"); } - if (result == op1 && !IS_INTERNED(Z_STR_P(result))) { + if (result == op1 && Z_REFCOUNTED_P(result)) { /* special case, perform operations on result */ result_str = zend_string_realloc(Z_STR_P(result), result_len, 0); } else { @@ -2017,7 +2043,7 @@ static void increment_string(zval *str) /* {{{ */ return; } - if (IS_INTERNED(Z_STR_P(str))) { + if (!Z_REFCOUNTED_P(str)) { Z_STR_P(str) = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0); Z_TYPE_INFO_P(str) = IS_STRING_EX; } else if (Z_REFCOUNT_P(str) > 1) { @@ -2133,7 +2159,19 @@ try_again: } break; case IS_OBJECT: - if (Z_OBJ_HANDLER_P(op1, do_operation)) { + if (Z_OBJ_HANDLER_P(op1, get) + && Z_OBJ_HANDLER_P(op1, set)) { + /* proxy object */ + zval rv; + zval *val; + TSRMLS_FETCH(); + + val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv TSRMLS_CC); + Z_ADDREF_P(val); + fast_increment_function(val); + Z_OBJ_HANDLER_P(op1, set)(op1, val TSRMLS_CC); + zval_ptr_dtor(val); + } else if (Z_OBJ_HANDLER_P(op1, do_operation)) { zval op2; int res; TSRMLS_FETCH(); @@ -2196,7 +2234,19 @@ try_again: } break; case IS_OBJECT: - if (Z_OBJ_HANDLER_P(op1, do_operation)) { + if (Z_OBJ_HANDLER_P(op1, get) + && Z_OBJ_HANDLER_P(op1, set)) { + /* proxy object */ + zval rv; + zval *val; + TSRMLS_FETCH(); + + val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv TSRMLS_CC); + Z_ADDREF_P(val); + fast_decrement_function(val); + Z_OBJ_HANDLER_P(op1, set)(op1, val TSRMLS_CC); + zval_ptr_dtor(val); + } else if (Z_OBJ_HANDLER_P(op1, do_operation)) { zval op2; int res; TSRMLS_FETCH(); @@ -2518,8 +2568,7 @@ ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) /* {{{ */ ZEND_API zend_string *zend_long_to_str(zend_long num) /* {{{ */ { char buf[MAX_LENGTH_OF_LONG + 1]; - char *res; - _zend_print_signed_to_buf(buf + sizeof(buf) - 1, num, zend_ulong, res); + char *res = zend_print_long_to_buf(buf + sizeof(buf) - 1, num); return zend_string_init(res, buf + sizeof(buf) - 1 - res, 0); } /* }}} */ @@ -2528,6 +2577,143 @@ ZEND_API zend_uchar is_numeric_str_function(const zend_string *str, zend_long *l return is_numeric_string_ex(str->val, str->len, lval, dval, -1, NULL); } +ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info) +{ + const char *ptr; + int base = 10, digits = 0, dp_or_e = 0; + double local_dval = 0.0; + zend_uchar type; + + if (!length) { + return 0; + } + + if (oflow_info != NULL) { + *oflow_info = 0; + } + + /* Skip any whitespace + * This is much faster than the isspace() function */ + while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r' || *str == '\v' || *str == '\f') { + str++; + length--; + } + ptr = str; + + if (*ptr == '-' || *ptr == '+') { + ptr++; + } + + if (ZEND_IS_DIGIT(*ptr)) { + /* Handle hex numbers + * str is used instead of ptr to disallow signs and keep old behavior */ + if (length > 2 && *str == '0' && (str[1] == 'x' || str[1] == 'X')) { + base = 16; + ptr += 2; + } + + /* Skip any leading 0s */ + while (*ptr == '0') { + ptr++; + } + + /* Count the number of digits. If a decimal point/exponent is found, + * it's a double. Otherwise, if there's a dval or no need to check for + * a full match, stop when there are too many digits for a long */ + for (type = IS_LONG; !(digits >= MAX_LENGTH_OF_LONG && (dval || allow_errors == 1)); digits++, ptr++) { +check_digits: + if (ZEND_IS_DIGIT(*ptr) || (base == 16 && ZEND_IS_XDIGIT(*ptr))) { + continue; + } else if (base == 10) { + if (*ptr == '.' && dp_or_e < 1) { + goto process_double; + } else if ((*ptr == 'e' || *ptr == 'E') && dp_or_e < 2) { + const char *e = ptr + 1; + + if (*e == '-' || *e == '+') { + ptr = e++; + } + if (ZEND_IS_DIGIT(*e)) { + goto process_double; + } + } + } + + break; + } + + if (base == 10) { + if (digits >= MAX_LENGTH_OF_LONG) { + if (oflow_info != NULL) { + *oflow_info = *str == '-' ? -1 : 1; + } + dp_or_e = -1; + goto process_double; + } + } else if (!(digits < SIZEOF_ZEND_LONG * 2 || (digits == SIZEOF_ZEND_LONG * 2 && ptr[-digits] <= '7'))) { + if (dval) { + local_dval = zend_hex_strtod(str, &ptr); + } + if (oflow_info != NULL) { + *oflow_info = 1; + } + type = IS_DOUBLE; + } + } else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) { +process_double: + type = IS_DOUBLE; + + /* If there's a dval, do the conversion; else continue checking + * the digits if we need to check for a full match */ + if (dval) { + local_dval = zend_strtod(str, &ptr); + } else if (allow_errors != 1 && dp_or_e != -1) { + dp_or_e = (*ptr++ == '.') ? 1 : 2; + goto check_digits; + } + } else { + return 0; + } + + if (ptr != str + length) { + if (!allow_errors) { + return 0; + } + if (allow_errors == -1) { + zend_error(E_NOTICE, "A non well formed numeric value encountered"); + } + } + + if (type == IS_LONG) { + if (digits == MAX_LENGTH_OF_LONG - 1) { + int cmp = strcmp(&ptr[-digits], long_min_digits); + + if (!(cmp < 0 || (cmp == 0 && *str == '-'))) { + if (dval) { + *dval = zend_strtod(str, NULL); + } + if (oflow_info != NULL) { + *oflow_info = *str == '-' ? -1 : 1; + } + + return IS_DOUBLE; + } + } + + if (lval) { + *lval = ZEND_STRTOL(str, NULL, base); + } + + return IS_LONG; + } else { + if (dval) { + *dval = local_dval; + } + + return IS_DOUBLE; + } +} + /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 41342de020..8075edf939 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -69,14 +69,41 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSR ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC); ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce TSRMLS_DC); + +/** + * Checks whether the string "str" with length "length" is numeric. The value + * of allow_errors determines whether it's required to be entirely numeric, or + * just its prefix. Leading whitespace is allowed. + * + * The function returns 0 if the string did not contain a valid number; IS_LONG + * if it contained a number that fits within the range of a long; or IS_DOUBLE + * if the number was out of long range or contained a decimal point/exponent. + * The number's value is returned into the respective pointer, *lval or *dval, + * if that pointer is not NULL. + * + * This variant also gives information if a string that represents an integer + * could not be represented as such due to overflow. It writes 1 to oflow_info + * if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN. + */ +ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info); + END_EXTERN_C() #if ZEND_DVAL_TO_LVAL_CAST_OK -# define zend_dval_to_lval(d) ((zend_long) (d)) +static zend_always_inline zend_long zend_dval_to_lval(double d) +{ + if (EXPECTED(zend_finite(d)) && EXPECTED(!zend_isnan(d))) { + return (zend_long)d; + } else { + return 0; + } +} #elif SIZEOF_ZEND_LONG == 4 static zend_always_inline zend_long zend_dval_to_lval(double d) { - if (d > ZEND_LONG_MAX || d < ZEND_LONG_MIN) { + if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) { + return 0; + } else if (d > ZEND_LONG_MAX || d < ZEND_LONG_MIN) { double two_pow_32 = pow(2., 32.), dmod; @@ -93,8 +120,10 @@ static zend_always_inline zend_long zend_dval_to_lval(double d) #else static zend_always_inline zend_long zend_dval_to_lval(double d) { + if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) { + return 0; /* >= as (double)ZEND_LONG_MAX is outside signed range */ - if (d >= ZEND_LONG_MAX || d < ZEND_LONG_MIN) { + } else if (d >= ZEND_LONG_MAX || d < ZEND_LONG_MIN) { double two_pow_64 = pow(2., 64.), dmod; @@ -114,165 +143,21 @@ static zend_always_inline zend_long zend_dval_to_lval(double d) #define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9') #define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f')) -/** - * Checks whether the string "str" with length "length" is numeric. The value - * of allow_errors determines whether it's required to be entirely numeric, or - * just its prefix. Leading whitespace is allowed. - * - * The function returns 0 if the string did not contain a valid number; IS_LONG - * if it contained a number that fits within the range of a long; or IS_DOUBLE - * if the number was out of long range or contained a decimal point/exponent. - * The number's value is returned into the respective pointer, *lval or *dval, - * if that pointer is not NULL. - * - * This variant also gives information if a string that represents an integer - * could not be represented as such due to overflow. It writes 1 to oflow_info - * if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN. - */ -static inline zend_uchar is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info) +static zend_always_inline zend_uchar is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info) { - const char *ptr; - int base = 10, digits = 0, dp_or_e = 0; - double local_dval = 0.0; - zend_uchar type; - - if (!length) { + if (*str > '9') { return 0; } - - if (oflow_info != NULL) { - *oflow_info = 0; - } - - /* Skip any whitespace - * This is much faster than the isspace() function */ - while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r' || *str == '\v' || *str == '\f') { - str++; - length--; - } - ptr = str; - - if (*ptr == '-' || *ptr == '+') { - ptr++; - } - - if (ZEND_IS_DIGIT(*ptr)) { - /* Handle hex numbers - * str is used instead of ptr to disallow signs and keep old behavior */ - if (length > 2 && *str == '0' && (str[1] == 'x' || str[1] == 'X')) { - base = 16; - ptr += 2; - } - - /* Skip any leading 0s */ - while (*ptr == '0') { - ptr++; - } - - /* Count the number of digits. If a decimal point/exponent is found, - * it's a double. Otherwise, if there's a dval or no need to check for - * a full match, stop when there are too many digits for a long */ - for (type = IS_LONG; !(digits >= MAX_LENGTH_OF_LONG && (dval || allow_errors == 1)); digits++, ptr++) { -check_digits: - if (ZEND_IS_DIGIT(*ptr) || (base == 16 && ZEND_IS_XDIGIT(*ptr))) { - continue; - } else if (base == 10) { - if (*ptr == '.' && dp_or_e < 1) { - goto process_double; - } else if ((*ptr == 'e' || *ptr == 'E') && dp_or_e < 2) { - const char *e = ptr + 1; - - if (*e == '-' || *e == '+') { - ptr = e++; - } - if (ZEND_IS_DIGIT(*e)) { - goto process_double; - } - } - } - - break; - } - - if (base == 10) { - if (digits >= MAX_LENGTH_OF_LONG) { - if (oflow_info != NULL) { - *oflow_info = *str == '-' ? -1 : 1; - } - dp_or_e = -1; - goto process_double; - } - } else if (!(digits < SIZEOF_ZEND_LONG * 2 || (digits == SIZEOF_ZEND_LONG * 2 && ptr[-digits] <= '7'))) { - if (dval) { - local_dval = zend_hex_strtod(str, &ptr); - } - if (oflow_info != NULL) { - *oflow_info = 1; - } - type = IS_DOUBLE; - } - } else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) { -process_double: - type = IS_DOUBLE; - - /* If there's a dval, do the conversion; else continue checking - * the digits if we need to check for a full match */ - if (dval) { - local_dval = zend_strtod(str, &ptr); - } else if (allow_errors != 1 && dp_or_e != -1) { - dp_or_e = (*ptr++ == '.') ? 1 : 2; - goto check_digits; - } - } else { - return 0; - } - - if (ptr != str + length) { - if (!allow_errors) { - return 0; - } - if (allow_errors == -1) { - zend_error(E_NOTICE, "A non well formed numeric value encountered"); - } - } - - if (type == IS_LONG) { - if (digits == MAX_LENGTH_OF_LONG - 1) { - int cmp = strcmp(&ptr[-digits], long_min_digits); - - if (!(cmp < 0 || (cmp == 0 && *str == '-'))) { - if (dval) { - *dval = zend_strtod(str, NULL); - } - if (oflow_info != NULL) { - *oflow_info = *str == '-' ? -1 : 1; - } - - return IS_DOUBLE; - } - } - - if (lval) { - *lval = ZEND_STRTOL(str, NULL, base); - } - - return IS_LONG; - } else { - if (dval) { - *dval = local_dval; - } - - return IS_DOUBLE; - } + return _is_numeric_string_ex(str, length, lval, dval, allow_errors, oflow_info); } -static inline zend_uchar is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors) { +static zend_always_inline zend_uchar is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors) { return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL); } ZEND_API zend_uchar is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval); -static inline const char * +static zend_always_inline const char * zend_memnstr(const char *haystack, const char *needle, size_t needle_len, char *end) { const char *p = haystack; @@ -309,7 +194,7 @@ zend_memnstr(const char *haystack, const char *needle, size_t needle_len, char * return NULL; } -static inline const void *zend_memrchr(const void *s, int c, size_t n) +static zend_always_inline const void *zend_memrchr(const void *s, int c, size_t n) { register const unsigned char *e; @@ -401,7 +286,6 @@ ZEND_API int zend_atoi(const char *str, int str_len); ZEND_API zend_long zend_atol(const char *str, int str_len); ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC); -END_EXTERN_C() #define convert_to_ex_master(pzv, lower_type, upper_type) \ if (Z_TYPE_P(pzv)!=upper_type) { \ @@ -1021,30 +905,31 @@ static zend_always_inline void fast_is_not_identical_function(zval *result, zval return SUCCESS; \ } -/* input: buf points to the END of the buffer */ -#define _zend_print_unsigned_to_buf(buf, num, vartype, result) do { \ - char *__p = (buf); \ - vartype __num = (num); \ - *__p = '\0'; \ - do { \ - *--__p = (char) (__num % 10) + '0'; \ - __num /= 10; \ - } while (__num > 0); \ - result = __p; \ -} while (0) +/* buf points to the END of the buffer */ +static zend_always_inline char *zend_print_ulong_to_buf(char *buf, zend_ulong num) { + *buf = '\0'; + do { + *--buf = (char) (num % 10) + '0'; + num /= 10; + } while (num > 0); + return buf; +} /* buf points to the END of the buffer */ -#define _zend_print_signed_to_buf(buf, num, vartype, result) do { \ - if (num < 0) { \ - _zend_print_unsigned_to_buf((buf), -(vartype)(num), vartype, (result)); \ - *--(result) = '-'; \ - } else { \ - _zend_print_unsigned_to_buf((buf), (num), vartype, (result)); \ - } \ -} while (0) +static zend_always_inline char *zend_print_long_to_buf(char *buf, zend_long num) { + if (num < 0) { + char *result = zend_print_ulong_to_buf(buf, ~((zend_ulong) num) + 1); + *--result = '-'; + return result; + } else { + return zend_print_ulong_to_buf(buf, num); + } +} ZEND_API zend_string *zend_long_to_str(zend_long num); +END_EXTERN_C() + #endif /* diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h new file mode 100644 index 0000000000..1705965c6b --- /dev/null +++ b/Zend/zend_portability.h @@ -0,0 +1,399 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans <andi@zend.com> | + | Zeev Suraski <zeev@zend.com> | + | Dmitry Stogov <zeev@zend.com> | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#ifndef ZEND_PORTABILITY_H +#define ZEND_PORTABILITY_H + +#ifdef __cplusplus +#define BEGIN_EXTERN_C() extern "C" { +#define END_EXTERN_C() } +#else +#define BEGIN_EXTERN_C() +#define END_EXTERN_C() +#endif + +/* + * general definitions + */ + +#ifdef ZEND_WIN32 +# include "zend_config.w32.h" +# define ZEND_PATHS_SEPARATOR ';' +#elif defined(NETWARE) +# include <zend_config.h> +# define ZEND_PATHS_SEPARATOR ';' +#elif defined(__riscos__) +# include <zend_config.h> +# define ZEND_PATHS_SEPARATOR ';' +#else +# include <zend_config.h> +# define ZEND_PATHS_SEPARATOR ':' +#endif + +#include "../TSRM/TSRM.h" + +#include <stdio.h> +#include <assert.h> + +#ifdef HAVE_UNIX_H +# include <unix.h> +#endif + +#ifdef HAVE_STDARG_H +# include <stdarg.h> +#endif + +#ifdef HAVE_DLFCN_H +# include <dlfcn.h> +#endif + +#ifdef HAVE_LIMITS_H +# include <limits.h> +#endif + +#if HAVE_ALLOCA_H && !defined(_ALLOCA_H) +# include <alloca.h> +#endif + +/* Only use this macro if you know for sure that all of the switches values + are covered by its case statements */ +#if ZEND_DEBUG +# define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_ASSERT(0); break; +#elif defined(ZEND_WIN32) +# define EMPTY_SWITCH_DEFAULT_CASE() default: __assume(0); break; +#else +# define EMPTY_SWITCH_DEFAULT_CASE() +#endif + +/* all HAVE_XXX test have to be after the include of zend_config above */ + +#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32) + +# ifndef RTLD_LAZY +# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */ +# endif + +# ifndef RTLD_GLOBAL +# define RTLD_GLOBAL 0 +# endif + +# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT) +# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT) +# elif defined(RTLD_DEEPBIND) +# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND) +# else +# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL) +# endif +# define DL_UNLOAD dlclose +# if defined(DLSYM_NEEDS_UNDERSCORE) +# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" s) +# else +# define DL_FETCH_SYMBOL dlsym +# endif +# define DL_ERROR dlerror +# define DL_HANDLE void * +# define ZEND_EXTENSIONS_SUPPORT 1 +#elif defined(ZEND_WIN32) +# define DL_LOAD(libname) LoadLibrary(libname) +# define DL_FETCH_SYMBOL GetProcAddress +# define DL_UNLOAD FreeLibrary +# define DL_HANDLE HMODULE +# define ZEND_EXTENSIONS_SUPPORT 1 +#else +# define DL_HANDLE void * +# define ZEND_EXTENSIONS_SUPPORT 0 +#endif + +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# ifndef HAVE_ALLOCA_H +# ifdef _AIX +# pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca(); +# endif +# endif +# endif +#endif + +/* Compatibility with non-clang compilers */ +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif + +/* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */ +#ifdef __GNUC__ +# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) +#else +# define ZEND_GCC_VERSION 0 +#endif + +#if ZEND_GCC_VERSION >= 2096 +# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +#else +# define ZEND_ATTRIBUTE_MALLOC +#endif + +#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size) +# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X))) +# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y))) +#else +# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) +# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) +#endif + +/* Format string checks are disabled by default, because we use custom format modifiers (like %p), + * which cause a large amount of false positives. You can enable format checks by adding + * -DZEND_CHECK_FORMAT_STRINGS to CFLAGS. */ + +#if defined(ZEND_CHECK_FORMAT_STRINGS) && (ZEND_GCC_VERSION >= 2007 || __has_attribute(format)) +# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) +#else +# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) +#endif + +#if defined(ZEND_CHECK_FORMAT_STRINGS) && ((ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)) || __has_attribute(format)) +# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) +#else +# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) +#endif + +#if ZEND_GCC_VERSION >= 3001 || __has_attribute(deprecated) +# define ZEND_ATTRIBUTE_DEPRECATED __attribute__((deprecated)) +#elif defined(ZEND_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define ZEND_ATTRIBUTE_DEPRECATED __declspec(deprecated) +#else +# define ZEND_ATTRIBUTE_DEPRECATED +#endif + +#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003 +# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused)) +# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused)); +#else +# define ZEND_ATTRIBUTE_UNUSED +# define ZEND_ATTRIBUTE_UNUSED_LABEL +#endif + +#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__) +# define ZEND_FASTCALL __attribute__((fastcall)) +#elif defined(_MSC_VER) && defined(_M_IX86) +# define ZEND_FASTCALL __fastcall +#else +# define ZEND_FASTCALL +#endif + +#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 +#else +# define __restrict__ +#endif +#define restrict __restrict__ + +#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn) +# define HAVE_NORETURN +# define ZEND_NORETURN __attribute__((noreturn)) +#elif defined(ZEND_WIN32) +# define HAVE_NORETURN +# define ZEND_NORETURN __declspec(noreturn) +#else +# define ZEND_NORETURN +#endif + +#if ZEND_DEBUG +# define zend_always_inline inline +# define zend_never_inline +#else +# if defined(__GNUC__) +# if __GNUC__ >= 3 +# define zend_always_inline inline __attribute__((always_inline)) +# define zend_never_inline __attribute__((noinline)) +# else +# define zend_always_inline inline +# define zend_never_inline +# endif +# elif defined(_MSC_VER) +# define zend_always_inline __forceinline +# define zend_never_inline +# else +# if __has_attribute(always_inline) +# define zend_always_inline inline __attribute__((always_inline)) +# else +# define zend_always_inline inline +# endif +# if __has_attribute(noinline) +# define zend_never_inline __attribute__((noinline)) +# else +# define zend_never_inline +# endif +# endif +#endif /* ZEND_DEBUG */ + +#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) +# define EXPECTED(condition) __builtin_expect(!(!(condition)), 1) +# define UNEXPECTED(condition) __builtin_expect(!(!(condition)), 0) +#else +# define EXPECTED(condition) (condition) +# define UNEXPECTED(condition) (condition) +#endif + +#ifndef XtOffsetOf +# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX)) +# ifdef __STDC__ +# define XtOffset(p_type, field) _Offsetof(p_type, field) +# else +# ifdef CRAY2 +# define XtOffset(p_type, field) \ + (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) + +# else /* !CRAY2 */ + +# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) + +# endif /* !CRAY2 */ +# endif /* __STDC__ */ +# else /* ! (CRAY || __arm) */ + +# define XtOffset(p_type, field) \ + ((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) + +# endif /* !CRAY */ + +# ifdef offsetof +# define XtOffsetOf(s_type, field) offsetof(s_type, field) +# else +# define XtOffsetOf(s_type, field) XtOffset(s_type*, field) +# endif + +#endif + +#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) +# define ZEND_ALLOCA_MAX_SIZE (32 * 1024) +# define ALLOCA_FLAG(name) \ + zend_bool name; +# define SET_ALLOCA_FLAG(name) \ + name = 1 +# define do_alloca_ex(size, limit, use_heap) \ + ((use_heap = (UNEXPECTED((size) > (limit)))) ? emalloc(size) : alloca(size)) +# define do_alloca(size, use_heap) \ + do_alloca_ex(size, ZEND_ALLOCA_MAX_SIZE, use_heap) +# define free_alloca(p, use_heap) \ + do { if (UNEXPECTED(use_heap)) efree(p); } while (0) +#else +# define ALLOCA_FLAG(name) +# define SET_ALLOCA_FLAG(name) +# define do_alloca(p, use_heap) emalloc(p) +# define free_alloca(p, use_heap) efree(p) +#endif + +#ifdef HAVE_SIGSETJMP +# define SETJMP(a) sigsetjmp(a, 0) +# define LONGJMP(a,b) siglongjmp(a, b) +# define JMP_BUF sigjmp_buf +#else +# define SETJMP(a) setjmp(a) +# define LONGJMP(a,b) longjmp(a, b) +# define JMP_BUF jmp_buf +#endif + +#if ZEND_DEBUG +# define ZEND_FILE_LINE_D const char *__zend_filename, const uint __zend_lineno +# define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D +# define ZEND_FILE_LINE_ORIG_D const char *__zend_orig_filename, const uint __zend_orig_lineno +# define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D +# define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno +# define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C +# define ZEND_FILE_LINE_C __FILE__, __LINE__ +# define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C +# define ZEND_FILE_LINE_EMPTY_C NULL, 0 +# define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C +# define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno +# define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C +# define ZEND_ASSERT(c) assert(c) +#else +# define ZEND_FILE_LINE_D +# define ZEND_FILE_LINE_DC +# define ZEND_FILE_LINE_ORIG_D +# define ZEND_FILE_LINE_ORIG_DC +# define ZEND_FILE_LINE_RELAY_C +# define ZEND_FILE_LINE_RELAY_CC +# define ZEND_FILE_LINE_C +# define ZEND_FILE_LINE_CC +# define ZEND_FILE_LINE_EMPTY_C +# define ZEND_FILE_LINE_EMPTY_CC +# define ZEND_FILE_LINE_ORIG_RELAY_C +# define ZEND_FILE_LINE_ORIG_RELAY_CC +# define ZEND_ASSERT(c) +#endif /* ZEND_DEBUG */ + +#if ZEND_DEBUG +# define Z_DBG(expr) (expr) +#else +# define Z_DBG(expr) +#endif + +#ifdef ZTS +# define ZTS_V 1 +#else +# define ZTS_V 0 +#endif + +#ifndef LONG_MAX +# define LONG_MAX 2147483647L +#endif + +#ifndef LONG_MIN +# define LONG_MIN (- LONG_MAX - 1) +#endif + +#define MAX_LENGTH_OF_DOUBLE 32 + +#undef MIN +#undef MAX +#define MAX(a, b) (((a)>(b))?(a):(b)) +#define MIN(a, b) (((a)<(b))?(a):(b)) +#define ZEND_STRL(str) (str), (sizeof(str)-1) +#define ZEND_STRS(str) (str), (sizeof(str)) +#define ZEND_NORMALIZE_BOOL(n) \ + ((n) ? (((n)>0) ? 1 : -1) : 0) +#define ZEND_TRUTH(x) ((x) ? 1 : 0) +#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b)) + +#define ZEND_MAX_RESERVED_RESOURCES 4 + +/* excpt.h on Digital Unix 4.0 defines function_table */ +#undef function_table + +#ifdef ZEND_WIN32 +#define ZEND_SECURE_ZERO(var, size) RtlSecureZeroMemory((var), (size)) +#else +#define ZEND_SECURE_ZERO(var, size) memset((var), 0, (size)) +#endif + +#endif /* ZEND_PORTABILITY_H */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + */ diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h index ecd7b7042a..8a3dede91e 100644 --- a/Zend/zend_ptr_stack.h +++ b/Zend/zend_ptr_stack.h @@ -111,7 +111,7 @@ static zend_always_inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) return *(--stack->top_element); } -static inline void *zend_ptr_stack_top(zend_ptr_stack *stack) +static zend_always_inline void *zend_ptr_stack_top(zend_ptr_stack *stack) { return stack->elements[stack->top - 1]; } diff --git a/Zend/zend_smart_str.h b/Zend/zend_smart_str.h new file mode 100644 index 0000000000..2724ac7323 --- /dev/null +++ b/Zend/zend_smart_str.h @@ -0,0 +1,125 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 7 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2014 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann <sascha@schumann.cx> | + +----------------------------------------------------------------------+ + */ + +#ifndef ZEND_SMART_STR_H +#define ZEND_SMART_STR_H + +#include <zend.h> +#include "zend_smart_str_public.h" + +#ifndef SMART_STR_PREALLOC +#define SMART_STR_PREALLOC 128 +#endif + +#ifndef SMART_STR_START_SIZE +#define SMART_STR_START_SIZE 78 +#endif + +#define smart_str_appends_ex(dest, src, what) \ + smart_str_appendl_ex((dest), (src), strlen(src), (what)) +#define smart_str_appends(dest, src) \ + smart_str_appendl((dest), (src), strlen(src)) +#define smart_str_appendc(dest, c) \ + smart_str_appendc_ex((dest), (c), 0) +#define smart_str_appendl(dest, src, len) \ + smart_str_appendl_ex((dest), (src), (len), 0) +#define smart_str_append(dest, src) \ + smart_str_append_ex((dest), (src), 0) +#define smart_str_append_smart_str(dest, src) \ + smart_str_append_smart_str_ex((dest), (src), 0) +#define smart_str_sets(dest, src) \ + smart_str_setl((dest), (src), strlen(src)); +#define smart_str_append_long(dest, val) \ + smart_str_append_long_ex((dest), (val), 0) +#define smart_str_append_unsigned(dest, val) \ + smart_str_append_unsigned_ex((dest), (val), 0) + +static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, zend_bool persistent) { + size_t newlen; + if (!str->s) { + newlen = len; + str->a = newlen < SMART_STR_START_SIZE + ? SMART_STR_START_SIZE + : newlen + SMART_STR_PREALLOC; + str->s = zend_string_alloc(str->a, persistent); + str->s->len = 0; + } else { + newlen = str->s->len + len; + if (newlen >= str->a) { + str->a = newlen + SMART_STR_PREALLOC; + str->s = (zend_string *) perealloc(str->s, _STR_HEADER_SIZE + str->a + 1, persistent); + } + } + return newlen; +} + +static zend_always_inline void smart_str_free(smart_str *str) { + if (str->s) { + zend_string_release(str->s); + str->s = NULL; + } + str->a = 0; +} + +static zend_always_inline void smart_str_0(smart_str *str) { + if (str->s) { + str->s->val[str->s->len] = '\0'; + } +} + +static zend_always_inline void smart_str_appendc_ex(smart_str *dest, char ch, zend_bool persistent) { + size_t new_len = smart_str_alloc(dest, 1, persistent); + dest->s->val[new_len - 1] = ch; + dest->s->len = new_len; +} + +static zend_always_inline void smart_str_appendl_ex(smart_str *dest, const char *str, size_t len, zend_bool persistent) { + size_t new_len = smart_str_alloc(dest, len, persistent); + memcpy(dest->s->val + dest->s->len, str, len); + dest->s->len = new_len; +} + +static zend_always_inline void smart_str_append_ex(smart_str *dest, const zend_string *src, zend_bool persistent) { + smart_str_appendl_ex(dest, src->val, src->len, persistent); +} + +static zend_always_inline void smart_str_append_smart_str_ex(smart_str *dest, const smart_str *src, zend_bool persistent) { + if (src->s && src->s->len) { + smart_str_append_ex(dest, src->s, persistent); + } +} + +static zend_always_inline void smart_str_append_long_ex(smart_str *dest, zend_long num, zend_bool persistent) { + char buf[32]; + char *result = zend_print_long_to_buf(buf + sizeof(buf) - 1, num); + smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent); +} + +static zend_always_inline void smart_str_append_unsigned_ex(smart_str *dest, zend_ulong num, zend_bool persistent) { + char buf[32]; + char *result = zend_print_ulong_to_buf(buf + sizeof(buf) - 1, num); + smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent); +} + +static zend_always_inline void smart_str_setl(smart_str *dest, const char *src, size_t len) { + smart_str_free(dest); + smart_str_appendl(dest, src, len); +} + +#endif + diff --git a/ext/standard/php_smart_str_public.h b/Zend/zend_smart_str_public.h index 7ce299e442..23abe8e064 100644 --- a/ext/standard/php_smart_str_public.h +++ b/Zend/zend_smart_str_public.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -16,12 +16,8 @@ +----------------------------------------------------------------------+ */ -/* $Id$ */ - -#ifndef PHP_SMART_STR_PUBLIC_H -#define PHP_SMART_STR_PUBLIC_H - -#include <sys/types.h> +#ifndef ZEND_SMART_STR_PUBLIC_H +#define ZEND_SMART_STR_PUBLIC_H typedef struct { zend_string *s; diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c deleted file mode 100644 index 049d29f6a2..0000000000 --- a/Zend/zend_static_allocator.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans <andi@zend.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend_static_allocator.h" - -/* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ - -inline static void block_init(Block *block, uint32_t block_size) -{ - block->pos = block->bp = (char *) emalloc(block_size); - block->end = block->bp + block_size; -} - -inline static char *block_allocate(Block *block, uint32_t size) -{ - char *retval = block->pos; - if ((block->pos += size) >= block->end) { - return (char *)NULL; - } - return retval; -} - -inline static void block_destroy(Block *block) -{ - efree(block->bp); -} - -void static_allocator_init(StaticAllocator *sa) -{ - sa->Blocks = (Block *) emalloc(sizeof(Block)); - block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE); - sa->num_blocks = 1; - sa->current_block = 0; -} - -char *static_allocator_allocate(StaticAllocator *sa, uint32_t size) -{ - char *retval; - - retval = block_allocate(&sa->Blocks[sa->current_block], size); - if (retval) { - return retval; - } - sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks); - sa->current_block++; - block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_SIZE); - retval = block_allocate(&sa->Blocks[sa->current_block], size); - return retval; -} - -void static_allocator_destroy(StaticAllocator *sa) -{ - uint32_t i; - - for (i=0; i<sa->num_blocks; i++) { - block_free(&sa->Blocks[i]); - } - efree(sa->Blocks); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h deleted file mode 100644 index cd9b0ff583..0000000000 --- a/Zend/zend_static_allocator.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans <andi@zend.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STATIC_ALLOCATOR_H -#define ZEND_STATIC_ALLOCATOR_H - -#define ALLOCATOR_BLOCK_SIZE 400000 - -/* Temporary */ -typedef unsigned int uint32_t; -#define emalloc(s) malloc(s) -#define efree(p) free(p) - -typedef struct _Block { - char *bp; - char *pos; - char *end; -} Block; - -typedef struct _StaticAllocator { - Block *Blocks; - uint32_t num_blocks; - uint32_t current_block; -} StaticAllocator; - -void static_allocator_init(StaticAllocator *sa); -char *static_allocator_allocate(StaticAllocator *sa, uint32_t size); -void static_allocator_destroy(StaticAllocator *sa); - -#endif /* ZEND_STATIC_ALLOCATOR_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h index 10fa8d8a60..84dc2e00b8 100644 --- a/Zend/zend_stream.h +++ b/Zend/zend_stream.h @@ -63,14 +63,14 @@ typedef struct _zend_stream { } zend_stream; typedef struct _zend_file_handle { - zend_stream_type type; - const char *filename; - char *opened_path; union { int fd; FILE *fp; zend_stream stream; } handle; + const char *filename; + char *opened_path; + zend_stream_type type; zend_bool free_filename; } zend_file_handle; diff --git a/Zend/zend_string.c b/Zend/zend_string.c index a9148f2c4a..a4455e8da9 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -80,7 +80,7 @@ void zend_interned_strings_dtor(TSRMLS_D) #ifndef ZTS zend_hash_destroy(&CG(interned_strings)); #else - free(CG(empty_string)); + zend_string_release(CG(empty_string)); #endif } diff --git a/Zend/zend_string.h b/Zend/zend_string.h index a2b5fb932e..d30e14b5b3 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -140,7 +140,7 @@ static zend_always_inline zend_string *zend_string_init(const char *str, size_t static zend_always_inline zend_string *zend_string_copy(zend_string *s) { if (!IS_INTERNED(s)) { - zend_string_addref(s); + GC_REFCOUNT(s)++; } return s; } @@ -161,14 +161,14 @@ static zend_always_inline zend_string *zend_string_realloc(zend_string *s, size_ if (IS_INTERNED(s)) { ret = zend_string_alloc(len, persistent); memcpy(ret->val, s->val, (len > s->len ? s->len : len) + 1); - } else if (EXPECTED(zend_string_refcount(s) == 1)) { + } else if (EXPECTED(GC_REFCOUNT(s) == 1)) { ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_STR_HEADER_SIZE + len + 1), persistent); ret->len = len; zend_string_forget_hash_val(ret); } else { ret = zend_string_alloc(len, persistent); memcpy(ret->val, s->val, (len > s->len ? s->len : len) + 1); - zend_string_delref(s); + GC_REFCOUNT(s)--; } return ret; } @@ -180,14 +180,14 @@ static zend_always_inline zend_string *zend_string_safe_realloc(zend_string *s, if (IS_INTERNED(s)) { ret = zend_string_safe_alloc(n, m, l, persistent); memcpy(ret->val, s->val, ((n * m) + l > (size_t)s->len ? (size_t)s->len : ((n * m) + l)) + 1); - } else if (zend_string_refcount(s) == 1) { + } else if (GC_REFCOUNT(s) == 1) { ret = (zend_string *)safe_perealloc(s, n, m, ZEND_MM_ALIGNED_SIZE(_STR_HEADER_SIZE + l + 1), persistent); ret->len = (n * m) + l; zend_string_forget_hash_val(ret); } else { ret = zend_string_safe_alloc(n, m, l, persistent); memcpy(ret->val, s->val, ((n * m) + l > (size_t)s->len ? (size_t)s->len : ((n * m) + l)) + 1); - zend_string_delref(s); + GC_REFCOUNT(s)--; } return ret; } @@ -195,7 +195,7 @@ static zend_always_inline zend_string *zend_string_safe_realloc(zend_string *s, static zend_always_inline void zend_string_free(zend_string *s) { if (!IS_INTERNED(s)) { - ZEND_ASSERT(zend_string_refcount(s) <= 1); + ZEND_ASSERT(GC_REFCOUNT(s) <= 1); pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT); } } @@ -203,7 +203,7 @@ static zend_always_inline void zend_string_free(zend_string *s) static zend_always_inline void zend_string_release(zend_string *s) { if (!IS_INTERNED(s)) { - if (zend_string_delref(s) == 0) { + if (--GC_REFCOUNT(s) == 0) { pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT); } } @@ -253,7 +253,7 @@ static zend_always_inline zend_bool zend_string_equals(zend_string *s1, zend_str * -- Ralf S. Engelschall <rse@engelschall.com> */ -static inline zend_ulong zend_inline_hash_func(const char *str, size_t len) +static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size_t len) { register zend_ulong hash = Z_UL(5381); diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c index b289ae17c9..43f02b48f8 100644 --- a/Zend/zend_ts_hash.c +++ b/Zend/zend_ts_hash.c @@ -110,12 +110,12 @@ ZEND_API zval *_zend_ts_hash_add_or_update(TsHashTable *ht, zend_string *key, zv return retval; } -ZEND_API zval *_zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC) +ZEND_API zval *_zend_ts_hash_index_add_or_update(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC) { zval *retval; begin_write(ht); - retval = _zend_hash_index_update_or_next_insert(TS_HASH(ht), h, pData, flag ZEND_FILE_LINE_RELAY_CC); + retval = _zend_hash_index_add_or_update(TS_HASH(ht), h, pData, flag ZEND_FILE_LINE_RELAY_CC); end_write(ht); return retval; diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h index 0adedff437..6cb36410b8 100644 --- a/Zend/zend_ts_hash.h +++ b/Zend/zend_ts_hash.h @@ -55,11 +55,11 @@ ZEND_API zval *_zend_ts_hash_add_or_update(TsHashTable *ht, zend_string *key, zv #define zend_ts_hash_add(ht, key, pData) \ _zend_ts_hash_add_or_update(ht, key, pData, HASH_ADD ZEND_FILE_LINE_CC) -ZEND_API zval *_zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC); +ZEND_API zval *_zend_ts_hash_index_add_or_update(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC); #define zend_ts_hash_index_update(ht, h, pData) \ - _zend_ts_hash_index_update_or_next_insert(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_CC) + _zend_ts_hash_index_add_or_update(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_CC) #define zend_ts_hash_next_index_insert(ht, pData) \ - _zend_ts_hash_index_update_or_next_insert(ht, 0, pData, HASH_NEXT_INSERT ZEND_FILE_LINE_CC) + _zend_ts_hash_index_add_or_update(ht, ht->nNextFreeElement, pData, HASH_ADD ZEND_FILE_LINE_CC) ZEND_API zval* zend_ts_hash_add_empty_element(TsHashTable *ht, zend_string *key); @@ -111,7 +111,7 @@ ZEND_API zval *_zend_ts_hash_str_add(TsHashTable *ht, const char *key, int len, #define zend_ts_hash_str_add(ht, key, len, pData) \ _zend_ts_hash_str_add(ht, key, len, pData ZEND_FILE_LINE_CC) -static inline void *zend_ts_hash_str_find_ptr(TsHashTable *ht, const char *str, int len) +static zend_always_inline void *zend_ts_hash_str_find_ptr(TsHashTable *ht, const char *str, int len) { zval *zv; @@ -119,7 +119,7 @@ static inline void *zend_ts_hash_str_find_ptr(TsHashTable *ht, const char *str, return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_ts_hash_str_update_ptr(TsHashTable *ht, const char *str, int len, void *pData) +static zend_always_inline void *zend_ts_hash_str_update_ptr(TsHashTable *ht, const char *str, int len, void *pData) { zval tmp, *zv; @@ -128,7 +128,7 @@ static inline void *zend_ts_hash_str_update_ptr(TsHashTable *ht, const char *str return zv ? Z_PTR_P(zv) : NULL; } -static inline void *zend_ts_hash_str_add_ptr(TsHashTable *ht, const char *str, int len, void *pData) +static zend_always_inline void *zend_ts_hash_str_add_ptr(TsHashTable *ht, const char *str, int len, void *pData) { zval tmp, *zv; diff --git a/Zend/zend_types.h b/Zend/zend_types.h index f8d80c95a4..1ac7b298eb 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -14,6 +14,7 @@ +----------------------------------------------------------------------+ | Authors: Andi Gutmans <andi@zend.com> | | Zeev Suraski <zeev@zend.com> | + | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ @@ -22,6 +23,7 @@ #ifndef ZEND_TYPES_H #define ZEND_TYPES_H +#include "zend_portability.h" #include "zend_long.h" #ifdef WORDS_BIGENDIAN @@ -43,6 +45,11 @@ typedef unsigned char zend_bool; typedef unsigned char zend_uchar; +typedef enum { + SUCCESS = 0, + FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */ +} ZEND_RESULT_CODE; + #ifdef ZEND_ENABLE_ZVAL_LONG64 # ifdef ZEND_WIN32 # define ZEND_SIZE_MAX _UI64_MAX @@ -83,6 +90,7 @@ typedef uint32_t zend_uintptr_t; typedef struct _zend_object_handlers zend_object_handlers; typedef struct _zend_class_entry zend_class_entry; typedef union _zend_function zend_function; +typedef struct _zend_execute_data zend_execute_data; typedef struct _zval_struct zval; @@ -101,7 +109,7 @@ typedef void (*dtor_func_t)(zval *pDest); typedef void (*copy_ctor_func_t)(zval *pElement); typedef union _zend_value { - zend_long lval; /* long value */ + zend_long lval; /* long value */ double dval; /* double value */ zend_refcounted *counted; zend_string *str; @@ -144,7 +152,7 @@ struct _zend_refcounted { ZEND_ENDIAN_LOHI_3( zend_uchar type, zend_uchar flags, /* used for strings & objects */ - uint16_t gc_info) /* keeps GC root number (or 0) and color */ + uint16_t gc_info) /* keeps GC root number (or 0) and color */ } v; uint32_t type_info; } u; @@ -152,33 +160,33 @@ struct _zend_refcounted { struct _zend_string { zend_refcounted gc; - zend_ulong h; /* hash value */ - size_t len; + zend_ulong h; /* hash value */ + size_t len; char val[1]; }; typedef struct _Bucket { - zend_ulong h; /* hash value (or numeric index) */ + zend_ulong h; /* hash value (or numeric index) */ zend_string *key; /* string key or NULL for numerics */ zval val; } Bucket; typedef struct _HashTable { - uint32_t nTableSize; - uint32_t nTableMask; - uint32_t nNumUsed; - uint32_t nNumOfElements; - zend_long nNextFreeElement; + uint32_t nTableSize; + uint32_t nTableMask; + uint32_t nNumUsed; + uint32_t nNumOfElements; + zend_long nNextFreeElement; Bucket *arData; - uint32_t *arHash; + uint32_t *arHash; dtor_func_t pDestructor; - uint32_t nInternalPointer; + uint32_t nInternalPointer; union { struct { ZEND_ENDIAN_LOHI_3( zend_uchar flags, zend_uchar nApplyCount, - uint16_t reserve) + uint16_t reserve) } v; uint32_t flags; } u; @@ -191,7 +199,7 @@ struct _zend_array { struct _zend_object { zend_refcounted gc; - uint32_t handle; // TODO: may be removed ??? + uint32_t handle; // TODO: may be removed ??? zend_class_entry *ce; const zend_object_handlers *handlers; HashTable *properties; @@ -201,7 +209,7 @@ struct _zend_object { struct _zend_resource { zend_refcounted gc; - zend_long handle; // TODO: may be removed ??? + zend_long handle; // TODO: may be removed ??? int type; void *ptr; }; @@ -241,7 +249,7 @@ struct _zend_ast_ref { #define IS_INDIRECT 15 #define IS_PTR 17 -static inline zend_uchar zval_get_type(const zval* pz) { +static zend_always_inline zend_uchar zval_get_type(const zval* pz) { return pz->u1.v.type; } @@ -519,10 +527,10 @@ static inline zend_uchar zval_get_type(const zval* pz) { IS_STRING_EX; \ } while (0) -#define ZVAL_INTERNED_STR(z, s) do { \ - zval *__z = (z); \ - zend_string *__s = (s); \ - Z_STR_P(__z) = __s; \ +#define ZVAL_INTERNED_STR(z, s) do { \ + zval *__z = (z); \ + zend_string *__s = (s); \ + Z_STR_P(__z) = __s; \ Z_TYPE_INFO_P(__z) = IS_INTERNED_STRING_EX; \ } while (0) @@ -530,10 +538,22 @@ static inline zend_uchar zval_get_type(const zval* pz) { zval *__z = (z); \ zend_string *__s = (s); \ Z_STR_P(__z) = __s; \ - /* interned strings support */ \ Z_TYPE_INFO_P(__z) = IS_STRING_EX; \ } while (0) +#define ZVAL_STR_COPY(z, s) do { \ + zval *__z = (z); \ + zend_string *__s = (s); \ + Z_STR_P(__z) = __s; \ + /* interned strings support */ \ + if (IS_INTERNED(__s)) { \ + Z_TYPE_INFO_P(__z) = IS_INTERNED_STRING_EX; \ + } else { \ + GC_REFCOUNT(__s)++; \ + Z_TYPE_INFO_P(__z) = IS_STRING_EX; \ + } \ + } while (0) + #define ZVAL_ARR(z, a) do { \ zval *__z = (z); \ Z_ARR_P(__z) = (a); \ @@ -572,26 +592,26 @@ static inline zend_uchar zval_get_type(const zval* pz) { #define ZVAL_NEW_RES(z, h, p, t) do { \ zend_resource *_res = emalloc(sizeof(zend_resource)); \ - zval *__z; \ + zval *__z; \ GC_REFCOUNT(_res) = 1; \ GC_TYPE_INFO(_res) = IS_RESOURCE; \ _res->handle = (h); \ _res->type = (t); \ _res->ptr = (p); \ - __z = (z); \ + __z = (z); \ Z_RES_P(__z) = _res; \ Z_TYPE_INFO_P(__z) = IS_RESOURCE_EX; \ } while (0) #define ZVAL_NEW_PERSISTENT_RES(z, h, p, t) do { \ zend_resource *_res = malloc(sizeof(zend_resource)); \ - zval *__z; \ + zval *__z; \ GC_REFCOUNT(_res) = 1; \ GC_TYPE_INFO(_res) = IS_RESOURCE; \ _res->handle = (h); \ _res->type = (t); \ _res->ptr = (p); \ - __z = (z); \ + __z = (z); \ Z_RES_P(__z) = _res; \ Z_TYPE_INFO_P(__z) = IS_RESOURCE_EX; \ } while (0) @@ -650,6 +670,170 @@ static inline zend_uchar zval_get_type(const zval* pz) { Z_TYPE_INFO_P(z) = IS_PTR; \ } while (0) +#define Z_REFCOUNT_P(pz) zval_refcount_p(pz) +#define Z_SET_REFCOUNT_P(pz, rc) zval_set_refcount_p(pz, rc) +#define Z_ADDREF_P(pz) zval_addref_p(pz) +#define Z_DELREF_P(pz) zval_delref_p(pz) + +#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z)) +#define Z_SET_REFCOUNT(z, rc) Z_SET_REFCOUNT_P(&(z), rc) +#define Z_ADDREF(z) Z_ADDREF_P(&(z)) +#define Z_DELREF(z) Z_DELREF_P(&(z)) + +#define Z_TRY_ADDREF_P(pz) do { \ + if (Z_REFCOUNTED_P((pz))) { \ + Z_ADDREF_P((pz)); \ + } \ +} while (0) + +#define Z_TRY_DELREF_P(pz) do { \ + if (Z_REFCOUNTED_P((pz))) { \ + Z_DELREF_P((pz)); \ + } \ +} while (0) + +#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z)) +#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z)) + +static zend_always_inline uint32_t zval_refcount_p(zval* pz) { + ZEND_ASSERT(Z_REFCOUNTED_P(pz) || Z_IMMUTABLE_P(pz)); + return GC_REFCOUNT(Z_COUNTED_P(pz)); +} + +static zend_always_inline uint32_t zval_set_refcount_p(zval* pz, uint32_t rc) { + ZEND_ASSERT(Z_REFCOUNTED_P(pz)); + return GC_REFCOUNT(Z_COUNTED_P(pz)) = rc; +} + +static zend_always_inline uint32_t zval_addref_p(zval* pz) { + ZEND_ASSERT(Z_REFCOUNTED_P(pz)); + return ++GC_REFCOUNT(Z_COUNTED_P(pz)); +} + +static zend_always_inline uint32_t zval_delref_p(zval* pz) { + ZEND_ASSERT(Z_REFCOUNTED_P(pz)); + return --GC_REFCOUNT(Z_COUNTED_P(pz)); +} + +#define ZVAL_COPY_VALUE(z, v) \ + do { \ + zval *_z1 = (z); \ + zval *_z2 = (v); \ + (_z1)->value = (_z2)->value; \ + Z_TYPE_INFO_P(_z1) = Z_TYPE_INFO_P(_z2); \ + } while (0) + +#define ZVAL_COPY(z, v) \ + do { \ + zval *__z1 = (z); \ + zval *__z2 = (v); \ + ZVAL_COPY_VALUE(__z1, __z2); \ + if (Z_OPT_REFCOUNTED_P(__z1)) { \ + Z_ADDREF_P(__z1); \ + } \ + } while (0) + +#define ZVAL_DUP(z, v) \ + do { \ + zval *__z1 = (z); \ + zval *__z2 = (v); \ + ZVAL_COPY_VALUE(__z1, __z2); \ + zval_opt_copy_ctor(__z1); \ + } while (0) + +#define ZVAL_DEREF(z) do { \ + if (UNEXPECTED(Z_ISREF_P(z))) { \ + (z) = Z_REFVAL_P(z); \ + } \ + } while (0) + +#define ZVAL_MAKE_REF(zv) do { \ + zval *__zv = (zv); \ + if (!Z_ISREF_P(__zv)) { \ + ZVAL_NEW_REF(__zv, __zv); \ + } \ + } while (0) + +#define ZVAL_UNREF(z) do { \ + zval *_z = (z); \ + zend_reference *ref; \ + ZEND_ASSERT(Z_ISREF_P(_z)); \ + ref = Z_REF_P(_z); \ + ZVAL_COPY_VALUE(_z, &ref->val); \ + efree_size(ref, sizeof(zend_reference)); \ + } while (0) + +#define SEPARATE_STRING(zv) do { \ + zval *_zv = (zv); \ + if (Z_REFCOUNTED_P(_zv) && \ + Z_REFCOUNT_P(_zv) > 1) { \ + Z_DELREF_P(_zv); \ + zval_copy_ctor_func(_zv); \ + } \ + } while (0) + +#define SEPARATE_ARRAY(zv) do { \ + zval *_zv = (zv); \ + if (Z_REFCOUNT_P(_zv) > 1) { \ + if (!Z_IMMUTABLE_P(_zv)) { \ + Z_DELREF_P(_zv); \ + } \ + zval_copy_ctor_func(_zv); \ + } \ + } while (0) + +#define SEPARATE_ZVAL_NOREF(zv) do { \ + zval *_zv = (zv); \ + if (Z_COPYABLE_P(_zv) || \ + Z_IMMUTABLE_P(_zv)) { \ + if (Z_REFCOUNT_P(_zv) > 1) { \ + if (!Z_IMMUTABLE_P(_zv)) { \ + Z_DELREF_P(_zv); \ + } \ + zval_copy_ctor_func(_zv); \ + } \ + } \ + } while (0) + +#define SEPARATE_ZVAL(zv) do { \ + zval *_zv = (zv); \ + if (Z_REFCOUNTED_P(_zv) || \ + Z_IMMUTABLE_P(_zv)) { \ + if (Z_REFCOUNT_P(_zv) > 1) { \ + if (Z_COPYABLE_P(_zv) || \ + Z_IMMUTABLE_P(_zv)) { \ + if (!Z_IMMUTABLE_P(_zv)) { \ + Z_DELREF_P(_zv); \ + } \ + zval_copy_ctor_func(_zv); \ + } else if (Z_ISREF_P(_zv)) { \ + Z_DELREF_P(_zv); \ + ZVAL_DUP(_zv, Z_REFVAL_P(_zv)); \ + } \ + } \ + } \ + } while (0) + +#define SEPARATE_ZVAL_IF_NOT_REF(zv) do { \ + zval *_zv = (zv); \ + if (Z_COPYABLE_P(_zv) || \ + Z_IMMUTABLE_P(_zv)) { \ + if (Z_REFCOUNT_P(_zv) > 1) { \ + if (!Z_IMMUTABLE_P(_zv)) { \ + Z_DELREF_P(_zv); \ + } \ + zval_copy_ctor_func(_zv); \ + } \ + } \ + } while (0) + +#define SEPARATE_ARG_IF_REF(varptr) do { \ + ZVAL_DEREF(varptr); \ + if (Z_REFCOUNTED_P(varptr)) { \ + Z_ADDREF_P(varptr); \ + } \ + } while (0) + #endif /* ZEND_TYPES_H */ /* diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index 538d2a5566..94ae438e9d 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -39,7 +39,7 @@ static zend_always_inline void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC) static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC) { if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) { - _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_CC); + _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC); } } diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 665829d685..01a91cad80 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -178,7 +178,7 @@ static int php_check_dots(const char *element, int n) #define MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 ) typedef struct { - zend_ulong ReparseTag; + unsigned long ReparseTag; unsigned short ReparseDataLength; unsigned short Reserved; union { @@ -187,7 +187,7 @@ typedef struct { unsigned short SubstituteNameLength; unsigned short PrintNameOffset; unsigned short PrintNameLength; - zend_ulong Flags; + unsigned long Flags; wchar_t ReparseTarget[1]; } SymbolicLinkReparseBuffer; struct { @@ -201,19 +201,19 @@ typedef struct { unsigned char ReparseTarget[1]; } GenericReparseBuffer; }; -} REPARSE_DATA_BUFFER; +} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; #define SECS_BETWEEN_EPOCHS (__int64)11644473600 #define SECS_TO_100NS (__int64)10000000 -static inline time_t FileTimeToUnixTime(const FILETIME FileTime) +static inline time_t FileTimeToUnixTime(const FILETIME *FileTime) { __int64 UnixTime; long *nsec = NULL; SYSTEMTIME SystemTime; - FileTimeToSystemTime(&FileTime, &SystemTime); + FileTimeToSystemTime(FileTime, &SystemTime); - UnixTime = ((__int64)FileTime.dwHighDateTime << 32) + - FileTime.dwLowDateTime; + UnixTime = ((__int64)FileTime->dwHighDateTime << 32) + + FileTime->dwLowDateTime; UnixTime -= (SECS_BETWEEN_EPOCHS * SECS_TO_100NS); @@ -294,7 +294,7 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{{ */ { WIN32_FILE_ATTRIBUTE_DATA data; - __int64 t; + LARGE_INTEGER t; const size_t path_len = strlen(path); ALLOCA_FLAG(use_heap_large); @@ -393,13 +393,14 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{ } buf->st_nlink = 1; - t = data.nFileSizeHigh; - t = t << 32; - t |= data.nFileSizeLow; - buf->st_size = t; - buf->st_atime = FileTimeToUnixTime(data.ftLastAccessTime); - buf->st_ctime = FileTimeToUnixTime(data.ftCreationTime); - buf->st_mtime = FileTimeToUnixTime(data.ftLastWriteTime); + t.HighPart = data.nFileSizeHigh; + t.LowPart = data.nFileSizeLow; + /* It's an overflow on 32 bit, however it won't fix as long + as zend_long is 32 bit. */ + buf->st_size = (zend_long)t.QuadPart; + buf->st_atime = FileTimeToUnixTime(&data.ftLastAccessTime); + buf->st_ctime = FileTimeToUnixTime(&data.ftCreationTime); + buf->st_mtime = FileTimeToUnixTime(&data.ftLastWriteTime); return 0; } /* }}} */ @@ -983,6 +984,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i memcpy(substitutename, path, len + 1); substitutename_len = len; } else { + /* XXX this might be not the end, restart handling with REPARSE_GUID_DATA_BUFFER should be implemented. */ free_alloca(pbuffer, use_heap_large); return -1; } diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h index b439d3eaa7..96ac6faa30 100644 --- a/Zend/zend_virtual_cwd.h +++ b/Zend/zend_virtual_cwd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -70,7 +70,7 @@ typedef unsigned short mode_t; #define IS_UNC_PATH(path, len) \ (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1])) #define IS_ABSOLUTE_PATH(path, len) \ - (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len))) + (len >= 2 && (/* is local */isalpha(path[0]) && path[1] == ':' || /* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1]))) #elif defined(NETWARE) #ifdef HAVE_DIRENT_H @@ -213,18 +213,18 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC); typedef struct _realpath_cache_bucket { zend_ulong key; char *path; - int path_len; char *realpath; + struct _realpath_cache_bucket *next; + time_t expires; + int path_len; int realpath_len; int is_dir; - time_t expires; #ifdef PHP_WIN32 unsigned char is_rvalid; unsigned char is_readable; unsigned char is_wvalid; unsigned char is_writable; #endif - struct _realpath_cache_bucket *next; } realpath_cache_bucket; typedef struct _virtual_cwd_globals { diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 4bd80bd9d6..7fa544b579 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -883,7 +883,6 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY) if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -891,19 +890,7 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY) ZVAL_DEREF(var_ptr); SEPARATE_ZVAL_NOREF(var_ptr); - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_increment_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - increment_function(var_ptr); - } + increment_function(var_ptr); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); @@ -939,7 +926,6 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY) if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -947,19 +933,7 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY) ZVAL_DEREF(var_ptr); SEPARATE_ZVAL_NOREF(var_ptr); - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_decrement_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - decrement_function(var_ptr); - } + decrement_function(var_ptr); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); @@ -974,7 +948,7 @@ ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY) { USE_OPLINE zend_free_op free_op1; - zval *var_ptr, *retval; + zval *var_ptr; SAVE_OPLINE(); var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); @@ -991,34 +965,19 @@ ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY) if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) { ZVAL_NULL(EX_VAR(opline->result.var)); - FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - retval = EX_VAR(opline->result.var); - if (UNEXPECTED(Z_ISREF_P(var_ptr))) { var_ptr = Z_REFVAL_P(var_ptr); - ZVAL_DUP(retval, var_ptr); + ZVAL_DUP(EX_VAR(opline->result.var), var_ptr); } else { - ZVAL_DUP(retval, var_ptr); - SEPARATE_ZVAL_NOREF(var_ptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + zval_opt_copy_ctor(var_ptr); } - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_increment_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - increment_function(var_ptr); - } + increment_function(var_ptr); FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); @@ -1029,7 +988,7 @@ ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY) { USE_OPLINE zend_free_op free_op1; - zval *var_ptr, *retval; + zval *var_ptr; SAVE_OPLINE(); var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); @@ -1046,34 +1005,19 @@ ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY) if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) { ZVAL_NULL(EX_VAR(opline->result.var)); - FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - retval = EX_VAR(opline->result.var); - if (UNEXPECTED(Z_ISREF_P(var_ptr))) { var_ptr = Z_REFVAL_P(var_ptr); - ZVAL_DUP(retval, var_ptr); + ZVAL_DUP(EX_VAR(opline->result.var), var_ptr); } else { - ZVAL_DUP(retval, var_ptr); - SEPARATE_ZVAL_NOREF(var_ptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + zval_opt_copy_ctor(var_ptr); } - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_decrement_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - decrement_function(var_ptr); - } + decrement_function(var_ptr); FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); @@ -1158,8 +1102,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST| zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -1179,8 +1122,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST| zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -1394,7 +1336,7 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HELPER(zend_fetch_property_address_read_helper, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) +ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) { USE_OPLINE zend_free_op free_op1; @@ -1427,11 +1369,6 @@ ZEND_VM_HELPER(zend_fetch_property_address_read_helper, CONST|TMP|VAR|UNUSED|CV, ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_property_address_read_helper); -} - ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV) { USE_OPLINE @@ -1542,7 +1479,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|CV, CONST|TMP| CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_property_address_read_helper); + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_FETCH_OBJ_R); } } @@ -1643,26 +1580,21 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, OP2_TYPE TSRMLS_CC); FREE_OP2(); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -1670,7 +1602,6 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } FREE_OP1_VAR_PTR(); /* assign_dim has two opcodes! */ @@ -1687,24 +1618,18 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV) zval *variable_ptr; SAVE_OPLINE(); - value = GET_OP2_ZVAL_PTR(BP_VAR_R); + value = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); if (OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_OP2_TMP_FREE()) { - zval_dtor(value); + if (OP2_TYPE == IS_TMP_VAR) { + FREE_OP2(); } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (OP2_TYPE == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (OP2_TYPE == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, OP2_TYPE TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -1786,6 +1711,8 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) vm_frame_kind frame_kind = EX(frame_kind); if (frame_kind == VM_FRAME_NESTED_FUNCTION) { + zend_object *object; + i_free_compiled_variables(execute_data TSRMLS_CC); if (UNEXPECTED(EX(symbol_table) != NULL)) { zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC); @@ -1795,26 +1722,22 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) != 0) && EX(func)->op_array.prototype) { OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype); } + object = Z_OBJ(EX(This)); zend_vm_stack_free_call_frame(execute_data TSRMLS_CC); execute_data = EG(current_execute_data); - if (Z_OBJ(EG(This))) { + if (object) { if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) { if (!(EX(opline)->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) { - Z_DELREF(EG(This)); + GC_REFCOUNT(object)--; } - if (Z_REFCOUNT(EG(This)) == 1) { - zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC); + if (GC_REFCOUNT(object) == 1) { + zend_object_store_ctor_failed(object TSRMLS_CC); } } - if (!Z_DELREF(EG(This))) { - _zval_dtor_func_for_ptr(Z_COUNTED(EG(This)) ZEND_FILE_LINE_CC); - } else if (UNEXPECTED(!Z_GC_INFO(EG(This)))) { - gc_possible_root(Z_COUNTED(EG(This)) TSRMLS_CC); - } + OBJ_RELEASE(object); } - Z_OBJ(EG(This)) = EX(object); EG(scope) = EX(scope); if (UNEXPECTED(EG(exception) != NULL)) { @@ -2055,26 +1978,11 @@ ZEND_VM_HANDLER(70, ZEND_FREE, TMP|VAR, ANY) USE_OPLINE SAVE_OPLINE(); - if (OP1_TYPE == IS_TMP_VAR) { - zval_dtor(EX_VAR(opline->op1.var)); - } else { - zval_ptr_dtor(EX_VAR(opline->op1.var)); - } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(53, ZEND_INIT_STRING, ANY, ANY) -{ - USE_OPLINE - zval *tmp = EX_VAR(opline->result.var); - - SAVE_OPLINE(); - ZVAL_EMPTY_STRING(tmp); - /*CHECK_EXCEPTION();*/ - ZEND_VM_NEXT_OPCODE(); -} - ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP|UNUSED, CONST) { USE_OPLINE @@ -2342,7 +2250,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -2350,8 +2258,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -2622,9 +2530,10 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) USE_OPLINE zend_execute_data *call = EX(call); zend_function *fbc = call->func; + zend_object *object = Z_OBJ(call->This); SAVE_OPLINE(); - EX(call) = call->prev_nested_call; + EX(call) = call->prev_execute_data; if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) { zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name->val, fbc->common.function_name->val); @@ -2641,7 +2550,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) } if (fbc->common.scope && !(fbc->common.fn_flags & ZEND_ACC_STATIC) && - !call->object) { + !object) { if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { /* FIXME: output identifiers properly */ @@ -2664,16 +2573,16 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) if (fbc->common.scope) { should_change_scope = 1; - Z_OBJ(EG(This)) = call->object; /* TODO: we don't set scope if we call an object method ??? */ /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */ #if 1 - EG(scope) = (call->object) ? NULL : fbc->common.scope; + EG(scope) = object ? NULL : fbc->common.scope; #else EG(scope) = fbc->common.scope; #endif - } else { + } else { call->called_scope = EX(called_scope); + Z_OBJ(call->This) = Z_OBJ(EX(This)); } call->prev_execute_data = execute_data; @@ -2708,7 +2617,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(call->num_args, ret TSRMLS_CC); + fbc->internal_function.handler(call, ret TSRMLS_CC); } else { zend_execute_internal(call, ret TSRMLS_CC); } @@ -2728,7 +2637,6 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) } else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { zval *return_value = NULL; - Z_OBJ(EG(This)) = call->object; EG(scope) = fbc->common.scope; call->symbol_table = NULL; if (RETURN_VALUE_USED(opline)) { @@ -2748,25 +2656,25 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) zend_vm_stack_free_call_frame(call TSRMLS_CC); } else { call->prev_execute_data = execute_data; - i_init_func_execute_data(call, &fbc->op_array, return_value, EXPECTED(zend_execute_ex == execute_ex) ? VM_FRAME_NESTED_FUNCTION : VM_FRAME_TOP_FUNCTION TSRMLS_CC); + i_init_func_execute_data(call, &fbc->op_array, return_value, VM_FRAME_NESTED_FUNCTION TSRMLS_CC); if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { + call->frame_kind = VM_FRAME_TOP_FUNCTION; zend_execute_ex(call TSRMLS_CC); } } } else { /* ZEND_OVERLOADED_FUNCTION */ - Z_OBJ(EG(This)) = call->object; EG(scope) = fbc->common.scope; ZVAL_NULL(EX_VAR(opline->result.var)); /* Not sure what should be done here if it's a static method */ - if (EXPECTED(call->object != NULL)) { + if (EXPECTED(object != NULL)) { call->prev_execute_data = execute_data; EG(current_execute_data) = call; - call->object->handlers->call_method(fbc->common.function_name, call->object, call->num_args, EX_VAR(opline->result.var) TSRMLS_CC); + object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var) TSRMLS_CC); EG(current_execute_data) = call->prev_execute_data; } else { zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); @@ -2791,22 +2699,17 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) } ZEND_VM_C_LABEL(fcall_end_change_scope): - if (Z_OBJ(EG(This))) { + if (object) { if (UNEXPECTED(EG(exception) != NULL) && (opline->op1.num & ZEND_CALL_CTOR)) { if (!(opline->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) { - Z_DELREF(EG(This)); + GC_REFCOUNT(object)--; } - if (Z_REFCOUNT(EG(This)) == 1) { - zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC); + if (GC_REFCOUNT(object) == 1) { + zend_object_store_ctor_failed(object TSRMLS_CC); } } - if (!Z_DELREF(EG(This))) { - _zval_dtor_func_for_ptr(Z_COUNTED(EG(This)) ZEND_FILE_LINE_CC); - } else if (UNEXPECTED(!Z_GC_INFO(EG(This)))) { - gc_possible_root(Z_COUNTED(EG(This)) TSRMLS_CC); - } + OBJ_RELEASE(object); } - Z_OBJ(EG(This)) = EX(object); EG(scope) = EX(scope); ZEND_VM_C_LABEL(fcall_end): @@ -2840,7 +2743,7 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) zval_copy_ctor_func(EX(return_value)); } } - } else if (Z_ISREF_P(retval_ptr)) { + } else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(retval_ptr)) { ZVAL_COPY(EX(return_value), Z_REFVAL_P(retval_ptr)); FREE_OP1_IF_VAR(); } else { @@ -2893,9 +2796,8 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) } else { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EX(return_value)) { - zval tmp; - ZVAL_DUP(&tmp, retval_ptr); - ZVAL_NEW_REF(EX(return_value), &tmp); + ZVAL_NEW_REF(EX(return_value), retval_ptr); + if (Z_REFCOUNTED_P(retval_ptr)) Z_ADDREF_P(retval_ptr); } break; } @@ -3054,7 +2956,7 @@ ZEND_VM_HANDLER(117, ZEND_SEND_VAR, VAR|CV, ANY) varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); arg = ZEND_CALL_ARG(EX(call), opline->op2.num); EX(call)->num_args = opline->op2.num; - if (Z_ISREF_P(varptr)) { + if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(varptr)) { ZVAL_COPY(arg, Z_REFVAL_P(varptr)); FREE_OP1(); } else { @@ -3159,7 +3061,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR_EX, VAR|CV, ANY) varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); arg = ZEND_CALL_ARG(EX(call), opline->op2.num); EX(call)->num_args = opline->op2.num; - if (Z_ISREF_P(varptr)) { + if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(varptr)) { ZVAL_COPY(arg, Z_REFVAL_P(varptr)); FREE_OP1(); } else { @@ -3192,7 +3094,7 @@ ZEND_VM_C_LABEL(send_again): zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht) TSRMLS_CC); if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) { - int i; + uint32_t i; int separate = 0; /* check if any of arguments are going to be passed by reference */ @@ -3351,12 +3253,12 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY) if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) { OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype); } - if (EX(call)->object) { - OBJ_RELEASE(EX(call)->object); + if (Z_OBJ(EX(call)->This)) { + OBJ_RELEASE(Z_OBJ(EX(call)->This)); } EX(call)->func = (zend_function*)&zend_pass_function; EX(call)->called_scope = NULL; - EX(call)->object = NULL; + Z_OBJ(EX(call)->This) = NULL; } else { uint32_t arg_num = 1; @@ -3414,12 +3316,12 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY) if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) { OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype); } - if (EX(call)->object) { - OBJ_RELEASE(EX(call)->object); + if (Z_OBJ(EX(call)->This)) { + OBJ_RELEASE(Z_OBJ(EX(call)->This)); } EX(call)->func = (zend_function*)&zend_pass_function; EX(call)->called_scope = NULL; - EX(call)->object = NULL; + Z_OBJ(EX(call)->This) = NULL; break; } @@ -3493,12 +3395,12 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY) if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) { OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype); } - if (EX(call)->object) { - OBJ_RELEASE(EX(call)->object); + if (Z_OBJ(EX(call)->This)) { + OBJ_RELEASE(Z_OBJ(EX(call)->This)); } EX(call)->func = (zend_function*)&zend_pass_function; EX(call)->called_scope = NULL; - EX(call)->object = NULL; + Z_OBJ(EX(call)->This) = NULL; FREE_OP1(); CHECK_EXCEPTION(); @@ -3667,13 +3569,9 @@ ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST) brk_opline = EX(func)->op_array.opcodes + el->brk; - if (brk_opline->opcode == ZEND_SWITCH_FREE) { - if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_ptr_dtor(EX_VAR(brk_opline->op1.var)); - } - } else if (brk_opline->opcode == ZEND_FREE) { + if (brk_opline->opcode == ZEND_FREE) { if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_dtor(EX_VAR(brk_opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var)); } } ZEND_VM_JMP(opline->op1.jmp_addr); @@ -3695,16 +3593,6 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(49, ZEND_SWITCH_FREE, VAR, ANY) -{ - USE_OPLINE - - SAVE_OPLINE(); - zval_ptr_dtor(EX_VAR(opline->op1.var)); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); -} - ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY) { USE_OPLINE @@ -3897,8 +3785,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST) ZVAL_DUP(EX_VAR(opline->result.var), value); } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) { /* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */ - ZVAL_STR(EX_VAR(opline->result.var), ce->name); - zend_string_addref(ce->name); + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); } else { zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv)); } @@ -3926,7 +3813,7 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS FREE_OP1_VAR_PTR(); } else { expr_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (IS_OP1_TMP_FREE()) { /* temporary variable */ + if (OP1_TYPE == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (OP1_TYPE == IS_CONST) { @@ -3934,9 +3821,9 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); FREE_OP1_IF_VAR(); } else if (OP1_TYPE == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -4100,7 +3987,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) } } else { ZVAL_COPY_VALUE(result, expr); - if (!IS_OP1_TMP_FREE()) { + if (OP1_TYPE != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_array(result); @@ -4120,7 +4007,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) } } else { ZVAL_COPY_VALUE(result, expr); - if (!IS_OP1_TMP_FREE()) { + if (OP1_TYPE != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_object(result); @@ -4150,8 +4037,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) ZVAL_UNDEF(&tmp_inc_filename); if (Z_TYPE_P(inc_filename) != IS_STRING) { - ZVAL_DUP(&tmp_inc_filename, inc_filename); - convert_to_string(&tmp_inc_filename); + ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename)); inc_filename = &tmp_inc_filename; } @@ -4168,9 +4054,9 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) zend_file_handle file_handle; char *resolved_path; - resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC); + resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC); if (resolved_path) { - failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path)); + failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path)); } else { resolved_path = Z_STRVAL_P(inc_filename); } @@ -4183,7 +4069,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) file_handle.opened_path = estrdup(resolved_path); } - if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) { + if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) { new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); zend_destroy_file_handle(&file_handle TSRMLS_CC); } else { @@ -4231,7 +4117,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) } call = zend_vm_stack_push_call_frame( - (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC); + (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC); if (EX(symbol_table)) { call->symbol_table = EX(symbol_table); @@ -4240,10 +4126,11 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) } call->prev_execute_data = execute_data; - i_init_code_execute_data(call, new_op_array, return_value, EXPECTED(zend_execute_ex == execute_ex) ? VM_FRAME_NESTED_CODE : VM_FRAME_TOP_CODE TSRMLS_CC); + i_init_code_execute_data(call, new_op_array, return_value, VM_FRAME_NESTED_CODE TSRMLS_CC); if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { + call->frame_kind = VM_FRAME_TOP_CODE; zend_execute_ex(call TSRMLS_CC); } @@ -4266,29 +4153,37 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) zval tmp, *varname; HashTable *target_symbol_table; zend_free_op free_op1; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (OP1_TYPE == IS_CV && OP2_TYPE == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_UNDEF(&tmp); if (OP1_TYPE != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (OP2_TYPE != IS_UNUSED) { @@ -4300,10 +4195,8 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (OP1_TYPE != IS_CONST && tmp_is_dup) { + if (OP1_TYPE != IS_CONST) { zval_dtor(&tmp); - } else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { - zval_ptr_dtor(&tmp); } FREE_OP1(); HANDLE_EXCEPTION(); @@ -4322,10 +4215,8 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (OP1_TYPE != IS_CONST && tmp_is_dup) { + if (OP1_TYPE != IS_CONST) { zval_dtor(&tmp); - } else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { - zval_ptr_dtor(&tmp); } FREE_OP1(); CHECK_EXCEPTION(); @@ -4366,12 +4257,9 @@ ZEND_VM_C_LABEL(num_index_dim): zend_hash_index_del(ht, hval); break; case IS_STRING: - if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (OP2_TYPE != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - ZEND_VM_C_GOTO(numeric_index_dim); + ZEND_VM_C_GOTO(num_index_dim); } } if (ht == &EG(symbol_table).ht) { @@ -4379,15 +4267,6 @@ ZEND_VM_C_LABEL(num_index_dim): } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -ZEND_VM_C_LABEL(numeric_index_dim): - zend_hash_index_del(ht, hval); - if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -4475,22 +4354,14 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) SAVE_OPLINE(); if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && - (opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + (opline->extended_value & ZEND_FE_FETCH_BYREF)) { array_ptr = array_ref = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); ZVAL_DEREF(array_ptr); if (Z_TYPE_P(array_ptr) == IS_ARRAY) { + SEPARATE_ARRAY(array_ptr); if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - array_ref = array_ptr; - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - ZVAL_NEW_REF(array_ptr, array_ptr); - array_ref = array_ptr; - array_ptr = Z_REFVAL_P(array_ptr); - } - } else if (Z_IMMUTABLE_P(array_ptr)) { - zval_copy_ctor(array_ptr); - } else { - SEPARATE_ZVAL_NOREF(array_ptr); + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); } if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { @@ -4501,9 +4372,6 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) ce = Z_OBJCE_P(array_ptr); if (!ce || ce->get_iterator == NULL) { - if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - } Z_ADDREF_P(array_ptr); } array_ref = array_ptr; @@ -4513,9 +4381,12 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) } else { array_ptr = array_ref = GET_OP1_ZVAL_PTR(BP_VAR_R); ZVAL_DEREF(array_ptr); - if (IS_OP1_TMP_FREE()) { /* IS_TMP_VAR */ + if (OP1_TYPE == IS_TMP_VAR) { ZVAL_COPY_VALUE(&tmp, array_ptr); - array_ptr = &tmp; + if (Z_OPT_IMMUTABLE_P(&tmp)) { + zval_copy_ctor_func(&tmp); + } + array_ref = array_ptr = &tmp; if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (ce && ce->get_iterator) { @@ -4531,10 +4402,11 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) } } else if (Z_IMMUTABLE_P(array_ref)) { if (OP1_TYPE == IS_CV) { - zval_copy_ctor(array_ref); + zval_copy_ctor_func(array_ref); Z_ADDREF_P(array_ref); } else { - ZVAL_DUP(&tmp, array_ref); + ZVAL_COPY_VALUE(&tmp, array_ref); + zval_copy_ctor_func(&tmp); array_ptr = array_ref = &tmp; } } else if (Z_REFCOUNTED_P(array_ref)) { @@ -4555,14 +4427,13 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) ZVAL_UNREF(array_ref); array_ptr = array_ref; } - if (Z_IMMUTABLE_P(array_ptr) || - (Z_ISREF_P(array_ref) && - Z_REFCOUNTED_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { - if (!Z_IMMUTABLE_P(array_ptr)) { - Z_DELREF_P(array_ptr); - } - zval_copy_ctor(array_ptr); + if (Z_IMMUTABLE_P(array_ptr)) { + zval_copy_ctor_func(array_ptr); + } else if (Z_ISREF_P(array_ref) && + Z_COPYABLE_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 1) { + Z_DELREF_P(array_ptr); + zval_copy_ctor_func(array_ptr); } if (OP1_TYPE == IS_CV) { Z_ADDREF_P(array_ref); @@ -4572,16 +4443,16 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) } if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC); - if (OP1_TYPE == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + if (OP1_TYPE == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) { FREE_OP1_IF_VAR(); } if (iter && EXPECTED(EG(exception) == NULL)) { ZVAL_OBJ(&iterator, &iter->std); array_ptr = array_ref = &iterator; } else { - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { FREE_OP1_VAR_PTR(); } if (!EG(exception)) { @@ -4600,7 +4471,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { FREE_OP1_VAR_PTR(); } HANDLE_EXCEPTION(); @@ -4609,38 +4480,50 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { FREE_OP1_VAR_PTR(); } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = Z_OBJ_P(array_ptr); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - zend_string *str_key; - zend_ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0); - if (key_type != HASH_KEY_NON_EXISTENT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) { - break; + HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var); + HashPosition pos = 0; + Bucket *p; + + while (1) { + if (pos >= fe_ht->nNumUsed) { + is_empty = 1; + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { + FREE_OP1_VAR_PTR(); } - zend_hash_move_forward(fe_ht); + ZEND_VM_JMP(opline->op2.jmp_addr); + } + p = fe_ht->arData + pos; + if (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) { + pos++; + continue; + } + if (!ce || + !p->key || + zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) { + break; } + pos++; } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var)); + fe_ht->nInternalPointer = pos; + ptr->pos = pos; + ptr->ht = fe_ht; + ptr->h = fe_ht->arData[pos].h; + is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); is_empty = 1; } - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { FREE_OP1_VAR_PTR(); } if (is_empty) { @@ -4658,92 +4541,186 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) zval *array, *array_ref; zval *value; HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zval *key = NULL; + HashPointer *ptr; + HashPosition pos; + Bucket *p; array = array_ref = EX_VAR(opline->op1.var); if (Z_ISREF_P(array)) { array = Z_REFVAL_P(array); // TODO: referenced value might be changed to different array ??? if (Z_IMMUTABLE_P(array)) { - zval_copy_ctor(array); + zval_copy_ctor_func(array); } } - if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { - key = EX_VAR((opline+1)->result.var); - } SAVE_OPLINE(); - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); + if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) { + fe_ht = Z_ARRVAL_P(array); + ptr = (HashPointer*)EX_VAR((opline+1)->op1.var); + pos = ptr->pos; + if (UNEXPECTED(pos == INVALID_IDX)) { + /* reached end of iteration */ ZEND_VM_JMP(opline->op2.jmp_addr); - - case ZEND_ITER_PLAIN_OBJECT: { - zend_object *zobj = Z_OBJ_P(array); - int key_type; - zend_string *str_key; - zend_ulong int_key; - - fe_ht = Z_OBJPROP_P(array); - zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); + } else if (UNEXPECTED(ptr->ht != fe_ht)) { + ptr->ht = fe_ht; + pos = 0; + } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) { + if (fe_ht->u.flags & HASH_FLAG_PACKED) { + pos = ptr->h; + } else { + pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask]; + while (pos != INVALID_IDX) { + if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) { + break; + } + pos = Z_NEXT(fe_ht->arData[pos].val); + } + } + } + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_JMP(opline->op2.jmp_addr); + } + p = fe_ht->arData + pos; + value = &p->val; + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; + continue; + } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; + continue; + } + } + if (opline->extended_value & ZEND_FE_FETCH_BYREF) { + ZVAL_MAKE_REF(value); + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + } else { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { + if (!p->key) { + ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key); + } + } + break; + } + do { + pos++; + if (pos >= fe_ht->nNumUsed) { + fe_ht->nInternalPointer = ptr->pos = INVALID_IDX; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } + p = fe_ht->arData + pos; + } while (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)); + fe_ht->nInternalPointer = ptr->pos = pos; + ptr->h = fe_ht->arData[pos].h; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) { + zend_object_iterator *iter; + + if ((iter = zend_iterator_unwrap(array TSRMLS_CC)) == NULL) { + /* plain object */ + zend_object *zobj = Z_OBJ_P(array); + + fe_ht = Z_OBJPROP_P(array); + ptr = (HashPointer*)EX_VAR((opline+1)->op1.var); + pos = ptr->pos; + if (pos == INVALID_IDX) { + /* reached end of iteration */ + ZEND_VM_JMP(opline->op2.jmp_addr); + } else if (UNEXPECTED(ptr->ht != fe_ht)) { + ptr->ht = fe_ht; + pos = 0; + } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) { + if (fe_ht->u.flags & HASH_FLAG_PACKED) { + pos = ptr->h; + } else { + pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask]; + while (pos != INVALID_IDX) { + if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) { + break; + } + pos = Z_NEXT(fe_ht->arData[pos].val); + } + } + } while (1) { - if ((value = zend_hash_get_current_data(fe_ht)) == NULL) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { /* reached end of iteration */ ZEND_VM_JMP(opline->op2.jmp_addr); } - if (Z_TYPE_P(value) == IS_INDIRECT) { + p = fe_ht->arData + pos; + value = &p->val; + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; + continue; + } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { value = Z_INDIRECT_P(value); - if (Z_TYPE_P(value) == IS_UNDEF) { - zend_hash_move_forward(fe_ht); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; continue; } } - key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0); - - zend_hash_move_forward(fe_ht); - if (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) { + if (UNEXPECTED(!p->key)) { + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { + ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h); + } + break; + } else if (zend_check_property_access(zobj, p->key TSRMLS_CC) == SUCCESS) { + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { + if (p->key->val[0]) { + ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key); + } else { + const char *class_name, *prop_name; + size_t prop_name_len; + zend_unmangle_property_name_ex( + p->key, &class_name, &prop_name, &prop_name_len); + ZVAL_STRINGL(EX_VAR((opline+1)->result.var), prop_name, prop_name_len); + } + } break; } + pos++; } - - if (key) { - if (key_type == HASH_KEY_IS_LONG) { - ZVAL_LONG(key, int_key); - } else { - const char *class_name, *prop_name; - int prop_name_len; - zend_unmangle_property_name_ex( - str_key->val, str_key->len, &class_name, &prop_name, &prop_name_len - ); - ZVAL_STRINGL(key, prop_name, prop_name_len); - } - } - - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = Z_ARRVAL_P(array); - zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); - if ((value = zend_hash_get_current_data(fe_ht)) == NULL) { - /* reached end of iteration */ - ZEND_VM_JMP(opline->op2.jmp_addr); - } - if (key) { - zend_hash_get_current_key_zval(fe_ht, key); + if (opline->extended_value & ZEND_FE_FETCH_BYREF) { + ZVAL_MAKE_REF(value); + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + } else { + ZVAL_COPY(EX_VAR(opline->result.var), value); } - zend_hash_move_forward(fe_ht); - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); - break; - - case ZEND_ITER_OBJECT: + do { + pos++; + if (pos >= fe_ht->nNumUsed) { + fe_ht->nInternalPointer = ptr->pos = INVALID_IDX; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } + p = fe_ht->arData + pos; + } while (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF) || + (EXPECTED(p->key != NULL) && + zend_check_property_access(zobj, p->key TSRMLS_CC) == FAILURE)); + fe_ht->nInternalPointer = ptr->pos = pos; + ptr->h = fe_ht->arData[pos].h; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } else { /* !iter happens from exception */ if (iter && ++iter->index > 0) { /* This could cause an endless loop if index becomes zero again. @@ -4772,31 +4749,31 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) /* failure in get_current_data */ ZEND_VM_JMP(opline->op2.jmp_addr); } - if (key) { + if (opline->extended_value & ZEND_FE_FETCH_BYREF) { + ZVAL_MAKE_REF(value); + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + } else { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { if (iter->funcs->get_current_key) { - iter->funcs->get_current_key(iter, key TSRMLS_CC); + iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var) TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); HANDLE_EXCEPTION(); } } else { - ZVAL_LONG(key, iter->index); + ZVAL_LONG(EX_VAR((opline+1)->result.var), iter->index); } } - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - ZVAL_MAKE_REF(value); - Z_ADDREF_P(value); - ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } } else { - ZVAL_COPY(EX_VAR(opline->result.var), value); + zend_error(E_WARNING, "Invalid argument supplied for foreach()"); + ZEND_VM_JMP(opline->op2.jmp_addr); } - - CHECK_EXCEPTION(); - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); } ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) @@ -4972,7 +4949,7 @@ ZEND_VM_C_LABEL(num_index_prop): } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -5087,13 +5064,6 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(142, ZEND_RAISE_ABSTRACT_ERROR, ANY, ANY) -{ - SAVE_OPLINE(); - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(scope)->name->val, EX(func)->op_array.function_name->val); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY) { USE_OPLINE @@ -5114,10 +5084,15 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY) USE_OPLINE zend_free_op free_op1; zval *value; + int is_ref = 0; SAVE_OPLINE(); value = GET_OP1_ZVAL_PTR(BP_VAR_R); + if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } if (i_zend_is_true(value TSRMLS_CC)) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (OP1_TYPE == IS_CONST) { @@ -5126,6 +5101,9 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY) } } else if (OP1_TYPE == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (OP1_TYPE == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + FREE_OP1(); } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -5135,16 +5113,22 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(158, ZEND_JMP_SET_VAR, CONST|TMP|VAR|CV, ANY) +ZEND_VM_HANDLER(169, ZEND_COALESCE, CONST|TMP|VAR|CV, ANY) { USE_OPLINE zend_free_op free_op1; zval *value; + int is_ref = 0; SAVE_OPLINE(); - value = GET_OP1_ZVAL_PTR(BP_VAR_R); + value = GET_OP1_ZVAL_PTR(BP_VAR_IS); - if (i_zend_is_true(value TSRMLS_CC)) { + if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (OP1_TYPE == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { @@ -5152,6 +5136,9 @@ ZEND_VM_HANDLER(158, ZEND_JMP_SET_VAR, CONST|TMP|VAR|CV, ANY) } } else if (OP1_TYPE == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (OP1_TYPE == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + FREE_OP1(); } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -5170,33 +5157,18 @@ ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY) SAVE_OPLINE(); value = GET_OP1_ZVAL_PTR(BP_VAR_R); - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (OP1_TYPE == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); - } - } else if (OP1_TYPE == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(157, ZEND_QM_ASSIGN_VAR, CONST|TMP|VAR|CV, ANY) -{ - USE_OPLINE - zend_free_op free_op1; - zval *value; - - SAVE_OPLINE(); - value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (OP1_TYPE == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); + if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) { + ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value)); + FREE_OP1(); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { + zval_copy_ctor_func(EX_VAR(opline->result.var)); + } + } else if (OP1_TYPE == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - } else if (OP1_TYPE == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } ZEND_VM_NEXT_OPCODE(); } @@ -5419,18 +5391,18 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) * arguments pushed to the stack that have to be dtor'ed. */ zend_vm_stack_free_args(EX(call) TSRMLS_CC); - if (call->object) { + if (Z_OBJ(call->This)) { if (call->flags & ZEND_CALL_CTOR) { if (!(call->flags & ZEND_CALL_CTOR_RESULT_UNUSED)) { - GC_REFCOUNT(call->object)--; + GC_REFCOUNT(Z_OBJ(call->This))--; } - if (GC_REFCOUNT(call->object) == 1) { - zend_object_store_ctor_failed(call->object TSRMLS_CC); + if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) { + zend_object_store_ctor_failed(Z_OBJ(call->This) TSRMLS_CC); } } - OBJ_RELEASE(call->object); + OBJ_RELEASE(Z_OBJ(call->This)); } - EX(call) = call->prev_nested_call; + EX(call) = call->prev_execute_data; zend_vm_stack_free_call_frame(call TSRMLS_CC); call = EX(call); } while (call); @@ -5447,13 +5419,9 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) catch_op_num >= EX(func)->op_array.brk_cont_array[i].brk) { zend_op *brk_opline = &EX(func)->op_array.opcodes[EX(func)->op_array.brk_cont_array[i].brk]; - if (brk_opline->opcode == ZEND_SWITCH_FREE) { + if (brk_opline->opcode == ZEND_FREE) { if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_ptr_dtor(EX_VAR(brk_opline->op1.var)); - } - } else if (brk_opline->opcode == ZEND_FREE) { - if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_dtor(EX_VAR(brk_opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var)); } } } @@ -5589,7 +5557,7 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED) if (closure_is_static || closure_is_being_defined_inside_static_context) { zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC); } else { - zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EG(This)) ? &EG(This) : NULL TSRMLS_CC); + zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC); } CHECK_EXCEPTION(); @@ -5648,8 +5616,8 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(&generator->value); + if (OP1_TYPE != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); @@ -5679,14 +5647,14 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE ZVAL_DUP(&generator->value, value); } else if (OP1_TYPE == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); FREE_OP1_IF_VAR(); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (OP1_TYPE == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -5704,14 +5672,14 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE ZVAL_DUP(&generator->key, key); } else if (OP2_TYPE == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((OP2_TYPE == IS_VAR || OP2_TYPE == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); FREE_OP2_IF_VAR(); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (OP2_TYPE == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -5829,19 +5797,46 @@ ZEND_VM_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST) zval *varname; zval *value; zval *variable_ptr; - zend_string *name; + Bucket *p; + uint32_t idx; SAVE_OPLINE(); varname = GET_OP2_ZVAL_PTR(BP_VAR_R); - name = Z_STR_P(varname); - value = zend_hash_find(&EG(symbol_table).ht, name); - if (value == NULL) { - value = zend_hash_add_new(&EG(symbol_table).ht, name, &EG(uninitialized_zval)); + idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname)); + /* index 0 can't be cached (NULL is a mark of uninitialized cache slot) */ + p = EG(symbol_table).ht.arData + idx; + if (EXPECTED(idx > 0) && + EXPECTED(idx < EG(symbol_table).ht.nNumUsed) && + EXPECTED(Z_TYPE(p->val) != IS_UNDEF) && + (EXPECTED(p->key == Z_STR_P(varname)) || + (EXPECTED(p->h == Z_STR_P(varname)->h) && + EXPECTED(p->key != NULL) && + EXPECTED(p->key->len == Z_STRLEN_P(varname)) && + EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) { + value = &EG(symbol_table).ht.arData[idx].val; /* GLOBAL variable may be an INDIRECT pointer to CV */ - } else if (Z_TYPE_P(value) == IS_INDIRECT) { - value = Z_INDIRECT_P(value); - if (Z_TYPE_P(value) == IS_UNDEF) { - ZVAL_NULL(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_NULL(value); + } + } + } else { + value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname)); + if (UNEXPECTED(value == NULL)) { + value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval)); + idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket); + CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx); + } else { + idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket); + CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx); + /* GLOBAL variable may be an INDIRECT pointer to CV */ + if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_NULL(value); + } + } } } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 0720356e94..9f7d4c3a1a 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -370,7 +370,7 @@ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC } execute_data = zend_vm_stack_push_call_frame( - (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, Z_OBJ(EG(This)), NULL TSRMLS_CC); + (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL TSRMLS_CC); if (EG(current_execute_data)) { execute_data->symbol_table = zend_rebuild_symbol_table(TSRMLS_C); } else { @@ -386,6 +386,8 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) vm_frame_kind frame_kind = EX(frame_kind); if (frame_kind == VM_FRAME_NESTED_FUNCTION) { + zend_object *object; + i_free_compiled_variables(execute_data TSRMLS_CC); if (UNEXPECTED(EX(symbol_table) != NULL)) { zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC); @@ -395,26 +397,22 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) != 0) && EX(func)->op_array.prototype) { OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype); } + object = Z_OBJ(EX(This)); zend_vm_stack_free_call_frame(execute_data TSRMLS_CC); execute_data = EG(current_execute_data); - if (Z_OBJ(EG(This))) { + if (object) { if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) { if (!(EX(opline)->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) { - Z_DELREF(EG(This)); + GC_REFCOUNT(object)--; } - if (Z_REFCOUNT(EG(This)) == 1) { - zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC); + if (GC_REFCOUNT(object) == 1) { + zend_object_store_ctor_failed(object TSRMLS_CC); } } - if (!Z_DELREF(EG(This))) { - _zval_dtor_func_for_ptr(Z_COUNTED(EG(This)) ZEND_FILE_LINE_CC); - } else if (UNEXPECTED(!Z_GC_INFO(EG(This)))) { - gc_possible_root(Z_COUNTED(EG(This)) TSRMLS_CC); - } + OBJ_RELEASE(object); } - Z_OBJ(EG(This)) = EX(object); EG(scope) = EX(scope); if (UNEXPECTED(EG(exception) != NULL)) { @@ -488,25 +486,15 @@ static int ZEND_FASTCALL ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_CONTINUE(); } -static int ZEND_FASTCALL ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *tmp = EX_VAR(opline->result.var); - - SAVE_OPLINE(); - ZVAL_EMPTY_STRING(tmp); - /*CHECK_EXCEPTION();*/ - ZEND_VM_NEXT_OPCODE(); -} - static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_execute_data *call = EX(call); zend_function *fbc = call->func; + zend_object *object = Z_OBJ(call->This); SAVE_OPLINE(); - EX(call) = call->prev_nested_call; + EX(call) = call->prev_execute_data; if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) { zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name->val, fbc->common.function_name->val); @@ -523,7 +511,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } if (fbc->common.scope && !(fbc->common.fn_flags & ZEND_ACC_STATIC) && - !call->object) { + !object) { if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { /* FIXME: output identifiers properly */ @@ -546,16 +534,16 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (fbc->common.scope) { should_change_scope = 1; - Z_OBJ(EG(This)) = call->object; /* TODO: we don't set scope if we call an object method ??? */ /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */ #if 1 - EG(scope) = (call->object) ? NULL : fbc->common.scope; + EG(scope) = object ? NULL : fbc->common.scope; #else EG(scope) = fbc->common.scope; #endif } else { call->called_scope = EX(called_scope); + Z_OBJ(call->This) = Z_OBJ(EX(This)); } call->prev_execute_data = execute_data; @@ -590,7 +578,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(call->num_args, ret TSRMLS_CC); + fbc->internal_function.handler(call, ret TSRMLS_CC); } else { zend_execute_internal(call, ret TSRMLS_CC); } @@ -610,7 +598,6 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { zval *return_value = NULL; - Z_OBJ(EG(This)) = call->object; EG(scope) = fbc->common.scope; call->symbol_table = NULL; if (RETURN_VALUE_USED(opline)) { @@ -630,25 +617,25 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_vm_stack_free_call_frame(call TSRMLS_CC); } else { call->prev_execute_data = execute_data; - i_init_func_execute_data(call, &fbc->op_array, return_value, EXPECTED(zend_execute_ex == execute_ex) ? VM_FRAME_NESTED_FUNCTION : VM_FRAME_TOP_FUNCTION TSRMLS_CC); + i_init_func_execute_data(call, &fbc->op_array, return_value, VM_FRAME_NESTED_FUNCTION TSRMLS_CC); if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { + call->frame_kind = VM_FRAME_TOP_FUNCTION; zend_execute_ex(call TSRMLS_CC); } } } else { /* ZEND_OVERLOADED_FUNCTION */ - Z_OBJ(EG(This)) = call->object; EG(scope) = fbc->common.scope; ZVAL_NULL(EX_VAR(opline->result.var)); /* Not sure what should be done here if it's a static method */ - if (EXPECTED(call->object != NULL)) { + if (EXPECTED(object != NULL)) { call->prev_execute_data = execute_data; EG(current_execute_data) = call; - call->object->handlers->call_method(fbc->common.function_name, call->object, call->num_args, EX_VAR(opline->result.var) TSRMLS_CC); + object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var) TSRMLS_CC); EG(current_execute_data) = call->prev_execute_data; } else { zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); @@ -673,22 +660,17 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } fcall_end_change_scope: - if (Z_OBJ(EG(This))) { + if (object) { if (UNEXPECTED(EG(exception) != NULL) && (opline->op1.num & ZEND_CALL_CTOR)) { if (!(opline->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) { - Z_DELREF(EG(This)); + GC_REFCOUNT(object)--; } - if (Z_REFCOUNT(EG(This)) == 1) { - zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC); + if (GC_REFCOUNT(object) == 1) { + zend_object_store_ctor_failed(object TSRMLS_CC); } } - if (!Z_DELREF(EG(This))) { - _zval_dtor_func_for_ptr(Z_COUNTED(EG(This)) ZEND_FILE_LINE_CC); - } else if (UNEXPECTED(!Z_GC_INFO(EG(This)))) { - gc_possible_root(Z_COUNTED(EG(This)) TSRMLS_CC); - } + OBJ_RELEASE(object); } - Z_OBJ(EG(This)) = EX(object); EG(scope) = EX(scope); fcall_end: @@ -736,7 +718,7 @@ send_again: zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht) TSRMLS_CC); if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) { - int i; + uint32_t i; int separate = 0; /* check if any of arguments are going to be passed by reference */ @@ -895,12 +877,12 @@ static int ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) { OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype); } - if (EX(call)->object) { - OBJ_RELEASE(EX(call)->object); + if (Z_OBJ(EX(call)->This)) { + OBJ_RELEASE(Z_OBJ(EX(call)->This)); } EX(call)->func = (zend_function*)&zend_pass_function; EX(call)->called_scope = NULL; - EX(call)->object = NULL; + Z_OBJ(EX(call)->This) = NULL; } else { uint32_t arg_num = 1; @@ -958,12 +940,12 @@ static int ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) { OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype); } - if (EX(call)->object) { - OBJ_RELEASE(EX(call)->object); + if (Z_OBJ(EX(call)->This)) { + OBJ_RELEASE(Z_OBJ(EX(call)->This)); } EX(call)->func = (zend_function*)&zend_pass_function; EX(call)->called_scope = NULL; - EX(call)->object = NULL; + Z_OBJ(EX(call)->This) = NULL; break; } @@ -1142,13 +1124,6 @@ static int ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - SAVE_OPLINE(); - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(scope)->name->val, EX(func)->op_array.function_name->val); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - static int ZEND_FASTCALL ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { SAVE_OPLINE(); @@ -1319,18 +1294,18 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER * arguments pushed to the stack that have to be dtor'ed. */ zend_vm_stack_free_args(EX(call) TSRMLS_CC); - if (call->object) { + if (Z_OBJ(call->This)) { if (call->flags & ZEND_CALL_CTOR) { if (!(call->flags & ZEND_CALL_CTOR_RESULT_UNUSED)) { - GC_REFCOUNT(call->object)--; + GC_REFCOUNT(Z_OBJ(call->This))--; } - if (GC_REFCOUNT(call->object) == 1) { - zend_object_store_ctor_failed(call->object TSRMLS_CC); + if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) { + zend_object_store_ctor_failed(Z_OBJ(call->This) TSRMLS_CC); } } - OBJ_RELEASE(call->object); + OBJ_RELEASE(Z_OBJ(call->This)); } - EX(call) = call->prev_nested_call; + EX(call) = call->prev_execute_data; zend_vm_stack_free_call_frame(call TSRMLS_CC); call = EX(call); } while (call); @@ -1347,13 +1322,9 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER catch_op_num >= EX(func)->op_array.brk_cont_array[i].brk) { zend_op *brk_opline = &EX(func)->op_array.opcodes[EX(func)->op_array.brk_cont_array[i].brk]; - if (brk_opline->opcode == ZEND_SWITCH_FREE) { + if (brk_opline->opcode == ZEND_FREE) { if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_ptr_dtor(EX_VAR(brk_opline->op1.var)); - } - } else if (brk_opline->opcode == ZEND_FREE) { - if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_dtor(EX_VAR(brk_opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var)); } } } @@ -1782,13 +1753,9 @@ static int ZEND_FASTCALL ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) brk_opline = EX(func)->op_array.opcodes + el->brk; - if (brk_opline->opcode == ZEND_SWITCH_FREE) { - if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_ptr_dtor(EX_VAR(brk_opline->op1.var)); - } - } else if (brk_opline->opcode == ZEND_FREE) { + if (brk_opline->opcode == ZEND_FREE) { if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_dtor(EX_VAR(brk_opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var)); } } ZEND_VM_JMP(opline->op1.jmp_addr); @@ -1855,7 +1822,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1907,7 +1874,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name)); } zend_string_free(lcname); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); fbc = Z_FUNC_P(func); called_scope = NULL; @@ -1924,7 +1891,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H /* Delay closure destruction until its invocation */ fbc->common.prototype = (zend_function*)Z_OBJ_P(function_name_ptr); } else if (IS_TMP_VAR == IS_CV) { - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) && zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) { @@ -1979,7 +1946,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H GC_REFCOUNT(object)++; /* For $this pointer */ } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2610,7 +2577,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG zval_copy_ctor_func(EX(return_value)); } } - } else if (Z_ISREF_P(retval_ptr)) { + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(retval_ptr)) { ZVAL_COPY(EX(return_value), Z_REFVAL_P(retval_ptr)); } else { @@ -2663,9 +2630,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND } else { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EX(return_value)) { - zval tmp; - ZVAL_DUP(&tmp, retval_ptr); - ZVAL_NEW_REF(EX(return_value), &tmp); + ZVAL_NEW_REF(EX(return_value), retval_ptr); + if (Z_REFCOUNTED_P(retval_ptr)) Z_ADDREF_P(retval_ptr); } break; } @@ -2893,7 +2859,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!0) { + if (IS_CONST != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_array(result); @@ -2913,7 +2879,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!0) { + if (IS_CONST != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_object(result); @@ -2942,8 +2908,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA ZVAL_UNDEF(&tmp_inc_filename); if (Z_TYPE_P(inc_filename) != IS_STRING) { - ZVAL_DUP(&tmp_inc_filename, inc_filename); - convert_to_string(&tmp_inc_filename); + ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename)); inc_filename = &tmp_inc_filename; } @@ -2960,9 +2925,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA zend_file_handle file_handle; char *resolved_path; - resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC); + resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC); if (resolved_path) { - failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path)); + failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path)); } else { resolved_path = Z_STRVAL_P(inc_filename); } @@ -2975,7 +2940,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA file_handle.opened_path = estrdup(resolved_path); } - if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) { + if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) { new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); zend_destroy_file_handle(&file_handle TSRMLS_CC); } else { @@ -3023,7 +2988,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA } call = zend_vm_stack_push_call_frame( - (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC); + (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC); if (EX(symbol_table)) { call->symbol_table = EX(symbol_table); @@ -3032,10 +2997,11 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA } call->prev_execute_data = execute_data; - i_init_code_execute_data(call, new_op_array, return_value, EXPECTED(zend_execute_ex == execute_ex) ? VM_FRAME_NESTED_CODE : VM_FRAME_TOP_CODE TSRMLS_CC); + i_init_code_execute_data(call, new_op_array, return_value, VM_FRAME_NESTED_CODE TSRMLS_CC); if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { + call->frame_kind = VM_FRAME_TOP_CODE; zend_execute_ex(call TSRMLS_CC); } @@ -3065,22 +3031,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && - (opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + (opline->extended_value & ZEND_FE_FETCH_BYREF)) { array_ptr = array_ref = NULL; ZVAL_DEREF(array_ptr); if (Z_TYPE_P(array_ptr) == IS_ARRAY) { + SEPARATE_ARRAY(array_ptr); if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - array_ref = array_ptr; - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - ZVAL_NEW_REF(array_ptr, array_ptr); - array_ref = array_ptr; - array_ptr = Z_REFVAL_P(array_ptr); - } - } else if (Z_IMMUTABLE_P(array_ptr)) { - zval_copy_ctor(array_ptr); - } else { - SEPARATE_ZVAL_NOREF(array_ptr); + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); } if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { @@ -3091,9 +3049,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A ce = Z_OBJCE_P(array_ptr); if (!ce || ce->get_iterator == NULL) { - if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - } Z_ADDREF_P(array_ptr); } array_ref = array_ptr; @@ -3103,9 +3058,12 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } else { array_ptr = array_ref = opline->op1.zv; ZVAL_DEREF(array_ptr); - if (0) { /* IS_TMP_VAR */ + if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&tmp, array_ptr); - array_ptr = &tmp; + if (Z_OPT_IMMUTABLE_P(&tmp)) { + zval_copy_ctor_func(&tmp); + } + array_ref = array_ptr = &tmp; if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (ce && ce->get_iterator) { @@ -3121,10 +3079,11 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } } else if (Z_IMMUTABLE_P(array_ref)) { if (IS_CONST == IS_CV) { - zval_copy_ctor(array_ref); + zval_copy_ctor_func(array_ref); Z_ADDREF_P(array_ref); } else { - ZVAL_DUP(&tmp, array_ref); + ZVAL_COPY_VALUE(&tmp, array_ref); + zval_copy_ctor_func(&tmp); array_ptr = array_ref = &tmp; } } else if (Z_REFCOUNTED_P(array_ref)) { @@ -3145,14 +3104,13 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A ZVAL_UNREF(array_ref); array_ptr = array_ref; } - if (Z_IMMUTABLE_P(array_ptr) || - (Z_ISREF_P(array_ref) && - Z_REFCOUNTED_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { - if (!Z_IMMUTABLE_P(array_ptr)) { - Z_DELREF_P(array_ptr); - } - zval_copy_ctor(array_ptr); + if (Z_IMMUTABLE_P(array_ptr)) { + zval_copy_ctor_func(array_ptr); + } else if (Z_ISREF_P(array_ref) && + Z_COPYABLE_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 1) { + Z_DELREF_P(array_ptr); + zval_copy_ctor_func(array_ptr); } if (IS_CONST == IS_CV) { Z_ADDREF_P(array_ref); @@ -3162,16 +3120,16 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC); - if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) { } if (iter && EXPECTED(EG(exception) == NULL)) { ZVAL_OBJ(&iterator, &iter->std); array_ptr = array_ref = &iterator; } else { - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } if (!EG(exception)) { @@ -3190,7 +3148,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } HANDLE_EXCEPTION(); @@ -3199,38 +3157,50 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = Z_OBJ_P(array_ptr); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - zend_string *str_key; - zend_ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0); - if (key_type != HASH_KEY_NON_EXISTENT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) { - break; + HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var); + HashPosition pos = 0; + Bucket *p; + + while (1) { + if (pos >= fe_ht->nNumUsed) { + is_empty = 1; + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { + } - zend_hash_move_forward(fe_ht); + ZEND_VM_JMP(opline->op2.jmp_addr); } + p = fe_ht->arData + pos; + if (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) { + pos++; + continue; + } + if (!ce || + !p->key || + zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) { + break; + } + pos++; } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var)); + fe_ht->nInternalPointer = pos; + ptr->pos = pos; + ptr->ht = fe_ht; + ptr->h = fe_ht->arData[pos].h; + is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); is_empty = 1; } - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } if (is_empty) { @@ -3268,10 +3238,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR USE_OPLINE zval *value; + int is_ref = 0; SAVE_OPLINE(); value = opline->op1.zv; + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } if (i_zend_is_true(value TSRMLS_CC)) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_CONST == IS_CONST) { @@ -3280,6 +3255,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR } } else if (IS_CONST == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_CONST == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -3288,16 +3266,22 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_COALESCE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zval *value; + int is_ref = 0; SAVE_OPLINE(); value = opline->op1.zv; - if (i_zend_is_true(value TSRMLS_CC)) { + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_CONST == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { @@ -3305,6 +3289,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE } } else if (IS_CONST == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_CONST == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -3322,33 +3309,18 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); value = opline->op1.zv; - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_CONST == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); - } - } else if (IS_CONST == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); - } - ZEND_VM_NEXT_OPCODE(); -} + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) { + ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value)); -static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - - zval *value; - - SAVE_OPLINE(); - value = opline->op1.zv; - - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_CONST == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { + zval_copy_ctor_func(EX_VAR(opline->result.var)); + } + } else if (IS_CONST == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - } else if (IS_CONST == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } ZEND_VM_NEXT_OPCODE(); } @@ -3791,8 +3763,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -3812,8 +3783,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -3957,7 +3927,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_ ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_CONST(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -3989,11 +3959,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_CONS ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CONST_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -4054,7 +4019,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CONST_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -4153,7 +4118,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -4161,8 +4126,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -4338,8 +4303,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO ZVAL_DUP(EX_VAR(opline->result.var), value); } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) { /* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */ - ZVAL_STR(EX_VAR(opline->result.var), ce->name); - zend_string_addref(ce->name); + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); } else { zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv)); } @@ -4367,7 +4331,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O } else { expr_ptr = opline->op1.zv; - if (0) { /* temporary variable */ + if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CONST == IS_CONST) { @@ -4375,9 +4339,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CONST == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -4474,29 +4438,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA zval tmp, *varname; HashTable *target_symbol_table; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_CONST == IS_CV && IS_CONST == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = opline->op1.zv; + ZVAL_UNDEF(&tmp); if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_CONST != IS_UNUSED) { @@ -4508,10 +4480,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_CONST != IS_CONST && tmp_is_dup) { + if (IS_CONST != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - zval_ptr_dtor(&tmp); } HANDLE_EXCEPTION(); @@ -4530,10 +4500,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_CONST != IS_CONST && tmp_is_dup) { + if (IS_CONST != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - zval_ptr_dtor(&tmp); } CHECK_EXCEPTION(); @@ -4713,7 +4681,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -4832,8 +4800,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CONST != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -4862,14 +4830,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE ZVAL_DUP(&generator->value, value); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -4887,14 +4855,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE ZVAL_DUP(&generator->key, key); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -4953,7 +4921,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4968,7 +4936,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4983,7 +4951,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4998,7 +4966,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5013,7 +4981,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5028,7 +4996,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5043,7 +5011,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5058,7 +5026,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5073,7 +5041,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5089,7 +5057,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCO opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5105,7 +5073,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5121,7 +5089,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5137,7 +5105,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HAN opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5153,7 +5121,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_O opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5168,7 +5136,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5183,7 +5151,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5198,7 +5166,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5213,7 +5181,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5227,7 +5195,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); container = opline->op1.zv; zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { } @@ -5244,7 +5212,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); container = opline->op1.zv; zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -5270,7 +5238,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMP_HANDLER(ZEND_OP if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { if (IS_TMP_VAR == IS_UNUSED) { @@ -5278,14 +5246,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMP_HANDLER(ZEND_OP } container = opline->op1.zv; zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_TMP(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -5312,17 +5280,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_TMP( } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CONST_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -5349,7 +5312,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -5376,7 +5339,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMP_HANDLER(ZEND_OP zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -5384,7 +5347,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMP_HANDLER(ZEND_OP CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CONST_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -5455,13 +5418,13 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE } } if (IS_TMP_VAR != IS_CONST) { - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } } else { if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -5469,8 +5432,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -5541,7 +5504,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE EX(call) = zend_vm_stack_push_call_frame( func, opline->extended_value, 0, called_scope, object, EX(call) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5557,7 +5520,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5580,7 +5543,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC } else { expr_ptr = opline->op1.zv; - if (0) { /* temporary variable */ + if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CONST == IS_CONST) { @@ -5588,9 +5551,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CONST == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -5642,7 +5605,7 @@ str_index: /* do nothing */ break; } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr); } @@ -5774,7 +5737,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -5788,7 +5751,7 @@ num_index_prop: result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); CHECK_EXCEPTION(); @@ -5821,7 +5784,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMP_HANDLER(ZEN result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); CHECK_EXCEPTION(); @@ -5862,8 +5825,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CONST != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -5892,14 +5855,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->value, value); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -5917,14 +5880,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->key, key); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -5968,7 +5931,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -6302,8 +6265,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -6323,8 +6285,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -6468,7 +6429,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OP ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_VAR(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -6501,11 +6462,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_VAR( ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CONST_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -6567,7 +6523,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OP CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CONST_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -6644,7 +6600,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -6652,8 +6608,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -6763,7 +6719,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC } else { expr_ptr = opline->op1.zv; - if (0) { /* temporary variable */ + if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CONST == IS_CONST) { @@ -6771,9 +6727,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CONST == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -6870,29 +6826,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND zval tmp, *varname; HashTable *target_symbol_table; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_CONST == IS_CV && IS_VAR == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = opline->op1.zv; + ZVAL_UNDEF(&tmp); if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_VAR != IS_UNUSED) { @@ -6904,10 +6868,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_CONST != IS_CONST && tmp_is_dup) { + if (IS_CONST != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - zval_ptr_dtor(&tmp); } HANDLE_EXCEPTION(); @@ -6926,10 +6888,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_CONST != IS_CONST && tmp_is_dup) { + if (IS_CONST != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - zval_ptr_dtor(&tmp); } CHECK_EXCEPTION(); @@ -7109,7 +7069,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -7197,8 +7157,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CONST != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -7227,14 +7187,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->value, value); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -7252,14 +7212,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->key, key); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); zval_ptr_dtor_nogc(free_op2.var); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -7362,8 +7322,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -7383,8 +7342,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -7569,7 +7527,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -7577,8 +7535,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -7630,7 +7588,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_ } else { expr_ptr = opline->op1.zv; - if (0) { /* temporary variable */ + if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CONST == IS_CONST) { @@ -7638,9 +7596,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_ ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CONST == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -7737,29 +7695,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H zval tmp, *varname; HashTable *target_symbol_table; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_CONST == IS_CV && IS_UNUSED == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = opline->op1.zv; + ZVAL_UNDEF(&tmp); if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_UNUSED != IS_UNUSED) { @@ -7771,10 +7737,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_CONST != IS_CONST && tmp_is_dup) { + if (IS_CONST != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - zval_ptr_dtor(&tmp); } HANDLE_EXCEPTION(); @@ -7793,10 +7757,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_CONST != IS_CONST && tmp_is_dup) { + if (IS_CONST != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - zval_ptr_dtor(&tmp); } CHECK_EXCEPTION(); @@ -7901,7 +7863,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER if (closure_is_static || closure_is_being_defined_inside_static_context) { zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC); } else { - zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EG(This)) ? &EG(This) : NULL TSRMLS_CC); + zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC); } CHECK_EXCEPTION(); @@ -7942,8 +7904,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CONST != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -7972,14 +7934,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL ZVAL_DUP(&generator->value, value); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -7997,14 +7959,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL ZVAL_DUP(&generator->key, key); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_UNUSED == IS_VAR || IS_UNUSED == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -8380,7 +8342,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_CV(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -8412,11 +8374,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CONST_CV(Z ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CONST_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -8477,7 +8434,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CONST_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -8554,7 +8511,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -8562,8 +8519,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -8724,7 +8681,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO } else { expr_ptr = opline->op1.zv; - if (0) { /* temporary variable */ + if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CONST == IS_CONST) { @@ -8732,9 +8689,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CONST == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -8918,7 +8875,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -9004,8 +8961,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CONST != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -9034,14 +8991,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A ZVAL_DUP(&generator->value, value); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -9059,14 +9016,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A ZVAL_DUP(&generator->key, key); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -9123,7 +9080,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); bitwise_not_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9136,7 +9093,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); boolean_not_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9152,7 +9109,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_print_variable(z TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9189,7 +9146,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else { opline = opline->op2.jmp_addr; } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -9220,7 +9177,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else { opline++; } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -9251,7 +9208,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else { opline = opline->op2.jmp_addr; } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -9286,7 +9243,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZVAL_FALSE(EX_VAR(opline->result.var)); opline = opline->op2.jmp_addr; } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -9320,7 +9277,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_FALSE(EX_VAR(opline->result.var)); opline++; } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -9332,11 +9289,7 @@ static int ZEND_FASTCALL ZEND_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) USE_OPLINE SAVE_OPLINE(); - if (IS_TMP_VAR == IS_TMP_VAR) { - zval_dtor(EX_VAR(opline->op1.var)); - } else { - zval_ptr_dtor(EX_VAR(opline->op1.var)); - } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9351,7 +9304,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EX(return_value)) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } else { if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); @@ -9360,7 +9313,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor_func(EX(return_value)); } } - } else if (Z_ISREF_P(retval_ptr)) { + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(retval_ptr)) { ZVAL_COPY(EX(return_value), Z_REFVAL_P(retval_ptr)); } else { @@ -9390,7 +9343,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EX(return_value)) { if (IS_TMP_VAR == IS_TMP_VAR) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } } else { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); @@ -9413,9 +9366,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE } else { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EX(return_value)) { - zval tmp; - ZVAL_DUP(&tmp, retval_ptr); - ZVAL_NEW_REF(EX(return_value), &tmp); + ZVAL_NEW_REF(EX(return_value), retval_ptr); + if (Z_REFCOUNTED_P(retval_ptr)) Z_ADDREF_P(retval_ptr); } break; } @@ -9508,7 +9460,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC)); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -9624,7 +9576,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9645,7 +9597,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!1) { + if (IS_TMP_VAR != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_array(result); @@ -9665,7 +9617,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!1) { + if (IS_TMP_VAR != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_object(result); @@ -9675,7 +9627,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9694,8 +9646,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND ZVAL_UNDEF(&tmp_inc_filename); if (Z_TYPE_P(inc_filename) != IS_STRING) { - ZVAL_DUP(&tmp_inc_filename, inc_filename); - convert_to_string(&tmp_inc_filename); + ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename)); inc_filename = &tmp_inc_filename; } @@ -9712,9 +9663,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND zend_file_handle file_handle; char *resolved_path; - resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC); + resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC); if (resolved_path) { - failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path)); + failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path)); } else { resolved_path = Z_STRVAL_P(inc_filename); } @@ -9727,7 +9678,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND file_handle.opened_path = estrdup(resolved_path); } - if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) { + if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) { new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); zend_destroy_file_handle(&file_handle TSRMLS_CC); } else { @@ -9763,7 +9714,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) { zval_ptr_dtor(&tmp_inc_filename); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } else if (EXPECTED(new_op_array != NULL)) { @@ -9775,7 +9726,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND } call = zend_vm_stack_push_call_frame( - (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC); + (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC); if (EX(symbol_table)) { call->symbol_table = EX(symbol_table); @@ -9784,10 +9735,11 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND } call->prev_execute_data = execute_data; - i_init_code_execute_data(call, new_op_array, return_value, EXPECTED(zend_execute_ex == execute_ex) ? VM_FRAME_NESTED_CODE : VM_FRAME_TOP_CODE TSRMLS_CC); + i_init_code_execute_data(call, new_op_array, return_value, VM_FRAME_NESTED_CODE TSRMLS_CC); if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { + call->frame_kind = VM_FRAME_TOP_CODE; zend_execute_ex(call TSRMLS_CC); } @@ -9817,22 +9769,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && - (opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + (opline->extended_value & ZEND_FE_FETCH_BYREF)) { array_ptr = array_ref = NULL; ZVAL_DEREF(array_ptr); if (Z_TYPE_P(array_ptr) == IS_ARRAY) { + SEPARATE_ARRAY(array_ptr); if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - array_ref = array_ptr; - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - ZVAL_NEW_REF(array_ptr, array_ptr); - array_ref = array_ptr; - array_ptr = Z_REFVAL_P(array_ptr); - } - } else if (Z_IMMUTABLE_P(array_ptr)) { - zval_copy_ctor(array_ptr); - } else { - SEPARATE_ZVAL_NOREF(array_ptr); + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); } if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { @@ -9843,9 +9787,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG ce = Z_OBJCE_P(array_ptr); if (!ce || ce->get_iterator == NULL) { - if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - } Z_ADDREF_P(array_ptr); } array_ref = array_ptr; @@ -9855,9 +9796,12 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } else { array_ptr = array_ref = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ZVAL_DEREF(array_ptr); - if (1) { /* IS_TMP_VAR */ + if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&tmp, array_ptr); - array_ptr = &tmp; + if (Z_OPT_IMMUTABLE_P(&tmp)) { + zval_copy_ctor_func(&tmp); + } + array_ref = array_ptr = &tmp; if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (ce && ce->get_iterator) { @@ -9873,10 +9817,11 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } } else if (Z_IMMUTABLE_P(array_ref)) { if (IS_TMP_VAR == IS_CV) { - zval_copy_ctor(array_ref); + zval_copy_ctor_func(array_ref); Z_ADDREF_P(array_ref); } else { - ZVAL_DUP(&tmp, array_ref); + ZVAL_COPY_VALUE(&tmp, array_ref); + zval_copy_ctor_func(&tmp); array_ptr = array_ref = &tmp; } } else if (Z_REFCOUNTED_P(array_ref)) { @@ -9897,14 +9842,13 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_UNREF(array_ref); array_ptr = array_ref; } - if (Z_IMMUTABLE_P(array_ptr) || - (Z_ISREF_P(array_ref) && - Z_REFCOUNTED_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { - if (!Z_IMMUTABLE_P(array_ptr)) { - Z_DELREF_P(array_ptr); - } - zval_copy_ctor(array_ptr); + if (Z_IMMUTABLE_P(array_ptr)) { + zval_copy_ctor_func(array_ptr); + } else if (Z_ISREF_P(array_ref) && + Z_COPYABLE_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 1) { + Z_DELREF_P(array_ptr); + zval_copy_ctor_func(array_ptr); } if (IS_TMP_VAR == IS_CV) { Z_ADDREF_P(array_ref); @@ -9914,16 +9858,16 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC); - if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) { } if (iter && EXPECTED(EG(exception) == NULL)) { ZVAL_OBJ(&iterator, &iter->std); array_ptr = array_ref = &iterator; } else { - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } if (!EG(exception)) { @@ -9942,7 +9886,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } HANDLE_EXCEPTION(); @@ -9951,38 +9895,50 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = Z_OBJ_P(array_ptr); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - zend_string *str_key; - zend_ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0); - if (key_type != HASH_KEY_NON_EXISTENT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) { - break; + HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var); + HashPosition pos = 0; + Bucket *p; + + while (1) { + if (pos >= fe_ht->nNumUsed) { + is_empty = 1; + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { + } - zend_hash_move_forward(fe_ht); + ZEND_VM_JMP(opline->op2.jmp_addr); + } + p = fe_ht->arData + pos; + if (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) { + pos++; + continue; } + if (!ce || + !p->key || + zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) { + break; + } + pos++; } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var)); + fe_ht->nInternalPointer = pos; + ptr->pos = pos; + ptr->ht = fe_ht; + ptr->h = fe_ht->arData[pos].h; + is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); is_empty = 1; } - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } if (is_empty) { @@ -10008,7 +9964,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else { zend_print_variable(ptr TSRMLS_CC); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } #endif zend_bailout(); @@ -10035,10 +9991,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS USE_OPLINE zend_free_op free_op1; zval *value; + int is_ref = 0; SAVE_OPLINE(); value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } if (i_zend_is_true(value TSRMLS_CC)) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_TMP_VAR == IS_CONST) { @@ -10047,25 +10008,34 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS } } else if (IS_TMP_VAR == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_TMP_VAR == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + zval_ptr_dtor_nogc(free_op1.var); } ZEND_VM_JMP(opline->op2.jmp_addr); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_COALESCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; zval *value; + int is_ref = 0; SAVE_OPLINE(); value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_TMP_VAR == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { @@ -10073,11 +10043,14 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ } } else if (IS_TMP_VAR == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_TMP_VAR == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + zval_ptr_dtor_nogc(free_op1.var); } ZEND_VM_JMP(opline->op2.jmp_addr); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10091,33 +10064,18 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_TMP_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); - } - } else if (IS_TMP_VAR == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_free_op free_op1; - zval *value; - - SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_TMP_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) { + ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value)); + zval_ptr_dtor_nogc(free_op1.var); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { + zval_copy_ctor_func(EX_VAR(opline->result.var)); + } + } else if (IS_TMP_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - } else if (IS_TMP_VAR == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } ZEND_VM_NEXT_OPCODE(); } @@ -10138,7 +10096,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A result = 0; } ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10178,7 +10136,7 @@ strlen_error: ZVAL_NULL(EX_VAR(opline->result.var)); } } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10229,7 +10187,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A break; EMPTY_SWITCH_DEFAULT_CASE() } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10243,7 +10201,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_add_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10258,7 +10216,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_sub_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10273,7 +10231,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_mul_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10288,7 +10246,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_div_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10303,7 +10261,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_mod_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10318,7 +10276,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG shift_left_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10333,7 +10291,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG shift_right_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10348,7 +10306,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER concat_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10363,7 +10321,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H fast_is_identical_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10379,7 +10337,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO fast_is_not_identical_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10395,7 +10353,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL fast_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10411,7 +10369,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H fast_not_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10427,7 +10385,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN fast_is_smaller_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10443,7 +10401,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_O fast_is_smaller_or_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10458,7 +10416,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ bitwise_or_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10473,7 +10431,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER bitwise_and_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10488,7 +10446,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER bitwise_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10503,7 +10461,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL boolean_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10542,7 +10500,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, if (IS_TMP_VAR != IS_CONST) { zend_string_release(name); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10552,7 +10510,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, ce = Z_CE_P(EX_VAR(opline->op2.var)); } retval = zend_std_get_static_property(ce, name, 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } else { target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); retval = zend_hash_find(target_symbol_table, name); @@ -10563,8 +10521,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -10584,8 +10541,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -10602,7 +10558,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, zval_update_constant(retval, 1 TSRMLS_CC); } } else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } } @@ -10673,7 +10629,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC); if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10689,7 +10645,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10723,13 +10679,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_CONST(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -10756,16 +10712,11 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_CONST( } } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_TMP_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -10792,7 +10743,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H } } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10826,7 +10777,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_TMP_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -10993,7 +10944,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC } else { expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (1) { /* temporary variable */ + if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_TMP_VAR == IS_CONST) { @@ -11001,9 +10952,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_TMP_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -11100,29 +11051,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND zval tmp, *varname; HashTable *target_symbol_table; zend_free_op free_op1; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_TMP_VAR == IS_CV && IS_CONST == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_CONST != IS_UNUSED) { @@ -11134,12 +11093,10 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_TMP_VAR != IS_CONST && tmp_is_dup) { + if (IS_TMP_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { @@ -11156,12 +11113,10 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_TMP_VAR != IS_CONST && tmp_is_dup) { + if (IS_TMP_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11224,7 +11179,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC if (IS_TMP_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } if (opline->extended_value & ZEND_ISSET) { @@ -11339,7 +11294,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -11354,7 +11309,7 @@ num_index_prop: } ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11386,7 +11341,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_CONST_HANDLER(ZEN } ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11425,8 +11380,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!1) { - zval_copy_ctor(&generator->value); + if (IS_TMP_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -11455,14 +11410,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->value, value); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -11480,14 +11435,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->key, key); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -11530,7 +11485,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR pow_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -11545,8 +11500,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_add_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11560,8 +11515,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_sub_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11575,8 +11530,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mul_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11590,8 +11545,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_div_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11605,8 +11560,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mod_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11620,8 +11575,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11635,8 +11590,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11650,8 +11605,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A concat_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11665,8 +11620,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN fast_is_identical_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11681,8 +11636,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE fast_is_not_identical_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11697,8 +11652,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER fast_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11713,8 +11668,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN fast_not_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11729,8 +11684,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDL fast_is_smaller_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11745,8 +11700,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPC fast_is_smaller_or_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11760,8 +11715,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_or_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11775,8 +11730,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_and_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11790,8 +11745,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11805,8 +11760,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER boolean_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11820,9 +11775,9 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -11837,8 +11792,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11863,7 +11818,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMP_HANDLER(ZEND_OPCO if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { if (IS_TMP_VAR == IS_UNUSED) { @@ -11871,14 +11826,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMP_HANDLER(ZEND_OPCO } container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_TMP(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -11905,17 +11860,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_TMP(ZE } } - zval_dtor(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_TMP_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -11942,8 +11892,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN } } - zval_dtor(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -11969,7 +11919,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMP_HANDLER(ZEND_OPCO zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -11977,7 +11927,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMP_HANDLER(ZEND_OPCO CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_TMP_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -12019,7 +11969,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're * string offsets or overloaded objects */ - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12051,7 +12001,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { if (UNEXPECTED(EG(exception) != NULL)) { - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); @@ -12090,7 +12040,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE EX(call) = zend_vm_stack_push_call_frame( fbc, opline->extended_value, 0, called_scope, obj, EX(call) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12107,7 +12057,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12130,7 +12080,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD } else { expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (1) { /* temporary variable */ + if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_TMP_VAR == IS_CONST) { @@ -12138,9 +12088,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_TMP_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -12192,7 +12142,7 @@ str_index: /* do nothing */ break; } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr); } @@ -12324,7 +12274,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -12338,9 +12288,9 @@ num_index_prop: result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12371,9 +12321,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_TMP_HANDLER(ZEND_ result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12412,8 +12362,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!1) { - zval_copy_ctor(&generator->value); + if (IS_TMP_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -12442,14 +12392,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->value, value); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -12467,14 +12417,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->key, key); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -12517,8 +12467,8 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS pow_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op1.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12532,7 +12482,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_add_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12547,7 +12497,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_sub_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12562,7 +12512,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mul_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12577,7 +12527,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_div_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12592,7 +12542,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mod_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12607,7 +12557,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12622,7 +12572,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12637,7 +12587,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A concat_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12652,7 +12602,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN fast_is_identical_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12668,7 +12618,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE fast_is_not_identical_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12684,7 +12634,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER fast_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12700,7 +12650,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN fast_not_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12716,7 +12666,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL fast_is_smaller_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12732,7 +12682,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPC fast_is_smaller_or_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12747,7 +12697,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_or_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12762,7 +12712,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_and_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12777,7 +12727,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12792,7 +12742,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER boolean_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12831,7 +12781,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE if (IS_TMP_VAR != IS_CONST) { zend_string_release(name); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12841,7 +12791,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE ce = Z_CE_P(EX_VAR(opline->op2.var)); } retval = zend_std_get_static_property(ce, name, 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } else { target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); retval = zend_hash_find(target_symbol_table, name); @@ -12852,8 +12802,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -12873,8 +12822,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -12891,7 +12839,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE zval_update_constant(retval, 1 TSRMLS_CC); } } else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } } @@ -12962,7 +12910,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC); zval_ptr_dtor_nogc(free_op2.var); if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12978,7 +12926,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC); zval_ptr_dtor_nogc(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13012,13 +12960,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCO container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC); zval_ptr_dtor_nogc(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_VAR(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -13046,16 +12994,11 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_VAR(ZE } zval_ptr_dtor_nogc(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_TMP_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -13083,7 +13026,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN } zval_ptr_dtor_nogc(free_op2.var); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13117,7 +13060,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCO CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_TMP_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -13270,7 +13213,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD } else { expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (1) { /* temporary variable */ + if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_TMP_VAR == IS_CONST) { @@ -13278,9 +13221,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_TMP_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -13377,29 +13320,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE zval tmp, *varname; HashTable *target_symbol_table; zend_free_op free_op1; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_TMP_VAR == IS_CV && IS_VAR == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_VAR != IS_UNUSED) { @@ -13411,12 +13362,10 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_TMP_VAR != IS_CONST && tmp_is_dup) { + if (IS_TMP_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { @@ -13433,12 +13382,10 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_TMP_VAR != IS_CONST && tmp_is_dup) { + if (IS_TMP_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13501,7 +13448,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD if (IS_TMP_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } if (opline->extended_value & ZEND_ISSET) { @@ -13616,7 +13563,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -13632,7 +13579,7 @@ num_index_prop: zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13665,7 +13612,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_VAR_HANDLER(ZEND_ zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13704,8 +13651,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!1) { - zval_copy_ctor(&generator->value); + if (IS_TMP_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -13734,14 +13681,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->value, value); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -13759,14 +13706,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->key, key); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); zval_ptr_dtor_nogc(free_op2.var); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -13809,7 +13756,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS pow_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13848,7 +13795,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, if (IS_TMP_VAR != IS_CONST) { zend_string_release(name); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13858,7 +13805,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, ce = Z_CE_P(EX_VAR(opline->op2.var)); } retval = zend_std_get_static_property(ce, name, 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } else { target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); retval = zend_hash_find(target_symbol_table, name); @@ -13869,8 +13816,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -13890,8 +13836,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -13908,7 +13853,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, zval_update_constant(retval, 1 TSRMLS_CC); } } else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } } @@ -13997,7 +13942,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_O container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14021,7 +13966,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP } else { expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (1) { /* temporary variable */ + if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_TMP_VAR == IS_CONST) { @@ -14029,9 +13974,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_TMP_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -14128,29 +14073,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN zval tmp, *varname; HashTable *target_symbol_table; zend_free_op free_op1; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_TMP_VAR == IS_CV && IS_UNUSED == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_UNUSED != IS_UNUSED) { @@ -14162,12 +14115,10 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_TMP_VAR != IS_CONST && tmp_is_dup) { + if (IS_TMP_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { @@ -14184,12 +14135,10 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_TMP_VAR != IS_CONST && tmp_is_dup) { + if (IS_TMP_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14252,7 +14201,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP if (IS_TMP_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } if (opline->extended_value & ZEND_ISSET) { @@ -14308,8 +14257,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!1) { - zval_copy_ctor(&generator->value); + if (IS_TMP_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -14338,14 +14287,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->value, value); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -14363,14 +14312,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->key, key); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_UNUSED == IS_VAR || IS_UNUSED == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -14413,7 +14362,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_add_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14428,7 +14377,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_sub_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14443,7 +14392,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_mul_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14458,7 +14407,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_div_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14473,7 +14422,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_mod_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14488,7 +14437,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14503,7 +14452,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14518,7 +14467,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR concat_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14533,7 +14482,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND fast_is_identical_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14549,7 +14498,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_ fast_is_not_identical_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14565,7 +14514,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ fast_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14581,7 +14530,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND fast_not_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14597,7 +14546,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLE fast_is_smaller_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14613,7 +14562,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCO fast_is_smaller_or_equal_function(result, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14628,7 +14577,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG bitwise_or_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14643,7 +14592,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_and_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14658,7 +14607,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14673,7 +14622,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ boolean_xor_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14690,7 +14639,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC); if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14706,7 +14655,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14740,13 +14689,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_CV(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -14773,16 +14722,11 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_TMP_CV(ZEN } } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_TMP_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -14809,7 +14753,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND } } - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14843,7 +14787,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_TMP_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -14993,7 +14937,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE } else { expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (1) { /* temporary variable */ + if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_TMP_VAR == IS_CONST) { @@ -15001,9 +14945,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_TMP_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -15187,7 +15131,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -15202,7 +15146,7 @@ num_index_prop: } ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15234,7 +15178,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_CV_HANDLER(ZEND_O } ZVAL_BOOL(EX_VAR(opline->result.var), result); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15273,8 +15217,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!1) { - zval_copy_ctor(&generator->value); + if (IS_TMP_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -15303,14 +15247,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->value, value); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -15328,14 +15272,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->key, key); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -15378,7 +15322,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) pow_function(EX_VAR(opline->result.var), _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15435,7 +15379,6 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15443,19 +15386,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZVAL_DEREF(var_ptr); SEPARATE_ZVAL_NOREF(var_ptr); - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_increment_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - increment_function(var_ptr); - } + increment_function(var_ptr); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); @@ -15491,7 +15422,6 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15499,19 +15429,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZVAL_DEREF(var_ptr); SEPARATE_ZVAL_NOREF(var_ptr); - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_decrement_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - decrement_function(var_ptr); - } + decrement_function(var_ptr); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); @@ -15526,7 +15444,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG { USE_OPLINE zend_free_op free_op1; - zval *var_ptr, *retval; + zval *var_ptr; SAVE_OPLINE(); var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); @@ -15543,34 +15461,19 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) { ZVAL_NULL(EX_VAR(opline->result.var)); - if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - retval = EX_VAR(opline->result.var); - if (UNEXPECTED(Z_ISREF_P(var_ptr))) { var_ptr = Z_REFVAL_P(var_ptr); - ZVAL_DUP(retval, var_ptr); + ZVAL_DUP(EX_VAR(opline->result.var), var_ptr); } else { - ZVAL_DUP(retval, var_ptr); - SEPARATE_ZVAL_NOREF(var_ptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + zval_opt_copy_ctor(var_ptr); } - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_increment_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - increment_function(var_ptr); - } + increment_function(var_ptr); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); @@ -15581,7 +15484,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG { USE_OPLINE zend_free_op free_op1; - zval *var_ptr, *retval; + zval *var_ptr; SAVE_OPLINE(); var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); @@ -15598,34 +15501,19 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) { ZVAL_NULL(EX_VAR(opline->result.var)); - if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - retval = EX_VAR(opline->result.var); - if (UNEXPECTED(Z_ISREF_P(var_ptr))) { var_ptr = Z_REFVAL_P(var_ptr); - ZVAL_DUP(retval, var_ptr); + ZVAL_DUP(EX_VAR(opline->result.var), var_ptr); } else { - ZVAL_DUP(retval, var_ptr); - SEPARATE_ZVAL_NOREF(var_ptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + zval_opt_copy_ctor(var_ptr); } - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_decrement_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - decrement_function(var_ptr); - } + decrement_function(var_ptr); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); @@ -15823,11 +15711,7 @@ static int ZEND_FASTCALL ZEND_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) USE_OPLINE SAVE_OPLINE(); - if (IS_VAR == IS_TMP_VAR) { - zval_dtor(EX_VAR(opline->op1.var)); - } else { - zval_ptr_dtor(EX_VAR(opline->op1.var)); - } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15851,7 +15735,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor_func(EX(return_value)); } } - } else if (Z_ISREF_P(retval_ptr)) { + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(retval_ptr)) { ZVAL_COPY(EX(return_value), Z_REFVAL_P(retval_ptr)); zval_ptr_dtor_nogc(free_op1.var); } else { @@ -15904,9 +15788,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE } else { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EX(return_value)) { - zval tmp; - ZVAL_DUP(&tmp, retval_ptr); - ZVAL_NEW_REF(EX(return_value), &tmp); + ZVAL_NEW_REF(EX(return_value), retval_ptr); + if (Z_REFCOUNTED_P(retval_ptr)) Z_ADDREF_P(retval_ptr); } break; } @@ -15959,7 +15842,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); arg = ZEND_CALL_ARG(EX(call), opline->op2.num); EX(call)->num_args = opline->op2.num; - if (Z_ISREF_P(varptr)) { + if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(varptr)) { ZVAL_COPY(arg, Z_REFVAL_P(varptr)); zval_ptr_dtor_nogc(free_op1.var); } else { @@ -16064,7 +15947,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); arg = ZEND_CALL_ARG(EX(call), opline->op2.num); EX(call)->num_args = opline->op2.num; - if (Z_ISREF_P(varptr)) { + if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(varptr)) { ZVAL_COPY(arg, Z_REFVAL_P(varptr)); zval_ptr_dtor_nogc(free_op1.var); } else { @@ -16115,12 +15998,12 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) { OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype); } - if (EX(call)->object) { - OBJ_RELEASE(EX(call)->object); + if (Z_OBJ(EX(call)->This)) { + OBJ_RELEASE(Z_OBJ(EX(call)->This)); } EX(call)->func = (zend_function*)&zend_pass_function; EX(call)->called_scope = NULL; - EX(call)->object = NULL; + Z_OBJ(EX(call)->This) = NULL; zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); @@ -16170,16 +16053,6 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_SWITCH_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - - SAVE_OPLINE(); - zval_ptr_dtor(EX_VAR(opline->op1.var)); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); -} - static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -16311,7 +16184,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!0) { + if (IS_VAR != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_array(result); @@ -16331,7 +16204,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!0) { + if (IS_VAR != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_object(result); @@ -16361,8 +16234,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND ZVAL_UNDEF(&tmp_inc_filename); if (Z_TYPE_P(inc_filename) != IS_STRING) { - ZVAL_DUP(&tmp_inc_filename, inc_filename); - convert_to_string(&tmp_inc_filename); + ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename)); inc_filename = &tmp_inc_filename; } @@ -16379,9 +16251,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND zend_file_handle file_handle; char *resolved_path; - resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC); + resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC); if (resolved_path) { - failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path)); + failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path)); } else { resolved_path = Z_STRVAL_P(inc_filename); } @@ -16394,7 +16266,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND file_handle.opened_path = estrdup(resolved_path); } - if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) { + if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) { new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); zend_destroy_file_handle(&file_handle TSRMLS_CC); } else { @@ -16442,7 +16314,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND } call = zend_vm_stack_push_call_frame( - (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC); + (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC); if (EX(symbol_table)) { call->symbol_table = EX(symbol_table); @@ -16451,10 +16323,11 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND } call->prev_execute_data = execute_data; - i_init_code_execute_data(call, new_op_array, return_value, EXPECTED(zend_execute_ex == execute_ex) ? VM_FRAME_NESTED_CODE : VM_FRAME_TOP_CODE TSRMLS_CC); + i_init_code_execute_data(call, new_op_array, return_value, VM_FRAME_NESTED_CODE TSRMLS_CC); if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { + call->frame_kind = VM_FRAME_TOP_CODE; zend_execute_ex(call TSRMLS_CC); } @@ -16484,22 +16357,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && - (opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + (opline->extended_value & ZEND_FE_FETCH_BYREF)) { array_ptr = array_ref = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ZVAL_DEREF(array_ptr); if (Z_TYPE_P(array_ptr) == IS_ARRAY) { + SEPARATE_ARRAY(array_ptr); if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - array_ref = array_ptr; - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - ZVAL_NEW_REF(array_ptr, array_ptr); - array_ref = array_ptr; - array_ptr = Z_REFVAL_P(array_ptr); - } - } else if (Z_IMMUTABLE_P(array_ptr)) { - zval_copy_ctor(array_ptr); - } else { - SEPARATE_ZVAL_NOREF(array_ptr); + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); } if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { @@ -16510,9 +16375,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG ce = Z_OBJCE_P(array_ptr); if (!ce || ce->get_iterator == NULL) { - if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - } Z_ADDREF_P(array_ptr); } array_ref = array_ptr; @@ -16522,9 +16384,12 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } else { array_ptr = array_ref = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ZVAL_DEREF(array_ptr); - if (0) { /* IS_TMP_VAR */ + if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&tmp, array_ptr); - array_ptr = &tmp; + if (Z_OPT_IMMUTABLE_P(&tmp)) { + zval_copy_ctor_func(&tmp); + } + array_ref = array_ptr = &tmp; if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (ce && ce->get_iterator) { @@ -16540,10 +16405,11 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } } else if (Z_IMMUTABLE_P(array_ref)) { if (IS_VAR == IS_CV) { - zval_copy_ctor(array_ref); + zval_copy_ctor_func(array_ref); Z_ADDREF_P(array_ref); } else { - ZVAL_DUP(&tmp, array_ref); + ZVAL_COPY_VALUE(&tmp, array_ref); + zval_copy_ctor_func(&tmp); array_ptr = array_ref = &tmp; } } else if (Z_REFCOUNTED_P(array_ref)) { @@ -16564,14 +16430,13 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_UNREF(array_ref); array_ptr = array_ref; } - if (Z_IMMUTABLE_P(array_ptr) || - (Z_ISREF_P(array_ref) && - Z_REFCOUNTED_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { - if (!Z_IMMUTABLE_P(array_ptr)) { - Z_DELREF_P(array_ptr); - } - zval_copy_ctor(array_ptr); + if (Z_IMMUTABLE_P(array_ptr)) { + zval_copy_ctor_func(array_ptr); + } else if (Z_ISREF_P(array_ref) && + Z_COPYABLE_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 1) { + Z_DELREF_P(array_ptr); + zval_copy_ctor_func(array_ptr); } if (IS_VAR == IS_CV) { Z_ADDREF_P(array_ref); @@ -16581,16 +16446,16 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC); - if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) { zval_ptr_dtor_nogc(free_op1.var); } if (iter && EXPECTED(EG(exception) == NULL)) { ZVAL_OBJ(&iterator, &iter->std); array_ptr = array_ref = &iterator; } else { - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } if (!EG(exception)) { @@ -16609,7 +16474,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } HANDLE_EXCEPTION(); @@ -16618,38 +16483,50 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = Z_OBJ_P(array_ptr); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - zend_string *str_key; - zend_ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0); - if (key_type != HASH_KEY_NON_EXISTENT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) { - break; + HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var); + HashPosition pos = 0; + Bucket *p; + + while (1) { + if (pos >= fe_ht->nNumUsed) { + is_empty = 1; + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { + if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } - zend_hash_move_forward(fe_ht); + ZEND_VM_JMP(opline->op2.jmp_addr); + } + p = fe_ht->arData + pos; + if (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) { + pos++; + continue; + } + if (!ce || + !p->key || + zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) { + break; } + pos++; } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var)); + fe_ht->nInternalPointer = pos; + ptr->pos = pos; + ptr->ht = fe_ht; + ptr->h = fe_ht->arData[pos].h; + is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); is_empty = 1; } - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } if (is_empty) { @@ -16667,92 +16544,186 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zval *array, *array_ref; zval *value; HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zval *key = NULL; + HashPointer *ptr; + HashPosition pos; + Bucket *p; array = array_ref = EX_VAR(opline->op1.var); if (Z_ISREF_P(array)) { array = Z_REFVAL_P(array); // TODO: referenced value might be changed to different array ??? if (Z_IMMUTABLE_P(array)) { - zval_copy_ctor(array); + zval_copy_ctor_func(array); } } - if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { - key = EX_VAR((opline+1)->result.var); - } SAVE_OPLINE(); - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); + if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) { + fe_ht = Z_ARRVAL_P(array); + ptr = (HashPointer*)EX_VAR((opline+1)->op1.var); + pos = ptr->pos; + if (UNEXPECTED(pos == INVALID_IDX)) { + /* reached end of iteration */ ZEND_VM_JMP(opline->op2.jmp_addr); + } else if (UNEXPECTED(ptr->ht != fe_ht)) { + ptr->ht = fe_ht; + pos = 0; + } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) { + if (fe_ht->u.flags & HASH_FLAG_PACKED) { + pos = ptr->h; + } else { + pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask]; + while (pos != INVALID_IDX) { + if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) { + break; + } + pos = Z_NEXT(fe_ht->arData[pos].val); + } + } + } + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_JMP(opline->op2.jmp_addr); + } + p = fe_ht->arData + pos; + value = &p->val; + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; + continue; + } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; + continue; + } + } + if (opline->extended_value & ZEND_FE_FETCH_BYREF) { + ZVAL_MAKE_REF(value); + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + } else { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { + if (!p->key) { + ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key); + } + } + break; + } + do { + pos++; + if (pos >= fe_ht->nNumUsed) { + fe_ht->nInternalPointer = ptr->pos = INVALID_IDX; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } + p = fe_ht->arData + pos; + } while (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)); + fe_ht->nInternalPointer = ptr->pos = pos; + ptr->h = fe_ht->arData[pos].h; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) { + zend_object_iterator *iter; - case ZEND_ITER_PLAIN_OBJECT: { - zend_object *zobj = Z_OBJ_P(array); - int key_type; - zend_string *str_key; - zend_ulong int_key; + if ((iter = zend_iterator_unwrap(array TSRMLS_CC)) == NULL) { + /* plain object */ + zend_object *zobj = Z_OBJ_P(array); - fe_ht = Z_OBJPROP_P(array); - zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); + fe_ht = Z_OBJPROP_P(array); + ptr = (HashPointer*)EX_VAR((opline+1)->op1.var); + pos = ptr->pos; + if (pos == INVALID_IDX) { + /* reached end of iteration */ + ZEND_VM_JMP(opline->op2.jmp_addr); + } else if (UNEXPECTED(ptr->ht != fe_ht)) { + ptr->ht = fe_ht; + pos = 0; + } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) { + if (fe_ht->u.flags & HASH_FLAG_PACKED) { + pos = ptr->h; + } else { + pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask]; + while (pos != INVALID_IDX) { + if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) { + break; + } + pos = Z_NEXT(fe_ht->arData[pos].val); + } + } + } while (1) { - if ((value = zend_hash_get_current_data(fe_ht)) == NULL) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { /* reached end of iteration */ ZEND_VM_JMP(opline->op2.jmp_addr); } - if (Z_TYPE_P(value) == IS_INDIRECT) { + p = fe_ht->arData + pos; + value = &p->val; + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; + continue; + } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { value = Z_INDIRECT_P(value); - if (Z_TYPE_P(value) == IS_UNDEF) { - zend_hash_move_forward(fe_ht); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + pos++; continue; } } - key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0); - - zend_hash_move_forward(fe_ht); - if (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) { + if (UNEXPECTED(!p->key)) { + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { + ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h); + } + break; + } else if (zend_check_property_access(zobj, p->key TSRMLS_CC) == SUCCESS) { + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { + if (p->key->val[0]) { + ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key); + } else { + const char *class_name, *prop_name; + size_t prop_name_len; + zend_unmangle_property_name_ex( + p->key, &class_name, &prop_name, &prop_name_len); + ZVAL_STRINGL(EX_VAR((opline+1)->result.var), prop_name, prop_name_len); + } + } break; } + pos++; } - - if (key) { - if (key_type == HASH_KEY_IS_LONG) { - ZVAL_LONG(key, int_key); - } else { - const char *class_name, *prop_name; - int prop_name_len; - zend_unmangle_property_name_ex( - str_key->val, str_key->len, &class_name, &prop_name, &prop_name_len - ); - ZVAL_STRINGL(key, prop_name, prop_name_len); - } - } - - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = Z_ARRVAL_P(array); - zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); - if ((value = zend_hash_get_current_data(fe_ht)) == NULL) { - /* reached end of iteration */ - ZEND_VM_JMP(opline->op2.jmp_addr); - } - if (key) { - zend_hash_get_current_key_zval(fe_ht, key); + if (opline->extended_value & ZEND_FE_FETCH_BYREF) { + ZVAL_MAKE_REF(value); + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + } else { + ZVAL_COPY(EX_VAR(opline->result.var), value); } - zend_hash_move_forward(fe_ht); - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var)); - break; - - case ZEND_ITER_OBJECT: + do { + pos++; + if (pos >= fe_ht->nNumUsed) { + fe_ht->nInternalPointer = ptr->pos = INVALID_IDX; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } + p = fe_ht->arData + pos; + } while (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF) || + (EXPECTED(p->key != NULL) && + zend_check_property_access(zobj, p->key TSRMLS_CC) == FAILURE)); + fe_ht->nInternalPointer = ptr->pos = pos; + ptr->h = fe_ht->arData[pos].h; + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } else { /* !iter happens from exception */ if (iter && ++iter->index > 0) { /* This could cause an endless loop if index becomes zero again. @@ -16781,31 +16752,31 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* failure in get_current_data */ ZEND_VM_JMP(opline->op2.jmp_addr); } - if (key) { + if (opline->extended_value & ZEND_FE_FETCH_BYREF) { + ZVAL_MAKE_REF(value); + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + } else { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) { if (iter->funcs->get_current_key) { - iter->funcs->get_current_key(iter, key TSRMLS_CC); + iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var) TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); HANDLE_EXCEPTION(); } } else { - ZVAL_LONG(key, iter->index); + ZVAL_LONG(EX_VAR((opline+1)->result.var), iter->index); } } - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - ZVAL_MAKE_REF(value); - Z_ADDREF_P(value); - ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value)); + ZEND_VM_INC_OPCODE(); + ZEND_VM_NEXT_OPCODE(); + } } else { - ZVAL_COPY(EX_VAR(opline->result.var), value); + zend_error(E_WARNING, "Invalid argument supplied for foreach()"); + ZEND_VM_JMP(opline->op2.jmp_addr); } - - CHECK_EXCEPTION(); - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); } static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -16835,10 +16806,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS USE_OPLINE zend_free_op free_op1; zval *value; + int is_ref = 0; SAVE_OPLINE(); value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } if (i_zend_is_true(value TSRMLS_CC)) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_VAR == IS_CONST) { @@ -16847,6 +16823,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS } } else if (IS_VAR == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_VAR == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + zval_ptr_dtor_nogc(free_op1.var); } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -16856,16 +16835,22 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_COALESCE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; zval *value; + int is_ref = 0; SAVE_OPLINE(); value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_VAR == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { @@ -16873,6 +16858,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ } } else if (IS_VAR == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_VAR == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + zval_ptr_dtor_nogc(free_op1.var); } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -16891,33 +16879,18 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); - } - } else if (IS_VAR == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_free_op free_op1; - zval *value; - - SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) { + ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value)); + zval_ptr_dtor_nogc(free_op1.var); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { + zval_copy_ctor_func(EX_VAR(opline->result.var)); + } + } else if (IS_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - } else if (IS_VAR == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } ZEND_VM_NEXT_OPCODE(); } @@ -17892,8 +17865,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -17913,8 +17885,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -18128,7 +18099,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -18160,11 +18131,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST( ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -18274,7 +18240,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -18353,26 +18319,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CONST TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -18380,7 +18341,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; /* assign_dim has two opcodes! */ @@ -18401,20 +18361,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (0) { - zval_dtor(value); + if (IS_CONST == IS_TMP_VAR) { + } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_CONST == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_CONST == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_CONST TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -18571,7 +18525,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -18579,8 +18533,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -18715,8 +18669,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE ZVAL_DUP(EX_VAR(opline->result.var), value); } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) { /* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */ - ZVAL_STR(EX_VAR(opline->result.var), ce->name); - zend_string_addref(ce->name); + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); } else { zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv)); } @@ -18744,7 +18697,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } else { expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_VAR == IS_CONST) { @@ -18752,9 +18705,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); zval_ptr_dtor_nogc(free_op1.var); } else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -18851,29 +18804,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND zval tmp, *varname; HashTable *target_symbol_table; zend_free_op free_op1; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_VAR == IS_CV && IS_CONST == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_CONST != IS_UNUSED) { @@ -18885,10 +18846,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_VAR != IS_CONST && tmp_is_dup) { + if (IS_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } zval_ptr_dtor_nogc(free_op1.var); HANDLE_EXCEPTION(); @@ -18907,10 +18866,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_VAR != IS_CONST && tmp_is_dup) { + if (IS_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); @@ -18951,12 +18908,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_CONST != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -18964,15 +18918,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -19220,7 +19165,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -19306,8 +19251,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); @@ -19337,14 +19282,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->value, value); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); zval_ptr_dtor_nogc(free_op1.var); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -19362,14 +19307,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->key, key); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -19433,7 +19378,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19448,7 +19393,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19463,7 +19408,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19478,7 +19423,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19493,7 +19438,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19508,7 +19453,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19523,7 +19468,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19538,7 +19483,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19553,7 +19498,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19569,7 +19514,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19585,7 +19530,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19601,7 +19546,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19617,7 +19562,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19633,7 +19578,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPC _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19648,7 +19593,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19663,7 +19608,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19678,7 +19623,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19693,7 +19638,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19717,7 +19662,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { @@ -19782,7 +19727,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); } @@ -19849,7 +19794,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMP(int (*bin } assign_op_dim_exit: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; @@ -19901,7 +19846,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_ } assign_op_exit: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20072,7 +20017,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(retval); } @@ -20126,7 +20071,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20164,7 +20109,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_NULL(retval); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); @@ -20214,7 +20159,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20239,7 +20184,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { zval_ptr_dtor_nogc(free_op1.var); } @@ -20264,7 +20209,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND } else { zend_fetch_dimension_address_W_ref(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -20286,7 +20231,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -20304,7 +20249,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20330,7 +20275,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } else { if (IS_TMP_VAR == IS_UNUSED) { @@ -20338,7 +20283,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO } container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); zval_ptr_dtor_nogc(free_op1.var); } CHECK_EXCEPTION(); @@ -20358,7 +20303,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -20367,7 +20312,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -20394,17 +20339,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -20421,7 +20361,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -20445,7 +20385,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -20480,7 +20420,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20507,7 +20447,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -20515,7 +20455,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -20533,7 +20473,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -20557,7 +20497,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); @@ -20585,7 +20525,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { zend_free_op free_op2, free_op_data1, free_op_data2; zval *value; @@ -20593,27 +20533,22 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL zval *variable_ptr; variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + zval_ptr_dtor_nogc(free_op2.var); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -20621,7 +20556,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; /* assign_dim has two opcodes! */ @@ -20642,20 +20576,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (1) { - zval_dtor(value); + if (IS_TMP_VAR == IS_TMP_VAR) { + zval_ptr_dtor_nogc(free_op2.var); } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_TMP_VAR == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_TMP_VAR == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -20694,7 +20622,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { if (UNEXPECTED(EG(exception) != NULL)) { - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); @@ -20733,7 +20661,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE EX(call) = zend_vm_stack_push_call_frame( fbc, opline->extended_value, 0, called_scope, obj, EX(call) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); @@ -20807,13 +20735,13 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND } } if (IS_TMP_VAR != IS_CONST) { - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } } else { if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -20821,8 +20749,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -20867,7 +20795,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -20890,7 +20818,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } else { expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_VAR == IS_CONST) { @@ -20898,9 +20826,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); zval_ptr_dtor_nogc(free_op1.var); } else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -20952,7 +20880,7 @@ str_index: /* do nothing */ break; } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr); } @@ -21025,12 +20953,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_TMP_VAR != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -21038,15 +20963,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -21068,7 +20984,7 @@ numeric_index_dim: zend_error(E_WARNING, "Illegal offset type in unset"); break; } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; } case IS_OBJECT: @@ -21079,13 +20995,13 @@ numeric_index_dim: //??? zval_copy_ctor(offset); //??? } Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; case IS_STRING: zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_CONTINUE(); /* bailed out before */ default: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; } if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; @@ -21115,7 +21031,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE zend_error(E_NOTICE, "Trying to unset property of non-object"); } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -21214,7 +21130,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -21228,7 +21144,7 @@ num_index_prop: result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); @@ -21261,7 +21177,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_ result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); @@ -21302,8 +21218,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); @@ -21333,14 +21249,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->value, value); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); zval_ptr_dtor_nogc(free_op1.var); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -21358,14 +21274,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->key, key); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -21409,7 +21325,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_ptr_dtor_nogc(free_op1.var); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22280,8 +22196,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -22301,8 +22216,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -22516,7 +22430,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -22549,11 +22463,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -22664,7 +22573,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -22743,26 +22652,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_VAR TSRMLS_CC); zval_ptr_dtor_nogc(free_op2.var); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -22770,7 +22674,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; /* assign_dim has two opcodes! */ @@ -22787,24 +22690,18 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A zval *variable_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (0) { - zval_dtor(value); + if (IS_VAR == IS_TMP_VAR) { + zval_ptr_dtor_nogc(free_op2.var); } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_VAR == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_VAR == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_VAR TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -23026,7 +22923,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -23034,8 +22931,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -23103,7 +23000,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } else { expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_VAR == IS_CONST) { @@ -23111,9 +23008,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); zval_ptr_dtor_nogc(free_op1.var); } else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -23210,29 +23107,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE zval tmp, *varname; HashTable *target_symbol_table; zend_free_op free_op1; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_VAR == IS_CV && IS_VAR == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_VAR != IS_UNUSED) { @@ -23244,10 +23149,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_VAR != IS_CONST && tmp_is_dup) { + if (IS_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } zval_ptr_dtor_nogc(free_op1.var); HANDLE_EXCEPTION(); @@ -23266,10 +23169,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_VAR != IS_CONST && tmp_is_dup) { + if (IS_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); @@ -23310,12 +23211,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_VAR != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -23323,15 +23221,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -23579,7 +23468,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -23667,8 +23556,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); @@ -23698,14 +23587,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->value, value); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); zval_ptr_dtor_nogc(free_op1.var); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -23723,14 +23612,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR ZVAL_DUP(&generator->key, key); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); zval_ptr_dtor_nogc(free_op2.var); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -24189,8 +24078,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -24210,8 +24098,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -24400,26 +24287,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_UNUSED TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -24427,7 +24309,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; /* assign_dim has two opcodes! */ @@ -24509,7 +24390,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -24517,8 +24398,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -24570,7 +24451,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } else { expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_VAR == IS_CONST) { @@ -24578,9 +24459,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); zval_ptr_dtor_nogc(free_op1.var); } else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -24677,29 +24558,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN zval tmp, *varname; HashTable *target_symbol_table; zend_free_op free_op1; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_VAR == IS_CV && IS_UNUSED == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_UNUSED != IS_UNUSED) { @@ -24711,10 +24600,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_VAR != IS_CONST && tmp_is_dup) { + if (IS_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } zval_ptr_dtor_nogc(free_op1.var); HANDLE_EXCEPTION(); @@ -24733,10 +24620,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_VAR != IS_CONST && tmp_is_dup) { + if (IS_VAR != IS_CONST) { zval_dtor(&tmp); - } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { - zval_ptr_dtor(&tmp); } zval_ptr_dtor_nogc(free_op1.var); CHECK_EXCEPTION(); @@ -24875,8 +24760,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); @@ -24906,14 +24791,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->value, value); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); zval_ptr_dtor_nogc(free_op1.var); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -24931,14 +24816,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->key, key); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_UNUSED == IS_VAR || IS_UNUSED == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -25918,7 +25803,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_free_op free_op1; @@ -25950,11 +25835,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -26064,7 +25944,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -26143,26 +26023,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CV TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -26170,7 +26045,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; /* assign_dim has two opcodes! */ @@ -26187,24 +26061,18 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR zval *variable_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (0) { - zval_dtor(value); + if (IS_CV == IS_TMP_VAR) { + } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_CV == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_CV == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_CV TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -26423,7 +26291,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -26431,8 +26299,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ object = NULL; if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { - if (EX(object)) { - object = EX(object); + if (Z_OBJ(EX(This))) { + object = Z_OBJ(EX(This)); GC_REFCOUNT(object)++; if (object->handlers->get_class_entry && !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { @@ -26499,7 +26367,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}; } else { expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_VAR == IS_CONST) { @@ -26507,9 +26375,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); zval_ptr_dtor_nogc(free_op1.var); } else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -26634,12 +26502,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_CV != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -26647,15 +26512,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -26823,7 +26679,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -26909,8 +26765,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_VAR != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); @@ -26940,14 +26796,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->value, value); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); zval_ptr_dtor_nogc(free_op1.var); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -26965,14 +26821,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->key, key); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -27036,7 +26892,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_object_clone_obj_t clone_call; SAVE_OPLINE(); - obj = _get_obj_zval_ptr_unused(TSRMLS_C); + obj = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_CONST || UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) { @@ -27110,7 +26966,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int { USE_OPLINE zend_free_op free_op_data1; - zval *object = _get_obj_zval_ptr_unused(TSRMLS_C); + zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); zval *property = opline->op2.zv; zval *value; int have_get_ptr = 0; @@ -27207,7 +27063,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int zval *value, *container; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { @@ -27466,7 +27322,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = opline->op2.zv; retval = EX_VAR(opline->result.var); @@ -27557,7 +27413,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = opline->op2.zv; retval = EX_VAR(opline->result.var); @@ -27634,7 +27490,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -27643,7 +27499,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CON zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = opline->op2.zv; if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -27666,11 +27522,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CON ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -27681,7 +27532,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE SAVE_OPLINE(); property = opline->op2.zv; - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -27705,7 +27556,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD SAVE_OPLINE(); property = opline->op2.zv; - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); @@ -27729,7 +27580,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = opline->op2.zv; if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -27763,7 +27614,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND SAVE_OPLINE(); property = opline->op2.zv; - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context"); @@ -27780,7 +27631,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -27791,7 +27642,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OP zval *container, *property; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = opline->op2.zv; if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { @@ -27815,7 +27666,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_ zval *property_name; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property_name = opline->op2.zv; if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { @@ -27890,7 +27741,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O zend_error_noreturn(E_ERROR, "Method name must be a string"); } - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { if (UNEXPECTED(EG(exception) != NULL)) { @@ -28024,8 +27875,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC ZVAL_DUP(EX_VAR(opline->result.var), value); } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) { /* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */ - ZVAL_STR(EX_VAR(opline->result.var), ce->name); - zend_string_addref(ce->name); + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); } else { zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv)); } @@ -28075,7 +27925,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H zend_ulong hval; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -28100,12 +27950,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_CONST != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -28113,15 +27960,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -28176,7 +28014,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -28206,7 +28044,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER(Z zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = opline->op2.zv; if (Z_TYPE_P(container) == IS_ARRAY) { @@ -28289,7 +28127,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -28318,7 +28156,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER( zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = opline->op2.zv; if (Z_TYPE_P(container) == IS_OBJECT) { @@ -28375,8 +28213,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_UNUSED != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -28405,14 +28243,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL ZVAL_DUP(&generator->value, value); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -28430,14 +28268,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL ZVAL_DUP(&generator->key, key); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -28480,7 +28318,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* { USE_OPLINE zend_free_op free_op2, free_op_data1; - zval *object = _get_obj_zval_ptr_unused(TSRMLS_C); + zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zval *value; int have_get_ptr = 0; @@ -28495,7 +28333,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { @@ -28560,7 +28398,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); } @@ -28578,7 +28416,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (* zval *value, *container; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { @@ -28626,7 +28464,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (* } assign_op_dim_exit: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); @@ -28678,7 +28516,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina } assign_op_exit: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -28837,7 +28675,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_ int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = EX_VAR(opline->result.var); @@ -28849,7 +28687,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(retval); } @@ -28903,7 +28741,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_ } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -28929,7 +28767,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = EX_VAR(opline->result.var); @@ -28941,7 +28779,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_NULL(retval); CHECK_EXCEPTION(); @@ -28991,7 +28829,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -29007,7 +28845,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -29016,7 +28854,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -29034,17 +28872,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -29055,13 +28888,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -29079,13 +28912,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -29103,7 +28936,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -29120,7 +28953,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -29138,7 +28971,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O SAVE_OPLINE(); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context"); @@ -29147,7 +28980,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -29155,7 +28988,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -29166,14 +28999,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCO zval *container, *property; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -29190,14 +29023,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HA zval *property_name; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); @@ -29243,7 +29076,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDL * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're * string offsets or overloaded objects */ - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -29271,11 +29104,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC zend_error_noreturn(E_ERROR, "Method name must be a string"); } - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { if (UNEXPECTED(EG(exception) != NULL)) { - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); @@ -29314,7 +29147,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC EX(call) = zend_vm_stack_push_call_frame( fbc, opline->extended_value, 0, called_scope, obj, EX(call) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -29360,7 +29193,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN zend_ulong hval; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -29385,12 +29218,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_TMP_VAR != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -29398,15 +29228,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -29428,7 +29249,7 @@ numeric_index_dim: zend_error(E_WARNING, "Illegal offset type in unset"); break; } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; } case IS_OBJECT: @@ -29439,13 +29260,13 @@ numeric_index_dim: //??? zval_copy_ctor(offset); //??? } Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; case IS_STRING: zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_CONTINUE(); /* bailed out before */ default: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; } @@ -29461,7 +29282,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -29475,7 +29296,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN zend_error(E_NOTICE, "Trying to unset property of non-object"); } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -29491,7 +29312,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEN zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY) { @@ -29574,7 +29395,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -29588,7 +29409,7 @@ num_index_prop: result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); CHECK_EXCEPTION(); @@ -29604,7 +29425,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZE zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_OBJECT) { @@ -29621,7 +29442,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZE result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); CHECK_EXCEPTION(); @@ -29662,8 +29483,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_UNUSED != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -29692,14 +29513,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->value, value); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -29717,14 +29538,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->key, key); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -29767,7 +29588,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* { USE_OPLINE zend_free_op free_op2, free_op_data1; - zval *object = _get_obj_zval_ptr_unused(TSRMLS_C); + zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zval *value; int have_get_ptr = 0; @@ -29865,7 +29686,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_VAR(int (* zval *value, *container; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { @@ -30124,7 +29945,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_ int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = EX_VAR(opline->result.var); @@ -30216,7 +30037,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = EX_VAR(opline->result.var); @@ -30294,7 +30115,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -30303,7 +30124,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -30327,11 +30148,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -30342,7 +30158,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -30366,7 +30182,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); @@ -30390,7 +30206,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -30425,7 +30241,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O SAVE_OPLINE(); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context"); @@ -30442,7 +30258,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -30453,7 +30269,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO zval *container, *property; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { @@ -30477,7 +30293,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA zval *property_name; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { @@ -30558,7 +30374,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC zend_error_noreturn(E_ERROR, "Method name must be a string"); } - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { if (UNEXPECTED(EG(exception) != NULL)) { @@ -30647,7 +30463,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN zend_ulong hval; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -30672,12 +30488,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_VAR != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -30685,15 +30498,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -30748,7 +30552,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -30778,7 +30582,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEN zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY) { @@ -30861,7 +30665,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -30891,7 +30695,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZE zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_OBJECT) { @@ -30949,8 +30753,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_UNUSED != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -30979,14 +30783,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->value, value); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -31004,14 +30808,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER ZVAL_DUP(&generator->key, key); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); zval_ptr_dtor_nogc(free_op2.var); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -31054,7 +30858,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int { USE_OPLINE zend_free_op free_op_data1; - zval *object = _get_obj_zval_ptr_unused(TSRMLS_C); + zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); zval *property = NULL; zval *value; int have_get_ptr = 0; @@ -31151,7 +30955,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int zval *value, *container; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { @@ -31465,8 +31269,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_UNUSED != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -31495,14 +31299,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND ZVAL_DUP(&generator->value, value); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -31520,14 +31324,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND ZVAL_DUP(&generator->key, key); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_UNUSED == IS_VAR || IS_UNUSED == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -31570,7 +31374,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b { USE_OPLINE zend_free_op free_op_data1; - zval *object = _get_obj_zval_ptr_unused(TSRMLS_C); + zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zval *value; int have_get_ptr = 0; @@ -31667,7 +31471,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b zval *value, *container; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { @@ -31926,7 +31730,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = EX_VAR(opline->result.var); @@ -32017,7 +31821,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_ int have_get_ptr = 0; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = EX_VAR(opline->result.var); @@ -32094,7 +31898,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H return zend_post_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -32103,7 +31907,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV( zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -32126,11 +31930,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV( ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -32141,7 +31940,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -32165,7 +31964,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); @@ -32189,7 +31988,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -32223,7 +32022,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP SAVE_OPLINE(); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) { zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context"); @@ -32240,7 +32039,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -32251,7 +32050,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD zval *container, *property; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { @@ -32275,7 +32074,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN zval *property_name; SAVE_OPLINE(); - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { @@ -32355,7 +32154,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO zend_error_noreturn(E_ERROR, "Method name must be a string"); } - object = _get_obj_zval_ptr_unused(TSRMLS_C); + object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { if (UNEXPECTED(EG(exception) != NULL)) { @@ -32443,7 +32242,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND zend_ulong hval; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -32468,12 +32267,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_CV != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -32481,15 +32277,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -32544,7 +32331,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); } @@ -32574,7 +32361,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY) { @@ -32657,7 +32444,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -32686,7 +32473,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEN zval *offset; SAVE_OPLINE(); - container = _get_obj_zval_ptr_unused(TSRMLS_C); + container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC); offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_P(container) == IS_OBJECT) { @@ -32743,8 +32530,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_UNUSED != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = NULL; @@ -32773,14 +32560,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->value, value); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -32798,14 +32585,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->key, key); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -32895,7 +32682,6 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -32903,19 +32689,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZVAL_DEREF(var_ptr); SEPARATE_ZVAL_NOREF(var_ptr); - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_increment_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - increment_function(var_ptr); - } + increment_function(var_ptr); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); @@ -32950,7 +32724,6 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -32958,19 +32731,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZVAL_DEREF(var_ptr); SEPARATE_ZVAL_NOREF(var_ptr); - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_decrement_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - decrement_function(var_ptr); - } + decrement_function(var_ptr); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); @@ -32984,7 +32745,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS { USE_OPLINE - zval *var_ptr, *retval; + zval *var_ptr; SAVE_OPLINE(); var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); @@ -33001,34 +32762,19 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) { ZVAL_NULL(EX_VAR(opline->result.var)); - CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - retval = EX_VAR(opline->result.var); - if (UNEXPECTED(Z_ISREF_P(var_ptr))) { var_ptr = Z_REFVAL_P(var_ptr); - ZVAL_DUP(retval, var_ptr); + ZVAL_DUP(EX_VAR(opline->result.var), var_ptr); } else { - ZVAL_DUP(retval, var_ptr); - SEPARATE_ZVAL_NOREF(var_ptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + zval_opt_copy_ctor(var_ptr); } - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_increment_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - increment_function(var_ptr); - } + increment_function(var_ptr); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -33038,7 +32784,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS { USE_OPLINE - zval *var_ptr, *retval; + zval *var_ptr; SAVE_OPLINE(); var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); @@ -33055,34 +32801,19 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) { ZVAL_NULL(EX_VAR(opline->result.var)); - CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - retval = EX_VAR(opline->result.var); - if (UNEXPECTED(Z_ISREF_P(var_ptr))) { var_ptr = Z_REFVAL_P(var_ptr); - ZVAL_DUP(retval, var_ptr); + ZVAL_DUP(EX_VAR(opline->result.var), var_ptr); } else { - ZVAL_DUP(retval, var_ptr); - SEPARATE_ZVAL_NOREF(var_ptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + zval_opt_copy_ctor(var_ptr); } - if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_OBJECT) - && Z_OBJ_HANDLER_P(var_ptr, get) - && Z_OBJ_HANDLER_P(var_ptr, set)) { - /* proxy object */ - zval rv; - zval *val = Z_OBJ_HANDLER_P(var_ptr, get)(var_ptr, &rv TSRMLS_CC); - Z_ADDREF_P(val); - fast_decrement_function(val); - Z_OBJ_HANDLER_P(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(val); - } else { - decrement_function(var_ptr); - } + decrement_function(var_ptr); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -33292,7 +33023,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor_func(EX(return_value)); } } - } else if (Z_ISREF_P(retval_ptr)) { + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(retval_ptr)) { ZVAL_COPY(EX(return_value), Z_REFVAL_P(retval_ptr)); } else { @@ -33345,9 +33076,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER } else { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EX(return_value)) { - zval tmp; - ZVAL_DUP(&tmp, retval_ptr); - ZVAL_NEW_REF(EX(return_value), &tmp); + ZVAL_NEW_REF(EX(return_value), retval_ptr); + if (Z_REFCOUNTED_P(retval_ptr)) Z_ADDREF_P(retval_ptr); } break; } @@ -33399,7 +33129,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); arg = ZEND_CALL_ARG(EX(call), opline->op2.num); EX(call)->num_args = opline->op2.num; - if (Z_ISREF_P(varptr)) { + if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(varptr)) { ZVAL_COPY(arg, Z_REFVAL_P(varptr)); } else { @@ -33503,7 +33233,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); arg = ZEND_CALL_ARG(EX(call), opline->op2.num); EX(call)->num_args = opline->op2.num; - if (Z_ISREF_P(varptr)) { + if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(varptr)) { ZVAL_COPY(arg, Z_REFVAL_P(varptr)); } else { @@ -33554,12 +33284,12 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) { OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype); } - if (EX(call)->object) { - OBJ_RELEASE(EX(call)->object); + if (Z_OBJ(EX(call)->This)) { + OBJ_RELEASE(Z_OBJ(EX(call)->This)); } EX(call)->func = (zend_function*)&zend_pass_function; EX(call)->called_scope = NULL; - EX(call)->object = NULL; + Z_OBJ(EX(call)->This) = NULL; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -33736,7 +33466,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!0) { + if (IS_CV != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_array(result); @@ -33756,7 +33486,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else { ZVAL_COPY_VALUE(result, expr); - if (!0) { + if (IS_CV != IS_TMP_VAR) { zval_opt_copy_ctor(result); } convert_to_object(result); @@ -33785,8 +33515,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL ZVAL_UNDEF(&tmp_inc_filename); if (Z_TYPE_P(inc_filename) != IS_STRING) { - ZVAL_DUP(&tmp_inc_filename, inc_filename); - convert_to_string(&tmp_inc_filename); + ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename)); inc_filename = &tmp_inc_filename; } @@ -33803,9 +33532,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL zend_file_handle file_handle; char *resolved_path; - resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC); + resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC); if (resolved_path) { - failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path)); + failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path)); } else { resolved_path = Z_STRVAL_P(inc_filename); } @@ -33818,7 +33547,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL file_handle.opened_path = estrdup(resolved_path); } - if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) { + if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) { new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); zend_destroy_file_handle(&file_handle TSRMLS_CC); } else { @@ -33866,7 +33595,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL } call = zend_vm_stack_push_call_frame( - (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC); + (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC); if (EX(symbol_table)) { call->symbol_table = EX(symbol_table); @@ -33875,10 +33604,11 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL } call->prev_execute_data = execute_data; - i_init_code_execute_data(call, new_op_array, return_value, EXPECTED(zend_execute_ex == execute_ex) ? VM_FRAME_NESTED_CODE : VM_FRAME_TOP_CODE TSRMLS_CC); + i_init_code_execute_data(call, new_op_array, return_value, VM_FRAME_NESTED_CODE TSRMLS_CC); if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { + call->frame_kind = VM_FRAME_TOP_CODE; zend_execute_ex(call TSRMLS_CC); } @@ -33908,22 +33638,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); if ((IS_CV == IS_CV || IS_CV == IS_VAR) && - (opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + (opline->extended_value & ZEND_FE_FETCH_BYREF)) { array_ptr = array_ref = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ZVAL_DEREF(array_ptr); if (Z_TYPE_P(array_ptr) == IS_ARRAY) { + SEPARATE_ARRAY(array_ptr); if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - array_ref = array_ptr; - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - ZVAL_NEW_REF(array_ptr, array_ptr); - array_ref = array_ptr; - array_ptr = Z_REFVAL_P(array_ptr); - } - } else if (Z_IMMUTABLE_P(array_ptr)) { - zval_copy_ctor(array_ptr); - } else { - SEPARATE_ZVAL_NOREF(array_ptr); + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); } if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { @@ -33934,9 +33656,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS ce = Z_OBJCE_P(array_ptr); if (!ce || ce->get_iterator == NULL) { - if (!Z_ISREF_P(array_ref)) { - SEPARATE_ZVAL_NOREF(array_ptr); - } Z_ADDREF_P(array_ptr); } array_ref = array_ptr; @@ -33946,9 +33665,12 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } else { array_ptr = array_ref = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ZVAL_DEREF(array_ptr); - if (0) { /* IS_TMP_VAR */ + if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&tmp, array_ptr); - array_ptr = &tmp; + if (Z_OPT_IMMUTABLE_P(&tmp)) { + zval_copy_ctor_func(&tmp); + } + array_ref = array_ptr = &tmp; if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (ce && ce->get_iterator) { @@ -33964,10 +33686,11 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } } else if (Z_IMMUTABLE_P(array_ref)) { if (IS_CV == IS_CV) { - zval_copy_ctor(array_ref); + zval_copy_ctor_func(array_ref); Z_ADDREF_P(array_ref); } else { - ZVAL_DUP(&tmp, array_ref); + ZVAL_COPY_VALUE(&tmp, array_ref); + zval_copy_ctor_func(&tmp); array_ptr = array_ref = &tmp; } } else if (Z_REFCOUNTED_P(array_ref)) { @@ -33988,14 +33711,13 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZVAL_UNREF(array_ref); array_ptr = array_ref; } - if (Z_IMMUTABLE_P(array_ptr) || - (Z_ISREF_P(array_ref) && - Z_REFCOUNTED_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { - if (!Z_IMMUTABLE_P(array_ptr)) { - Z_DELREF_P(array_ptr); - } - zval_copy_ctor(array_ptr); + if (Z_IMMUTABLE_P(array_ptr)) { + zval_copy_ctor_func(array_ptr); + } else if (Z_ISREF_P(array_ref) && + Z_COPYABLE_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 1) { + Z_DELREF_P(array_ptr); + zval_copy_ctor_func(array_ptr); } if (IS_CV == IS_CV) { Z_ADDREF_P(array_ref); @@ -34005,16 +33727,16 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC); - if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) { } if (iter && EXPECTED(EG(exception) == NULL)) { ZVAL_OBJ(&iterator, &iter->std); array_ptr = array_ref = &iterator; } else { - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } if (!EG(exception)) { @@ -34033,7 +33755,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } HANDLE_EXCEPTION(); @@ -34042,38 +33764,50 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(array_ref); - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = Z_OBJ_P(array_ptr); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - zend_string *str_key; - zend_ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0); - if (key_type != HASH_KEY_NON_EXISTENT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) { - break; + HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var); + HashPosition pos = 0; + Bucket *p; + + while (1) { + if (pos >= fe_ht->nNumUsed) { + is_empty = 1; + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { + } - zend_hash_move_forward(fe_ht); + ZEND_VM_JMP(opline->op2.jmp_addr); + } + p = fe_ht->arData + pos; + if (Z_TYPE(p->val) == IS_UNDEF || + (Z_TYPE(p->val) == IS_INDIRECT && + Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) { + pos++; + continue; + } + if (!ce || + !p->key || + zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) { + break; } + pos++; } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var)); + fe_ht->nInternalPointer = pos; + ptr->pos = pos; + ptr->ht = fe_ht; + ptr->h = fe_ht->arData[pos].h; + is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); is_empty = 1; } - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) { } if (is_empty) { @@ -34111,10 +33845,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) USE_OPLINE zval *value; + int is_ref = 0; SAVE_OPLINE(); value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } if (i_zend_is_true(value TSRMLS_CC)) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_CV == IS_CONST) { @@ -34123,6 +33862,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } } else if (IS_CV == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_CV == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -34131,16 +33873,22 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_COALESCE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zval *value; + int is_ref = 0; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) { + is_ref = 1; + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); if (IS_CV == IS_CONST) { if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { @@ -34148,6 +33896,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A } } else if (IS_CV == IS_CV) { if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } else if (IS_CV == IS_VAR && is_ref) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } ZEND_VM_JMP(opline->op2.jmp_addr); } @@ -34165,33 +33916,18 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_CV == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); - } - } else if (IS_CV == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); - } - ZEND_VM_NEXT_OPCODE(); -} + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) { + ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value)); -static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - - zval *value; - - SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - - ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); - if (IS_CV == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - zval_copy_ctor_func(EX_VAR(opline->result.var)); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { + zval_copy_ctor_func(EX_VAR(opline->result.var)); + } + } else if (IS_CV == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - } else if (IS_CV == IS_CV) { - if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } ZEND_VM_NEXT_OPCODE(); } @@ -35165,8 +34901,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -35186,8 +34921,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -35401,7 +35135,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -35433,11 +35167,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(Z ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -35547,7 +35276,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -35626,26 +35355,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CONST TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -35653,7 +35377,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } /* assign_dim has two opcodes! */ @@ -35674,20 +35397,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (0) { - zval_dtor(value); + if (IS_CONST == IS_TMP_VAR) { + } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_CONST == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_CONST == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_CONST TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -35803,7 +35520,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO } else { expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CV == IS_CONST) { @@ -35811,9 +35528,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CV == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -35910,29 +35627,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL zval tmp, *varname; HashTable *target_symbol_table; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_CV == IS_CV && IS_CONST == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_CONST != IS_UNUSED) { @@ -35944,10 +35669,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_CV != IS_CONST && tmp_is_dup) { + if (IS_CV != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - zval_ptr_dtor(&tmp); } HANDLE_EXCEPTION(); @@ -35966,10 +35689,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_CV != IS_CONST && tmp_is_dup) { + if (IS_CV != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - zval_ptr_dtor(&tmp); } CHECK_EXCEPTION(); @@ -36010,12 +35731,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_CONST != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -36023,15 +35741,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -36279,7 +35988,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -36365,8 +36074,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CV != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); @@ -36395,14 +36104,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A ZVAL_DUP(&generator->value, value); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -36420,14 +36129,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A ZVAL_DUP(&generator->key, key); } else if (IS_CONST == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CONST == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -36488,19 +36197,46 @@ static int ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN zval *varname; zval *value; zval *variable_ptr; - zend_string *name; + Bucket *p; + uint32_t idx; SAVE_OPLINE(); varname = opline->op2.zv; - name = Z_STR_P(varname); - value = zend_hash_find(&EG(symbol_table).ht, name); - if (value == NULL) { - value = zend_hash_add_new(&EG(symbol_table).ht, name, &EG(uninitialized_zval)); + idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname)); + /* index 0 can't be cached (NULL is a mark of uninitialized cache slot) */ + p = EG(symbol_table).ht.arData + idx; + if (EXPECTED(idx > 0) && + EXPECTED(idx < EG(symbol_table).ht.nNumUsed) && + EXPECTED(Z_TYPE(p->val) != IS_UNDEF) && + (EXPECTED(p->key == Z_STR_P(varname)) || + (EXPECTED(p->h == Z_STR_P(varname)->h) && + EXPECTED(p->key != NULL) && + EXPECTED(p->key->len == Z_STRLEN_P(varname)) && + EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) { + value = &EG(symbol_table).ht.arData[idx].val; /* GLOBAL variable may be an INDIRECT pointer to CV */ - } else if (Z_TYPE_P(value) == IS_INDIRECT) { - value = Z_INDIRECT_P(value); - if (Z_TYPE_P(value) == IS_UNDEF) { - ZVAL_NULL(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_NULL(value); + } + } + } else { + value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname)); + if (UNEXPECTED(value == NULL)) { + value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval)); + idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket); + CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx); + } else { + idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket); + CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx); + /* GLOBAL variable may be an INDIRECT pointer to CV */ + if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_NULL(value); + } + } } } @@ -36521,7 +36257,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36536,7 +36272,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36551,7 +36287,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36566,7 +36302,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36581,7 +36317,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36596,7 +36332,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36611,7 +36347,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36626,7 +36362,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36641,7 +36377,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36657,7 +36393,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36673,7 +36409,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36689,7 +36425,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36705,7 +36441,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36721,7 +36457,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCO _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36736,7 +36472,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36751,7 +36487,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36766,7 +36502,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36781,7 +36517,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36805,7 +36541,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { @@ -36870,7 +36606,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); } @@ -36936,7 +36672,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMP(int (*bina } assign_op_dim_exit: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); @@ -36988,7 +36724,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o } assign_op_exit: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37159,7 +36895,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(retval); } @@ -37213,7 +36949,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37251,7 +36987,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_NULL(retval); CHECK_EXCEPTION(); @@ -37301,7 +37037,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37326,7 +37062,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { } @@ -37351,7 +37087,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL } else { zend_fetch_dimension_address_W_ref(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -37373,7 +37109,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -37391,7 +37127,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37417,7 +37153,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { if (IS_TMP_VAR == IS_UNUSED) { @@ -37425,7 +37161,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD } container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } CHECK_EXCEPTION(); @@ -37445,7 +37181,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -37454,7 +37190,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -37481,17 +37217,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEN } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -37508,7 +37239,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -37532,7 +37263,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -37567,7 +37298,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37594,7 +37325,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -37602,7 +37333,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -37620,7 +37351,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var)); } @@ -37644,7 +37375,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); @@ -37672,7 +37403,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { zend_free_op free_op2, free_op_data1, free_op_data2; zval *value; @@ -37680,27 +37411,22 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE zval *variable_ptr; variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR TSRMLS_CC); - zval_dtor(free_op2.var); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + zval_ptr_dtor_nogc(free_op2.var); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -37708,7 +37434,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } /* assign_dim has two opcodes! */ @@ -37729,20 +37454,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (1) { - zval_dtor(value); + if (IS_TMP_VAR == IS_TMP_VAR) { + zval_ptr_dtor_nogc(free_op2.var); } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_TMP_VAR == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_TMP_VAR == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -37781,7 +37500,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { if (UNEXPECTED(EG(exception) != NULL)) { - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object))); @@ -37820,7 +37539,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ EX(call) = zend_vm_stack_push_call_frame( fbc, opline->extended_value, 0, called_scope, obj, EX(call) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37837,7 +37556,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -37860,7 +37579,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE } else { expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CV == IS_CONST) { @@ -37868,9 +37587,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CV == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -37922,7 +37641,7 @@ str_index: /* do nothing */ break; } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr); } @@ -37995,12 +37714,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_TMP_VAR != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -38008,15 +37724,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -38038,7 +37745,7 @@ numeric_index_dim: zend_error(E_WARNING, "Illegal offset type in unset"); break; } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; } case IS_OBJECT: @@ -38049,13 +37756,13 @@ numeric_index_dim: //??? zval_copy_ctor(offset); //??? } Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; case IS_STRING: zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_CONTINUE(); /* bailed out before */ default: - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); break; } @@ -38085,7 +37792,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER zend_error(E_NOTICE, "Trying to unset property of non-object"); } } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -38184,7 +37891,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -38198,7 +37905,7 @@ num_index_prop: result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); CHECK_EXCEPTION(); @@ -38231,7 +37938,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER(ZEND_O result = ((opline->extended_value & ZEND_ISSET) == 0); } - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); ZVAL_BOOL(EX_VAR(opline->result.var), result); CHECK_EXCEPTION(); @@ -38272,8 +37979,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CV != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); @@ -38302,14 +38009,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->value, value); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -38327,14 +38034,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->key, key); } else if (IS_TMP_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_TMP_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -38378,7 +38085,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op2.var); + zval_ptr_dtor_nogc(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -39248,8 +38955,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -39269,8 +38975,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -39484,7 +39189,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -39517,11 +39222,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -39632,7 +39332,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -39711,26 +39411,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_VAR TSRMLS_CC); zval_ptr_dtor_nogc(free_op2.var); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -39738,7 +39433,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } /* assign_dim has two opcodes! */ @@ -39755,24 +39449,18 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR zval *variable_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (0) { - zval_dtor(value); + if (IS_VAR == IS_TMP_VAR) { + zval_ptr_dtor_nogc(free_op2.var); } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_VAR == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_VAR == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_VAR TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -39953,7 +39641,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE } else { expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CV == IS_CONST) { @@ -39961,9 +39649,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CV == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -40060,29 +39748,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER zval tmp, *varname; HashTable *target_symbol_table; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_CV == IS_CV && IS_VAR == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_VAR != IS_UNUSED) { @@ -40094,10 +39790,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_CV != IS_CONST && tmp_is_dup) { + if (IS_CV != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - zval_ptr_dtor(&tmp); } HANDLE_EXCEPTION(); @@ -40116,10 +39810,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_CV != IS_CONST && tmp_is_dup) { + if (IS_CV != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - zval_ptr_dtor(&tmp); } CHECK_EXCEPTION(); @@ -40160,12 +39852,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_VAR != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -40173,15 +39862,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -40429,7 +40109,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -40517,8 +40197,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CV != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); @@ -40547,14 +40227,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->value, value); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -40572,14 +40252,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&generator->key, key); } else if (IS_VAR == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); zval_ptr_dtor_nogc(free_op2.var); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_VAR == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -41037,8 +40717,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -41058,8 +40737,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type, zend_error(E_NOTICE,"Undefined variable: %s", name->val); /* break missing intentionally */ case BP_VAR_IS: - retval = EX_VAR(opline->result.var); - ZVAL_NULL(retval); + retval = &EG(uninitialized_zval); break; case BP_VAR_RW: zend_error(E_NOTICE,"Undefined variable: %s", name->val); @@ -41248,26 +40926,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_UNUSED TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -41275,7 +40948,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } /* assign_dim has two opcodes! */ @@ -41302,7 +40974,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC } else { expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CV == IS_CONST) { @@ -41310,9 +40982,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CV == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -41409,29 +41081,37 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND zval tmp, *varname; HashTable *target_symbol_table; - zend_bool tmp_is_dup = 0; SAVE_OPLINE(); if (IS_CV == IS_CV && IS_UNUSED == IS_UNUSED && (opline->extended_value & ZEND_QUICK_SET)) { - ZVAL_COPY_VALUE(&tmp, EX_VAR(opline->op1.var)); - ZVAL_UNDEF(EX_VAR(opline->op1.var)); - zval_ptr_dtor(&tmp); + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + if (!--GC_REFCOUNT(garbage)) { + ZVAL_UNDEF(var); + _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC); + } else { + GC_ZVAL_CHECK_POSSIBLE_ROOT(var); + ZVAL_UNDEF(var); + } + } else { + ZVAL_UNDEF(var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + ZVAL_UNDEF(&tmp); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_DUP(&tmp, varname); convert_to_string(&tmp); varname = &tmp; - tmp_is_dup = 1; - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - ZVAL_COPY(&tmp, varname); - varname = &tmp; } if (IS_UNUSED != IS_UNUSED) { @@ -41443,10 +41123,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND } else { ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { - if (IS_CV != IS_CONST && tmp_is_dup) { + if (IS_CV != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - zval_ptr_dtor(&tmp); } HANDLE_EXCEPTION(); @@ -41465,10 +41143,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND zend_hash_del_ind(target_symbol_table, Z_STR_P(varname)); } - if (IS_CV != IS_CONST && tmp_is_dup) { + if (IS_CV != IS_CONST) { zval_dtor(&tmp); - } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { - zval_ptr_dtor(&tmp); } CHECK_EXCEPTION(); @@ -41589,8 +41265,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CV != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); @@ -41619,14 +41295,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->value, value); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -41644,14 +41320,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_DUP(&generator->key, key); } else if (IS_UNUSED == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_UNUSED == IS_VAR || IS_UNUSED == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_UNUSED == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -42630,7 +42306,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -42662,11 +42338,6 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -42776,7 +42447,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } } @@ -42855,26 +42526,21 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CV TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); if (UNEXPECTED(variable_ptr != NULL)) { - zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC); + FREE_OP(free_op_data1); } else { variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); if (UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (IS_TMP_FREE(free_op_data1)) { - zval_dtor(value); - } + FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } - FREE_OP_VAR_PTR(free_op_data2); } else { - if ((opline+1)->op1_type == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if ((opline+1)->op1_type == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); + value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC); + if ((opline+1)->op1_type == IS_VAR) { + FREE_OP(free_op_data1); } if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); @@ -42882,7 +42548,6 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER FREE_OP_VAR_PTR(free_op_data2); } } - FREE_OP_IF_VAR(free_op_data1); } /* assign_dim has two opcodes! */ @@ -42899,24 +42564,18 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG zval *variable_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) { - if (0) { - zval_dtor(value); + if (IS_CV == IS_TMP_VAR) { + } if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } } else { - if (IS_CV == IS_TMP_VAR) { - value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC); - } else if (IS_CV == IS_CONST) { - value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC); - } else { - value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC); - } + value = zend_assign_to_variable(variable_ptr, value, IS_CV TSRMLS_CC); if (RETURN_VALUE_USED(opline)) { ZVAL_COPY(EX_VAR(opline->result.var), value); } @@ -43093,7 +42752,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ } else { expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (0) { /* temporary variable */ + if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&new_expr, expr_ptr); expr_ptr = &new_expr; } else if (IS_CV == IS_CONST) { @@ -43101,9 +42760,9 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ ZVAL_DUP(&new_expr, expr_ptr); expr_ptr = &new_expr; } - } else if (Z_ISREF_P(expr_ptr)) { - ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr)); - expr_ptr = &new_expr; + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(expr_ptr)) { + expr_ptr = Z_REFVAL_P(expr_ptr); + if (Z_REFCOUNTED_P(expr_ptr)) Z_ADDREF_P(expr_ptr); } else if (IS_CV == IS_CV && Z_REFCOUNTED_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); @@ -43228,12 +42887,9 @@ num_index_dim: zend_hash_index_del(ht, hval); break; case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - if (Z_REFCOUNTED_P(offset)) Z_ADDREF_P(offset); - } if (IS_CV != IS_CONST) { if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) { - goto numeric_index_dim; + goto num_index_dim; } } if (ht == &EG(symbol_table).ht) { @@ -43241,15 +42897,6 @@ num_index_dim: } else { zend_hash_del(ht, Z_STR_P(offset)); } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(offset); - } - break; -numeric_index_dim: - zend_hash_index_del(ht, hval); - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(offset); - } break; case IS_NULL: zend_hash_del(ht, STR_EMPTY_ALLOC()); @@ -43417,7 +43064,7 @@ num_index_prop: } } if (Z_TYPE_P(offset) == IS_LONG) { - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) { + if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) { if ((opline->extended_value & ZEND_ISSET) || Z_STRVAL_P(container)[offset->value.lval] != '0') { result = 1; @@ -43503,8 +43150,8 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1); /* Temporary variables don't need ctor copying */ - if (!0) { - zval_copy_ctor(&generator->value); + if (IS_CV != IS_TMP_VAR) { + zval_opt_copy_ctor(&generator->value); } } else { zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); @@ -43533,14 +43180,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZVAL_DUP(&generator->value, value); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->value, value); - } else if (Z_ISREF_P(value)) { + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(value)) { ZVAL_DUP(&generator->value, Z_REFVAL_P(value)); } else { + ZVAL_COPY_VALUE(&generator->value, value); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value); + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); } - ZVAL_COPY_VALUE(&generator->value, value); } } } else { @@ -43558,14 +43205,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZVAL_DUP(&generator->key, key); } else if (IS_CV == IS_TMP_VAR) { ZVAL_COPY_VALUE(&generator->key, key); - } else if (Z_ISREF_P(key)) { + } else if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(key)) { ZVAL_DUP(&generator->key, Z_REFVAL_P(key)); } else { + ZVAL_COPY_VALUE(&generator->key, key); if (IS_CV == IS_CV) { - if (Z_REFCOUNTED_P(key)) Z_ADDREF_P(key); + if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key); } - ZVAL_COPY_VALUE(&generator->key, key); } if (Z_TYPE(generator->key) == IS_LONG @@ -44864,11 +44511,11 @@ void zend_init_opcodes_handlers(void) ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, @@ -44954,31 +44601,31 @@ void zend_init_opcodes_handlers(void) ZEND_BOOL_SPEC_CV_HANDLER, ZEND_BOOL_SPEC_CV_HANDLER, ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, @@ -47179,31 +46826,31 @@ void zend_init_opcodes_handlers(void) ZEND_DECLARE_FUNCTION_SPEC_HANDLER, ZEND_DECLARE_FUNCTION_SPEC_HANDLER, ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, @@ -47554,56 +47201,56 @@ void zend_init_opcodes_handlers(void) ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER, - ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER, - ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER, - ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER, - ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER, - ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER, - ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER, - ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER, - ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER, - ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER, - ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, - ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, @@ -47854,6 +47501,31 @@ void zend_init_opcodes_handlers(void) ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, + ZEND_COALESCE_SPEC_CONST_HANDLER, + ZEND_COALESCE_SPEC_CONST_HANDLER, + ZEND_COALESCE_SPEC_CONST_HANDLER, + ZEND_COALESCE_SPEC_CONST_HANDLER, + ZEND_COALESCE_SPEC_CONST_HANDLER, + ZEND_COALESCE_SPEC_TMP_HANDLER, + ZEND_COALESCE_SPEC_TMP_HANDLER, + ZEND_COALESCE_SPEC_TMP_HANDLER, + ZEND_COALESCE_SPEC_TMP_HANDLER, + ZEND_COALESCE_SPEC_TMP_HANDLER, + ZEND_COALESCE_SPEC_VAR_HANDLER, + ZEND_COALESCE_SPEC_VAR_HANDLER, + ZEND_COALESCE_SPEC_VAR_HANDLER, + ZEND_COALESCE_SPEC_VAR_HANDLER, + ZEND_COALESCE_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_COALESCE_SPEC_CV_HANDLER, + ZEND_COALESCE_SPEC_CV_HANDLER, + ZEND_COALESCE_SPEC_CV_HANDLER, + ZEND_COALESCE_SPEC_CV_HANDLER, + ZEND_COALESCE_SPEC_CV_HANDLER, ZEND_NULL_HANDLER }; zend_opcode_handlers = (opcode_handler_t*)labels; diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 58cbe09787..4db87e5a85 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -35,7 +35,7 @@ ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value } execute_data = zend_vm_stack_push_call_frame( - (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, Z_OBJ(EG(This)), NULL TSRMLS_CC); + (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL TSRMLS_CC); if (EG(current_execute_data)) { execute_data->symbol_table = zend_rebuild_symbol_table(TSRMLS_C); } else { diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index df4ac12d3a..69c25085aa 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -212,7 +212,7 @@ $op1_get_obj_zval_ptr_deref = array( "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", "VAR" => "_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", "CONST" => "opline->op1.zv", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", + "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)", "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); @@ -221,7 +221,7 @@ $op2_get_obj_zval_ptr_deref = array( "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", "VAR" => "_get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", "CONST" => "opline->op2.zv", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", + "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)", "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); @@ -230,7 +230,7 @@ $op1_get_obj_zval_ptr_ptr = array( "TMP" => "NULL", "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", + "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)", "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); @@ -239,31 +239,13 @@ $op2_get_obj_zval_ptr_ptr = array( "TMP" => "NULL", "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", + "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)", "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); -$op1_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op1)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op2_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op2)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - $op1_free_op = array( "ANY" => "FREE_OP(free_op1)", - "TMP" => "zval_dtor(free_op1.var)", + "TMP" => "zval_ptr_dtor_nogc(free_op1.var)", "VAR" => "zval_ptr_dtor_nogc(free_op1.var)", "CONST" => "", "UNUSED" => "", @@ -272,7 +254,7 @@ $op1_free_op = array( $op2_free_op = array( "ANY" => "FREE_OP(free_op2)", - "TMP" => "zval_dtor(free_op2.var)", + "TMP" => "zval_ptr_dtor_nogc(free_op2.var)", "VAR" => "zval_ptr_dtor_nogc(free_op2.var)", "CONST" => "", "UNUSED" => "", @@ -280,7 +262,7 @@ $op2_free_op = array( ); $op1_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op1)", + "ANY" => "if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(free_op1.var);}", "TMP" => "", "VAR" => "zval_ptr_dtor_nogc(free_op1.var)", "CONST" => "", @@ -289,7 +271,7 @@ $op1_free_op_if_var = array( ); $op2_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op2)", + "ANY" => "if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(free_op1.var);}", "TMP" => "", "VAR" => "zval_ptr_dtor_nogc(free_op2.var)", "CONST" => "", @@ -366,7 +348,7 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $op1_get_obj_zval_ptr, $op2_get_obj_zval_ptr, $op1_get_obj_zval_ptr_deref, $op2_get_obj_zval_ptr_deref, $op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr, - $op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free, + $op1_free, $op2_free, $op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var, $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix; @@ -391,8 +373,6 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { "/GET_OP2_OBJ_ZVAL_PTR_DEREF\(([^)]*)\)/", "/GET_OP1_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", "/GET_OP2_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", - "/IS_OP1_TMP_FREE\(\)/", - "/IS_OP2_TMP_FREE\(\)/", "/FREE_OP1\(\)/", "/FREE_OP2\(\)/", "/FREE_OP1_IF_VAR\(\)/", @@ -429,8 +409,6 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $op2_get_obj_zval_ptr_deref[$op2], $op1_get_obj_zval_ptr_ptr[$op1], $op2_get_obj_zval_ptr_ptr[$op2], - $op1_is_tmp_free[$op1], - $op2_is_tmp_free[$op2], $op1_free_op[$op1], $op2_free_op[$op2], $op1_free_op_if_var[$op1], diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c index 729f922963..d31eb14141 100644 --- a/Zend/zend_vm_opcodes.c +++ b/Zend/zend_vm_opcodes.c @@ -21,7 +21,7 @@ #include <stdio.h> #include <zend.h> -const char *zend_vm_opcodes_map[169] = { +const char *zend_vm_opcodes_map[170] = { "ZEND_NOP", "ZEND_ADD", "ZEND_SUB", @@ -71,11 +71,11 @@ const char *zend_vm_opcodes_map[169] = { "ZEND_JMPZ_EX", "ZEND_JMPNZ_EX", "ZEND_CASE", - "ZEND_SWITCH_FREE", + NULL, "ZEND_BRK", "ZEND_CONT", "ZEND_BOOL", - "ZEND_INIT_STRING", + NULL, "ZEND_ADD_CHAR", "ZEND_ADD_STRING", "ZEND_ADD_VAR", @@ -164,7 +164,7 @@ const char *zend_vm_opcodes_map[169] = { "ZEND_DECLARE_CLASS", "ZEND_DECLARE_INHERITED_CLASS", "ZEND_DECLARE_FUNCTION", - "ZEND_RAISE_ABSTRACT_ERROR", + NULL, "ZEND_DECLARE_CONST", "ZEND_ADD_INTERFACE", "ZEND_DECLARE_INHERITED_CLASS_DELAYED", @@ -179,8 +179,8 @@ const char *zend_vm_opcodes_map[169] = { "ZEND_ADD_TRAIT", "ZEND_BIND_TRAITS", "ZEND_SEPARATE", - "ZEND_QM_ASSIGN_VAR", - "ZEND_JMP_SET_VAR", + NULL, + NULL, "ZEND_DISCARD_EXCEPTION", "ZEND_YIELD", "ZEND_GENERATOR_RETURN", @@ -191,6 +191,7 @@ const char *zend_vm_opcodes_map[169] = { "ZEND_POW", "ZEND_ASSIGN_POW", "ZEND_BIND_GLOBAL", + "ZEND_COALESCE", }; ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) { diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 9274d3e044..43aea9ee95 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -72,11 +72,9 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_JMPZ_EX 46 #define ZEND_JMPNZ_EX 47 #define ZEND_CASE 48 -#define ZEND_SWITCH_FREE 49 #define ZEND_BRK 50 #define ZEND_CONT 51 #define ZEND_BOOL 52 -#define ZEND_INIT_STRING 53 #define ZEND_ADD_CHAR 54 #define ZEND_ADD_STRING 55 #define ZEND_ADD_VAR 56 @@ -156,7 +154,6 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_DECLARE_CLASS 139 #define ZEND_DECLARE_INHERITED_CLASS 140 #define ZEND_DECLARE_FUNCTION 141 -#define ZEND_RAISE_ABSTRACT_ERROR 142 #define ZEND_DECLARE_CONST 143 #define ZEND_ADD_INTERFACE 144 #define ZEND_DECLARE_INHERITED_CLASS_DELAYED 145 @@ -170,8 +167,6 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_ADD_TRAIT 154 #define ZEND_BIND_TRAITS 155 #define ZEND_SEPARATE 156 -#define ZEND_QM_ASSIGN_VAR 157 -#define ZEND_JMP_SET_VAR 158 #define ZEND_DISCARD_EXCEPTION 159 #define ZEND_YIELD 160 #define ZEND_GENERATOR_RETURN 161 @@ -182,5 +177,6 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_POW 166 #define ZEND_ASSIGN_POW 167 #define ZEND_BIND_GLOBAL 168 +#define ZEND_COALESCE 169 #endif diff --git a/acinclude.m4 b/acinclude.m4 index 81dc0db34a..678296aac7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -844,7 +844,7 @@ AC_DEFUN([PHP_SHARED_MODULE],[ ;; *netware*[)] suffix=nlm - link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) ifelse($1, php5lib, , -L$(top_builddir)/netware -lphp5lib) $(translit(ifelse($1, php5lib, $1, m4_substr($1, 3)),a-z_-,A-Z__)_SHARED_LIBADD)' + link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) ifelse($1, php7lib, , -L$(top_builddir)/netware -lphp7lib) $(translit(ifelse($1, php7lib, $1, m4_substr($1, 3)),a-z_-,A-Z__)_SHARED_LIBADD)' ;; *[)] suffix=la diff --git a/build/build.mk b/build/build.mk index 2c189159a2..007f081f19 100644 --- a/build/build.mk +++ b/build/build.mk @@ -1,5 +1,5 @@ # +----------------------------------------------------------------------+ -# | PHP Version 5 | +# | PHP Version 7 | # +----------------------------------------------------------------------+ # | Copyright (c) 1997-2014 The PHP Group | # +----------------------------------------------------------------------+ @@ -39,7 +39,7 @@ $(STAMP): build/buildcheck.sh snapshot: distname='$(DISTNAME)'; \ if test -z "$$distname"; then \ - distname='php5-snapshot'; \ + distname='php7-snapshot'; \ fi; \ myname=`basename \`pwd\`` ; \ cd .. && cp -rp $$myname $$distname; \ diff --git a/build/build2.mk b/build/build2.mk index be103fc322..2d9e684ec0 100644 --- a/build/build2.mk +++ b/build/build2.mk @@ -1,5 +1,5 @@ # +----------------------------------------------------------------------+ -# | PHP Version 5 | +# | PHP Version 7 | # +----------------------------------------------------------------------+ # | Copyright (c) 1997-2007 The PHP Group | # +----------------------------------------------------------------------+ diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 8ff3531825..f8f827d671 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -1,6 +1,6 @@ #! /bin/sh # +----------------------------------------------------------------------+ -# | PHP Version 5 | +# | PHP Version 7 | # +----------------------------------------------------------------------+ # | Copyright (c) 1997-2007 The PHP Group | # +----------------------------------------------------------------------+ diff --git a/build/mkdep.awk b/build/mkdep.awk index 06547c79c1..c1adefe612 100644 --- a/build/mkdep.awk +++ b/build/mkdep.awk @@ -1,5 +1,5 @@ # +----------------------------------------------------------------------+ -# | PHP Version 5 | +# | PHP Version 7 | # +----------------------------------------------------------------------+ # | Copyright (c) 2000-2006 The PHP Group | # +----------------------------------------------------------------------+ diff --git a/configure.in b/configure.in index e818ec9150..f947d2f9de 100644 --- a/configure.in +++ b/configure.in @@ -335,10 +335,10 @@ case $host_alias in PHP_BUILD_PROGRAM PHP_ADD_SOURCES(/main, internal_functions.c,,PHP_GLOBAL_OBJS) PHP_ADD_SOURCES(win32, sendmail.c, -I$CFLAGS, PHP_GLOBAL_OBJS) - PHP5LIB_SHARED_LIBADD=\$\(EXTRA_LIBS\) + PHP7LIB_SHARED_LIBADD=\$\(EXTRA_LIBS\) EXTENSION_DIR=sys:/php$PHP_MAJOR_VERSION/ext - PHP_SUBST(PHP5LIB_SHARED_LIBADD) - PHP_SHARED_MODULE(php5lib, PHP_GLOBAL_OBJS, netware) + PHP_SUBST(PHP7LIB_SHARED_LIBADD) + PHP_SHARED_MODULE(php7lib, PHP_GLOBAL_OBJS, netware) ;; esac @@ -787,7 +787,12 @@ if test "$PHP_GCOV" = "yes"; then AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) fi - ltp_version_list="1.5 1.6 1.7 1.9 1.10" + dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison) + ltp_version_min="105" + dnl non-working versions, e.g. "1.8 1.18"; + dnl remove "none" when introducing the first incompatible LTP version an + dnl separate any following additions by spaces + ltp_version_exclude="1.8" AC_CHECK_PROG(LTP, lcov, lcov) AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml) @@ -797,21 +802,30 @@ if test "$PHP_GCOV" = "yes"; then if test "$LTP"; then AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [ php_cv_ltp_version=invalid - ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'` - for ltp_check_version in $ltp_version_list; do - if test "$ltp_version" = "$ltp_check_version"; then - php_cv_ltp_version="$ltp_check_version (ok)" + ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z` + if test -n "$ltp_version_vars"; then + set $ltp_version_vars + ltp_version="${1}.${2}" + ltp_version_num="`expr ${1} \* 100 + ${2}`" + if test $ltp_version_num -ge $ltp_version_min; then + php_cv_ltp_version="$ltp_version (ok)" + for ltp_check_version in $ltp_version_exclude; do + if test "$ltp_version" = "$ltp_check_version"; then + php_cv_ltp_version=invalid + break + fi + done fi - done + fi ]) else - ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list" + ltp_msg="To enable code coverage reporting you must have LTP installed" AC_MSG_ERROR([$ltp_msg]) fi case $php_cv_ltp_version in ""|invalid[)] - ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)." + ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)." AC_MSG_ERROR([$ltp_msg]) LTP="exit 0;" ;; @@ -1468,7 +1482,7 @@ esac PHP_ADD_SOURCES(Zend, \ zend_language_parser.c zend_language_scanner.c \ zend_ini_parser.c zend_ini_scanner.c \ - zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c zend_dtrace.c \ + zend_alloc.c zend_compile.c zend_constants.c zend_dtrace.c \ zend_execute_API.c zend_highlight.c zend_llist.c \ zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ @@ -1476,11 +1490,8 @@ PHP_ADD_SOURCES(Zend, \ zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \ zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \ zend_closures.c zend_float.c zend_string.c zend_signal.c zend_generators.c \ - zend_virtual_cwd.c zend_ast.c) - -if test -r "$abs_srcdir/Zend/zend_objects.c"; then - PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c) -fi + zend_virtual_cwd.c zend_ast.c zend_objects.c zend_object_handlers.c zend_objects_API.c \ + zend_default_classes.c zend_inheritance.c) dnl Selectively disable optimization due to high RAM usage during dnl compiling the executor. @@ -1509,7 +1520,7 @@ $php_shtool mkdir -p pear/scripts $php_shtool mkdir -p scripts $php_shtool mkdir -p scripts/man1 -ALL_OUTPUT_FILES="php5.spec main/build-defs.h \ +ALL_OUTPUT_FILES="php7.spec main/build-defs.h \ scripts/phpize scripts/man1/phpize.1 \ scripts/php-config scripts/man1/php-config.1 \ $PHP_OUTPUT_FILES" diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 53d85a541b..7ef30cad5e 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h index df16410004..12098cff89 100644 --- a/ext/bcmath/php_bcmath.h +++ b/ext/bcmath/php_bcmath.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index e04a75c1b5..6e6f2a95c3 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -359,12 +359,6 @@ static PHP_FUNCTION(bzread) } data = zend_string_alloc(len, 0); data->len = php_stream_read(stream, data->val, data->len); - - if (data->len < 0) { - zend_string_free(data); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream"); - RETURN_FALSE; - } data->val[data->len] = '\0'; RETURN_STR(data); diff --git a/ext/bz2/bz2.dsp b/ext/bz2/bz2.dsp deleted file mode 100644 index a054c522a7..0000000000 --- a/ext/bz2/bz2.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=bz2 - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "bz2.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "bz2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "bz2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "bz2 - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_bz2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
-
-!ELSEIF "$(CFG)" == "bz2 - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_bz2.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "bz2 - Win32 Release_TS"
-# Name "bz2 - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\bz2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\bz2_filter.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_bz2.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index b19b46eb57..1c1d6ccfb6 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -34,17 +34,17 @@ enum strm_status { }; typedef struct _php_bz2_filter_data { - int persistent; bz_stream strm; char *inbuf; - size_t inbuf_len; char *outbuf; + size_t inbuf_len; size_t outbuf_len; - /* Decompress options */ - enum strm_status status; - unsigned int small_footprint : 1; - unsigned int expect_concatenated : 1; + enum strm_status status; /* Decompress option */ + unsigned int small_footprint : 1; /* Decompress option */ + unsigned int expect_concatenated : 1; /* Decompress option */ + + int persistent; } php_bz2_filter_data; /* }}} */ diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h index ceb151b9e4..6e90e8d67f 100644 --- a/ext/bz2/php_bz2.h +++ b/ext/bz2/php_bz2.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c index 31367c66e0..3dd16ce45b 100644 --- a/ext/calendar/cal_unix.c +++ b/ext/calendar/cal_unix.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 173cf076e1..50385482a7 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c index d2b36f981a..b6dc135d33 100644 --- a/ext/calendar/easter.c +++ b/ext/calendar/easter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 6731ea74aa..5f0b8ff697 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -464,7 +464,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, } /* the core of COM */ -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, +int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f, WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC) { DISPID dispid, altdispid; @@ -472,20 +472,19 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, HRESULT hr; VARIANT *vargs = NULL, *byref_vals = NULL; int i, byref_count = 0, j; - zend_internal_function *f = (zend_internal_function*)EG(current_execute_data)->func; /* assumption: that the active function (f) is the function we generated for the engine */ if (!f || f->arg_info == NULL) { f = NULL; } - hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC); + hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid TSRMLS_CC); if (FAILED(hr)) { char *winerr = NULL; char *msg = NULL; winerr = php_win32_error_to_msg(hr); - spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr); + spprintf(&msg, 0, "Unable to lookup `%s': %s", f->function_name->val, winerr); LocalFree(winerr); php_com_throw_exception(hr, msg TSRMLS_CC); efree(msg); diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c index eb13ba8ccd..ae2c6ee2f0 100644 --- a/ext/com_dotnet/com_dotnet.c +++ b/ext/com_dotnet/com_dotnet.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index fd2f0a6d70..f66119842e 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 3dec630721..74a3920e34 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -250,7 +250,7 @@ static PHP_FUNCTION(com_method_handler) zval *object = getThis(); Z_OBJ_HANDLER_P(object, call_method)( - ((zend_internal_function*)EG(current_execute_data)->func)->function_name, + ((zend_internal_function*)EX(func))->function_name, Z_OBJ_P(object), INTERNAL_FUNCTION_PARAM_PASSTHRU); } @@ -378,7 +378,7 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU VariantInit(&v); - if (SUCCESS == php_com_do_invoke_byref(obj, method->val, method->len, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { + if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); ret = SUCCESS; VariantClear(&v); diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c index f6aa1a1980..a7614673f8 100644 --- a/ext/com_dotnet/com_iterator.c +++ b/ext/com_dotnet/com_iterator.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c index d83aeeb188..084a720ea1 100644 --- a/ext/com_dotnet/com_misc.c +++ b/ext/com_dotnet/com_misc.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c index d12120f54f..51cc7e8f1d 100644 --- a/ext/com_dotnet/com_olechar.c +++ b/ext/com_dotnet/com_olechar.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index a1c2f77661..eb80e760c8 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index 2eac10f5a8..881ebfbaea 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index eefa28dd3a..33b1c65c9c 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index 36b6e82116..dbd5529f6d 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 409b8f9956..6112dfb4bf 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -482,7 +482,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) } /* add the mappings */ - ZVAL_STR(&tmp2, zend_string_copy(name)); + ZVAL_STR_COPY(&tmp2, name); pid = zend_hash_next_free_element(disp->dispid_to_name); zend_hash_index_update(disp->dispid_to_name, pid, &tmp2); @@ -517,7 +517,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) } /* add the mappings */ - ZVAL_STR(&tmp2, zend_string_copy(name)); + ZVAL_STR_COPY(&tmp2, name); pid = zend_hash_next_free_element(disp->dispid_to_name); zend_hash_index_update(disp->dispid_to_name, pid, &tmp2); diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h index 51f621bd5f..cb60083289 100644 --- a/ext/com_dotnet/php_com_dotnet.h +++ b/ext/com_dotnet/php_com_dotnet.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h index f153883006..e79e6f586d 100644 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ b/ext/com_dotnet/php_com_dotnet_internal.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -104,12 +104,12 @@ PHP_FUNCTION(com_get_active_object); HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member, WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC); HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, - int namelen, DISPID *dispid TSRMLS_DC); + size_t namelen, DISPID *dispid TSRMLS_DC); int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC); int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC); -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, +int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f, WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC); /* com_wrapper.c */ diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index 8f116b86d3..41d5559c67 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ctype/ctype.dsp b/ext/ctype/ctype.dsp deleted file mode 100644 index 1305c72f6a..0000000000 --- a/ext/ctype/ctype.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ctype" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=ctype - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ctype.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ctype.mak" CFG="ctype - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ctype - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ctype - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ctype - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D HAVE_CTYPE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ctype.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ctype - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CTYPE=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ctype.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "ctype - Win32 Release_TS"
-# Name "ctype - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ctype.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_ctype.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h index ab5ec44ec4..fc99a58c9b 100644 --- a/ext/ctype/php_ctype.h +++ b/ext/ctype/php_ctype.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/curl/curl.dsp b/ext/curl/curl.dsp deleted file mode 100644 index 6524fceb89..0000000000 --- a/ext/curl/curl.dsp +++ /dev/null @@ -1,190 +0,0 @@ -# Microsoft Developer Studio Project File - Name="curl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=curl - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "curl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "curl.mak" CFG="curl - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "curl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "curl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "curl - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "curl - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "curl - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "curl___Win32_Debug_TS_SSL"
-# PROP BASE Intermediate_Dir "curl___Win32_Debug_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS_SSL"
-# PROP Intermediate_Dir "Debug_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php5ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none /nodefaultlib
-
-!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "curl___Win32_Release_TS_SSL"
-# PROP BASE Intermediate_Dir "curl___Win32_Release_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS_SSL"
-# PROP Intermediate_Dir "Release_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php5ts.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "curl - Win32 Release_TS"
-# Name "curl - Win32 Debug_TS"
-# Name "curl - Win32 Debug_TS_SSL"
-# Name "curl - Win32 Release_TS_SSL"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\interface.c
-# End Source File
-
-# Begin Source File
-SOURCE=.\multi.c
-# End Source File
-
-# Begin Source File
-SOURCE=.\share.c
-# End Source File
-
-# Begin Source File
-SOURCE=.\streams.c
-# End Source File
-
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_curl.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c index 8e66445fb5..6b0e5462a1 100644 --- a/ext/curl/curl_file.c +++ b/ext/curl/curl_file.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/curl/interface.c b/ext/curl/interface.c index d8e084796d..6caaa5258b 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -82,7 +82,7 @@ #define SMART_STR_PREALLOC 4096 -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/info.h" #include "ext/standard/file.h" #include "ext/standard/url.h" @@ -557,6 +557,12 @@ PHP_MINFO_FUNCTION(curl) #if LIBCURL_VERSION_NUM >= 0x071504 /* 7.21.4 */ {"TLS-SRP", CURL_VERSION_TLSAUTH_SRP}, #endif +#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */ + {"HTTP2", CURL_VERSION_HTTP2}, +#endif +#if LIBCURL_VERSION_NUM >= 0x072600 /* 7.38.0 */ + {"GSSAPI", CURL_VERSION_GSSAPI}, +#endif {NULL, 0} }; @@ -1832,10 +1838,10 @@ static void _php_curl_set_default_options(php_curl *ch) curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ cainfo = INI_STR("openssl.cafile"); - if (!(cainfo && strlen(cainfo) > 0)) { + if (!(cainfo && cainfo[0] != '\0')) { cainfo = INI_STR("curl.cainfo"); } - if (cainfo && strlen(cainfo) > 0) { + if (cainfo && cainfo[0] != '\0') { curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo); } @@ -2462,7 +2468,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_ zval *current; HashTable *postfields; zend_string *string_key; - ulong num_key; + zend_ulong num_key; struct HttpPost *first = NULL; struct HttpPost *last = NULL; diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 72cfd29ca7..d9e6df2c98 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index c75d7f80d1..ad44ae7b96 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -23,7 +23,7 @@ #define _PHP_CURL_H #include "php.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #ifdef COMPILE_DL_CURL #undef HAVE_CURL diff --git a/ext/curl/share.c b/ext/curl/share.c index 90c869df02..94694e0b2e 100644 --- a/ext/curl/share.c +++ b/ext/curl/share.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index 103f1cf692..3d13638f90 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -28,7 +28,7 @@ Features AsynchDNS => Yes
CharConv => No
Debug => No
-GSS-Negotiate => Yes
+GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
@@ -40,6 +40,8 @@ SPNEGO => Yes SSL => Yes
SSPI => Yes
TLS-SRP => No
+HTTP2 => No
+GSSAPI => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host => %s-pc-win32
SSL Version => OpenSSL/%s
diff --git a/ext/date/lib/astro.c b/ext/date/lib/astro.c index 7f51c71d92..84e8a40021 100644 --- a/ext/date/lib/astro.c +++ b/ext/date/lib/astro.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c index a77fdd7182..1739566728 100644 --- a/ext/date/lib/dow.c +++ b/ext/date/lib/dow.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index 86e98ea744..58a185d3be 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 6c4819bde8..2a615559f6 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -2,7 +2,7 @@ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index c5cb15f797..cb5df16251 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index f8a781a363..3b7580f9d1 100644 --- a/ext/date/lib/parse_iso_intervals.c +++ b/ext/date/lib/parse_iso_intervals.c @@ -2,7 +2,7 @@ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index efd822e84e..097488ec57 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index e7a31dd142..a503f9e01e 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c index 716975a90f..ea88a2256a 100644 --- a/ext/date/lib/timelib.c +++ b/ext/date/lib/timelib.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -71,10 +71,11 @@ timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel) void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr) { unsigned int i; + size_t tz_abbr_len = strlen(tz_abbr); TIMELIB_TIME_FREE(tm->tz_abbr); tm->tz_abbr = strdup(tz_abbr); - for (i = 0; i < strlen(tz_abbr); i++) { + for (i = 0; i < tz_abbr_len; i++) { tm->tz_abbr[i] = toupper(tz_abbr[i]); } } diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 89c9dcbc2d..b7c49888cb 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h index e5780f6cca..3f9f5b07e7 100644 --- a/ext/date/lib/timelib_structs.h +++ b/ext/date/lib/timelib_structs.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -173,10 +173,10 @@ typedef struct timelib_error_message { } timelib_error_message; typedef struct timelib_error_container { - int warning_count; + struct timelib_error_message *error_messages; struct timelib_error_message *warning_messages; int error_count; - struct timelib_error_message *error_messages; + int warning_count; } timelib_error_container; typedef struct _timelib_tz_lookup_table { diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index a23104f68c..98e7b2292c 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -12,578 +12,578 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = { { "Africa/Blantyre" , 0x00052F }, { "Africa/Brazzaville" , 0x000584 }, { "Africa/Bujumbura" , 0x0005D9 }, - { "Africa/Cairo" , 0x00061D }, - { "Africa/Casablanca" , 0x000A04 }, - { "Africa/Ceuta" , 0x000C66 }, - { "Africa/Conakry" , 0x000F6D }, - { "Africa/Dakar" , 0x000FC2 }, - { "Africa/Dar_es_Salaam" , 0x001017 }, - { "Africa/Djibouti" , 0x001084 }, - { "Africa/Douala" , 0x0010D9 }, - { "Africa/El_Aaiun" , 0x00112E }, - { "Africa/Freetown" , 0x001359 }, - { "Africa/Gaborone" , 0x0013AE }, - { "Africa/Harare" , 0x00141B }, - { "Africa/Johannesburg" , 0x001470 }, - { "Africa/Juba" , 0x0014DE }, - { "Africa/Kampala" , 0x0015F1 }, - { "Africa/Khartoum" , 0x001670 }, - { "Africa/Kigali" , 0x001783 }, - { "Africa/Kinshasa" , 0x0017D8 }, - { "Africa/Lagos" , 0x001844 }, - { "Africa/Libreville" , 0x001899 }, - { "Africa/Lome" , 0x0018EE }, - { "Africa/Luanda" , 0x001943 }, - { "Africa/Lubumbashi" , 0x001998 }, - { "Africa/Lusaka" , 0x0019F3 }, - { "Africa/Malabo" , 0x001A48 }, - { "Africa/Maputo" , 0x001A9D }, - { "Africa/Maseru" , 0x001AF2 }, - { "Africa/Mbabane" , 0x001B5A }, - { "Africa/Mogadishu" , 0x001BB0 }, - { "Africa/Monrovia" , 0x001C0B }, - { "Africa/Nairobi" , 0x001C71 }, - { "Africa/Ndjamena" , 0x001CF0 }, - { "Africa/Niamey" , 0x001D5C }, - { "Africa/Nouakchott" , 0x001DB1 }, - { "Africa/Ouagadougou" , 0x001E06 }, - { "Africa/Porto-Novo" , 0x001E5B }, - { "Africa/Sao_Tome" , 0x001EB0 }, - { "Africa/Timbuktu" , 0x001F05 }, - { "Africa/Tripoli" , 0x001F5A }, - { "Africa/Tunis" , 0x002063 }, - { "Africa/Windhoek" , 0x002175 }, - { "America/Adak" , 0x0023BC }, - { "America/Anchorage" , 0x002732 }, - { "America/Anguilla" , 0x002AA6 }, - { "America/Antigua" , 0x002AFB }, - { "America/Araguaina" , 0x002B61 }, - { "America/Argentina/Buenos_Aires" , 0x002CC6 }, - { "America/Argentina/Catamarca" , 0x002E74 }, - { "America/Argentina/ComodRivadavia" , 0x003035 }, - { "America/Argentina/Cordoba" , 0x0031DB }, - { "America/Argentina/Jujuy" , 0x0033B0 }, - { "America/Argentina/La_Rioja" , 0x003564 }, - { "America/Argentina/Mendoza" , 0x00371C }, - { "America/Argentina/Rio_Gallegos" , 0x0038DC }, - { "America/Argentina/Salta" , 0x003A91 }, - { "America/Argentina/San_Juan" , 0x003C3D }, - { "America/Argentina/San_Luis" , 0x003DF5 }, - { "America/Argentina/Tucuman" , 0x003FBB }, - { "America/Argentina/Ushuaia" , 0x004177 }, - { "America/Aruba" , 0x004332 }, - { "America/Asuncion" , 0x004398 }, - { "America/Atikokan" , 0x00467D }, - { "America/Atka" , 0x004753 }, - { "America/Bahia" , 0x004AB9 }, - { "America/Bahia_Banderas" , 0x004C4C }, - { "America/Barbados" , 0x004EC5 }, - { "America/Belem" , 0x004F5F }, - { "America/Belize" , 0x00505A }, - { "America/Blanc-Sablon" , 0x0051D6 }, - { "America/Boa_Vista" , 0x00528A }, - { "America/Bogota" , 0x005393 }, - { "America/Boise" , 0x0053FF }, - { "America/Buenos_Aires" , 0x005796 }, - { "America/Cambridge_Bay" , 0x00592F }, - { "America/Campo_Grande" , 0x005C57 }, - { "America/Cancun" , 0x005F46 }, - { "America/Caracas" , 0x006188 }, - { "America/Catamarca" , 0x0061EF }, - { "America/Cayenne" , 0x006395 }, - { "America/Cayman" , 0x0063F7 }, - { "America/Chicago" , 0x00644C }, - { "America/Chihuahua" , 0x006963 }, - { "America/Coral_Harbour" , 0x006BCE }, - { "America/Cordoba" , 0x006C60 }, - { "America/Costa_Rica" , 0x006E06 }, - { "America/Creston" , 0x006E90 }, - { "America/Cuiaba" , 0x006F1C }, - { "America/Curacao" , 0x0071FA }, - { "America/Danmarkshavn" , 0x007260 }, - { "America/Dawson" , 0x0073A4 }, - { "America/Dawson_Creek" , 0x0076C1 }, - { "America/Denver" , 0x00789B }, - { "America/Detroit" , 0x007C21 }, - { "America/Dominica" , 0x007F80 }, - { "America/Edmonton" , 0x007FD5 }, - { "America/Eirunepe" , 0x00838D }, - { "America/El_Salvador" , 0x0084A5 }, - { "America/Ensenada" , 0x00851A }, - { "America/Fort_Wayne" , 0x0089C1 }, - { "America/Fortaleza" , 0x008883 }, - { "America/Glace_Bay" , 0x008C2B }, - { "America/Godthab" , 0x008FA2 }, - { "America/Goose_Bay" , 0x009266 }, - { "America/Grand_Turk" , 0x009723 }, - { "America/Grenada" , 0x0098F8 }, - { "America/Guadeloupe" , 0x00994D }, - { "America/Guatemala" , 0x0099A2 }, - { "America/Guayaquil" , 0x009A2B }, - { "America/Guyana" , 0x009A88 }, - { "America/Halifax" , 0x009B09 }, - { "America/Havana" , 0x00A01F }, - { "America/Hermosillo" , 0x00A392 }, - { "America/Indiana/Indianapolis" , 0x00A470 }, - { "America/Indiana/Knox" , 0x00A701 }, - { "America/Indiana/Marengo" , 0x00AA98 }, - { "America/Indiana/Petersburg" , 0x00AD3E }, - { "America/Indiana/Tell_City" , 0x00B28B }, - { "America/Indiana/Vevay" , 0x00B524 }, - { "America/Indiana/Vincennes" , 0x00B75F }, - { "America/Indiana/Winamac" , 0x00BA13 }, - { "America/Indianapolis" , 0x00B021 }, - { "America/Inuvik" , 0x00BCCC }, - { "America/Iqaluit" , 0x00BFC3 }, - { "America/Jamaica" , 0x00C2E5 }, - { "America/Jujuy" , 0x00C3AA }, - { "America/Juneau" , 0x00C554 }, - { "America/Kentucky/Louisville" , 0x00C8D2 }, - { "America/Kentucky/Monticello" , 0x00CCF0 }, - { "America/Knox_IN" , 0x00D075 }, - { "America/Kralendijk" , 0x00D3E6 }, - { "America/La_Paz" , 0x00D44C }, - { "America/Lima" , 0x00D4B3 }, - { "America/Los_Angeles" , 0x00D55B }, - { "America/Louisville" , 0x00D96C }, - { "America/Lower_Princes" , 0x00DD61 }, - { "America/Maceio" , 0x00DDC7 }, - { "America/Managua" , 0x00DF01 }, - { "America/Manaus" , 0x00DFB4 }, - { "America/Marigot" , 0x00E0B6 }, - { "America/Martinique" , 0x00E10B }, - { "America/Matamoros" , 0x00E177 }, - { "America/Mazatlan" , 0x00E3D0 }, - { "America/Mendoza" , 0x00E63D }, - { "America/Menominee" , 0x00E7F1 }, - { "America/Merida" , 0x00EB72 }, - { "America/Metlakatla" , 0x00EDAD }, - { "America/Mexico_City" , 0x00EEE8 }, - { "America/Miquelon" , 0x00F163 }, - { "America/Moncton" , 0x00F3D5 }, - { "America/Monterrey" , 0x00F86C }, - { "America/Montevideo" , 0x00FACF }, - { "America/Montreal" , 0x00FDE1 }, - { "America/Montserrat" , 0x0102D1 }, - { "America/Nassau" , 0x010326 }, - { "America/New_York" , 0x01066B }, - { "America/Nipigon" , 0x010B76 }, - { "America/Nome" , 0x010EC7 }, - { "America/Noronha" , 0x011245 }, - { "America/North_Dakota/Beulah" , 0x011375 }, - { "America/North_Dakota/Center" , 0x011709 }, - { "America/North_Dakota/New_Salem" , 0x011A9D }, - { "America/Ojinaga" , 0x011E46 }, - { "America/Panama" , 0x0120A7 }, - { "America/Pangnirtung" , 0x0120FC }, - { "America/Paramaribo" , 0x012432 }, - { "America/Phoenix" , 0x0124C4 }, - { "America/Port-au-Prince" , 0x012582 }, - { "America/Port_of_Spain" , 0x0128A6 }, - { "America/Porto_Acre" , 0x0127A2 }, - { "America/Porto_Velho" , 0x0128FB }, - { "America/Puerto_Rico" , 0x0129F1 }, - { "America/Rainy_River" , 0x012A5C }, - { "America/Rankin_Inlet" , 0x012D94 }, - { "America/Recife" , 0x01307A }, - { "America/Regina" , 0x0131A4 }, - { "America/Resolute" , 0x013362 }, - { "America/Rio_Branco" , 0x01364A }, - { "America/Rosario" , 0x013752 }, - { "America/Santa_Isabel" , 0x0138F8 }, - { "America/Santarem" , 0x013C9B }, - { "America/Santiago" , 0x013DA0 }, - { "America/Santo_Domingo" , 0x014149 }, - { "America/Sao_Paulo" , 0x01420F }, - { "America/Scoresbysund" , 0x01451E }, - { "America/Shiprock" , 0x01480C }, - { "America/Sitka" , 0x014B85 }, - { "America/St_Barthelemy" , 0x014F0D }, - { "America/St_Johns" , 0x014F62 }, - { "America/St_Kitts" , 0x0154B5 }, - { "America/St_Lucia" , 0x01550A }, - { "America/St_Thomas" , 0x01555F }, - { "America/St_Vincent" , 0x0155B4 }, - { "America/Swift_Current" , 0x015609 }, - { "America/Tegucigalpa" , 0x01572A }, - { "America/Thule" , 0x0157A9 }, - { "America/Thunder_Bay" , 0x0159F0 }, - { "America/Tijuana" , 0x015D39 }, - { "America/Toronto" , 0x0160D2 }, - { "America/Tortola" , 0x0165F2 }, - { "America/Vancouver" , 0x016647 }, - { "America/Virgin" , 0x016A84 }, - { "America/Whitehorse" , 0x016AD9 }, - { "America/Winnipeg" , 0x016DF6 }, - { "America/Yakutat" , 0x017236 }, - { "America/Yellowknife" , 0x0175A1 }, - { "Antarctica/Casey" , 0x0178B1 }, - { "Antarctica/Davis" , 0x01794F }, - { "Antarctica/DumontDUrville" , 0x0179F0 }, - { "Antarctica/Macquarie" , 0x017A81 }, - { "Antarctica/Mawson" , 0x017CCE }, - { "Antarctica/McMurdo" , 0x017D4A }, - { "Antarctica/Palmer" , 0x0180F5 }, - { "Antarctica/Rothera" , 0x018411 }, - { "Antarctica/South_Pole" , 0x018487 }, - { "Antarctica/Syowa" , 0x018805 }, - { "Antarctica/Troll" , 0x018873 }, - { "Antarctica/Vostok" , 0x018A45 }, - { "Arctic/Longyearbyen" , 0x018AB6 }, - { "Asia/Aden" , 0x018DE8 }, - { "Asia/Almaty" , 0x018E3D }, - { "Asia/Amman" , 0x018FBC }, - { "Asia/Anadyr" , 0x019272 }, - { "Asia/Aqtau" , 0x019474 }, - { "Asia/Aqtobe" , 0x019673 }, - { "Asia/Ashgabat" , 0x01982B }, - { "Asia/Ashkhabad" , 0x019948 }, - { "Asia/Baghdad" , 0x019A65 }, - { "Asia/Bahrain" , 0x019BDA }, - { "Asia/Baku" , 0x019C40 }, - { "Asia/Bangkok" , 0x019F28 }, - { "Asia/Beirut" , 0x019F7D }, - { "Asia/Bishkek" , 0x01A28A }, - { "Asia/Brunei" , 0x01A436 }, - { "Asia/Calcutta" , 0x01A498 }, - { "Asia/Chita" , 0x01A511 }, - { "Asia/Choibalsan" , 0x01A726 }, - { "Asia/Chongqing" , 0x01A89F }, - { "Asia/Chungking" , 0x01A93F }, - { "Asia/Colombo" , 0x01A9DF }, - { "Asia/Dacca" , 0x01AA7B }, - { "Asia/Damascus" , 0x01AB21 }, - { "Asia/Dhaka" , 0x01AE71 }, - { "Asia/Dili" , 0x01AF17 }, - { "Asia/Dubai" , 0x01AFA1 }, - { "Asia/Dushanbe" , 0x01AFF6 }, - { "Asia/Gaza" , 0x01B0F9 }, - { "Asia/Harbin" , 0x01B44C }, - { "Asia/Hebron" , 0x01B4EC }, - { "Asia/Ho_Chi_Minh" , 0x01B848 }, - { "Asia/Hong_Kong" , 0x01B8C0 }, - { "Asia/Hovd" , 0x01BA82 }, - { "Asia/Irkutsk" , 0x01BBFA }, - { "Asia/Istanbul" , 0x01BDE5 }, - { "Asia/Jakarta" , 0x01C1D2 }, - { "Asia/Jayapura" , 0x01C27C }, - { "Asia/Jerusalem" , 0x01C319 }, - { "Asia/Kabul" , 0x01C648 }, - { "Asia/Kamchatka" , 0x01C699 }, - { "Asia/Karachi" , 0x01C892 }, - { "Asia/Kashgar" , 0x01C947 }, - { "Asia/Kathmandu" , 0x01C99C }, - { "Asia/Katmandu" , 0x01CA02 }, - { "Asia/Khandyga" , 0x01CA68 }, - { "Asia/Kolkata" , 0x01CC92 }, - { "Asia/Krasnoyarsk" , 0x01CD0B }, - { "Asia/Kuala_Lumpur" , 0x01CEF8 }, - { "Asia/Kuching" , 0x01CFB5 }, - { "Asia/Kuwait" , 0x01D0A3 }, - { "Asia/Macao" , 0x01D0F8 }, - { "Asia/Macau" , 0x01D233 }, - { "Asia/Magadan" , 0x01D36E }, - { "Asia/Makassar" , 0x01D572 }, - { "Asia/Manila" , 0x01D637 }, - { "Asia/Muscat" , 0x01D6BC }, - { "Asia/Nicosia" , 0x01D711 }, - { "Asia/Novokuznetsk" , 0x01D9F9 }, - { "Asia/Novosibirsk" , 0x01DC19 }, - { "Asia/Omsk" , 0x01DE09 }, - { "Asia/Oral" , 0x01DFF5 }, - { "Asia/Phnom_Penh" , 0x01E1C5 }, - { "Asia/Pontianak" , 0x01E23D }, - { "Asia/Pyongyang" , 0x01E2FF }, - { "Asia/Qatar" , 0x01E38F }, - { "Asia/Qyzylorda" , 0x01E3F5 }, - { "Asia/Rangoon" , 0x01E5CB }, - { "Asia/Riyadh" , 0x01E643 }, - { "Asia/Saigon" , 0x01E698 }, - { "Asia/Sakhalin" , 0x01E710 }, - { "Asia/Samarkand" , 0x01E90D }, - { "Asia/Seoul" , 0x01EA43 }, - { "Asia/Shanghai" , 0x01EB0A }, - { "Asia/Singapore" , 0x01EBB6 }, - { "Asia/Srednekolymsk" , 0x01EC6D }, - { "Asia/Taipei" , 0x01EE6D }, - { "Asia/Tashkent" , 0x01EF9E }, - { "Asia/Tbilisi" , 0x01F0CF }, - { "Asia/Tehran" , 0x01F289 }, - { "Asia/Tel_Aviv" , 0x01F4F7 }, - { "Asia/Thimbu" , 0x01F826 }, - { "Asia/Thimphu" , 0x01F88C }, - { "Asia/Tokyo" , 0x01F8F2 }, - { "Asia/Ujung_Pandang" , 0x01F97C }, - { "Asia/Ulaanbaatar" , 0x01F9F9 }, - { "Asia/Ulan_Bator" , 0x01FB54 }, - { "Asia/Urumqi" , 0x01FCA1 }, - { "Asia/Ust-Nera" , 0x01FD03 }, - { "Asia/Vientiane" , 0x01FF15 }, - { "Asia/Vladivostok" , 0x01FF8D }, - { "Asia/Yakutsk" , 0x020177 }, - { "Asia/Yekaterinburg" , 0x020361 }, - { "Asia/Yerevan" , 0x020582 }, - { "Atlantic/Azores" , 0x020782 }, - { "Atlantic/Bermuda" , 0x020C85 }, - { "Atlantic/Canary" , 0x020F66 }, - { "Atlantic/Cape_Verde" , 0x02123C }, - { "Atlantic/Faeroe" , 0x0212B5 }, - { "Atlantic/Faroe" , 0x021559 }, - { "Atlantic/Jan_Mayen" , 0x0217FD }, - { "Atlantic/Madeira" , 0x021B2F }, - { "Atlantic/Reykjavik" , 0x022038 }, - { "Atlantic/South_Georgia" , 0x0221F1 }, - { "Atlantic/St_Helena" , 0x022403 }, - { "Atlantic/Stanley" , 0x022235 }, - { "Australia/ACT" , 0x022458 }, - { "Australia/Adelaide" , 0x02277B }, - { "Australia/Brisbane" , 0x022AAD }, - { "Australia/Broken_Hill" , 0x022B7A }, - { "Australia/Canberra" , 0x022EBE }, - { "Australia/Currie" , 0x0231E1 }, - { "Australia/Darwin" , 0x02351A }, - { "Australia/Eucla" , 0x0235A6 }, - { "Australia/Hobart" , 0x023682 }, - { "Australia/LHI" , 0x0239E6 }, - { "Australia/Lindeman" , 0x023C87 }, - { "Australia/Lord_Howe" , 0x023D6E }, - { "Australia/Melbourne" , 0x02401F }, - { "Australia/North" , 0x02434A }, - { "Australia/NSW" , 0x0243C4 }, - { "Australia/Perth" , 0x0246E7 }, - { "Australia/Queensland" , 0x0247C5 }, - { "Australia/South" , 0x024877 }, - { "Australia/Sydney" , 0x024B9A }, - { "Australia/Tasmania" , 0x024EDD }, - { "Australia/Victoria" , 0x025228 }, - { "Australia/West" , 0x02554B }, - { "Australia/Yancowinna" , 0x025607 }, - { "Brazil/Acre" , 0x02592F }, - { "Brazil/DeNoronha" , 0x025A33 }, - { "Brazil/East" , 0x025B53 }, - { "Brazil/West" , 0x025E30 }, - { "Canada/Atlantic" , 0x025F28 }, - { "Canada/Central" , 0x026410 }, - { "Canada/East-Saskatchewan" , 0x026D1A }, - { "Canada/Eastern" , 0x02682A }, - { "Canada/Mountain" , 0x026EA3 }, - { "Canada/Newfoundland" , 0x027219 }, - { "Canada/Pacific" , 0x027744 }, - { "Canada/Saskatchewan" , 0x027B5D }, - { "Canada/Yukon" , 0x027CE6 }, - { "CET" , 0x027FE9 }, - { "Chile/Continental" , 0x0282F2 }, - { "Chile/EasterIsland" , 0x02868D }, - { "CST6CDT" , 0x0289CF }, - { "Cuba" , 0x028D20 }, - { "EET" , 0x029093 }, - { "Egypt" , 0x029346 }, - { "Eire" , 0x02972D }, - { "EST" , 0x029C3E }, - { "EST5EDT" , 0x029C82 }, - { "Etc/GMT" , 0x029FD3 }, - { "Etc/GMT+0" , 0x02A09F }, - { "Etc/GMT+1" , 0x02A129 }, - { "Etc/GMT+10" , 0x02A1B6 }, - { "Etc/GMT+11" , 0x02A244 }, - { "Etc/GMT+12" , 0x02A2D2 }, - { "Etc/GMT+2" , 0x02A3ED }, - { "Etc/GMT+3" , 0x02A479 }, - { "Etc/GMT+4" , 0x02A505 }, - { "Etc/GMT+5" , 0x02A591 }, - { "Etc/GMT+6" , 0x02A61D }, - { "Etc/GMT+7" , 0x02A6A9 }, - { "Etc/GMT+8" , 0x02A735 }, - { "Etc/GMT+9" , 0x02A7C1 }, - { "Etc/GMT-0" , 0x02A05B }, - { "Etc/GMT-1" , 0x02A0E3 }, - { "Etc/GMT-10" , 0x02A16F }, - { "Etc/GMT-11" , 0x02A1FD }, - { "Etc/GMT-12" , 0x02A28B }, - { "Etc/GMT-13" , 0x02A319 }, - { "Etc/GMT-14" , 0x02A360 }, - { "Etc/GMT-2" , 0x02A3A7 }, - { "Etc/GMT-3" , 0x02A433 }, - { "Etc/GMT-4" , 0x02A4BF }, - { "Etc/GMT-5" , 0x02A54B }, - { "Etc/GMT-6" , 0x02A5D7 }, - { "Etc/GMT-7" , 0x02A663 }, - { "Etc/GMT-8" , 0x02A6EF }, - { "Etc/GMT-9" , 0x02A77B }, - { "Etc/GMT0" , 0x02A017 }, - { "Etc/Greenwich" , 0x02A807 }, - { "Etc/UCT" , 0x02A84B }, - { "Etc/Universal" , 0x02A88F }, - { "Etc/UTC" , 0x02A8D3 }, - { "Etc/Zulu" , 0x02A917 }, - { "Europe/Amsterdam" , 0x02A95B }, - { "Europe/Andorra" , 0x02AD99 }, - { "Europe/Athens" , 0x02B015 }, - { "Europe/Belfast" , 0x02B358 }, - { "Europe/Belgrade" , 0x02B88F }, - { "Europe/Berlin" , 0x02BB58 }, - { "Europe/Bratislava" , 0x02BEBC }, - { "Europe/Brussels" , 0x02C1EE }, - { "Europe/Bucharest" , 0x02C625 }, - { "Europe/Budapest" , 0x02C94F }, - { "Europe/Busingen" , 0x02CCB8 }, - { "Europe/Chisinau" , 0x02CF6F }, - { "Europe/Copenhagen" , 0x02D2FD }, - { "Europe/Dublin" , 0x02D607 }, - { "Europe/Gibraltar" , 0x02DB18 }, - { "Europe/Guernsey" , 0x02DF6F }, - { "Europe/Helsinki" , 0x02E4A6 }, - { "Europe/Isle_of_Man" , 0x02E75C }, - { "Europe/Istanbul" , 0x02EC93 }, - { "Europe/Jersey" , 0x02F080 }, - { "Europe/Kaliningrad" , 0x02F5B7 }, - { "Europe/Kiev" , 0x02F822 }, - { "Europe/Lisbon" , 0x02FB3E }, - { "Europe/Ljubljana" , 0x030042 }, - { "Europe/London" , 0x03030B }, - { "Europe/Luxembourg" , 0x030842 }, - { "Europe/Madrid" , 0x030C98 }, - { "Europe/Malta" , 0x03105E }, - { "Europe/Mariehamn" , 0x031417 }, - { "Europe/Minsk" , 0x0316CD }, - { "Europe/Monaco" , 0x0318DB }, - { "Europe/Moscow" , 0x031D16 }, - { "Europe/Nicosia" , 0x031F70 }, - { "Europe/Oslo" , 0x032258 }, - { "Europe/Paris" , 0x03258A }, - { "Europe/Podgorica" , 0x0329D0 }, - { "Europe/Prague" , 0x032C99 }, - { "Europe/Riga" , 0x032FCB }, - { "Europe/Rome" , 0x033310 }, - { "Europe/Samara" , 0x0336D3 }, - { "Europe/San_Marino" , 0x03393C }, - { "Europe/Sarajevo" , 0x033CFF }, - { "Europe/Simferopol" , 0x033FC8 }, - { "Europe/Skopje" , 0x034219 }, - { "Europe/Sofia" , 0x0344E2 }, - { "Europe/Stockholm" , 0x0347EA }, - { "Europe/Tallinn" , 0x034A99 }, - { "Europe/Tirane" , 0x034DD3 }, - { "Europe/Tiraspol" , 0x0350D9 }, - { "Europe/Uzhgorod" , 0x035467 }, - { "Europe/Vaduz" , 0x03577E }, - { "Europe/Vatican" , 0x035A2D }, - { "Europe/Vienna" , 0x035DF0 }, - { "Europe/Vilnius" , 0x03611D }, - { "Europe/Volgograd" , 0x03645C }, - { "Europe/Warsaw" , 0x03667D }, - { "Europe/Zagreb" , 0x036A5E }, - { "Europe/Zaporozhye" , 0x036D27 }, - { "Europe/Zurich" , 0x037068 }, - { "Factory" , 0x037317 }, - { "GB" , 0x037388 }, - { "GB-Eire" , 0x0378BF }, - { "GMT" , 0x037DF6 }, - { "GMT+0" , 0x037EC2 }, - { "GMT-0" , 0x037E7E }, - { "GMT0" , 0x037E3A }, - { "Greenwich" , 0x037F06 }, - { "Hongkong" , 0x037F4A }, - { "HST" , 0x03810C }, - { "Iceland" , 0x038150 }, - { "Indian/Antananarivo" , 0x038309 }, - { "Indian/Chagos" , 0x03837D }, - { "Indian/Christmas" , 0x0383DF }, - { "Indian/Cocos" , 0x038423 }, - { "Indian/Comoro" , 0x038467 }, - { "Indian/Kerguelen" , 0x0384BC }, - { "Indian/Mahe" , 0x038511 }, - { "Indian/Maldives" , 0x038566 }, - { "Indian/Mauritius" , 0x0385BB }, - { "Indian/Mayotte" , 0x038631 }, - { "Indian/Reunion" , 0x038686 }, - { "Iran" , 0x0386DB }, - { "Israel" , 0x038949 }, - { "Jamaica" , 0x038C78 }, - { "Japan" , 0x038D3D }, - { "Kwajalein" , 0x038DC7 }, - { "Libya" , 0x038E2A }, - { "MET" , 0x038F33 }, - { "Mexico/BajaNorte" , 0x03923C }, - { "Mexico/BajaSur" , 0x0395A5 }, - { "Mexico/General" , 0x0397EA }, - { "MST" , 0x039A48 }, - { "MST7MDT" , 0x039A8C }, - { "Navajo" , 0x039DDD }, - { "NZ" , 0x03A156 }, - { "NZ-CHAT" , 0x03A4D4 }, - { "Pacific/Apia" , 0x03A7B8 }, - { "Pacific/Auckland" , 0x03A954 }, - { "Pacific/Chatham" , 0x03ACE0 }, - { "Pacific/Chuuk" , 0x03AFD3 }, - { "Pacific/Easter" , 0x03B02C }, - { "Pacific/Efate" , 0x03B37B }, - { "Pacific/Enderbury" , 0x03B441 }, - { "Pacific/Fakaofo" , 0x03B4AF }, - { "Pacific/Fiji" , 0x03B500 }, - { "Pacific/Funafuti" , 0x03B693 }, - { "Pacific/Galapagos" , 0x03B6D7 }, - { "Pacific/Gambier" , 0x03B74F }, - { "Pacific/Guadalcanal" , 0x03B7B4 }, - { "Pacific/Guam" , 0x03B809 }, - { "Pacific/Honolulu" , 0x03B85F }, - { "Pacific/Johnston" , 0x03B8D6 }, - { "Pacific/Kiritimati" , 0x03B955 }, - { "Pacific/Kosrae" , 0x03B9C0 }, - { "Pacific/Kwajalein" , 0x03BA1D }, - { "Pacific/Majuro" , 0x03BA89 }, - { "Pacific/Marquesas" , 0x03BAE8 }, - { "Pacific/Midway" , 0x03BB4F }, - { "Pacific/Nauru" , 0x03BBD9 }, - { "Pacific/Niue" , 0x03BC51 }, - { "Pacific/Norfolk" , 0x03BCAF }, - { "Pacific/Noumea" , 0x03BD04 }, - { "Pacific/Pago_Pago" , 0x03BD94 }, - { "Pacific/Palau" , 0x03BE0B }, - { "Pacific/Pitcairn" , 0x03BE4F }, - { "Pacific/Pohnpei" , 0x03BEA4 }, - { "Pacific/Ponape" , 0x03BEF9 }, - { "Pacific/Port_Moresby" , 0x03BF3E }, - { "Pacific/Rarotonga" , 0x03BF82 }, - { "Pacific/Saipan" , 0x03C05E }, - { "Pacific/Samoa" , 0x03C0C1 }, - { "Pacific/Tahiti" , 0x03C138 }, - { "Pacific/Tarawa" , 0x03C19D }, - { "Pacific/Tongatapu" , 0x03C1F1 }, - { "Pacific/Truk" , 0x03C27D }, - { "Pacific/Wake" , 0x03C2C2 }, - { "Pacific/Wallis" , 0x03C312 }, - { "Pacific/Yap" , 0x03C356 }, - { "Poland" , 0x03C39B }, - { "Portugal" , 0x03C77C }, - { "PRC" , 0x03CC78 }, - { "PST8PDT" , 0x03CD18 }, - { "ROC" , 0x03D069 }, - { "ROK" , 0x03D19A }, - { "Singapore" , 0x03D261 }, - { "Turkey" , 0x03D318 }, - { "UCT" , 0x03D705 }, - { "Universal" , 0x03D749 }, - { "US/Alaska" , 0x03D78D }, - { "US/Aleutian" , 0x03DAF6 }, - { "US/Arizona" , 0x03DE5C }, - { "US/Central" , 0x03DEEA }, - { "US/East-Indiana" , 0x03E8F4 }, - { "US/Eastern" , 0x03E3F5 }, - { "US/Hawaii" , 0x03EB5E }, - { "US/Indiana-Starke" , 0x03EBCF }, - { "US/Michigan" , 0x03EF40 }, - { "US/Mountain" , 0x03F277 }, - { "US/Pacific" , 0x03F5F0 }, - { "US/Pacific-New" , 0x03F9F5 }, - { "US/Samoa" , 0x03FDFA }, - { "UTC" , 0x03FE71 }, - { "W-SU" , 0x040168 }, - { "WET" , 0x03FEB5 }, - { "Zulu" , 0x0403AB }, + { "Africa/Cairo" , 0x00062E }, + { "Africa/Casablanca" , 0x000A15 }, + { "Africa/Ceuta" , 0x000C77 }, + { "Africa/Conakry" , 0x000F7E }, + { "Africa/Dakar" , 0x000FD3 }, + { "Africa/Dar_es_Salaam" , 0x001028 }, + { "Africa/Djibouti" , 0x001095 }, + { "Africa/Douala" , 0x0010EA }, + { "Africa/El_Aaiun" , 0x00113F }, + { "Africa/Freetown" , 0x00136A }, + { "Africa/Gaborone" , 0x0013BF }, + { "Africa/Harare" , 0x001414 }, + { "Africa/Johannesburg" , 0x001469 }, + { "Africa/Juba" , 0x0014D7 }, + { "Africa/Kampala" , 0x0015EA }, + { "Africa/Khartoum" , 0x001669 }, + { "Africa/Kigali" , 0x00177C }, + { "Africa/Kinshasa" , 0x0017D1 }, + { "Africa/Lagos" , 0x00183D }, + { "Africa/Libreville" , 0x001892 }, + { "Africa/Lome" , 0x0018E7 }, + { "Africa/Luanda" , 0x00193C }, + { "Africa/Lubumbashi" , 0x001991 }, + { "Africa/Lusaka" , 0x0019FD }, + { "Africa/Malabo" , 0x001A52 }, + { "Africa/Maputo" , 0x001AA7 }, + { "Africa/Maseru" , 0x001AFC }, + { "Africa/Mbabane" , 0x001B6A }, + { "Africa/Mogadishu" , 0x001BD8 }, + { "Africa/Monrovia" , 0x001C33 }, + { "Africa/Nairobi" , 0x001C99 }, + { "Africa/Ndjamena" , 0x001D18 }, + { "Africa/Niamey" , 0x001D84 }, + { "Africa/Nouakchott" , 0x001DD9 }, + { "Africa/Ouagadougou" , 0x001E2E }, + { "Africa/Porto-Novo" , 0x001E83 }, + { "Africa/Sao_Tome" , 0x001ED8 }, + { "Africa/Timbuktu" , 0x001F2D }, + { "Africa/Tripoli" , 0x001F82 }, + { "Africa/Tunis" , 0x00208B }, + { "Africa/Windhoek" , 0x00219D }, + { "America/Adak" , 0x0023E4 }, + { "America/Anchorage" , 0x00275A }, + { "America/Anguilla" , 0x002ACE }, + { "America/Antigua" , 0x002B23 }, + { "America/Araguaina" , 0x002B89 }, + { "America/Argentina/Buenos_Aires" , 0x002CEE }, + { "America/Argentina/Catamarca" , 0x002E9C }, + { "America/Argentina/ComodRivadavia" , 0x00305D }, + { "America/Argentina/Cordoba" , 0x003203 }, + { "America/Argentina/Jujuy" , 0x0033D8 }, + { "America/Argentina/La_Rioja" , 0x00358C }, + { "America/Argentina/Mendoza" , 0x003744 }, + { "America/Argentina/Rio_Gallegos" , 0x003904 }, + { "America/Argentina/Salta" , 0x003AB9 }, + { "America/Argentina/San_Juan" , 0x003C65 }, + { "America/Argentina/San_Luis" , 0x003E1D }, + { "America/Argentina/Tucuman" , 0x003FE3 }, + { "America/Argentina/Ushuaia" , 0x00419F }, + { "America/Aruba" , 0x00435A }, + { "America/Asuncion" , 0x0043C0 }, + { "America/Atikokan" , 0x0046A5 }, + { "America/Atka" , 0x00477B }, + { "America/Bahia" , 0x004AE1 }, + { "America/Bahia_Banderas" , 0x004C74 }, + { "America/Barbados" , 0x004EED }, + { "America/Belem" , 0x004F87 }, + { "America/Belize" , 0x005082 }, + { "America/Blanc-Sablon" , 0x0051FE }, + { "America/Boa_Vista" , 0x0052B2 }, + { "America/Bogota" , 0x0053BB }, + { "America/Boise" , 0x005427 }, + { "America/Buenos_Aires" , 0x0057BE }, + { "America/Cambridge_Bay" , 0x005957 }, + { "America/Campo_Grande" , 0x005C7F }, + { "America/Cancun" , 0x005F6E }, + { "America/Caracas" , 0x0061B0 }, + { "America/Catamarca" , 0x006217 }, + { "America/Cayenne" , 0x0063BD }, + { "America/Cayman" , 0x00641F }, + { "America/Chicago" , 0x006474 }, + { "America/Chihuahua" , 0x00698B }, + { "America/Coral_Harbour" , 0x006BF6 }, + { "America/Cordoba" , 0x006C88 }, + { "America/Costa_Rica" , 0x006E2E }, + { "America/Creston" , 0x006EB8 }, + { "America/Cuiaba" , 0x006F44 }, + { "America/Curacao" , 0x007222 }, + { "America/Danmarkshavn" , 0x007288 }, + { "America/Dawson" , 0x0073CC }, + { "America/Dawson_Creek" , 0x0076E9 }, + { "America/Denver" , 0x0078C3 }, + { "America/Detroit" , 0x007C49 }, + { "America/Dominica" , 0x007FA8 }, + { "America/Edmonton" , 0x007FFD }, + { "America/Eirunepe" , 0x0083B5 }, + { "America/El_Salvador" , 0x0084CD }, + { "America/Ensenada" , 0x008542 }, + { "America/Fort_Wayne" , 0x0089E9 }, + { "America/Fortaleza" , 0x0088AB }, + { "America/Glace_Bay" , 0x008C53 }, + { "America/Godthab" , 0x008FCA }, + { "America/Goose_Bay" , 0x00928E }, + { "America/Grand_Turk" , 0x00974B }, + { "America/Grenada" , 0x009920 }, + { "America/Guadeloupe" , 0x009975 }, + { "America/Guatemala" , 0x0099CA }, + { "America/Guayaquil" , 0x009A53 }, + { "America/Guyana" , 0x009AB0 }, + { "America/Halifax" , 0x009B31 }, + { "America/Havana" , 0x00A047 }, + { "America/Hermosillo" , 0x00A3BA }, + { "America/Indiana/Indianapolis" , 0x00A498 }, + { "America/Indiana/Knox" , 0x00A729 }, + { "America/Indiana/Marengo" , 0x00AAC0 }, + { "America/Indiana/Petersburg" , 0x00AD66 }, + { "America/Indiana/Tell_City" , 0x00B2B3 }, + { "America/Indiana/Vevay" , 0x00B54C }, + { "America/Indiana/Vincennes" , 0x00B787 }, + { "America/Indiana/Winamac" , 0x00BA3B }, + { "America/Indianapolis" , 0x00B049 }, + { "America/Inuvik" , 0x00BCF4 }, + { "America/Iqaluit" , 0x00BFEB }, + { "America/Jamaica" , 0x00C30D }, + { "America/Jujuy" , 0x00C3D2 }, + { "America/Juneau" , 0x00C57C }, + { "America/Kentucky/Louisville" , 0x00C8FA }, + { "America/Kentucky/Monticello" , 0x00CD18 }, + { "America/Knox_IN" , 0x00D09D }, + { "America/Kralendijk" , 0x00D40E }, + { "America/La_Paz" , 0x00D474 }, + { "America/Lima" , 0x00D4DB }, + { "America/Los_Angeles" , 0x00D583 }, + { "America/Louisville" , 0x00D994 }, + { "America/Lower_Princes" , 0x00DD89 }, + { "America/Maceio" , 0x00DDEF }, + { "America/Managua" , 0x00DF29 }, + { "America/Manaus" , 0x00DFDC }, + { "America/Marigot" , 0x00E0DE }, + { "America/Martinique" , 0x00E133 }, + { "America/Matamoros" , 0x00E19F }, + { "America/Mazatlan" , 0x00E3F8 }, + { "America/Mendoza" , 0x00E665 }, + { "America/Menominee" , 0x00E819 }, + { "America/Merida" , 0x00EB9A }, + { "America/Metlakatla" , 0x00EDD5 }, + { "America/Mexico_City" , 0x00EF10 }, + { "America/Miquelon" , 0x00F18B }, + { "America/Moncton" , 0x00F3FD }, + { "America/Monterrey" , 0x00F894 }, + { "America/Montevideo" , 0x00FAF7 }, + { "America/Montreal" , 0x00FE09 }, + { "America/Montserrat" , 0x0102F9 }, + { "America/Nassau" , 0x01034E }, + { "America/New_York" , 0x010693 }, + { "America/Nipigon" , 0x010B9E }, + { "America/Nome" , 0x010EEF }, + { "America/Noronha" , 0x01126D }, + { "America/North_Dakota/Beulah" , 0x01139D }, + { "America/North_Dakota/Center" , 0x011731 }, + { "America/North_Dakota/New_Salem" , 0x011AC5 }, + { "America/Ojinaga" , 0x011E6E }, + { "America/Panama" , 0x0120CF }, + { "America/Pangnirtung" , 0x012124 }, + { "America/Paramaribo" , 0x01245A }, + { "America/Phoenix" , 0x0124EC }, + { "America/Port-au-Prince" , 0x0125AA }, + { "America/Port_of_Spain" , 0x0128CE }, + { "America/Porto_Acre" , 0x0127CA }, + { "America/Porto_Velho" , 0x012923 }, + { "America/Puerto_Rico" , 0x012A19 }, + { "America/Rainy_River" , 0x012A84 }, + { "America/Rankin_Inlet" , 0x012DBC }, + { "America/Recife" , 0x0130A2 }, + { "America/Regina" , 0x0131CC }, + { "America/Resolute" , 0x01338A }, + { "America/Rio_Branco" , 0x013672 }, + { "America/Rosario" , 0x01377A }, + { "America/Santa_Isabel" , 0x013920 }, + { "America/Santarem" , 0x013CC3 }, + { "America/Santiago" , 0x013DC8 }, + { "America/Santo_Domingo" , 0x014171 }, + { "America/Sao_Paulo" , 0x014237 }, + { "America/Scoresbysund" , 0x014546 }, + { "America/Shiprock" , 0x014834 }, + { "America/Sitka" , 0x014BAD }, + { "America/St_Barthelemy" , 0x014F35 }, + { "America/St_Johns" , 0x014F8A }, + { "America/St_Kitts" , 0x0154DD }, + { "America/St_Lucia" , 0x015532 }, + { "America/St_Thomas" , 0x015587 }, + { "America/St_Vincent" , 0x0155DC }, + { "America/Swift_Current" , 0x015631 }, + { "America/Tegucigalpa" , 0x015752 }, + { "America/Thule" , 0x0157D1 }, + { "America/Thunder_Bay" , 0x015A18 }, + { "America/Tijuana" , 0x015D61 }, + { "America/Toronto" , 0x0160FA }, + { "America/Tortola" , 0x01661A }, + { "America/Vancouver" , 0x01666F }, + { "America/Virgin" , 0x016AAC }, + { "America/Whitehorse" , 0x016B01 }, + { "America/Winnipeg" , 0x016E1E }, + { "America/Yakutat" , 0x01725E }, + { "America/Yellowknife" , 0x0175C9 }, + { "Antarctica/Casey" , 0x0178D9 }, + { "Antarctica/Davis" , 0x017977 }, + { "Antarctica/DumontDUrville" , 0x017A18 }, + { "Antarctica/Macquarie" , 0x017AA9 }, + { "Antarctica/Mawson" , 0x017CF6 }, + { "Antarctica/McMurdo" , 0x017D72 }, + { "Antarctica/Palmer" , 0x01811D }, + { "Antarctica/Rothera" , 0x018439 }, + { "Antarctica/South_Pole" , 0x0184AF }, + { "Antarctica/Syowa" , 0x01882D }, + { "Antarctica/Troll" , 0x01889B }, + { "Antarctica/Vostok" , 0x018A6D }, + { "Arctic/Longyearbyen" , 0x018ADE }, + { "Asia/Aden" , 0x018E10 }, + { "Asia/Almaty" , 0x018E65 }, + { "Asia/Amman" , 0x018FE4 }, + { "Asia/Anadyr" , 0x01929A }, + { "Asia/Aqtau" , 0x01949C }, + { "Asia/Aqtobe" , 0x01969B }, + { "Asia/Ashgabat" , 0x019853 }, + { "Asia/Ashkhabad" , 0x019970 }, + { "Asia/Baghdad" , 0x019A8D }, + { "Asia/Bahrain" , 0x019C02 }, + { "Asia/Baku" , 0x019C68 }, + { "Asia/Bangkok" , 0x019F50 }, + { "Asia/Beirut" , 0x019FA5 }, + { "Asia/Bishkek" , 0x01A2B2 }, + { "Asia/Brunei" , 0x01A45E }, + { "Asia/Calcutta" , 0x01A4C0 }, + { "Asia/Chita" , 0x01A539 }, + { "Asia/Choibalsan" , 0x01A74E }, + { "Asia/Chongqing" , 0x01A8C7 }, + { "Asia/Chungking" , 0x01A967 }, + { "Asia/Colombo" , 0x01AA07 }, + { "Asia/Dacca" , 0x01AAA3 }, + { "Asia/Damascus" , 0x01AB49 }, + { "Asia/Dhaka" , 0x01AE99 }, + { "Asia/Dili" , 0x01AF3F }, + { "Asia/Dubai" , 0x01AFC9 }, + { "Asia/Dushanbe" , 0x01B01E }, + { "Asia/Gaza" , 0x01B121 }, + { "Asia/Harbin" , 0x01B474 }, + { "Asia/Hebron" , 0x01B514 }, + { "Asia/Ho_Chi_Minh" , 0x01B870 }, + { "Asia/Hong_Kong" , 0x01B8E8 }, + { "Asia/Hovd" , 0x01BAAA }, + { "Asia/Irkutsk" , 0x01BC22 }, + { "Asia/Istanbul" , 0x01BE0D }, + { "Asia/Jakarta" , 0x01C1FA }, + { "Asia/Jayapura" , 0x01C2A4 }, + { "Asia/Jerusalem" , 0x01C341 }, + { "Asia/Kabul" , 0x01C670 }, + { "Asia/Kamchatka" , 0x01C6C1 }, + { "Asia/Karachi" , 0x01C8BA }, + { "Asia/Kashgar" , 0x01C96F }, + { "Asia/Kathmandu" , 0x01C9C4 }, + { "Asia/Katmandu" , 0x01CA2A }, + { "Asia/Khandyga" , 0x01CA90 }, + { "Asia/Kolkata" , 0x01CCBA }, + { "Asia/Krasnoyarsk" , 0x01CD33 }, + { "Asia/Kuala_Lumpur" , 0x01CF20 }, + { "Asia/Kuching" , 0x01CFDD }, + { "Asia/Kuwait" , 0x01D0CB }, + { "Asia/Macao" , 0x01D120 }, + { "Asia/Macau" , 0x01D25B }, + { "Asia/Magadan" , 0x01D396 }, + { "Asia/Makassar" , 0x01D59A }, + { "Asia/Manila" , 0x01D65F }, + { "Asia/Muscat" , 0x01D6E4 }, + { "Asia/Nicosia" , 0x01D739 }, + { "Asia/Novokuznetsk" , 0x01DA21 }, + { "Asia/Novosibirsk" , 0x01DC41 }, + { "Asia/Omsk" , 0x01DE31 }, + { "Asia/Oral" , 0x01E01D }, + { "Asia/Phnom_Penh" , 0x01E1ED }, + { "Asia/Pontianak" , 0x01E265 }, + { "Asia/Pyongyang" , 0x01E327 }, + { "Asia/Qatar" , 0x01E3B7 }, + { "Asia/Qyzylorda" , 0x01E41D }, + { "Asia/Rangoon" , 0x01E5F3 }, + { "Asia/Riyadh" , 0x01E66B }, + { "Asia/Saigon" , 0x01E6C0 }, + { "Asia/Sakhalin" , 0x01E738 }, + { "Asia/Samarkand" , 0x01E935 }, + { "Asia/Seoul" , 0x01EA6B }, + { "Asia/Shanghai" , 0x01EB32 }, + { "Asia/Singapore" , 0x01EBDE }, + { "Asia/Srednekolymsk" , 0x01EC95 }, + { "Asia/Taipei" , 0x01EE95 }, + { "Asia/Tashkent" , 0x01EFC6 }, + { "Asia/Tbilisi" , 0x01F0F7 }, + { "Asia/Tehran" , 0x01F2B1 }, + { "Asia/Tel_Aviv" , 0x01F51F }, + { "Asia/Thimbu" , 0x01F84E }, + { "Asia/Thimphu" , 0x01F8B4 }, + { "Asia/Tokyo" , 0x01F91A }, + { "Asia/Ujung_Pandang" , 0x01F9A4 }, + { "Asia/Ulaanbaatar" , 0x01FA21 }, + { "Asia/Ulan_Bator" , 0x01FB7C }, + { "Asia/Urumqi" , 0x01FCC9 }, + { "Asia/Ust-Nera" , 0x01FD2B }, + { "Asia/Vientiane" , 0x01FF3D }, + { "Asia/Vladivostok" , 0x01FFB5 }, + { "Asia/Yakutsk" , 0x02019F }, + { "Asia/Yekaterinburg" , 0x020389 }, + { "Asia/Yerevan" , 0x0205AA }, + { "Atlantic/Azores" , 0x0207AA }, + { "Atlantic/Bermuda" , 0x020CAD }, + { "Atlantic/Canary" , 0x020F8E }, + { "Atlantic/Cape_Verde" , 0x021264 }, + { "Atlantic/Faeroe" , 0x0212DD }, + { "Atlantic/Faroe" , 0x021581 }, + { "Atlantic/Jan_Mayen" , 0x021825 }, + { "Atlantic/Madeira" , 0x021B57 }, + { "Atlantic/Reykjavik" , 0x022060 }, + { "Atlantic/South_Georgia" , 0x022219 }, + { "Atlantic/St_Helena" , 0x02242B }, + { "Atlantic/Stanley" , 0x02225D }, + { "Australia/ACT" , 0x022480 }, + { "Australia/Adelaide" , 0x0227A3 }, + { "Australia/Brisbane" , 0x022AD5 }, + { "Australia/Broken_Hill" , 0x022BA2 }, + { "Australia/Canberra" , 0x022EE6 }, + { "Australia/Currie" , 0x023209 }, + { "Australia/Darwin" , 0x023542 }, + { "Australia/Eucla" , 0x0235CE }, + { "Australia/Hobart" , 0x0236AA }, + { "Australia/LHI" , 0x023A0E }, + { "Australia/Lindeman" , 0x023CAF }, + { "Australia/Lord_Howe" , 0x023D96 }, + { "Australia/Melbourne" , 0x024047 }, + { "Australia/North" , 0x024372 }, + { "Australia/NSW" , 0x0243EC }, + { "Australia/Perth" , 0x02470F }, + { "Australia/Queensland" , 0x0247ED }, + { "Australia/South" , 0x02489F }, + { "Australia/Sydney" , 0x024BC2 }, + { "Australia/Tasmania" , 0x024F05 }, + { "Australia/Victoria" , 0x025250 }, + { "Australia/West" , 0x025573 }, + { "Australia/Yancowinna" , 0x02562F }, + { "Brazil/Acre" , 0x025957 }, + { "Brazil/DeNoronha" , 0x025A5B }, + { "Brazil/East" , 0x025B7B }, + { "Brazil/West" , 0x025E58 }, + { "Canada/Atlantic" , 0x025F50 }, + { "Canada/Central" , 0x026438 }, + { "Canada/East-Saskatchewan" , 0x026D42 }, + { "Canada/Eastern" , 0x026852 }, + { "Canada/Mountain" , 0x026ECB }, + { "Canada/Newfoundland" , 0x027241 }, + { "Canada/Pacific" , 0x02776C }, + { "Canada/Saskatchewan" , 0x027B85 }, + { "Canada/Yukon" , 0x027D0E }, + { "CET" , 0x028011 }, + { "Chile/Continental" , 0x02831A }, + { "Chile/EasterIsland" , 0x0286B5 }, + { "CST6CDT" , 0x0289F7 }, + { "Cuba" , 0x028D48 }, + { "EET" , 0x0290BB }, + { "Egypt" , 0x02936E }, + { "Eire" , 0x029755 }, + { "EST" , 0x029C66 }, + { "EST5EDT" , 0x029CAA }, + { "Etc/GMT" , 0x029FFB }, + { "Etc/GMT+0" , 0x02A0C7 }, + { "Etc/GMT+1" , 0x02A151 }, + { "Etc/GMT+10" , 0x02A1DE }, + { "Etc/GMT+11" , 0x02A26C }, + { "Etc/GMT+12" , 0x02A2FA }, + { "Etc/GMT+2" , 0x02A415 }, + { "Etc/GMT+3" , 0x02A4A1 }, + { "Etc/GMT+4" , 0x02A52D }, + { "Etc/GMT+5" , 0x02A5B9 }, + { "Etc/GMT+6" , 0x02A645 }, + { "Etc/GMT+7" , 0x02A6D1 }, + { "Etc/GMT+8" , 0x02A75D }, + { "Etc/GMT+9" , 0x02A7E9 }, + { "Etc/GMT-0" , 0x02A083 }, + { "Etc/GMT-1" , 0x02A10B }, + { "Etc/GMT-10" , 0x02A197 }, + { "Etc/GMT-11" , 0x02A225 }, + { "Etc/GMT-12" , 0x02A2B3 }, + { "Etc/GMT-13" , 0x02A341 }, + { "Etc/GMT-14" , 0x02A388 }, + { "Etc/GMT-2" , 0x02A3CF }, + { "Etc/GMT-3" , 0x02A45B }, + { "Etc/GMT-4" , 0x02A4E7 }, + { "Etc/GMT-5" , 0x02A573 }, + { "Etc/GMT-6" , 0x02A5FF }, + { "Etc/GMT-7" , 0x02A68B }, + { "Etc/GMT-8" , 0x02A717 }, + { "Etc/GMT-9" , 0x02A7A3 }, + { "Etc/GMT0" , 0x02A03F }, + { "Etc/Greenwich" , 0x02A82F }, + { "Etc/UCT" , 0x02A873 }, + { "Etc/Universal" , 0x02A8B7 }, + { "Etc/UTC" , 0x02A8FB }, + { "Etc/Zulu" , 0x02A93F }, + { "Europe/Amsterdam" , 0x02A983 }, + { "Europe/Andorra" , 0x02ADC1 }, + { "Europe/Athens" , 0x02B03D }, + { "Europe/Belfast" , 0x02B380 }, + { "Europe/Belgrade" , 0x02B8B7 }, + { "Europe/Berlin" , 0x02BB80 }, + { "Europe/Bratislava" , 0x02BEE4 }, + { "Europe/Brussels" , 0x02C216 }, + { "Europe/Bucharest" , 0x02C64D }, + { "Europe/Budapest" , 0x02C977 }, + { "Europe/Busingen" , 0x02CCE0 }, + { "Europe/Chisinau" , 0x02CF97 }, + { "Europe/Copenhagen" , 0x02D325 }, + { "Europe/Dublin" , 0x02D62F }, + { "Europe/Gibraltar" , 0x02DB40 }, + { "Europe/Guernsey" , 0x02DF97 }, + { "Europe/Helsinki" , 0x02E4CE }, + { "Europe/Isle_of_Man" , 0x02E784 }, + { "Europe/Istanbul" , 0x02ECBB }, + { "Europe/Jersey" , 0x02F0A8 }, + { "Europe/Kaliningrad" , 0x02F5DF }, + { "Europe/Kiev" , 0x02F84A }, + { "Europe/Lisbon" , 0x02FB66 }, + { "Europe/Ljubljana" , 0x03006A }, + { "Europe/London" , 0x030333 }, + { "Europe/Luxembourg" , 0x03086A }, + { "Europe/Madrid" , 0x030CC0 }, + { "Europe/Malta" , 0x031086 }, + { "Europe/Mariehamn" , 0x03143F }, + { "Europe/Minsk" , 0x0316F5 }, + { "Europe/Monaco" , 0x031903 }, + { "Europe/Moscow" , 0x031D3E }, + { "Europe/Nicosia" , 0x031F98 }, + { "Europe/Oslo" , 0x032280 }, + { "Europe/Paris" , 0x0325B2 }, + { "Europe/Podgorica" , 0x0329F8 }, + { "Europe/Prague" , 0x032CC1 }, + { "Europe/Riga" , 0x032FF3 }, + { "Europe/Rome" , 0x033338 }, + { "Europe/Samara" , 0x0336FB }, + { "Europe/San_Marino" , 0x033964 }, + { "Europe/Sarajevo" , 0x033D27 }, + { "Europe/Simferopol" , 0x033FF0 }, + { "Europe/Skopje" , 0x034241 }, + { "Europe/Sofia" , 0x03450A }, + { "Europe/Stockholm" , 0x034812 }, + { "Europe/Tallinn" , 0x034AC1 }, + { "Europe/Tirane" , 0x034DFB }, + { "Europe/Tiraspol" , 0x035101 }, + { "Europe/Uzhgorod" , 0x03548F }, + { "Europe/Vaduz" , 0x0357A6 }, + { "Europe/Vatican" , 0x035A55 }, + { "Europe/Vienna" , 0x035E18 }, + { "Europe/Vilnius" , 0x036145 }, + { "Europe/Volgograd" , 0x036484 }, + { "Europe/Warsaw" , 0x0366A5 }, + { "Europe/Zagreb" , 0x036A86 }, + { "Europe/Zaporozhye" , 0x036D4F }, + { "Europe/Zurich" , 0x037090 }, + { "Factory" , 0x03733F }, + { "GB" , 0x0373B0 }, + { "GB-Eire" , 0x0378E7 }, + { "GMT" , 0x037E1E }, + { "GMT+0" , 0x037EEA }, + { "GMT-0" , 0x037EA6 }, + { "GMT0" , 0x037E62 }, + { "Greenwich" , 0x037F2E }, + { "Hongkong" , 0x037F72 }, + { "HST" , 0x038134 }, + { "Iceland" , 0x038178 }, + { "Indian/Antananarivo" , 0x038331 }, + { "Indian/Chagos" , 0x0383A5 }, + { "Indian/Christmas" , 0x038407 }, + { "Indian/Cocos" , 0x03844B }, + { "Indian/Comoro" , 0x03848F }, + { "Indian/Kerguelen" , 0x0384E4 }, + { "Indian/Mahe" , 0x038539 }, + { "Indian/Maldives" , 0x03858E }, + { "Indian/Mauritius" , 0x0385E3 }, + { "Indian/Mayotte" , 0x038659 }, + { "Indian/Reunion" , 0x0386AE }, + { "Iran" , 0x038703 }, + { "Israel" , 0x038971 }, + { "Jamaica" , 0x038CA0 }, + { "Japan" , 0x038D65 }, + { "Kwajalein" , 0x038DEF }, + { "Libya" , 0x038E52 }, + { "MET" , 0x038F5B }, + { "Mexico/BajaNorte" , 0x039264 }, + { "Mexico/BajaSur" , 0x0395CD }, + { "Mexico/General" , 0x039812 }, + { "MST" , 0x039A70 }, + { "MST7MDT" , 0x039AB4 }, + { "Navajo" , 0x039E05 }, + { "NZ" , 0x03A17E }, + { "NZ-CHAT" , 0x03A4FC }, + { "Pacific/Apia" , 0x03A7E0 }, + { "Pacific/Auckland" , 0x03A97C }, + { "Pacific/Chatham" , 0x03AD08 }, + { "Pacific/Chuuk" , 0x03AFFB }, + { "Pacific/Easter" , 0x03B054 }, + { "Pacific/Efate" , 0x03B3A3 }, + { "Pacific/Enderbury" , 0x03B469 }, + { "Pacific/Fakaofo" , 0x03B4D7 }, + { "Pacific/Fiji" , 0x03B528 }, + { "Pacific/Funafuti" , 0x03B6BB }, + { "Pacific/Galapagos" , 0x03B6FF }, + { "Pacific/Gambier" , 0x03B777 }, + { "Pacific/Guadalcanal" , 0x03B7DC }, + { "Pacific/Guam" , 0x03B831 }, + { "Pacific/Honolulu" , 0x03B887 }, + { "Pacific/Johnston" , 0x03B8FE }, + { "Pacific/Kiritimati" , 0x03B97D }, + { "Pacific/Kosrae" , 0x03B9E8 }, + { "Pacific/Kwajalein" , 0x03BA45 }, + { "Pacific/Majuro" , 0x03BAB1 }, + { "Pacific/Marquesas" , 0x03BB10 }, + { "Pacific/Midway" , 0x03BB77 }, + { "Pacific/Nauru" , 0x03BC01 }, + { "Pacific/Niue" , 0x03BC79 }, + { "Pacific/Norfolk" , 0x03BCD7 }, + { "Pacific/Noumea" , 0x03BD2C }, + { "Pacific/Pago_Pago" , 0x03BDBC }, + { "Pacific/Palau" , 0x03BE33 }, + { "Pacific/Pitcairn" , 0x03BE77 }, + { "Pacific/Pohnpei" , 0x03BECC }, + { "Pacific/Ponape" , 0x03BF21 }, + { "Pacific/Port_Moresby" , 0x03BF66 }, + { "Pacific/Rarotonga" , 0x03BFAA }, + { "Pacific/Saipan" , 0x03C086 }, + { "Pacific/Samoa" , 0x03C0E9 }, + { "Pacific/Tahiti" , 0x03C160 }, + { "Pacific/Tarawa" , 0x03C1C5 }, + { "Pacific/Tongatapu" , 0x03C219 }, + { "Pacific/Truk" , 0x03C2A5 }, + { "Pacific/Wake" , 0x03C2EA }, + { "Pacific/Wallis" , 0x03C33A }, + { "Pacific/Yap" , 0x03C37E }, + { "Poland" , 0x03C3C3 }, + { "Portugal" , 0x03C7A4 }, + { "PRC" , 0x03CCA0 }, + { "PST8PDT" , 0x03CD40 }, + { "ROC" , 0x03D091 }, + { "ROK" , 0x03D1C2 }, + { "Singapore" , 0x03D289 }, + { "Turkey" , 0x03D340 }, + { "UCT" , 0x03D72D }, + { "Universal" , 0x03D771 }, + { "US/Alaska" , 0x03D7B5 }, + { "US/Aleutian" , 0x03DB1E }, + { "US/Arizona" , 0x03DE84 }, + { "US/Central" , 0x03DF12 }, + { "US/East-Indiana" , 0x03E91C }, + { "US/Eastern" , 0x03E41D }, + { "US/Hawaii" , 0x03EB86 }, + { "US/Indiana-Starke" , 0x03EBF7 }, + { "US/Michigan" , 0x03EF68 }, + { "US/Mountain" , 0x03F29F }, + { "US/Pacific" , 0x03F618 }, + { "US/Pacific-New" , 0x03FA1D }, + { "US/Samoa" , 0x03FE22 }, + { "UTC" , 0x03FE99 }, + { "W-SU" , 0x040190 }, + { "WET" , 0x03FEDD }, + { "Zulu" , 0x0403D3 }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[263151] = { +const unsigned char timelib_timezone_db_data_builtin[263191] = { /* Africa/Abidjan */ @@ -698,8 +698,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Blantyre */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC3, 0xB0, -0x01, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x3E, 0xE2, 0x01, 0x48, 0x10, 0x60, 0x00, 0x00, 0x00, 0x00, @@ -713,10 +713,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Bujumbura */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77, 0xDA, -0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77, +0xDA, 0x00, 0x00, 0x00, 0x00, /* Africa/Cairo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -963,18 +964,17 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Gaborone */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0x82, 0x46, 0xCF, 0x68, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x15, 0x18, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x53, 0x41, 0x53, -0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34, 0x32, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34, +0x32, 0x00, 0x00, 0x00, 0x00, /* Africa/Harare */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC7, 0x64, -0x01, 0x00, 0x00, 0x1D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x1E, 0x1A, 0x01, 0x42, 0x09, 0x68, 0x00, 0x00, 0x00, 0x00, @@ -1040,8 +1040,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Kigali */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xBE, 0xF1, 0x0E, 0x50, -0x01, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x5A, 0x88, 0x01, 0x40, 0x89, 0x4A, 0x00, 0x00, 0x00, 0x00, @@ -1088,17 +1088,18 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Lubumbashi */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91, 0xAA, -0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, 0x65, -0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91, +0xAA, 0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, +0x65, 0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, /* Africa/Lusaka */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC9, 0xFC, -0x01, 0x00, 0x00, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0xCE, 0x1D, 0x01, 0x3D, 0xD0, 0xAD, 0x00, 0x00, 0x00, 0x00, @@ -1121,19 +1122,20 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Maseru */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xCA, 0xB8, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x19, 0xC8, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5, -0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, +0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, +0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5, 0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00, /* Africa/Mbabane */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xC7, 0x58, -0x01, 0x00, 0x00, 0x1D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42, -0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, +0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, +0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42, 0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, /* Africa/Mogadishu */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4056,7 +4058,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, +0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, @@ -8909,7 +8911,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Asia/Novokuznetsk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0xF9, 0x13, 0x40, +0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x18, 0x20, 0xC0, 0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10, 0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, 0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, @@ -8934,7 +8936,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x00, 0x15, 0x00, 0x00, 0x62, -0x70, 0x00, 0x15, 0x4E, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53, +0x70, 0x00, 0x15, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x58, 0x58, 0x01, 0x97, 0x96, 0x72, 0x00, 0x00, 0x00, 0x31, 0x4D, @@ -16412,7 +16414,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, +0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, @@ -18530,4 +18532,4 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2014.7", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2014.8", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index 7231dff093..40fbd6805a 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c index 9870313fbc..93c4126d14 100644 --- a/ext/date/lib/unixtime2tm.c +++ b/ext/date/lib/unixtime2tm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/php_date.c b/ext/date/php_date.c index cf3f6214a5..360c6d3f67 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -999,7 +999,7 @@ PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D) /* {{{ date() and gmdate() data */ -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" static char *mon_full_names[] = { "January", "February", "March", "April", @@ -2220,7 +2220,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */ abs(utc_offset / 60), abs((utc_offset % 60))); - ZVAL_STR(&zv, tmpstr); + ZVAL_NEW_STR(&zv, tmpstr); } break; case TIMELIB_ZONETYPE_ABBR: @@ -2312,7 +2312,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /* abs(tzobj->tzi.utc_offset / 60), abs((tzobj->tzi.utc_offset % 60))); - ZVAL_STR(&zv, tmpstr); + ZVAL_NEW_STR(&zv, tmpstr); } break; case TIMELIB_ZONETYPE_ABBR: @@ -4496,12 +4496,12 @@ PHP_FUNCTION(timezone_abbreviations_list) do { array_init(&element); - add_assoc_bool(&element, "dst", entry->type); - add_assoc_long(&element, "offset", entry->gmtoffset); + add_assoc_bool_ex(&element, "dst", sizeof("dst") -1, entry->type); + add_assoc_long_ex(&element, "offset", sizeof("offset") - 1, entry->gmtoffset); if (entry->full_tz_name) { - add_assoc_string(&element, "timezone_id", entry->full_tz_name); + add_assoc_string_ex(&element, "timezone_id", sizeof("timezone_id") - 1, entry->full_tz_name); } else { - add_assoc_null(&element, "timezone_id"); + add_assoc_null_ex(&element, "timezone_id", sizeof("timezone_id") - 1); } abbr_array_p = zend_hash_str_find(HASH_OF(return_value), entry->name, strlen(entry->name)); diff --git a/ext/date/php_date.h b/ext/date/php_date.h index ad82666cd7..aa46aa1b6c 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/date/tests/bug67118.phpt b/ext/date/tests/bug67118.phpt index 19b5914aa3..332142856e 100644 --- a/ext/date/tests/bug67118.phpt +++ b/ext/date/tests/bug67118.phpt @@ -23,4 +23,5 @@ class mydt extends datetime new mydt("Funktionsansvarig rådgivning och juridik", "UTC"); ?> --EXPECTF-- -Fatal error: Call to a member function format() on null in %sbug67118.php on line %d +Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %s on line %d +Bad date diff --git a/ext/date/tests/bug67118_2.phpt b/ext/date/tests/bug67118_2.phpt index 368d4d9401..9b6f545525 100644 --- a/ext/date/tests/bug67118_2.phpt +++ b/ext/date/tests/bug67118_2.phpt @@ -24,5 +24,12 @@ Done --EXPECTF-- First try Second try -NULL -Done
\ No newline at end of file +object(Foo)#1 (3) { + ["date"]=> + string(26) "2007-09-12 15:49:12.000000" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +} +Done diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 6bb98e24b5..de4ea4c464 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -470,19 +470,19 @@ ZEND_INI_MH(OnUpdateDefaultHandler) { dba_handler *hptr; - if (!strlen(new_value)) { + if (!new_value->len) { DBA_G(default_hptr) = NULL; - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } - for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value); hptr++); + for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value->val); hptr++); if (!hptr->name) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value->val); return FAILURE; } DBA_G(default_hptr) = hptr; - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } PHP_INI_BEGIN() @@ -519,7 +519,7 @@ PHP_MSHUTDOWN_FUNCTION(dba) } /* }}} */ -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" /* {{{ PHP_MINFO_FUNCTION */ diff --git a/ext/dba/dba.dsp b/ext/dba/dba.dsp deleted file mode 100644 index ddfd1485a9..0000000000 --- a/ext/dba/dba.dsp +++ /dev/null @@ -1,213 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dba" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=dba - Win32 Debug_TS Berkeley DB3
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "dba.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "dba.mak" CFG="dba - Win32 Debug_TS Berkeley DB3"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "dba - Win32 Release_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "dba - Win32 Debug_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "dba - Win32 Release_TS Berkeley DB3"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_DB3=1 /D DB3_INCLUDE_FILE="db.h" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D DBA_DB3=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php5ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "dba - Win32 Debug_TS Berkeley DB3"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D "DBA_DB3" /D DB3_INCLUDE_FILE="db.h" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "DBA_DB3" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-# ADD LINK32 php5ts_debug.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "dba - Win32 Release_TS Berkeley DB3"
-# Name "dba - Win32 Debug_TS Berkeley DB3"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\libcdb\cdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\cdb_make.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_cdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_db2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_db3.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_dbm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_flatfile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_gdbm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_inifile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_ndbm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libflatfile\flatfile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libinifile\inifile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\uint32.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\libcdb\cdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\cdb_make.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libflatfile\flatfile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_cdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_db2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_db3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dba.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dbm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_flatfile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_gdbm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_inifile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_ndbm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\uint32.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libinifile\inifile.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c index 075aedb0c1..17419dcf2e 100644 --- a/ext/dba/dba_cdb.c +++ b/ext/dba/dba_cdb.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c index 8ee5d95f22..66fd58b151 100644 --- a/ext/dba/dba_db1.c +++ b/ext/dba/dba_db1.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c index 60aa37f93a..6643eebcde 100644 --- a/ext/dba/dba_db2.c +++ b/ext/dba/dba_db2.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c index 95a1e51fe0..3f31222d9e 100644 --- a/ext/dba/dba_db3.c +++ b/ext/dba/dba_db3.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c index 94a6c95e81..a9752a7bf6 100644 --- a/ext/dba/dba_db4.c +++ b/ext/dba/dba_db4.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c index f65a79bcc7..b369f11c70 100644 --- a/ext/dba/dba_dbm.c +++ b/ext/dba/dba_dbm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c index ee8eefa652..9be6e9be18 100644 --- a/ext/dba/dba_flatfile.c +++ b/ext/dba/dba_flatfile.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c index d2c4a2f367..bea2f4cf58 100644 --- a/ext/dba/dba_gdbm.c +++ b/ext/dba/dba_gdbm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index 6067e99154..aaae690344 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c index 417446759c..f7b33efd3f 100644 --- a/ext/dba/dba_ndbm.c +++ b/ext/dba/dba_ndbm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c index a32b7e9e97..023e5e9b27 100644 --- a/ext/dba/dba_qdbm.c +++ b/ext/dba/dba_qdbm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_tcadb.c b/ext/dba/dba_tcadb.c index 341e99fed6..99c10c2f07 100644 --- a/ext/dba/dba_tcadb.c +++ b/ext/dba/dba_tcadb.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c index d8c58372ba..c8caf8b8f2 100644 --- a/ext/dba/libcdb/cdb.c +++ b/ext/dba/libcdb/cdb.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h index c6ffd17949..4b4a7ff2ff 100644 --- a/ext/dba/libcdb/cdb.h +++ b/ext/dba/libcdb/cdb.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c index 2813336b40..b6236f085e 100644 --- a/ext/dba/libcdb/cdb_make.c +++ b/ext/dba/libcdb/cdb_make.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h index d43fceb6d8..d33fcb15da 100644 --- a/ext/dba/libcdb/cdb_make.h +++ b/ext/dba/libcdb/cdb_make.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c index d8152d5015..76e1bbeaf2 100644 --- a/ext/dba/libcdb/uint32.c +++ b/ext/dba/libcdb/uint32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h index b0e0b44002..5390291953 100644 --- a/ext/dba/libcdb/uint32.h +++ b/ext/dba/libcdb/uint32.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c index a1fce218ab..8eae2d2508 100644 --- a/ext/dba/libflatfile/flatfile.c +++ b/ext/dba/libflatfile/flatfile.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h index 7e9b1796cd..2cd8db3521 100644 --- a/ext/dba/libflatfile/flatfile.h +++ b/ext/dba/libflatfile/flatfile.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 218037ebe3..6b64872649 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h index e41dac0ca4..9de43b62f5 100644 --- a/ext/dba/libinifile/inifile.h +++ b/ext/dba/libinifile/inifile.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h index d4d4c62c4a..d19000cf0f 100644 --- a/ext/dba/php_dba.h +++ b/ext/dba/php_dba.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dba/php_tcadb.h b/ext/dba/php_tcadb.h index b718a172f8..209830a94c 100644 --- a/ext/dba/php_tcadb.h +++ b/ext/dba/php_tcadb.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/attr.c b/ext/dom/attr.c index b650774378..7cef0230a4 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index a126cec573..82af257c0a 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c index ea954f8905..aee54bb3d2 100644 --- a/ext/dom/characterdata.c +++ b/ext/dom/characterdata.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/comment.c b/ext/dom/comment.c index 050c3abf70..9015586fd9 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/document.c b/ext/dom/document.c index a63004d705..133572af3f 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index ac2c8e4ea8..d3055214f6 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c index 1193ed44d5..08b33242b1 100644 --- a/ext/dom/documenttype.c +++ b/ext/dom/documenttype.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -204,7 +204,7 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval TSRMLS_D if (ret_buf.s) { smart_str_0(&ret_buf); - ZVAL_STR(retval, ret_buf.s); + ZVAL_NEW_STR(retval, ret_buf.s); return SUCCESS; } } diff --git a/ext/dom/dom.dsp b/ext/dom/dom.dsp deleted file mode 100644 index f2ae5b1a76..0000000000 --- a/ext/dom/dom.dsp +++ /dev/null @@ -1,250 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dom" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=dom - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "dom.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "dom.mak" CFG="dom - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "dom - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "dom - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "dom - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D "LIBXML_THREAD_ENABLED" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 wsock32.lib php5ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386 /out:"..\..\Release_TS/php_dom.dll" /implib:"..\..\Release_TS/php_dom.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "dom - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D LIBXML_THREAD_ENABLED=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts_debug.lib ws2_32.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS\php_dom.dll" /implib:"..\..\Debug_TS/php_dom.lib" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "dom - Win32 Release_TS"
-# Name "dom - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\attr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\cdatasection.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\characterdata.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\comment.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\document.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\documentfragment.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\documenttype.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domconfiguration.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domerrorhandler.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domexception.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domimplementation.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domimplementationlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domimplementationsource.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domlocator.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domstringlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\element.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\entity.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\entityreference.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\namednodemap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\namelist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\node.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\nodelist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\notation.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dom.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\processinginstruction.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\string_extend.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\text.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\typeinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\userdatahandler.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\xpath.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\dom_ce.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dom_fe.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dom_properties.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dom.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\xml_common.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h index 0e1002536e..8e6a64ac85 100644 --- a/ext/dom/dom_ce.h +++ b/ext/dom/dom_ce.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h index b05c4aee42..67cf0d199d 100644 --- a/ext/dom/dom_fe.h +++ b/ext/dom/dom_fe.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c index 8b611b153d..ee892f3703 100644 --- a/ext/dom/dom_iterators.c +++ b/ext/dom/dom_iterators.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h index 60551bdca1..7e607f0a2e 100644 --- a/ext/dom/dom_properties.h +++ b/ext/dom/dom_properties.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c index 272fda8f8f..4c189606dc 100644 --- a/ext/dom/domconfiguration.c +++ b/ext/dom/domconfiguration.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c index cd35b326b7..2214c3f786 100644 --- a/ext/dom/domerror.c +++ b/ext/dom/domerror.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c index 78b75fe615..af73819ee1 100644 --- a/ext/dom/domerrorhandler.c +++ b/ext/dom/domerrorhandler.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c index b41b83c6cd..4696e87f21 100644 --- a/ext/dom/domexception.c +++ b/ext/dom/domexception.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index c9394afc39..ea2b784b3c 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c index 07479f52eb..b4d20172f0 100644 --- a/ext/dom/domimplementationlist.c +++ b/ext/dom/domimplementationlist.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c index 2e8a8d81b2..f3becc6454 100644 --- a/ext/dom/domimplementationsource.c +++ b/ext/dom/domimplementationsource.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c index 4e01b3a443..8fdd326fcc 100644 --- a/ext/dom/domlocator.c +++ b/ext/dom/domlocator.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c index a12d8633ac..6e8bc05bac 100644 --- a/ext/dom/domstringlist.c +++ b/ext/dom/domstringlist.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/element.c b/ext/dom/element.c index 03895280c4..0aff19561a 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/entity.c b/ext/dom/entity.c index 1e229c4bd9..e0625fdd72 100644 --- a/ext/dom/entity.c +++ b/ext/dom/entity.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index 4e020db124..1c3e60e4f1 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index 3d5dbe499e..ab314851be 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c index 02b63af9ff..3f0b8e1640 100644 --- a/ext/dom/namelist.c +++ b/ext/dom/namelist.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/node.c b/ext/dom/node.c index 5868783565..b2079ffda2 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index a049491aee..68292d1983 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/notation.c b/ext/dom/notation.c index dc63f1516d..b26608adcf 100644 --- a/ext/dom/notation.c +++ b/ext/dom/notation.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 7f1c19bd0e..8a00ad5a08 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 628a19e978..9162031a90 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index a2bb1bd09f..a42cc9508b 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c index 3d65a84bad..75680089a4 100644 --- a/ext/dom/string_extend.c +++ b/ext/dom/string_extend.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/text.c b/ext/dom/text.c index bb7ee2e99c..1cefa665aa 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c index 5a437dc332..5267ee6f77 100644 --- a/ext/dom/typeinfo.c +++ b/ext/dom/typeinfo.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c index 6bddff6e73..e0b8756aa8 100644 --- a/ext/dom/userdatahandler.c +++ b/ext/dom/userdatahandler.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h index ed3d79b8a8..9d5ffe8fb6 100644 --- a/ext/dom/xml_common.h +++ b/ext/dom/xml_common.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index 107994f972..336365e342 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index ba91f9b44c..ca33700982 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index c1d92ba4e7..c626fef5c7 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h index d34d19855f..f1c2676772 100644 --- a/ext/ereg/php_ereg.h +++ b/ext/ereg/php_ereg.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ereg/php_regex.h b/ext/ereg/php_regex.h index bb83b89fc9..3fd5a663a1 100644 --- a/ext/ereg/php_regex.h +++ b/ext/ereg/php_regex.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ereg/regex/regex.dsp b/ext/ereg/regex/regex.dsp deleted file mode 100644 index e8f1ad4299..0000000000 --- a/ext/ereg/regex/regex.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="regex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=regex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "regex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "regex - Win32 Release" -# Name "regex - Win32 Debug" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Target -# End Project diff --git a/ext/ereg/regex/regex.dsw b/ext/ereg/regex/regex.dsw deleted file mode 100644 index 7b7df8126c..0000000000 --- a/ext/ereg/regex/regex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "regex"=.\regex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/ext/exif/exif.c b/ext/exif/exif.c index fe60a3d8d4..42f8a24102 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/exif/exif.dsp b/ext/exif/exif.dsp deleted file mode 100644 index 4a827338b2..0000000000 --- a/ext/exif/exif.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="exif" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=exif - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "exif.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "exif.mak" CFG="exif - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "exif - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "exif - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "exif - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_exif.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "exif - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_exif.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "exif - Win32 Release_TS"
-# Name "exif - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\exif.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_exif.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h index e0326752e6..8c2c207fa9 100644 --- a/ext/exif/php_exif.h +++ b/ext/exif/php_exif.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ext_skel b/ext/ext_skel index e6b01fd4fc..c0c398d15e 100755 --- a/ext/ext_skel +++ b/ext/ext_skel @@ -156,12 +156,12 @@ if test "\$PHP_$EXTNAME" != "no"; then dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL, dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD) + dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD) dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ]) dnl ],[ dnl AC_MSG_ERROR([wrong $extname lib version or lib not found]) dnl ],[ - dnl -L\$${EXTNAME}_DIR/lib -lm + dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm dnl ]) dnl dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD) diff --git a/ext/ext_skel_win32.php b/ext/ext_skel_win32.php index c04f037657..770c6f48bb 100644 --- a/ext/ext_skel_win32.php +++ b/ext/ext_skel_win32.php @@ -35,20 +35,6 @@ foreach($argv as $arg) { } } -$fp = fopen("$skel/skeleton.dsp", "rb"); -if ($fp) { - $dsp_file = fread($fp, filesize("$skel/skeleton.dsp")); - fclose($fp); - - $dsp_file = str_replace("extname", $extname, $dsp_file); - $dsp_file = str_replace("EXTNAME", strtoupper($extname), $dsp_file); - $fp = fopen("$extname/$extname.dsp", "wb"); - if ($fp) { - fwrite($fp, $dsp_file); - fclose($fp); - } -} - $fp = fopen("$extname/$extname.php", "rb"); if ($fp) { $php_file = fread($fp, filesize("$extname/$extname.php")); @@ -62,4 +48,5 @@ if ($fp) { } } -?>
\ No newline at end of file +?> + diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 17edd2d40c..f365b38573 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index 41a3ac5239..c1dc5aa1fa 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -1272,7 +1272,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v) * the sign extension must have happened. */ case FILE_BYTE: - v = (char) v; + v = (signed char) v; break; case FILE_SHORT: case FILE_BESHORT: diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index 5fcc3a3c84..e626929c9e 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -1913,7 +1913,7 @@ convert_libmagic_pattern(zval *pattern, char *val, int len, int options) t->val[j]='\0'; t->len = j; - ZVAL_STR(pattern, t); + ZVAL_NEW_STR(pattern, t); } private int diff --git a/ext/fileinfo/php_fileinfo.h b/ext/fileinfo/php_fileinfo.h index 354ec7b284..d9c6c18c27 100644 --- a/ext/fileinfo/php_fileinfo.h +++ b/ext/fileinfo/php_fileinfo.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c index 49410dbfe6..5a0ea0777d 100644 --- a/ext/filter/callback_filter.c +++ b/ext/filter/callback_filter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 873a6f83b3..7ef65bc196 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h index 4eec7b9119..8c41d8811e 100644 --- a/ext/filter/filter_private.h +++ b/ext/filter/filter_private.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index cbefae9d70..c37df628d2 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h index e62ef8c677..126a0c6c8b 100644 --- a/ext/filter/php_filter.h +++ b/ext/filter/php_filter.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index ca3059cd26..083b5382b6 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -20,7 +20,7 @@ #include "php_filter.h" #include "filter_private.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" /* {{{ STRUCTS */ typedef unsigned long filter_map[256]; @@ -52,7 +52,7 @@ static void php_filter_encode_html(zval *value, const unsigned char *chars) smart_str_0(&str); zval_ptr_dtor(value); - ZVAL_STR(value, str.s); + ZVAL_NEW_STR(value, str.s); } static const unsigned char hexchars[] = "0123456789ABCDEF"; @@ -105,7 +105,7 @@ static void php_filter_encode_url(zval *value, const unsigned char* chars, const *p = '\0'; str->len = p - (unsigned char *)str->val; zval_ptr_dtor(value); - ZVAL_STR(value, str); + ZVAL_NEW_STR(value, str); } static void php_filter_strip(zval *value, zend_long flags) @@ -135,7 +135,7 @@ static void php_filter_strip(zval *value, zend_long flags) buf->val[c] = '\0'; buf->len = c; zval_ptr_dtor(value); - ZVAL_STR(value, buf); + ZVAL_NEW_STR(value, buf); } /* }}} */ @@ -174,7 +174,7 @@ static void filter_map_apply(zval *value, filter_map *map) buf->val[c] = '\0'; buf->len = c; zval_ptr_dtor(value); - ZVAL_STR(value, buf); + ZVAL_NEW_STR(value, buf); } /* }}} */ @@ -184,7 +184,7 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL) size_t new_len; unsigned char enc[256] = {0}; - if (IS_INTERNED(Z_STR_P(value))) { + if (!Z_REFCOUNTED_P(value)) { ZVAL_STRINGL(value, Z_STRVAL_P(value), Z_STRLEN_P(value)); } diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 27051677c9..a5341080b8 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index 57b3f663d7..f2051fe195 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 1a1961122e..32d8fb86e2 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h index fffe6bf2f5..bd8de97483 100644 --- a/ext/ftp/php_ftp.h +++ b/ext/ftp/php_ftp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 97e625742f..ade37aa575 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gd/gd.dsp b/ext/gd/gd.dsp deleted file mode 100644 index d7207562f8..0000000000 --- a/ext/gd/gd.dsp +++ /dev/null @@ -1,600 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=gd - Win32 Release_TS GD2
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gd.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gd.mak" CFG="gd - Win32 Release_TS GD2"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gd - Win32 Release_TS GD2" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "gd - Win32 Debug_TS GD2" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "gd___Win32_Release_TS_GD2_bundled"
-# PROP BASE Intermediate_Dir "gd___Win32_Release_TS_GD2_bundled"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php5ts.lib freetype2.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\zlib\Release"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "gd___Win32_Debug_TS_GD2_bundled"
-# PROP BASE Intermediate_Dir "gd___Win32_Debug_TS_GD2_bundled"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts_debug.lib libjpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php5ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\zlib\Debug"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "gd - Win32 Release_TS GD2"
-# Name "gd - Win32 Debug_TS GD2"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\gd.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\gdttf.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\gdcache.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\gdttf.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_gd.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "libgd"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 1"
-
-# PROP Default_Filter "*.c"
-# Begin Source File
-
-SOURCE=.\libgd\gd.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd2copypal.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_arc_f_buggy.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gd.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gd2.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gif_in.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gif_out.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io_dp.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io_file.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io_ss.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_jpeg.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_png.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_ss.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_topal.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_wbmp.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdcache.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontg.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontl.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontmb.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfonts.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontt.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdft.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdhelpers.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdkanji.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdtables.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdxpm.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\wbmp.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\xbm.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files No. 1"
-
-# PROP Default_Filter "*.h"
-# Begin Source File
-
-SOURCE=.\libgd\gd.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdcache.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontg.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontmb.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfonts.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontt.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdhelpers.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\jisx0208.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\wbmp.h
-# End Source File
-# End Group
-# End Group
-# End Target
-# End Project
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c index 5c378ffb0f..0b79cb6f0d 100644 --- a/ext/gd/gd_ctx.c +++ b/ext/gd/gd_ctx.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c index d6fdd7d086..5a7d016ee8 100644 --- a/ext/gd/libgd/xbm.c +++ b/ext/gd/libgd/xbm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index 1f32a8f9b1..7510b2425d 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gd/tests/bug48801_1.phpt b/ext/gd/tests/bug48801_1.phpt index ef2aa1dba7..0ab6d7cdd9 100644 --- a/ext/gd/tests/bug48801_1.phpt +++ b/ext/gd/tests/bug48801_1.phpt @@ -1,13 +1,12 @@ --TEST-- -Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 and < 2.4.12 +Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 --SKIPIF-- <?php if(!extension_loaded('gd')){ die('skip gd extension not available'); } if(!function_exists('imageftbbox')) die('skip imageftbbox() not available'); include dirname(__FILE__) . '/func.inc'; - if(version_compare(get_freetype_version(), '2.4.10') < 0) die('skip for freetype >= 2.4.10'); - if(version_compare(get_freetype_version(), '2.4.12') >= 0) die('skip for freetype < 2.4.12'); + if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10'); ?> --FILE-- <?php @@ -21,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n"; ?> --EXPECTF-- (-1, 15) -(156, 15) -(156, -48) +(15%d, 15) +(15%d, -48) (-1, -48) diff --git a/ext/gd/tests/bug48801_2.phpt b/ext/gd/tests/bug48801_2.phpt deleted file mode 100644 index b2a719fa02..0000000000 --- a/ext/gd/tests/bug48801_2.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.12 ---SKIPIF-- -<?php - if(!extension_loaded('gd')){ die('skip gd extension not available'); } - if(!function_exists('imageftbbox')) die('skip imageftbbox() not available'); - - include dirname(__FILE__) . '/func.inc'; - if(version_compare(get_freetype_version(), '2.4.12') < 0) die('skip for freetype >= 2.4.12'); -?> ---FILE-- -<?php -$cwd = dirname(__FILE__); -$font = "$cwd/Tuffy.ttf"; -$bbox = imageftbbox(50, 0, $font, "image"); -echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n"; -echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n"; -echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n"; -echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n"; -?> ---EXPECTF-- -(-1, 15) -(155, 15) -(155, -48) -(-1, -48) diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 3f1909e753..938997a4a6 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gettext/gettext.dsp b/ext/gettext/gettext.dsp deleted file mode 100644 index 79ea194854..0000000000 --- a/ext/gettext/gettext.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gettext" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=gettext - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gettext.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gettext.mak" CFG="gettext - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gettext - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "gettext - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gettext - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /D HAVE_BIND_TEXTDOMAIN_CODESET=1 /D HAVE_NGETTEXT=1 /D HAVE_DNGETTEXT=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php5ts.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "gettext - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D HAVE_NGETTEXT=1 /D HAVE_DNGETTEXT=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /D HAVE_BIND_TEXTDOMAIN_CODESET=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
-# ADD LINK32 php5ts_debug.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "gettext - Win32 Release_TS"
-# Name "gettext - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\gettext.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_gettext.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h index f990d32af5..ab4f5fc764 100644 --- a/ext/gettext/php_gettext.h +++ b/ext/gettext/php_gettext.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4 index 2140aaf701..0388d548cf 100644 --- a/ext/gmp/config.m4 +++ b/ext/gmp/config.m4 @@ -1,7 +1,3 @@ -dnl -dnl $Id$ -dnl - PHP_ARG_WITH(gmp, for GNU MP support, [ --with-gmp[=DIR] Include GNU MP support]) @@ -15,14 +11,9 @@ if test "$PHP_GMP" != "no"; then AC_MSG_ERROR(Unable to locate gmp.h) fi - PHP_CHECK_LIBRARY(gmp, __gmp_randinit_lc_2exp_size, + PHP_CHECK_LIBRARY(gmp, __gmpz_rootrem, [],[ - PHP_CHECK_LIBRARY(gmp, gmp_randinit_lc_2exp_size, - [],[ - AC_MSG_ERROR([GNU MP Library version 4.1.2 or greater required.]) - ],[ - -L$GMP_DIR/$PHP_LIBDIR - ]) + AC_MSG_ERROR([GNU MP Library version 4.2 or greater required.]) ],[ -L$GMP_DIR/$PHP_LIBDIR ]) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 7eb9eef494..b5c18ecb37 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -25,7 +25,7 @@ #include "php_gmp.h" #include "ext/standard/info.h" #include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str_public.h" +#include "zend_smart_str_public.h" #include "zend_exceptions.h" #if HAVE_GMP @@ -224,16 +224,7 @@ typedef struct _gmp_temp { #define GMP_BIG_ENDIAN (1 << 3) #define GMP_NATIVE_ENDIAN (1 << 4) -#define GMP_42_OR_NEWER \ - ((__GNU_MP_VERSION >= 5) || (__GNU_MP_VERSION >= 4 && __GNU_MP_VERSION_MINOR >= 2)) - -/* The maximum base for input and output conversions is 62 from GMP 4.2 - * onwards. */ -#if GMP_42_OR_NEWER -# define MAX_BASE 62 -#else -# define MAX_BASE 36 -#endif +#define GMP_MAX_BASE 62 #define IS_GMP(zval) \ (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce TSRMLS_CC)) @@ -569,7 +560,7 @@ static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ } /* }}} */ -static int gmp_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ { mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(object); smart_str buf = {0}; @@ -596,7 +587,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len } /* }}} */ -static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ { mpz_ptr gmpnum; const unsigned char *p, *max; @@ -790,7 +781,7 @@ static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base) /* {{{ */ str->val[str->len] = '\0'; } - ZVAL_STR(result, str); + ZVAL_NEW_STR(result, str); } /* }}} */ @@ -1048,8 +1039,8 @@ ZEND_FUNCTION(gmp_init) return; } - if (base && (base < 2 || base > MAX_BASE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, MAX_BASE); + if (base && (base < 2 || base > GMP_MAX_BASE)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, GMP_MAX_BASE); RETURN_FALSE; } @@ -1204,15 +1195,10 @@ ZEND_FUNCTION(gmp_strval) return; } -#if MAX_BASE == 62 - /* Although the maximum base in general in GMP >= 4.2 is 62, mpz_get_str() + /* Although the maximum base in general in GMP is 62, mpz_get_str() * is explicitly limited to -36 when dealing with negative bases. */ - if ((base < 2 && base > -2) || base > MAX_BASE || base < -36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, MAX_BASE); -#else - if (base < 2 || base > MAX_BASE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, MAX_BASE); -#endif + if ((base < 2 && base > -2) || base > GMP_MAX_BASE || base < -36) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, GMP_MAX_BASE); RETURN_FALSE; } @@ -1596,14 +1582,7 @@ ZEND_FUNCTION(gmp_rootrem) add_next_index_zval(return_value, &result1); add_next_index_zval(return_value, &result2); -#if GMP_42_OR_NEWER mpz_rootrem(gmpnum_result1, gmpnum_result2, gmpnum_a, (gmp_ulong) nth); -#else - mpz_root(gmpnum_result1, gmpnum_a, (gmp_ulong) nth); - mpz_pow_ui(gmpnum_result2, gmpnum_result1, (gmp_ulong) nth); - mpz_sub(gmpnum_result2, gmpnum_a, gmpnum_result2); - mpz_abs(gmpnum_result2, gmpnum_result2); -#endif FREE_GMP_TEMP(temp_a); } @@ -1779,7 +1758,7 @@ ZEND_FUNCTION(gmp_random) if (!GMPG(rand_initialized)) { /* Initialize */ - gmp_randinit_lc_2exp_size(GMPG(rand_state), 32L); + gmp_randinit_mt(GMPG(rand_state)); /* Seed */ gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); @@ -1849,7 +1828,7 @@ ZEND_FUNCTION(gmp_setbit) if (index < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero"); - return; + RETURN_FALSE; } gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); @@ -1876,7 +1855,7 @@ ZEND_FUNCTION(gmp_clrbit) if (index < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero"); - return; + RETURN_FALSE; } gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h index bce2a9eaca..59485dd5b7 100644 --- a/ext/gmp/php_gmp.h +++ b/ext/gmp/php_gmp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/gmp/tests/bug50283.phpt b/ext/gmp/tests/bug50283.phpt index 13eef54804..561cd3d68c 100644 --- a/ext/gmp/tests/bug50283.phpt +++ b/ext/gmp/tests/bug50283.phpt @@ -2,7 +2,6 @@ Feature Request #50283 (allow base in gmp_strval to use full range: 2 to 62, and -2 to -36) --SKIPIF-- <?php if (!extension_loaded("gmp")) print "skip"; ?> -<?php if (version_compare(GMP_VERSION, "4.2.0", "<")) print "skip"; ?> --FILE-- <?php $a = gmp_init("0x41682179fbf5"); diff --git a/ext/gmp/tests/gmp_clrbit.phpt b/ext/gmp/tests/gmp_clrbit.phpt index 079d5d669f..0aab89dd37 100644 --- a/ext/gmp/tests/gmp_clrbit.phpt +++ b/ext/gmp/tests/gmp_clrbit.phpt @@ -10,7 +10,7 @@ gmp_clrbit($n, 0); var_dump(gmp_strval($n)); $n = gmp_init(-1); -gmp_clrbit($n, -1); +var_dump(gmp_clrbit($n, -1)); var_dump(gmp_strval($n)); $n = gmp_init("1000000"); @@ -35,10 +35,11 @@ gmp_clrbit(); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- string(1) "0" Warning: gmp_clrbit(): Index must be greater than or equal to zero in %s on line %d +bool(false) string(2) "-1" Warning: gmp_clrbit(): Index must be greater than or equal to zero in %s on line %d diff --git a/ext/gmp/tests/gmp_setbit.phpt b/ext/gmp/tests/gmp_setbit.phpt index 99848959d5..2eac23db0e 100644 --- a/ext/gmp/tests/gmp_setbit.phpt +++ b/ext/gmp/tests/gmp_setbit.phpt @@ -10,7 +10,7 @@ gmp_setbit($n, 10, -1); var_dump(gmp_strval($n)); $n = gmp_init(5); -gmp_setbit($n, -20, 0); +var_dump(gmp_setbit($n, -20, 0)); var_dump(gmp_strval($n)); $n = gmp_init(5); @@ -41,10 +41,11 @@ gmp_setbit($a,array()); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- string(2) "-1" Warning: gmp_setbit(): Index must be greater than or equal to zero in %s on line %d +bool(false) string(1) "5" string(1) "1" string(1) "7" diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 5a4529d0f5..406f074da3 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -287,7 +287,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename, php_hash_hmac_round((unsigned char *) digest->val, ops, context, K, (unsigned char *) digest->val, ops->digest_size); /* Zero the key */ - memset(K, 0, ops->block_size); + ZEND_SECURE_ZERO(K, ops->block_size); efree(K); efree(context); @@ -515,7 +515,7 @@ PHP_FUNCTION(hash_final) hash->ops->hash_final((unsigned char *) digest->val, hash->context); /* Zero the key */ - memset(hash->key, 0, hash->ops->block_size); + ZEND_SECURE_ZERO(hash->key, hash->ops->block_size); efree(hash->key); hash->key = NULL; } @@ -698,9 +698,9 @@ PHP_FUNCTION(hash_pbkdf2) memcpy(result + ((i - 1) * ops->digest_size), temp, ops->digest_size); } /* Zero potentially sensitive variables */ - memset(K1, 0, ops->block_size); - memset(K2, 0, ops->block_size); - memset(computed_salt, 0, salt_len + 4); + ZEND_SECURE_ZERO(K1, ops->block_size); + ZEND_SECURE_ZERO(K2, ops->block_size); + ZEND_SECURE_ZERO(computed_salt, salt_len + 4); efree(K1); efree(K2); efree(computed_salt); @@ -975,7 +975,7 @@ PHP_FUNCTION(mhash_keygen_s2k) } RETVAL_STRINGL(key, bytes); - memset(key, 0, bytes); + ZEND_SECURE_ZERO(key, bytes); efree(digest); efree(context); efree(key); diff --git a/ext/hash/hash_adler32.c b/ext/hash/hash_adler32.c index af5ff82de0..22ab2f29ac 100644 --- a/ext/hash/hash_adler32.c +++ b/ext/hash/hash_adler32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_crc32.c b/ext/hash/hash_crc32.c index 7e748df559..7e9a78e4a6 100644 --- a/ext/hash/hash_crc32.c +++ b/ext/hash/hash_crc32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_fnv.c b/ext/hash/hash_fnv.c index 1c92478259..8433678ba9 100644 --- a/ext/hash/hash_fnv.c +++ b/ext/hash/hash_fnv.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c index bda9579830..9fb8f2a5fb 100644 --- a/ext/hash/hash_gost.c +++ b/ext/hash/hash_gost.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -281,7 +281,7 @@ PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *context, const unsigned char *inp } memcpy(context->buffer, input + i, r); - memset(&context->buffer[r], 0, 32 - r); + ZEND_SECURE_ZERO(&context->buffer[r], 32 - r); context->length = r; } } @@ -306,7 +306,7 @@ PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context) digest[j + 3] = (unsigned char) ((context->state[i] >> 24) & 0xff); } - memset(context, 0, sizeof(*context)); + ZEND_SECURE_ZERO(context, sizeof(*context)); } const php_hash_ops php_hash_gost_ops = { diff --git a/ext/hash/hash_haval.c b/ext/hash/hash_haval.c index 32437cecdf..bc62954e6f 100644 --- a/ext/hash/hash_haval.c +++ b/ext/hash/hash_haval.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -169,7 +169,7 @@ static void PHP_3HAVALTransform(php_hash_uint32 state[8], const unsigned char bl } /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); + ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x)); } /* }}} */ @@ -206,7 +206,7 @@ static void PHP_4HAVALTransform(php_hash_uint32 state[8], const unsigned char bl } /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); + ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x)); } /* }}} */ @@ -245,7 +245,7 @@ static void PHP_5HAVALTransform(php_hash_uint32 state[8], const unsigned char bl } /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); + ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x)); } /* }}} */ @@ -368,7 +368,7 @@ PHP_HASH_API void PHP_HAVAL128Final(unsigned char *digest, PHP_HAVAL_CTX * conte /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -422,7 +422,7 @@ PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * conte /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -462,7 +462,7 @@ PHP_HASH_API void PHP_HAVAL192Final(unsigned char *digest, PHP_HAVAL_CTX * conte /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -503,7 +503,7 @@ PHP_HASH_API void PHP_HAVAL224Final(unsigned char *digest, PHP_HAVAL_CTX * conte /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -537,7 +537,7 @@ PHP_HASH_API void PHP_HAVAL256Final(unsigned char *digest, PHP_HAVAL_CTX * conte /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ diff --git a/ext/hash/hash_joaat.c b/ext/hash/hash_joaat.c index cfeab863de..84f65b7609 100644 --- a/ext/hash/hash_joaat.c +++ b/ext/hash/hash_joaat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c index 92f97ee506..98891f3b77 100644 --- a/ext/hash/hash_md.c +++ b/ext/hash/hash_md.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -344,7 +344,7 @@ PHP_HASH_API void PHP_MD5Final(unsigned char digest[16], PHP_MD5_CTX * context) /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -437,7 +437,7 @@ const unsigned char block[64]; state[3] += d; /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); + ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x)); } /* }}} */ @@ -602,7 +602,7 @@ PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX * context) /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ diff --git a/ext/hash/hash_ripemd.c b/ext/hash/hash_ripemd.c index 16fbd12b18..740cb78220 100644 --- a/ext/hash/hash_ripemd.c +++ b/ext/hash/hash_ripemd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -244,7 +244,7 @@ static void RIPEMD128Transform(php_hash_uint32 state[4], const unsigned char blo state[0] = tmp; tmp = 0; - memset(x, 0, sizeof(x)); + ZEND_SECURE_ZERO(x, sizeof(x)); } /* }}} */ @@ -342,7 +342,7 @@ static void RIPEMD256Transform(php_hash_uint32 state[8], const unsigned char blo state[7] += dd; tmp = 0; - memset(x, 0, sizeof(x)); + ZEND_SECURE_ZERO(x, sizeof(x)); } /* }}} */ @@ -441,7 +441,7 @@ static void RIPEMD160Transform(php_hash_uint32 state[5], const unsigned char blo state[0] = tmp; tmp = 0; - memset(x, 0, sizeof(x)); + ZEND_SECURE_ZERO(x, sizeof(x)); } /* }}} */ @@ -549,7 +549,7 @@ static void RIPEMD320Transform(php_hash_uint32 state[10], const unsigned char bl state[9] += ee; tmp = 0; - memset(x, 0, sizeof(x)); + ZEND_SECURE_ZERO(x, sizeof(x)); } /* }}} */ @@ -650,7 +650,7 @@ PHP_HASH_API void PHP_RIPEMD128Final(unsigned char digest[16], PHP_RIPEMD128_CTX /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -687,7 +687,7 @@ PHP_HASH_API void PHP_RIPEMD256Final(unsigned char digest[32], PHP_RIPEMD256_CTX /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -724,7 +724,7 @@ PHP_HASH_API void PHP_RIPEMD160Final(unsigned char digest[20], PHP_RIPEMD160_CTX /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -761,7 +761,7 @@ PHP_HASH_API void PHP_RIPEMD320Final(unsigned char digest[40], PHP_RIPEMD320_CTX /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c index d60a7a9780..003f05a774 100644 --- a/ext/hash/hash_sha.c +++ b/ext/hash/hash_sha.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -321,7 +321,7 @@ static void SHA1Transform(php_hash_uint32 state[5], const unsigned char block[64 state[4] += e; /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); + ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x)); } /* }}} */ @@ -400,7 +400,7 @@ PHP_HASH_API void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -511,7 +511,7 @@ static void SHA256Transform(php_hash_uint32 state[8], const unsigned char block[ state[7] += h; /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); + ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x)); } /* }}} */ @@ -607,7 +607,7 @@ PHP_HASH_API void PHP_SHA224Final(unsigned char digest[28], PHP_SHA224_CTX * con /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -684,7 +684,7 @@ PHP_HASH_API void PHP_SHA256Final(unsigned char digest[32], PHP_SHA256_CTX * con /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -821,7 +821,7 @@ static void SHA512Transform(php_hash_uint64 state[8], const unsigned char block[ state[7] += h; /* Zeroize sensitive information. */ - memset((unsigned char*) x, 0, sizeof(x)); + ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x)); } /* }}} */ @@ -906,7 +906,7 @@ PHP_HASH_API void PHP_SHA384Final(unsigned char digest[48], PHP_SHA384_CTX * con /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ @@ -1020,7 +1020,7 @@ PHP_HASH_API void PHP_SHA512Final(unsigned char digest[64], PHP_SHA512_CTX * con /* Zeroize sensitive information. */ - memset((unsigned char*) context, 0, sizeof(*context)); + ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ diff --git a/ext/hash/hash_snefru.c b/ext/hash/hash_snefru.c index 2cf37998ad..c35fee3c29 100644 --- a/ext/hash/hash_snefru.c +++ b/ext/hash/hash_snefru.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -166,7 +166,7 @@ PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *context, const unsigned char } memcpy(context->buffer, input + i, r); - memset(&context->buffer[r], 0, 32 - r); + ZEND_SECURE_ZERO(&context->buffer[r], 32 - r); context->length = r; } } @@ -190,7 +190,7 @@ PHP_HASH_API void PHP_SNEFRUFinal(unsigned char digest[32], PHP_SNEFRU_CTX *cont digest[j + 3] = (unsigned char) (context->state[i] & 0xff); } - memset(context, 0, sizeof(*context)); + ZEND_SECURE_ZERO(context, sizeof(*context)); } const php_hash_ops php_hash_snefru_ops = { diff --git a/ext/hash/hash_tiger.c b/ext/hash/hash_tiger.c index 78f932a745..78f42b3ec7 100644 --- a/ext/hash/hash_tiger.c +++ b/ext/hash/hash_tiger.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -207,7 +207,7 @@ PHP_HASH_API void PHP_TIGERUpdate(PHP_TIGER_CTX *context, const unsigned char *i i = 64 - context->length; memcpy(&context->buffer[context->length], input, i); tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state); - memset(context->buffer, 0, 64); + ZEND_SECURE_ZERO(context->buffer, 64); context->passed += 512; } @@ -216,7 +216,7 @@ PHP_HASH_API void PHP_TIGERUpdate(PHP_TIGER_CTX *context, const unsigned char *i tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state); context->passed += 512; } - memset(&context->buffer[r], 0, 64-r); + ZEND_SECURE_ZERO(&context->buffer[r], 64-r); memcpy(context->buffer, &input[i], r); context->length = r; } @@ -226,21 +226,21 @@ PHP_HASH_API void PHP_TIGER128Final(unsigned char digest[16], PHP_TIGER_CTX *con { TigerFinalize(context); TigerDigest(digest, 16, context); - memset(context, 0, sizeof(*context)); + ZEND_SECURE_ZERO(context, sizeof(*context)); } PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX *context) { TigerFinalize(context); TigerDigest(digest, 20, context); - memset(context, 0, sizeof(*context)); + ZEND_SECURE_ZERO(context, sizeof(*context)); } PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *context) { TigerFinalize(context); TigerDigest(digest, 24, context); - memset(context, 0, sizeof(*context)); + ZEND_SECURE_ZERO(context, sizeof(*context)); } #define PHP_HASH_TIGER_OPS(p, b) \ diff --git a/ext/hash/hash_whirlpool.c b/ext/hash/hash_whirlpool.c index ca41e523d0..b20dc82c17 100644 --- a/ext/hash/hash_whirlpool.c +++ b/ext/hash/hash_whirlpool.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -263,8 +263,8 @@ static void WhirlpoolTransform(PHP_WHIRLPOOL_CTX *context) context->state[5] ^= state[5] ^ block[5]; context->state[6] ^= state[6] ^ block[6]; context->state[7] ^= state[7] ^ block[7]; - - memset(state, 0, sizeof(state)); + + ZEND_SECURE_ZERO(state, sizeof(state)); } PHP_HASH_API void PHP_WHIRLPOOLInit(PHP_WHIRLPOOL_CTX *context) @@ -430,7 +430,7 @@ PHP_HASH_API void PHP_WHIRLPOOLFinal(unsigned char digest[64], PHP_WHIRLPOOL_CTX digest += 8; } - memset(context, 0, sizeof(*context)); + ZEND_SECURE_ZERO(context, sizeof(*context)); } const php_hash_ops php_hash_whirlpool_ops = { diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index d6905cfbd5..0fd0490f61 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_adler32.h b/ext/hash/php_hash_adler32.h index ca78b38a13..73ef1067a1 100644 --- a/ext/hash/php_hash_adler32.h +++ b/ext/hash/php_hash_adler32.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_crc32.h b/ext/hash/php_hash_crc32.h index cc61243c30..fbd39e93df 100644 --- a/ext/hash/php_hash_crc32.h +++ b/ext/hash/php_hash_crc32.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_crc32_tables.h b/ext/hash/php_hash_crc32_tables.h index 30f5602287..889e4f667f 100644 --- a/ext/hash/php_hash_crc32_tables.h +++ b/ext/hash/php_hash_crc32_tables.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_fnv.h b/ext/hash/php_hash_fnv.h index 10023fc618..40005f2ead 100644 --- a/ext/hash/php_hash_fnv.h +++ b/ext/hash/php_hash_fnv.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_gost.h b/ext/hash/php_hash_gost.h index cd3f9cfe90..f1fda06c72 100644 --- a/ext/hash/php_hash_gost.h +++ b/ext/hash/php_hash_gost.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_haval.h b/ext/hash/php_hash_haval.h index 4a37815daf..1fafe5742e 100644 --- a/ext/hash/php_hash_haval.h +++ b/ext/hash/php_hash_haval.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_joaat.h b/ext/hash/php_hash_joaat.h index 494e7eb09a..d722efcae6 100644 --- a/ext/hash/php_hash_joaat.h +++ b/ext/hash/php_hash_joaat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_md.h b/ext/hash/php_hash_md.h index 473abee66c..cfb696a323 100644 --- a/ext/hash/php_hash_md.h +++ b/ext/hash/php_hash_md.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_ripemd.h b/ext/hash/php_hash_ripemd.h index b564b3a17c..8eae0107b3 100644 --- a/ext/hash/php_hash_ripemd.h +++ b/ext/hash/php_hash_ripemd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_sha.h b/ext/hash/php_hash_sha.h index bd24fb0974..6517619f17 100644 --- a/ext/hash/php_hash_sha.h +++ b/ext/hash/php_hash_sha.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_snefru.h b/ext/hash/php_hash_snefru.h index 214edb1982..d36e34df47 100644 --- a/ext/hash/php_hash_snefru.h +++ b/ext/hash/php_hash_snefru.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_snefru_tables.h b/ext/hash/php_hash_snefru_tables.h index ef92453031..89fae8bd69 100644 --- a/ext/hash/php_hash_snefru_tables.h +++ b/ext/hash/php_hash_snefru_tables.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_tiger.h b/ext/hash/php_hash_tiger.h index fd602d6819..f8d6a738d7 100644 --- a/ext/hash/php_hash_tiger.h +++ b/ext/hash/php_hash_tiger.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_tiger_tables.h b/ext/hash/php_hash_tiger_tables.h index f3e726f80c..3cf9846803 100644 --- a/ext/hash/php_hash_tiger_tables.h +++ b/ext/hash/php_hash_tiger_tables.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_whirlpool.h b/ext/hash/php_hash_whirlpool.h index d28b1d927c..15882c6a07 100644 --- a/ext/hash/php_hash_whirlpool.h +++ b/ext/hash/php_hash_whirlpool.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_whirlpool_tables.h b/ext/hash/php_hash_whirlpool_tables.h index 4951636003..4599f82444 100644 --- a/ext/hash/php_hash_whirlpool_tables.h +++ b/ext/hash/php_hash_whirlpool_tables.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index e1bf9deede..d425f6cf1e 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -55,7 +55,7 @@ #undef iconv #endif -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/base64.h" #include "ext/standard/quot_print.h" @@ -415,7 +415,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c } if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) { - zend_long len; + size_t len; char *p = strstr(get_output_encoding(TSRMLS_C), "//"); if (p) { @@ -462,10 +462,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, if (in_p != NULL) { while (in_left > 0) { out_left = buf_growth - out_left; - { - size_t newlen; - smart_str_alloc((d), out_left, 0); - } + smart_str_alloc(d, out_left, 0); out_p = (d)->s->val + (d)->s->len; @@ -499,10 +496,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, } else { for (;;) { out_left = buf_growth - out_left; - { - size_t newlen; - smart_str_alloc((d), out_left, 0); - } + smart_str_alloc(d, out_left, 0); out_p = (d)->s->val + (d)->s->len; @@ -805,7 +799,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval, size_t out_left; size_t cnt; - zend_long total_len; + size_t total_len; err = _php_iconv_strlen(&total_len, str, nbytes, enc); if (err != PHP_ICONV_ERR_SUCCESS) { @@ -824,16 +818,16 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval, } } - if(len > total_len) { + if((size_t)len > total_len) { len = total_len; } - if (offset >= total_len) { + if ((size_t)offset >= total_len) { return PHP_ICONV_ERR_SUCCESS; } - if ((offset + len) > total_len ) { + if ((size_t)(offset + len) > total_len ) { /* trying to compute the length */ len = total_len - offset; } @@ -2076,7 +2070,7 @@ PHP_FUNCTION(iconv_substr) err = _php_iconv_substr(&retval, str->val, str->len, offset, length, charset); _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); - if (err == PHP_ICONV_ERR_SUCCESS && str->val != NULL && retval.s != NULL) { + if (err == PHP_ICONV_ERR_SUCCESS && str->val[0] != '\0' && retval.s != NULL) { RETURN_STR(retval.s); } smart_str_free(&retval); @@ -2761,7 +2755,7 @@ static int php_iconv_stream_filter_append_bucket( prev_ocnt = ocnt; } - if (out_buf_size - ocnt > 0) { + if (out_buf_size > ocnt) { if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { goto out_failure; } diff --git a/ext/iconv/iconv.dsp b/ext/iconv/iconv.dsp deleted file mode 100644 index 2d66cf00ab..0000000000 --- a/ext/iconv/iconv.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="iconv" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=iconv - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "iconv.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "iconv.mak" CFG="iconv - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "iconv - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "iconv - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "iconv - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "HAVE_ICONV" /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /D "ICONV_SUPPORTS_ERRNO" /D "HAVE_LIBICONV" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_iconv.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "iconv - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_ICONV" /D ZTS=1 /D "HAVE_LIBICONV" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_iconv.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "iconv - Win32 Release_TS"
-# Name "iconv - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\iconv.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_iconv.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h index 76e6758588..1a8330ae24 100644 --- a/ext/iconv/php_iconv.h +++ b/ext/iconv/php_iconv.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/imap/imap.dsp b/ext/imap/imap.dsp deleted file mode 100644 index ef05d49f20..0000000000 --- a/ext/imap/imap.dsp +++ /dev/null @@ -1,176 +0,0 @@ -# Microsoft Developer Studio Project File - Name="imap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=imap - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "imap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "imap.mak" CFG="imap - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "imap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "imap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "imap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "imap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "imap - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\IMAP\c-client" /I "..\..\TSRM" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /machine:I386 /out:"Release/php_imap.dll" /libpath:"..\..\Release" /libpath:"..\..\..\php_build\IMAP\C-Client"
-
-!ELSEIF "$(CFG)" == "imap - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\IMAP\c-client" /I "..\..\TSRM" /D "_DEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts_debug.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_imap.dll" /pdbtype:sept /libpath:"..\..\Debug" /libpath:"..\..\..\php_build\IMAP\C-Client"
-
-!ELSEIF "$(CFG)" == "imap - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "ZTS" /D "_DEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_imap.dll" /pdbtype:sept /libpath:"..\..\..\\" /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "imap - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\imap\c-client" /D "ZTS" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /D HAVE_IMAP2001=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib wsock32.lib winmm.lib cclient.lib Secur32.lib CertIdl.Lib /nologo /dll /machine:I386 /nodefaultlib:"LIBCMT" /out:"..\..\Release_TS/php_imap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\imap"
-# SUBTRACT LINK32 /nodefaultlib
-
-!ENDIF
-
-# Begin Target
-
-# Name "imap - Win32 Release"
-# Name "imap - Win32 Debug"
-# Name "imap - Win32 Debug_TS"
-# Name "imap - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_imap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\sendmail.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_imap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\sendmail.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\IMAP_Win32_HOWTO.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 3969a036fc..8dc56c5223 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -40,7 +40,7 @@ #include "ext/standard/php_string.h" #include "ext/standard/info.h" #include "ext/standard/file.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/pcre/php_pcre.h" #ifdef ERROR diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h index a823326cca..6f18181b53 100644 --- a/ext/imap/php_imap.h +++ b/ext/imap/php_imap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c index b188e54e4f..6ac44ffeb0 100644 --- a/ext/interbase/ibase_blobs.c +++ b/ext/interbase/ibase_blobs.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c index 63a838679d..5a64b31c75 100644 --- a/ext/interbase/ibase_events.c +++ b/ext/interbase/ibase_events.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c index 10d77449dc..2cd2ada65f 100644 --- a/ext/interbase/ibase_query.c +++ b/ext/interbase/ibase_query.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c index bdbec7d5b0..c068c8d56b 100644 --- a/ext/interbase/ibase_service.c +++ b/ext/interbase/ibase_service.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index a21e6469fa..59c4a0fa42 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/interbase/interbase.dsp b/ext/interbase/interbase.dsp deleted file mode 100644 index c151deb40c..0000000000 --- a/ext/interbase/interbase.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="interbase" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=interbase - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "interbase.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "interbase.mak" CFG="interbase - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "interbase - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "interbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName "interbase"
-# PROP Scc_LocalPath "."
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "interbase - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib php5ts_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib gds32_ms.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_interbase.dll" /pdbtype:sept /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "interbase - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D ZEND_DEBUG=0 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib gds32_ms.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_interbase.dll" /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "interbase - Win32 Debug_TS"
-# Name "interbase - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ibase_blobs.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ibase_events.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ibase_query.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ibase_service.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\interbase.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_interbase.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\interbase.rc
-# ADD BASE RSC /l 0x413
-# ADD RSC /l 0x413 /i "..\..\main" /i "..\..\win32" /d "PHP_H"
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h index a51f44c034..8e80505c17 100644 --- a/ext/interbase/php_ibase_includes.h +++ b/ext/interbase/php_ibase_includes.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c index 5a53df8b6b..4b47fbcfb6 100644 --- a/ext/interbase/php_ibase_udf.c +++ b/ext/interbase/php_ibase_udf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -84,7 +84,7 @@ * * gcc -shared `php-config --includes` `php-config --ldflags` \ * `php-config --libs` -o php_ibase_udf.so php_ibase_udf.c \ -* /usr/lib/libphp5.a +* /usr/lib/libphp7.a * * If you use the super server, you should also link against the embedded * library, but be sure to enable thread safety, as the super server is @@ -404,4 +404,3 @@ void udf_call_php8(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARA PARAMDSC *args[8] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }; call_php(name, r, 8, args); } - diff --git a/ext/interbase/php_interbase.h b/ext/interbase/php_interbase.h index 0518b586f9..c8afc8df8f 100644 --- a/ext/interbase/php_interbase.h +++ b/ext/interbase/php_interbase.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index ea3a305dd9..715a866111 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/breakiterator_class.h b/ext/intl/breakiterator/breakiterator_class.h index 0cf213f260..6333003981 100644 --- a/ext/intl/breakiterator/breakiterator_class.h +++ b/ext/intl/breakiterator/breakiterator_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index d8f18f99f3..19de7bce34 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/breakiterator_iterators.h b/ext/intl/breakiterator/breakiterator_iterators.h index a955f3a8e7..764f4f4426 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.h +++ b/ext/intl/breakiterator/breakiterator_iterators.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index cb5f669d05..1153340e14 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/breakiterator_methods.h b/ext/intl/breakiterator/breakiterator_methods.h index bc9ce80105..cffe767c55 100644 --- a/ext/intl/breakiterator/breakiterator_methods.h +++ b/ext/intl/breakiterator/breakiterator_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp index bffd1ee5cf..723cfd5022 100644 --- a/ext/intl/breakiterator/codepointiterator_internal.cpp +++ b/ext/intl/breakiterator/codepointiterator_internal.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/codepointiterator_internal.h b/ext/intl/breakiterator/codepointiterator_internal.h index 933347b859..0c9b8cc9a5 100644 --- a/ext/intl/breakiterator/codepointiterator_internal.h +++ b/ext/intl/breakiterator/codepointiterator_internal.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp index a833cf1853..d7fe359712 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.cpp +++ b/ext/intl/breakiterator/codepointiterator_methods.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/codepointiterator_methods.h b/ext/intl/breakiterator/codepointiterator_methods.h index ad3b710fc8..92f255d704 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.h +++ b/ext/intl/breakiterator/codepointiterator_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 74bebb2db2..d3b36291b2 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h index 861ca4253f..3a9209c479 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index 58375f8196..7273b1d277 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h index 2e7fbd2172..47f991f118 100644 --- a/ext/intl/calendar/calendar_class.h +++ b/ext/intl/calendar/calendar_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index 168c791d36..eaa1930e42 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/calendar/calendar_methods.h b/ext/intl/calendar/calendar_methods.h index dfd0bbeeaf..838917cac3 100644 --- a/ext/intl/calendar/calendar_methods.h +++ b/ext/intl/calendar/calendar_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp index 790a0519cd..b0c8a964f6 100644 --- a/ext/intl/calendar/gregoriancalendar_methods.cpp +++ b/ext/intl/calendar/gregoriancalendar_methods.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/calendar/gregoriancalendar_methods.h b/ext/intl/calendar/gregoriancalendar_methods.h index f911752cc7..659566427c 100644 --- a/ext/intl/calendar/gregoriancalendar_methods.h +++ b/ext/intl/calendar/gregoriancalendar_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator.c b/ext/intl/collator/collator.c index eff9568de1..07dc6385c8 100644 --- a/ext/intl/collator/collator.c +++ b/ext/intl/collator/collator.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator.h b/ext/intl/collator/collator.h index 96e7aa097b..ea0071b179 100644 --- a/ext/intl/collator/collator.h +++ b/ext/intl/collator/collator.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c index 72446f51a7..8d879de8f7 100644 --- a/ext/intl/collator/collator_attr.c +++ b/ext/intl/collator/collator_attr.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_attr.h b/ext/intl/collator/collator_attr.h index 85636cc486..b86365ff5e 100644 --- a/ext/intl/collator/collator_attr.h +++ b/ext/intl/collator/collator_attr.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c index 25a3ac8909..fd3f08e359 100644 --- a/ext/intl/collator/collator_class.c +++ b/ext/intl/collator/collator_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h index 8410e96646..f9d2cedf88 100644 --- a/ext/intl/collator/collator_class.h +++ b/ext/intl/collator/collator_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c index 444b1fc4fd..d27ff32ebd 100644 --- a/ext/intl/collator/collator_compare.c +++ b/ext/intl/collator/collator_compare.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_compare.h b/ext/intl/collator/collator_compare.h index 4e38b79309..cca9ca29b1 100644 --- a/ext/intl/collator/collator_compare.h +++ b/ext/intl/collator/collator_compare.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index 5a572067f6..bc279b25f7 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h index 7e169d559e..bf116bdfd8 100644 --- a/ext/intl/collator/collator_convert.h +++ b/ext/intl/collator/collator_convert.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c index a1b2aa743a..3c59f218e6 100644 --- a/ext/intl/collator/collator_create.c +++ b/ext/intl/collator/collator_create.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_create.h b/ext/intl/collator/collator_create.h index b740e82d68..b5e9489e3d 100644 --- a/ext/intl/collator/collator_create.h +++ b/ext/intl/collator/collator_create.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c index 91bc25d077..fb8886ef64 100644 --- a/ext/intl/collator/collator_error.c +++ b/ext/intl/collator/collator_error.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_error.h b/ext/intl/collator/collator_error.h index b2f44ea2a3..3c8c10a043 100644 --- a/ext/intl/collator/collator_error.h +++ b/ext/intl/collator/collator_error.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index db9e41f887..a93cd962f3 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_is_numeric.h b/ext/intl/collator/collator_is_numeric.h index d7aa12ce46..5ede4fa922 100644 --- a/ext/intl/collator/collator_is_numeric.h +++ b/ext/intl/collator/collator_is_numeric.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.c index dd37cc75db..76f154bb7c 100644 --- a/ext/intl/collator/collator_locale.c +++ b/ext/intl/collator/collator_locale.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_locale.h b/ext/intl/collator/collator_locale.h index bda90cd3b9..b2f837b49a 100644 --- a/ext/intl/collator/collator_locale.h +++ b/ext/intl/collator/collator_locale.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 1ec72e3a73..4fd7c4597e 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -203,7 +203,7 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRM /* }}} */ /* {{{ collator_compare_func - * Taken from PHP5 source (array_data_compare). + * Taken from PHP7 source (array_data_compare). */ static int collator_compare_func( const void* a, const void* b TSRMLS_DC ) { diff --git a/ext/intl/collator/collator_sort.h b/ext/intl/collator/collator_sort.h index a990cdf089..b5cb017a8c 100644 --- a/ext/intl/collator/collator_sort.h +++ b/ext/intl/collator/collator_sort.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index 783611e02f..23dc342080 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h index d2396cbf5a..e8ab66f40d 100644 --- a/ext/intl/common/common_date.h +++ b/ext/intl/common/common_date.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index ff28bdb456..952b39edca 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/common/common_enum.h b/ext/intl/common/common_enum.h index 2b6d1790d9..af46a47751 100644 --- a/ext/intl/common/common_enum.h +++ b/ext/intl/common/common_enum.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index f7b739555e..524bb94327 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/common/common_error.h b/ext/intl/common/common_error.h index 8716222124..46a26793ee 100644 --- a/ext/intl/common/common_error.h +++ b/ext/intl/common/common_error.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 887c404271..b27652aa9a 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/converter/converter.h b/ext/intl/converter/converter.h index bd316fcf98..520c7c6c86 100644 --- a/ext/intl/converter/converter.h +++ b/ext/intl/converter/converter.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c index eedc60040e..ffa606a9cd 100644 --- a/ext/intl/dateformat/dateformat.c +++ b/ext/intl/dateformat/dateformat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat.h b/ext/intl/dateformat/dateformat.h index f11918b79f..6139b67951 100644 --- a/ext/intl/dateformat/dateformat.h +++ b/ext/intl/dateformat/dateformat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c index 0450ef1c37..314ae730c7 100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_attr.h b/ext/intl/dateformat/dateformat_attr.h index 6fe82a6e00..e7013a9e2a 100644 --- a/ext/intl/dateformat/dateformat_attr.h +++ b/ext/intl/dateformat/dateformat_attr.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index 5f63d33143..71b136c6c1 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_attrcpp.h b/ext/intl/dateformat/dateformat_attrcpp.h index 408232f940..54536f21fa 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.h +++ b/ext/intl/dateformat/dateformat_attrcpp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c index 4c46a7d694..0d93338ecd 100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h index a3eb4b9839..ebd057022e 100644 --- a/ext/intl/dateformat/dateformat_class.h +++ b/ext/intl/dateformat/dateformat_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 97997554a5..4a272aa45f 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_create.h b/ext/intl/dateformat/dateformat_create.h index 47e67c2f45..c6e2d0feb8 100644 --- a/ext/intl/dateformat/dateformat_create.h +++ b/ext/intl/dateformat/dateformat_create.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_data.c b/ext/intl/dateformat/dateformat_data.c index 33451e1c51..509e91b617 100644 --- a/ext/intl/dateformat/dateformat_data.c +++ b/ext/intl/dateformat/dateformat_data.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h index cde9e363c9..a49da7dc89 100644 --- a/ext/intl/dateformat/dateformat_data.h +++ b/ext/intl/dateformat/dateformat_data.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c index dd9b64d4ee..d11eb2df24 100644 --- a/ext/intl/dateformat/dateformat_format.c +++ b/ext/intl/dateformat/dateformat_format.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_format.h b/ext/intl/dateformat/dateformat_format.h index 49f34c6892..02b773f991 100644 --- a/ext/intl/dateformat/dateformat_format.h +++ b/ext/intl/dateformat/dateformat_format.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index 2b431383ff..b552ed7529 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_format_object.h b/ext/intl/dateformat/dateformat_format_object.h index d80ea87e0f..f92296cd59 100644 --- a/ext/intl/dateformat/dateformat_format_object.h +++ b/ext/intl/dateformat/dateformat_format_object.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp index 92296be97a..b3f134a4f1 100644 --- a/ext/intl/dateformat/dateformat_helpers.cpp +++ b/ext/intl/dateformat/dateformat_helpers.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h index ca88da008a..c6121d75bb 100644 --- a/ext/intl/dateformat/dateformat_helpers.h +++ b/ext/intl/dateformat/dateformat_helpers.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index 183ccb261c..15279da3a1 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/dateformat/dateformat_parse.h b/ext/intl/dateformat/dateformat_parse.h index c74a3d5f15..694dbf8d90 100644 --- a/ext/intl/dateformat/dateformat_parse.h +++ b/ext/intl/dateformat/dateformat_parse.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter.c b/ext/intl/formatter/formatter.c index 12cbb6c75b..bb4d3d2ac5 100644 --- a/ext/intl/formatter/formatter.c +++ b/ext/intl/formatter/formatter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter.h b/ext/intl/formatter/formatter.h index 1f9ebead8e..47ec473aae 100644 --- a/ext/intl/formatter/formatter.h +++ b/ext/intl/formatter/formatter.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index 7278007c35..639342f4af 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_attr.h b/ext/intl/formatter/formatter_attr.h index c4bc94ce5f..e8690ac8a4 100644 --- a/ext/intl/formatter/formatter_attr.h +++ b/ext/intl/formatter/formatter_attr.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c index 601aeae5e6..8fcc155e85 100644 --- a/ext/intl/formatter/formatter_class.c +++ b/ext/intl/formatter/formatter_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h index 12061ba5df..1db688712c 100644 --- a/ext/intl/formatter/formatter_class.h +++ b/ext/intl/formatter/formatter_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_data.c b/ext/intl/formatter/formatter_data.c index 88f122f7c9..2f785ba68f 100644 --- a/ext/intl/formatter/formatter_data.c +++ b/ext/intl/formatter/formatter_data.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h index adc4818afc..0e3bc4fea4 100644 --- a/ext/intl/formatter/formatter_data.h +++ b/ext/intl/formatter/formatter_data.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index 1382b88d74..937cb05812 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_format.h b/ext/intl/formatter/formatter_format.h index 35fafd1ede..af7b0ffe26 100644 --- a/ext/intl/formatter/formatter_format.h +++ b/ext/intl/formatter/formatter_format.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index f7ac1b789f..939a8f782b 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_main.h b/ext/intl/formatter/formatter_main.h index 7669e684ae..66cf5c1b6b 100644 --- a/ext/intl/formatter/formatter_main.h +++ b/ext/intl/formatter/formatter_main.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index a84eecb2a9..0959d11830 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/formatter/formatter_parse.h b/ext/intl/formatter/formatter_parse.h index cb96c72b5d..7a3098fcb2 100644 --- a/ext/intl/formatter/formatter_parse.h +++ b/ext/intl/formatter/formatter_parse.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h index 756ce9173e..5256a272a1 100644 --- a/ext/intl/grapheme/grapheme.h +++ b/ext/intl/grapheme/grapheme.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index c752b02372..5e94eefc8a 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index 235d043818..a66796d80d 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index 99e484c17e..1d07dbba80 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2009 The PHP Group | +----------------------------------------------------------------------+ @@ -184,7 +184,7 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS, add_assoc_zval_ex(idna_info, "result", sizeof("result")-1, return_value); } else { zval zv; - ZVAL_STR(&zv, buffer); + ZVAL_NEW_STR(&zv, buffer); buffer_used = 1; add_assoc_zval_ex(idna_info, "result", sizeof("result")-1, &zv); } diff --git a/ext/intl/idn/idn.h b/ext/intl/idn/idn.h index 1fa4f8f2e5..1d49fe9f0a 100644 --- a/ext/intl/idn/idn.h +++ b/ext/intl/idn/idn.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2009 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/intl/intl_common.h b/ext/intl/intl_common.h index 9424571d02..a49794648d 100644 --- a/ext/intl/intl_common.h +++ b/ext/intl/intl_common.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_convert.c b/ext/intl/intl_convert.c index 92cdc4cef4..7f756b9e7f 100644 --- a/ext/intl/intl_convert.c +++ b/ext/intl/intl_convert.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_convert.h b/ext/intl/intl_convert.h index 3fc03f4bb7..952d765c52 100644 --- a/ext/intl/intl_convert.h +++ b/ext/intl/intl_convert.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_convertcpp.cpp b/ext/intl/intl_convertcpp.cpp index f699a3c61c..f52348bc25 100644 --- a/ext/intl/intl_convertcpp.cpp +++ b/ext/intl/intl_convertcpp.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_convertcpp.h b/ext/intl/intl_convertcpp.h index 89d4209dd3..fc2242a6b8 100644 --- a/ext/intl/intl_convertcpp.h +++ b/ext/intl/intl_convertcpp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_cppshims.h b/ext/intl/intl_cppshims.h index e58ec3bd45..e2db488d93 100644 --- a/ext/intl/intl_cppshims.h +++ b/ext/intl/intl_cppshims.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h index 1b764a2ab1..a7afb36be9 100644 --- a/ext/intl/intl_data.h +++ b/ext/intl/intl_data.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index 5c082ce190..9474834417 100644 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h index 06f33a4bd3..b800d10dbf 100644 --- a/ext/intl/intl_error.h +++ b/ext/intl/intl_error.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -21,7 +21,7 @@ #include <unicode/utypes.h> #include <unicode/parseerr.h> -#include <ext/standard/php_smart_str.h> +#include <zend_smart_str.h> #define INTL_ERROR_CODE(e) (e).code diff --git a/ext/intl/locale/locale.c b/ext/intl/locale/locale.c index 921e6e589f..21c875ca5d 100644 --- a/ext/intl/locale/locale.c +++ b/ext/intl/locale/locale.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/locale/locale.h b/ext/intl/locale/locale.h index f3859c7a2a..9118bee653 100644 --- a/ext/intl/locale/locale.h +++ b/ext/intl/locale/locale.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/locale/locale_class.c b/ext/intl/locale/locale_class.c index 432cfb28fc..eec4699b6d 100644 --- a/ext/intl/locale/locale_class.c +++ b/ext/intl/locale/locale_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/locale/locale_class.h b/ext/intl/locale/locale_class.h index cbddccbe17..afae06c77c 100644 --- a/ext/intl/locale/locale_class.h +++ b/ext/intl/locale/locale_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 4cafd02982..27f917ffbb 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -36,7 +36,7 @@ #include <zend.h> #include <php.h> #include "main/php_ini.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" ZEND_EXTERN_MODULE_GLOBALS( intl ) diff --git a/ext/intl/locale/locale_methods.h b/ext/intl/locale/locale_methods.h index e88fac64b7..bc11975c18 100644 --- a/ext/intl/locale/locale_methods.h +++ b/ext/intl/locale/locale_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c index b42d87967e..2ca8ed9186 100644 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat.h b/ext/intl/msgformat/msgformat.h index 205c7066fd..a0b2c89644 100644 --- a/ext/intl/msgformat/msgformat.h +++ b/ext/intl/msgformat/msgformat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c index 9359b796c3..79c04266e0 100644 --- a/ext/intl/msgformat/msgformat_attr.c +++ b/ext/intl/msgformat/msgformat_attr.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_attr.h b/ext/intl/msgformat/msgformat_attr.h index 898c4451e1..891f44c073 100644 --- a/ext/intl/msgformat/msgformat_attr.h +++ b/ext/intl/msgformat/msgformat_attr.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c index 71504bce2c..65f32bf683 100644 --- a/ext/intl/msgformat/msgformat_class.c +++ b/ext/intl/msgformat/msgformat_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h index 66b6ce18a5..8c2c29a7dd 100644 --- a/ext/intl/msgformat/msgformat_class.h +++ b/ext/intl/msgformat/msgformat_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c index 5d49054473..f94920d3e8 100644 --- a/ext/intl/msgformat/msgformat_data.c +++ b/ext/intl/msgformat/msgformat_data.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h index 3b7bdda78e..f3a594d25a 100644 --- a/ext/intl/msgformat/msgformat_data.h +++ b/ext/intl/msgformat/msgformat_data.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c index cb81137316..36cd61c685 100644 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_format.h b/ext/intl/msgformat/msgformat_format.h index b74deab8ff..12b0e4a283 100644 --- a/ext/intl/msgformat/msgformat_format.h +++ b/ext/intl/msgformat/msgformat_format.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c0c204cc69..46ebe25a17 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h index f88fd4f06b..41d179f8d0 100644 --- a/ext/intl/msgformat/msgformat_helpers.h +++ b/ext/intl/msgformat/msgformat_helpers.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c index 516f493ec9..add2f901eb 100644 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/msgformat/msgformat_parse.h b/ext/intl/msgformat/msgformat_parse.h index a937235839..4a86403a48 100644 --- a/ext/intl/msgformat/msgformat_parse.h +++ b/ext/intl/msgformat/msgformat_parse.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/normalizer/normalizer.c b/ext/intl/normalizer/normalizer.c index f06a3e685c..18c3cedcaf 100644 --- a/ext/intl/normalizer/normalizer.c +++ b/ext/intl/normalizer/normalizer.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/normalizer/normalizer.h b/ext/intl/normalizer/normalizer.h index eca9abe05a..c057a51883 100644 --- a/ext/intl/normalizer/normalizer.h +++ b/ext/intl/normalizer/normalizer.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.c index 154d877e3f..ccd8be3b29 100644 --- a/ext/intl/normalizer/normalizer_class.c +++ b/ext/intl/normalizer/normalizer_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h index 4d3f7d2341..3ce37fae88 100644 --- a/ext/intl/normalizer/normalizer_class.h +++ b/ext/intl/normalizer/normalizer_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/normalizer/normalizer_normalize.h b/ext/intl/normalizer/normalizer_normalize.h index 41c31f7949..c282c56795 100644 --- a/ext/intl/normalizer/normalizer_normalize.h +++ b/ext/intl/normalizer/normalizer_normalize.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 9ca225ab88..2c5e74809d 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h index 86a75cb335..3625c4fdcc 100644 --- a/ext/intl/php_intl.h +++ b/ext/intl/php_intl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c index 1232a42868..9b6b734ed6 100644 --- a/ext/intl/resourcebundle/resourcebundle.c +++ b/ext/intl/resourcebundle/resourcebundle.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/resourcebundle/resourcebundle.h b/ext/intl/resourcebundle/resourcebundle.h index 607ece98ba..e5aa9f092b 100644 --- a/ext/intl/resourcebundle/resourcebundle.h +++ b/ext/intl/resourcebundle/resourcebundle.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index a8252de638..0fbf7931d4 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h index 7cb015a8df..403b6beb17 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.h +++ b/ext/intl/resourcebundle/resourcebundle_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c index bdedfd15bc..cf38c6b676 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.c +++ b/ext/intl/resourcebundle/resourcebundle_iterator.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.h b/ext/intl/resourcebundle/resourcebundle_iterator.h index 32818f847f..b28fa91638 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.h +++ b/ext/intl/resourcebundle/resourcebundle_iterator.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker.c b/ext/intl/spoofchecker/spoofchecker.c index 42a014a90e..0a22875dcf 100644 --- a/ext/intl/spoofchecker/spoofchecker.c +++ b/ext/intl/spoofchecker/spoofchecker.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker.h b/ext/intl/spoofchecker/spoofchecker.h index f976d639ac..1cbdd7ea65 100644 --- a/ext/intl/spoofchecker/spoofchecker.h +++ b/ext/intl/spoofchecker/spoofchecker.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c index 7ae1a2feb6..5fb6ffb90c 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.c +++ b/ext/intl/spoofchecker/spoofchecker_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h index 9683b03b08..847b0a97b5 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.h +++ b/ext/intl/spoofchecker/spoofchecker_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker_create.c b/ext/intl/spoofchecker/spoofchecker_create.c index cf0173f997..962e31cb08 100644 --- a/ext/intl/spoofchecker/spoofchecker_create.c +++ b/ext/intl/spoofchecker/spoofchecker_create.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker_create.h b/ext/intl/spoofchecker/spoofchecker_create.h index 313faab8a3..405c1bda12 100644 --- a/ext/intl/spoofchecker/spoofchecker_create.h +++ b/ext/intl/spoofchecker/spoofchecker_create.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c index e5d11a899e..959a0c568f 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/spoofchecker/spoofchecker_main.h b/ext/intl/spoofchecker/spoofchecker_main.h index fb920d7841..44c99ec856 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.h +++ b/ext/intl/spoofchecker/spoofchecker_main.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index 623a643c49..d2aaa12344 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h index 71de20c09e..94b781b332 100644 --- a/ext/intl/timezone/timezone_class.h +++ b/ext/intl/timezone/timezone_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 530e6c5bed..033b216cdf 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/timezone/timezone_methods.h b/ext/intl/timezone/timezone_methods.h index 28c39f4fd7..29d72913fd 100644 --- a/ext/intl/timezone/timezone_methods.h +++ b/ext/intl/timezone/timezone_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/transliterator/transliterator.c b/ext/intl/transliterator/transliterator.c index 5f698e2b90..fda183b85a 100644 --- a/ext/intl/transliterator/transliterator.c +++ b/ext/intl/transliterator/transliterator.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/transliterator/transliterator.h b/ext/intl/transliterator/transliterator.h index cfd5d38dbd..081a730cbc 100644 --- a/ext/intl/transliterator/transliterator.h +++ b/ext/intl/transliterator/transliterator.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -21,7 +21,7 @@ #include <unicode/utypes.h> #include <unicode/utrans.h> -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" void transliterator_register_constants( INIT_FUNC_ARGS ); smart_str transliterator_parse_error_to_string( UParseError* pe ); diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index ff299a8f38..647ece8ba0 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/transliterator/transliterator_class.h b/ext/intl/transliterator/transliterator_class.h index a99c2ced16..f70e86995f 100644 --- a/ext/intl/transliterator/transliterator_class.h +++ b/ext/intl/transliterator/transliterator_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c index 978c830da7..e79aeb1621 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/intl/transliterator/transliterator_methods.h b/ext/intl/transliterator/transliterator_methods.h index b806de84fb..ff0b93a29a 100644 --- a/ext/intl/transliterator/transliterator_methods.h +++ b/ext/intl/transliterator/transliterator_methods.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/json/JSON_parser.h b/ext/json/JSON_parser.h index 3df999c5f3..da47f4078f 100644 --- a/ext/json/JSON_parser.h +++ b/ext/json/JSON_parser.h @@ -4,8 +4,8 @@ #define JSON_PARSER_H #include "php.h" -#include "ext/standard/php_smart_str.h" #include "php_json.h" +#include "zend_smart_str.h" #define JSON_PARSER_DEFAULT_DEPTH 512 diff --git a/ext/json/json.c b/ext/json/json.c index 24324bbe99..16e452a004 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -26,7 +26,7 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "ext/standard/html.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "JSON_parser.h" #include "php_json.h" #include <zend_exceptions.h> @@ -384,7 +384,7 @@ static void json_escape_string(smart_str *buf, char *s, size_t len, int options { int status; unsigned int us, next_us = 0; - size_t pos, checkpoint, newlen; + size_t pos, checkpoint; if (len == 0) { smart_str_appendl(buf, "\"\"", 2); @@ -789,7 +789,7 @@ static PHP_FUNCTION(json_encode) ZVAL_FALSE(return_value); } else { smart_str_0(&buf); /* copy? */ - ZVAL_STR(return_value, buf.s); + ZVAL_NEW_STR(return_value, buf.s); } } /* }}} */ diff --git a/ext/json/json.dsp b/ext/json/json.dsp deleted file mode 100644 index e5bb3767bf..0000000000 --- a/ext/json/json.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="json" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=json - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "json.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "json.mak" CFG="json - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "json - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "json - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "json - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "json_c" /D HAVE_JSON=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D ZTS=1 /D COMPILE_DL_JSON=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "_DEBUG"
-# ADD RSC /l 0x1009 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 iconv.lib php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_json.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "json - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "json_c" /D HAVE_JSON=1 /D "ZEND_WIN32" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D ZTS=1 /D COMPILE_DL_JSON=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /D "HAVE_FCNTL_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "NDEBUG"
-# ADD RSC /l 0x1009 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 iconv.lib php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_json.dll" /libpath:"..\..\Release_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "json - Win32 Debug_TS"
-# Name "json - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=".\json.c"
-# End Source File
-# Begin Source File
-
-SOURCE=.\JSON_parser.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\JSON_parser.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_decode.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_decode.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_to_utf16.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_to_utf16.h
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_json.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/json/php_json.h b/ext/json/php_json.h index 08a4a7ff94..5b2dc127dd 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -22,7 +22,7 @@ #define PHP_JSON_H #define PHP_JSON_VERSION "1.2.1" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str_public.h" extern zend_module_entry json_module_entry; #define phpext_json_ptr &json_module_entry diff --git a/ext/json/utf8_decode.h b/ext/json/utf8_decode.h index cc0fc79f6c..0908edd2d4 100644 --- a/ext/json/utf8_decode.h +++ b/ext/json/utf8_decode.h @@ -5,8 +5,8 @@ typedef struct json_utf8_decode { - int the_index; char *the_input; + int the_index; int the_length; int the_char; int the_byte; diff --git a/ext/ldap/LDAP_Win32_HOWTO.txt b/ext/ldap/LDAP_Win32_HOWTO.txt index bcee731e88..30b6096f58 100644 --- a/ext/ldap/LDAP_Win32_HOWTO.txt +++ b/ext/ldap/LDAP_Win32_HOWTO.txt @@ -14,7 +14,7 @@ Note 1: During the entire build process, you can ignore warnings about For 'Win32 Debug', change the runtime library to 'Debug Multithreaded DLL' For 'Win32 Release', change the runtime library to 'Multithreaded DLL' Select the Preprocessor tab, select 'All Configurations'. - Add '..\..\..\..\php5\regex' to the 'Additional include directories' list. + Add '..\..\..\..\php7\regex' to the 'Additional include directories' list. Add 'HAVE_MKTEMP' to the 'Preprocessor definitions' list. - Compile (you can compile both Debug and Release versions). diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 151b059026..f74de699ee 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -388,6 +388,23 @@ static int _get_lderrno(LDAP *ldap) } /* }}} */ +/* {{{ _set_lderrno + */ +static void _set_lderrno(LDAP *ldap, int lderr) +{ +#if !HAVE_NSLDAP +#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP + /* New versions of OpenLDAP do it this way */ + ldap_set_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr); +#else + ldap->ld_errno = lderr; +#endif +#else + ldap_set_lderrno(ldap, lderr, NULL, NULL); +#endif +} +/* }}} */ + /* {{{ proto bool ldap_bind(resource link [, string dn [, string password]]) Bind to LDAP directory */ PHP_FUNCTION(ldap_bind) @@ -402,18 +419,20 @@ PHP_FUNCTION(ldap_bind) RETURN_FALSE; } + ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); + if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) { + _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS); php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte"); RETURN_FALSE; } if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) { + _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte"); RETURN_FALSE; } - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc)); RETURN_FALSE; diff --git a/ext/ldap/ldap.dsp b/ext/ldap/ldap.dsp deleted file mode 100644 index a97ebe4105..0000000000 --- a/ext/ldap/ldap.dsp +++ /dev/null @@ -1,288 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ldap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=ldap - Win32 Debug_TS_SSL
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ldap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ldap.mak" CFG="ldap - Win32 Debug_TS_SSL"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ldap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Release_TS SASL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug_TS SASL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ldap - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "COMPILE_DL_LDAP_LDAP" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5nts.lib /nologo /dll /machine:I386 /out:"Release/php_ldap.dll" /libpath:"..\..\Release" /libpath:"..\..\..\php_build\openldap\libraries\Release"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "COMPILE_DL_LDAP_LDAP" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 oldap32.lib olber32.lib php5nts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\openldap\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D ZEND_DEBUG=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib php5nts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\openldap\libraries\Debug" /libpath:"..\..\Debug"
-# ADD LINK32 oldap32.lib olber32.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\openldap\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D ZEND_DEBUG=0 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS SASL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "ldap___Win32_Release_TS_SASL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Release_TS_SASL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS_SASL"
-# PROP Intermediate_Dir "Release_TS_SASL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 oldap32.lib olber32.lib libsasl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS SASL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "ldap___Win32_Debug_TS_SASL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Debug_TS_SASL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS_SASL"
-# PROP Intermediate_Dir "Debug_TS_SASL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-# ADD LINK32 oldap32.lib olber32.lib libsasl.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "ldap___Win32_Release_TS_SSL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Release_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS_SSL"
-# PROP Intermediate_Dir "Release_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php5ts.lib oldap32.lib olber32.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "ldap___Win32_Debug_TS_SSL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Debug_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS_SSL"
-# PROP Intermediate_Dir "Debug_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-# ADD LINK32 php5ts_debug.lib oldap32.lib olber32.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ENDIF
-
-# Begin Target
-
-# Name "ldap - Win32 Release"
-# Name "ldap - Win32 Debug"
-# Name "ldap - Win32 Debug_TS"
-# Name "ldap - Win32 Release_TS"
-# Name "ldap - Win32 Release_TS SASL"
-# Name "ldap - Win32 Debug_TS SASL"
-# Name "ldap - Win32 Release_TS_SSL"
-# Name "ldap - Win32 Debug_TS_SSL"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ldap.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_ldap.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\LDAP_Win32_HOWTO.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/ldap/ldap.mak b/ext/ldap/ldap.mak index 959fe16cf1..f285db0eff 100644 --- a/ext/ldap/ldap.mak +++ b/ext/ldap/ldap.mak @@ -4,7 +4,7 @@ PROJECT_ROOT = ..\.. # Module details MODULE_NAME = php_ldap -MODULE_DESC = "PHP 5 - LDAP Extension" +MODULE_DESC = "PHP 7 - LDAP Extension" VMAJ = 3 VMIN = 0 VREV = 0 diff --git a/ext/ldap/php_ldap.h b/ext/ldap/php_ldap.h index 944c3dd531..0ccdbfe665 100644 --- a/ext/ldap/php_ldap.h +++ b/ext/ldap/php_ldap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 8fd661c81d..d9e92541e9 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1030,20 +1030,20 @@ static PHP_FUNCTION(libxml_get_errors) zval z_error; object_init_ex(&z_error, libxmlerror_class_entry); - add_property_long(&z_error, "level", error->level); - add_property_long(&z_error, "code", error->code); - add_property_long(&z_error, "column", error->int2); + add_property_long_ex(&z_error, "level", sizeof("level") - 1, error->level TSRMLS_CC); + add_property_long_ex(&z_error, "code", sizeof("code") - 1, error->code TSRMLS_CC); + add_property_long_ex(&z_error, "column", sizeof("column") - 1, error->int2 TSRMLS_CC); if (error->message) { - add_property_string(&z_error, "message", error->message); + add_property_string_ex(&z_error, "message", sizeof("message") - 1, error->message TSRMLS_CC); } else { - add_property_stringl(&z_error, "message", "", 0); + add_property_stringl_ex(&z_error, "message", sizeof("message") - 1, "", 0 TSRMLS_CC); } if (error->file) { - add_property_string(&z_error, "file", error->file); + add_property_string_ex(&z_error, "file", sizeof("file") - 1, error->file TSRMLS_CC); } else { - add_property_stringl(&z_error, "file", "", 0); + add_property_stringl_ex(&z_error, "file", sizeof("file") - 1, "", 0 TSRMLS_CC); } - add_property_long(&z_error, "line", error->line); + add_property_long_ex(&z_error, "line", sizeof("line") - 1, error->line TSRMLS_CC); add_next_index_zval(return_value, &z_error); error = zend_llist_get_next(LIBXML(error_list)); diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h index b79ca17556..cccc83f8db 100644 --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -34,7 +34,7 @@ extern zend_module_entry libxml_module_entry; # define PHP_LIBXML_API #endif -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include <libxml/tree.h> #define LIBXML_SAVE_NOEMPTYTAG 1<<2 diff --git a/ext/mbstring/libmbfl/NEWS b/ext/mbstring/libmbfl/NEWS index fc16367ed1..8217e4158f 100644 --- a/ext/mbstring/libmbfl/NEWS +++ b/ext/mbstring/libmbfl/NEWS @@ -27,4 +27,3 @@ version 1.1.0 March 02, 2010 - added cp5022x encoding (moriyoshi) - added ISO-2022-JP-MS (moriyoshi) - moved to github.com from sourceforge.jp (moriyoshi) - diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 92e7327787..a50768f6d0 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h index ab6fcc86e0..091d8e2d9b 100644 --- a/ext/mbstring/mb_gpc.h +++ b/ext/mbstring/mb_gpc.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2001 The PHP Group | +----------------------------------------------------------------------+ @@ -30,14 +30,14 @@ #if HAVE_MBSTRING /* {{{ typedefs */ typedef struct _php_mb_encoding_handler_info_t { - int data_type; const char *separator; - unsigned int report_errors: 1; - enum mbfl_no_language to_language; const mbfl_encoding *to_encoding; - enum mbfl_no_language from_language; const mbfl_encoding **from_encodings; size_t num_from_encodings; + int data_type; + unsigned int report_errors : 1; + enum mbfl_no_language to_language; + enum mbfl_no_language from_language; } php_mb_encoding_handler_info_t; /* }}}*/ diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 212c8d013f..691391ab92 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -2963,7 +2963,7 @@ PHP_FUNCTION(mb_strimwidth) string.val = (unsigned char *)str; string.len = str_len; - if (from < 0 || from > str_len) { + if (from < 0 || (size_t)from > str_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start position is out of range"); RETURN_FALSE; } @@ -4195,7 +4195,7 @@ PHP_FUNCTION(mb_send_mail) } /* Subject: */ - if (subject != NULL && subject_len >= 0) { + if (subject != NULL) { orig_str.no_language = MBSTRG(language); orig_str.val = (unsigned char *)subject; orig_str.len = subject_len; diff --git a/ext/mbstring/mbstring.dsp b/ext/mbstring/mbstring.dsp deleted file mode 100644 index 2e050c6d20..0000000000 --- a/ext/mbstring/mbstring.dsp +++ /dev/null @@ -1,1112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mbstring" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mbstring - Win32 Debug_TS MBSTRING
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mbstring.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mbstring.mak" CFG="mbstring - Win32 Debug_TS MBSTRING"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mbstring - Win32 Release_TS MBSTRING" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mbstring - Win32 Debug_TS MBSTRING" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "mbstring___Win32_Release_TS_MBSTRING"
-# PROP BASE Intermediate_Dir "mbstring___Win32_Release_TS_MBSTRING"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "_MBCS" /D "_USRDLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libmbfl" /I "libmbfl\mbfl" /D ZEND_DEBUG=0 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /D MBFL_DLL_EXPORT=1 /D NOT_RUBY=1 /D "LIBMBFL_EXPORTS" /D "HAVE_STRICMP" /D "HAVE_CONFIG_H" /D "HAVE_STDLIB_H" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mbstring.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mbstring.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "mbstring___Win32_Debug_TS_MBSTRING"
-# PROP BASE Intermediate_Dir "mbstring___Win32_Debug_TS_MBSTRING"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libmbfl" /I "libmbfl\mbfl" /I "oniguruma" /D ZEND_DEBUG=1 /D MBSTRING_EXPORTS=1 /D HAVE_STDLIB_H=1 /D HAVE_STRING_H=1 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /D MBFL_DLL_EXPORT=1 /D NOT_RUBY=1 /D "LIBMBFL_EXPORTS" /D "HAVE_STRICMP" /D "HAVE_CONFIG_H" /D "HAVE_STDLIB_H" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mbstring.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mbstring.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mbstring - Win32 Release_TS MBSTRING"
-# Name "mbstring - Win32 Debug_TS MBSTRING"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mb_gpc.c
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbstring.c
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_mbregex.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_unicode.c
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\mb_gpc.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbstring.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_mbregex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_unicode.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\unicode_data.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "libmbfl"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\html_entities.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_7bit.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_8bit.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ascii.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_base64.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_big5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1251.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1252.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp866.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp932.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp936.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_cn.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp_win.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_tw.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_htmlent.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_hz.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso2022_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_1.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_10.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_13.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_14.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_15.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_3.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_6.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_7.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_9.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_jis.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8r.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8u.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_armscii8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp850.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_pass.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_qprint.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_sjis.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uhc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf16.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf32.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7imap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uuencode.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_wchar.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_allocators.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_convert.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_encoding.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_filter_output.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_ident.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_language.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_memory_device.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_string.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_de.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_en.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ja.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_neutral.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ru.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_uni.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_zh.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_hy.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\libmbfl\config.h.vc6
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\libmbfl
-InputPath=.\libmbfl\config.h.vc6
-
-"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h"
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\libmbfl
-InputPath=.\libmbfl\config.h.vc6
-
-"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h"
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\cp932_table.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\html_entities.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_7bit.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_8bit.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ascii.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_base64.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_big5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1251.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1252.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp866.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp932.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp936.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_cn.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp_win.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_kr.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_tw.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_htmlent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_hz.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso2022_kr.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_1.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_10.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_13.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_14.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_15.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_6.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_7.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_9.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_jis.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8r.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8u.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_armscii8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp850.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_pass.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_qprint.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_sjis.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uhc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf16.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf32.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7imap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uuencode.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_wchar.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_allocators.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_consts.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_convert.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_defs.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_encoding.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_filter_output.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_ident.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_language.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_memory_device.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_string.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_de.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_en.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ja.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_kr.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_neutral.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ru.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_uni.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_zh.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_hy.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_prop.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_big5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cns11643.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp1251.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp1252.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp866.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp932_ext.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp936.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_10.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_13.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_14.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_15.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_6.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_7.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_9.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_jis.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_koi8r.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_koi8u.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_armscii8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp850.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_uhc.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "oniguruma"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\oniguruma\regcomp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regexec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\reggnu.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regparse.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regposerr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\ascii.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\utf8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\euc_jp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\euc_tw.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\euc_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\sjis.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_1.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_3.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_6.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_7.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_9.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_10.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_11.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_13.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_14.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_15.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_16.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\koi8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\koi8_r.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\big5.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\oniguruma\win32\config.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\oniguruma\win32
-InputPath=.\oniguruma\win32\config.h
-
-"$(InputDir)\..\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h "$(InputDir)\..\config.h"
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\oniguruma\win32
-InputPath=.\oniguruma\win32\config.h
-
-"$(InputDir)\..\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h "$(InputDir)\..\config.h"
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\onigposix.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\oniguruma.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\php_compat.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regint.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regparse.h
-# End Source File
-# End Group
-# End Group
-# End Target
-# End Project
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h index 8e6310f75f..0136f8ef7d 100644 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 9628ee2526..de0bc768ad 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -28,7 +28,7 @@ #if HAVE_MBREGEX -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/info.h" #include "php_mbregex.h" #include "mbstring.h" @@ -717,7 +717,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase) /* don't bother doing an extended regex with just a number */ } - if (!Z_STRVAL_P(arg_pattern) || Z_STRLEN_P(arg_pattern) == 0) { + if (Z_STRLEN_P(arg_pattern) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern"); RETVAL_FALSE; goto out; @@ -1081,7 +1081,7 @@ PHP_FUNCTION(mb_split) err = 0; regs = onig_region_new(); /* churn through str, generating array entries as we go */ - while (count != 0 && (pos - (OnigUChar *)string) < string_len) { + while (count != 0 && (pos - (OnigUChar *)string) < (ptrdiff_t)string_len) { int beg, end; err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0); if (err < 0) { @@ -1403,7 +1403,7 @@ PHP_FUNCTION(mb_ereg_search_setpos) return; } - if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && position >= Z_STRLEN(MBREX(search_str)))) { + if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range"); MBREX(search_pos) = 0; RETURN_FALSE; diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h index 3d2e2b8e46..0088b0a716 100644 --- a/ext/mbstring/php_mbregex.h +++ b/ext/mbstring/php_mbregex.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c index a1db6819e9..ee5b75e67a 100644 --- a/ext/mbstring/php_unicode.c +++ b/ext/mbstring/php_unicode.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h index 5932b8d2da..e376895cbd 100644 --- a/ext/mbstring/php_unicode.h +++ b/ext/mbstring/php_unicode.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/tests/zend_multibyte-02.phpt b/ext/mbstring/tests/zend_multibyte-02.phpt index 8a1a572804..7db444841e 100644 --- a/ext/mbstring/tests/zend_multibyte-02.phpt +++ b/ext/mbstring/tests/zend_multibyte-02.phpt @@ -1,6 +1,7 @@ --TEST-- zend multibyte (2) --INI-- +error_reporting=E_ALL & ~E_DEPRECATED zend.multibyte=On zend.script_encoding=UTF-8 mbstring.internal_encoding=CP932 @@ -9,4 +10,4 @@ mbstring.internal_encoding=CP932 var_dump(bin2hex("テスト")); ?> --EXPECTF-- -php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed. +string(12) "836583588367" diff --git a/ext/mbstring/tests/zend_multibyte-06.phpt b/ext/mbstring/tests/zend_multibyte-06.phpt index 1b8adb5186..7eeac1d353 100644 --- a/ext/mbstring/tests/zend_multibyte-06.phpt +++ b/ext/mbstring/tests/zend_multibyte-06.phpt @@ -10,4 +10,4 @@ declare(encoding="UTF-8"); var_dump(bin2hex("テスト")); ?> --EXPECTF-- -php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed. +string(12) "836583588367" diff --git a/ext/mbstring/tests/zend_multibyte-07.phpt b/ext/mbstring/tests/zend_multibyte-07.phpt index 50d4cd95ed..685c6f1f04 100644 --- a/ext/mbstring/tests/zend_multibyte-07.phpt +++ b/ext/mbstring/tests/zend_multibyte-07.phpt @@ -1,8 +1,5 @@ --TEST-- zend multibyte (7) ---SKIPIF-- ---XFAIL-- -https://bugs.php.net/bug.php?id=66582 --INI-- error_reporting=E_ALL & ~E_DEPRECATED zend.multibyte=On diff --git a/ext/mbstring/tests/zend_multibyte-09.phpt b/ext/mbstring/tests/zend_multibyte-09.phpt index 7b0015c6c1..f9b8bf734f 100644 --- a/ext/mbstring/tests/zend_multibyte-09.phpt +++ b/ext/mbstring/tests/zend_multibyte-09.phpt @@ -1,8 +1,5 @@ --TEST-- zend multibyte (9) ---SKIPIF-- ---XFAIL-- -https://bugs.php.net/bug.php?id=66582 --INI-- error_reporting=E_ALL & ~E_DEPRECATED zend.multibyte=On diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index bfd9003e55..82cbe72176 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -40,7 +40,7 @@ #include "php_globals.h" #include "ext/standard/info.h" #include "ext/standard/php_rand.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "php_mcrypt_filter.h" static int le_mcrypt; @@ -452,7 +452,7 @@ static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */ } /* }}} */ -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" PHP_MINFO_FUNCTION(mcrypt) /* {{{ */ { diff --git a/ext/mcrypt/mcrypt.dsp b/ext/mcrypt/mcrypt.dsp deleted file mode 100644 index a0a1f00f4c..0000000000 --- a/ext/mcrypt/mcrypt.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mcrypt" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mcrypt - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mcrypt.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mcrypt.mak" CFG="mcrypt - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mcrypt - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mcrypt - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mcrypt - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MCRYPT" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\mcrypt\include" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MCRYPT_EXPORTS" /D "COMPILE_DL_MCRYPT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBMCRYPT=1 /D HAVE_LIBMCRYPT24=1 /D HAVE_MCRYPT_GENERIC_DEINIT /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS"
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mcrypt.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mcrypt" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\TSRM\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "mcrypt - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MCRYPT" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\mcrypt\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MCRYPT_EXPORTS" /D "COMPILE_DL_MCRYPT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBMCRYPT=1 /D HAVE_LIBMCRYPT24=1 /D HAVE_MCRYPT_GENERIC_DEINIT /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"mssql-70"
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mcrypt.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mcrypt\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mcrypt - Win32 Release_TS"
-# Name "mcrypt - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mcrypt.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\readdir.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mcrypt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\readdir.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c index 698664b236..26f3dceba7 100644 --- a/ext/mcrypt/mcrypt_filter.c +++ b/ext/mcrypt/mcrypt_filter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mcrypt/php_mcrypt.h b/ext/mcrypt/php_mcrypt.h index 9dfa1d8185..994e1cbfa5 100644 --- a/ext/mcrypt/php_mcrypt.h +++ b/ext/mcrypt/php_mcrypt.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mcrypt/php_mcrypt_filter.h b/ext/mcrypt/php_mcrypt_filter.h index bfb0d7288f..cacac5ca46 100644 --- a/ext/mcrypt/php_mcrypt_filter.h +++ b/ext/mcrypt/php_mcrypt_filter.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mssql/mssql.dsp b/ext/mssql/mssql.dsp deleted file mode 100644 index 43294280dd..0000000000 --- a/ext/mssql/mssql.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mssql" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mssql - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mssql.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mssql.mak" CFG="mssql - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mssql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mssql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mssql - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mssql70.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mssql-70\lib" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mssql-70\lib" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "mssql - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mssql70.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib ntwdblib.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_mssql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mssql - Win32 Release_TS"
-# Name "mssql - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_mssql.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mssql.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\mssql_win32_howto.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/mssql/mssql_win32_howto.txt b/ext/mssql/mssql_win32_howto.txt index d42bc2555b..735226f88a 100644 --- a/ext/mssql/mssql_win32_howto.txt +++ b/ext/mssql/mssql_win32_howto.txt @@ -12,7 +12,7 @@ Win32 Debug_TS php_build\mssql-70\include\sqlfront.h php_build\mssql-70\lib\ntwdblib.lib -php_build is a directory at the same level as php5. +php_build is a directory at the same level as php7. Start Visual Studio, load php_modules.dsw, select the MSSQL projects, configuration and build it. diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 4bb7454c43..1ba77ca8c4 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -489,7 +489,7 @@ PHP_RINIT_FUNCTION(mssql) { MS_SQL_G(default_link) = -1; MS_SQL_G(num_links) = MS_SQL_G(num_persistent); - MS_SQL_G(appname) = estrndup("PHP 5", 5); + MS_SQL_G(appname) = estrndup("PHP 7", 5); MS_SQL_G(server_message) = NULL; MS_SQL_G(min_error_severity) = MS_SQL_G(cfg_min_error_severity); MS_SQL_G(min_message_severity) = MS_SQL_G(cfg_min_message_severity); diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h index 5b2456e9bd..b0313a160a 100644 --- a/ext/mssql/php_mssql.h +++ b/ext/mssql/php_mssql.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysql/mysql.dsp b/ext/mysql/mysql.dsp deleted file mode 100644 index dfc9c63db5..0000000000 --- a/ext/mysql/mysql.dsp +++ /dev/null @@ -1,171 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mysql" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mysql - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mysql.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mysql.mak" CFG="mysql - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mysql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mysql - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "NDEBUG" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php5nts.lib /nologo /dll /machine:I386 /out:"Release/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release"
-
-!ELSEIF "$(CFG)" == "mysql - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php5nts_debug.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\Debug" /libpath:"..\..\Debug"
-
-!ELSEIF "$(CFG)" == "mysql - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\Debug" /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "mysql - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mysql - Win32 Release"
-# Name "mysql - Win32 Debug"
-# Name "mysql - Win32 Debug_TS"
-# Name "mysql - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_mysql.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mysql.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\Readme_w32.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/mysql/mysql_mysqlnd.h b/ext/mysql/mysql_mysqlnd.h index 0c4c221b15..29ac9838f2 100644 --- a/ext/mysql/mysql_mysqlnd.h +++ b/ext/mysql/mysql_mysqlnd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2009 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index e3535bc769..fc1dac5da7 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysql/php_mysql.h b/ext/mysql/php_mysql.h index 0368140580..279aec001d 100644 --- a/ext/mysql/php_mysql.h +++ b/ext/mysql/php_mysql.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysql/php_mysql_structs.h b/ext/mysql/php_mysql_structs.h index c39e5b25af..8eb9aa1d29 100644 --- a/ext/mysql/php_mysql_structs.h +++ b/ext/mysql/php_mysql_structs.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index c5124ebc2f..878c8fb946 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli.dsp b/ext/mysqli/mysqli.dsp deleted file mode 100755 index a334202187..0000000000 --- a/ext/mysqli/mysqli.dsp +++ /dev/null @@ -1,120 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mysqli" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mysqli - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mysqli.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mysqli.mak" CFG="mysqli - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mysqli - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysqli - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mysqli - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQLI_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\mysqli" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MYSQLI" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MYSQLI_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib zlib.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mysqli.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
-
-!ELSEIF "$(CFG)" == "mysqli - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQLI_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\mysqli" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MYSQLI" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MYSQLI_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib zlib.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mysqli.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mysqli - Win32 Release_TS"
-# Name "mysqli - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mysqli.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mysqli_api.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mysqli_fe.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mysqli_nonapi.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mysqli.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index d8596c9620..4eff098999 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -30,7 +30,7 @@ #include "php_ini.h" #include "php_globals.h" #include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "php_mysqli_structs.h" #include "mysqli_priv.h" diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index cb8a477be4..95096f4a61 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c index 898287d3fb..4c1c4a37a5 100644 --- a/ext/mysqli/mysqli_embedded.c +++ b/ext/mysqli/mysqli_embedded.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c index 30ed75ddb7..ec86b9d740 100644 --- a/ext/mysqli/mysqli_exception.c +++ b/ext/mysqli/mysqli_exception.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index e099fe7194..2b6c99b9c7 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_fe.h b/ext/mysqli/mysqli_fe.h index 9a9f851248..f5ca0963b5 100644 --- a/ext/mysqli/mysqli_fe.h +++ b/ext/mysqli/mysqli_fe.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_libmysql.h b/ext/mysqli/mysqli_libmysql.h index 5e7f730aec..a22899185a 100644 --- a/ext/mysqli/mysqli_libmysql.h +++ b/ext/mysqli/mysqli_libmysql.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_mysqlnd.h b/ext/mysqli/mysqli_mysqlnd.h index b6d23d9ef1..a1656e59eb 100644 --- a/ext/mysqli/mysqli_mysqlnd.h +++ b/ext/mysqli/mysqli_mysqlnd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2009 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 9c9a109ba2..db0d0ee677 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -29,7 +29,7 @@ #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "php_mysqli_structs.h" #include "mysqli_priv.h" diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h index b240cfab09..cff28400ed 100644 --- a/ext/mysqli/mysqli_priv.h +++ b/ext/mysqli/mysqli_priv.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index c1fa0a17d6..1354e0db93 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -84,7 +84,7 @@ static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC) \ if (l < ZEND_LONG_MAX) {\ ZVAL_LONG(retval, (zend_long) l);\ } else { \ - ZVAL_STR(retval, strpprintf(0, __ret_type_sprint_mod, l)); \ + ZVAL_NEW_STR(retval, strpprintf(0, __ret_type_sprint_mod, l)); \ } \ }\ return retval;\ @@ -170,7 +170,7 @@ static zval *link_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC) if (rc < ZEND_LONG_MAX) { ZVAL_LONG(retval, (zend_long) rc); } else { - ZVAL_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc)); + ZVAL_NEW_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc)); } } return retval; @@ -357,7 +357,7 @@ static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC) if (rc < ZEND_LONG_MAX) { ZVAL_LONG(retval, (zend_long) rc); } else { - ZVAL_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc)); + ZVAL_NEW_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc)); } } return retval; diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c index 7703465e21..ceec68efb4 100644 --- a/ext/mysqli/mysqli_report.c +++ b/ext/mysqli/mysqli_report.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c index 615ba94bbf..5caa926b47 100644 --- a/ext/mysqli/mysqli_result_iterator.c +++ b/ext/mysqli/mysqli_result_iterator.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index a72c97b596..084bc58581 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -28,7 +28,7 @@ #include "php_mysqli_structs.h" #include "mysqli_priv.h" -/* Define these in the PHP5 tree to make merging easy process */ +/* Define these in the PHP7 tree to make merging easy process */ #define Zzend_string_dupLICATE (1<<0) #define ZSTR_AUTOFREE (1<<1) diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h index e036cf42b7..566bdd7004 100644 --- a/ext/mysqli/php_mysqli.h +++ b/ext/mysqli/php_mysqli.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index 9570952ec0..d815df3eee 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 74a8b721f2..41f34e366a 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -27,7 +27,7 @@ #include "mysqlnd_statistics.h" #include "mysqlnd_charset.h" #include "mysqlnd_debug.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" /* TODO : @@ -2496,7 +2496,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons DBG_INF_FMT("Adding [%s][%s]", key, value); { zval attrz; - ZVAL_STR(&attrz, zend_string_init(value, strlen(value), 1)); + ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), 1)); zend_hash_str_update(conn->options->connect_attr, key, strlen(key), &attrz); } break; @@ -2798,7 +2798,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1); } if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) { - unsigned long server_version = conn->m->get_server_version(conn TSRMLS_CC); + zend_ulong server_version = conn->m->get_server_version(conn TSRMLS_CC); if (server_version < 50605L) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required"); smart_str_free(&tmp_str); diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index c70934be4d..1a23781eb0 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -264,8 +264,6 @@ PHPAPI void _mysqlnd_get_client_stats(zval *return_value TSRMLS_DC ZEND_FILE_L #define MYSQLND_METHOD_PRIVATE(class, method) php_##class##_##method##_priv ZEND_BEGIN_MODULE_GLOBALS(mysqlnd) - zend_bool collect_statistics; - zend_bool collect_memory_statistics; char * debug; /* The actual string */ char * trace_alloc_settings; /* The actual string */ MYSQLND_DEBUG * dbg; /* The DBG object for standard tracing */ @@ -283,6 +281,8 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqlnd) zend_long debug_realloc_fail_threshold; char * sha256_server_public_key; zend_bool fetch_data_copy; + zend_bool collect_statistics; + zend_bool collect_memory_statistics; ZEND_END_MODULE_GLOBALS(mysqlnd) PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd) diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index 9cc46dba4a..daa758c043 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -539,7 +539,7 @@ void _mysqlnd_free(void *ptr MYSQLND_MEM_D) #define SMART_STR_START_SIZE 2048 #define SMART_STR_PREALLOC 512 -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" /* {{{ _mysqlnd_pestrndup */ diff --git a/ext/mysqlnd/mysqlnd_alloc.h b/ext/mysqlnd/mysqlnd_alloc.h index eef5988829..b8a14fd1ab 100644 --- a/ext/mysqlnd/mysqlnd_alloc.h +++ b/ext/mysqlnd/mysqlnd_alloc.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 985357e3bc..255098c4f3 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c index 100e807bae..705f52ea82 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.c +++ b/ext/mysqlnd/mysqlnd_block_alloc.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_block_alloc.h b/ext/mysqlnd/mysqlnd_block_alloc.h index f9627744d5..c0232d4286 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.h +++ b/ext/mysqlnd/mysqlnd_block_alloc.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index bf67498eea..97a49e1054 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h index 87f30d8ba5..ef77b2fb74 100644 --- a/ext/mysqlnd/mysqlnd_charset.h +++ b/ext/mysqlnd/mysqlnd_charset.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index 92121cf247..f1fde4efbb 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h index fe91082175..bb4ff3e895 100644 --- a/ext/mysqlnd/mysqlnd_debug.h +++ b/ext/mysqlnd/mysqlnd_debug.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c index 98826b9ce3..e67d023edb 100644 --- a/ext/mysqlnd/mysqlnd_driver.c +++ b/ext/mysqlnd/mysqlnd_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 0d6a25a419..90068783d9 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c index 13f1e294dc..43f1318caa 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.c +++ b/ext/mysqlnd/mysqlnd_ext_plugin.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.h b/ext/mysqlnd/mysqlnd_ext_plugin.h index d4a9d6cfc0..c66043da83 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.h +++ b/ext/mysqlnd/mysqlnd_ext_plugin.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_libmysql_compat.h b/ext/mysqlnd/mysqlnd_libmysql_compat.h index b8ff959d18..db3883cd1e 100644 --- a/ext/mysqlnd/mysqlnd_libmysql_compat.h +++ b/ext/mysqlnd/mysqlnd_libmysql_compat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c index ab7a1ae9eb..a29a5a186d 100644 --- a/ext/mysqlnd/mysqlnd_loaddata.c +++ b/ext/mysqlnd/mysqlnd_loaddata.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index 6333875e18..da92acfbff 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_net.h b/ext/mysqlnd/mysqlnd_net.h index 76a474bc5f..699dd7f7d5 100644 --- a/ext/mysqlnd/mysqlnd_net.h +++ b/ext/mysqlnd/mysqlnd_net.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c index 7f5fb9b03f..3bb3c05147 100644 --- a/ext/mysqlnd/mysqlnd_plugin.c +++ b/ext/mysqlnd/mysqlnd_plugin.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h index 79e67da464..f05e352baa 100644 --- a/ext/mysqlnd/mysqlnd_priv.h +++ b/ext/mysqlnd/mysqlnd_priv.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 458ce47ff6..1b2602e6b6 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -115,7 +115,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC) SET_OOM_ERROR(*conn->error_info); DBG_RETURN(NULL); } - memset(set->data, 0, (size_t)(result->stored_data->row_count * result->meta->field_count * sizeof(zval)));; + memset(set->data, 0, (size_t)(result->stored_data->row_count * result->meta->field_count * sizeof(zval))); } /* Position at the first row */ set->data_cursor = set->data; diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index 7cb462960b..e98d1c3a52 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -200,17 +200,27 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l /* The following cast is guaranteed to do the right thing */ dval = (double) d32val; } +#elif defined(PHP_WIN32) + { + /* float datatype on Winows is already 4 byte but has a precision of 7 digits */ + char num_buf[2048]; + (void)_gcvt_s(num_buf, 2048, fval, field->decimals >= 31 ? 7 : field->decimals); + dval = zend_strtod(num_buf, NULL); + } #else { char num_buf[2048]; /* Over allocated */ char *s; +#ifndef FLT_DIG +# define FLT_DIG 6 +#endif /* Convert to string. Ignoring localization, etc. * Following MySQL's rules. If precision is undefined (NOT_FIXED_DEC i.e. 31) * or larger than 31, the value is limited to 6 (FLT_DIG). */ s = php_gcvt(fval, - field->decimals >= 31 ? 6 : field->decimals, + field->decimals >= 31 ? FLT_DIG : field->decimals, '.', 'e', num_buf); diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index ea275be192..610642d8de 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_result.h b/ext/mysqlnd/mysqlnd_result.h index f7e22a1d87..700efed83e 100644 --- a/ext/mysqlnd/mysqlnd_result.h +++ b/ext/mysqlnd/mysqlnd_result.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_result_meta.c b/ext/mysqlnd/mysqlnd_result_meta.c index 056e3dcef7..447de33ac9 100644 --- a/ext/mysqlnd/mysqlnd_result_meta.c +++ b/ext/mysqlnd/mysqlnd_result_meta.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_result_meta.h b/ext/mysqlnd/mysqlnd_result_meta.h index 97720adba1..91388b65a5 100644 --- a/ext/mysqlnd/mysqlnd_result_meta.h +++ b/ext/mysqlnd/mysqlnd_result_meta.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_reverse_api.c b/ext/mysqlnd/mysqlnd_reverse_api.c index 49684876a4..553a507818 100644 --- a/ext/mysqlnd/mysqlnd_reverse_api.c +++ b/ext/mysqlnd/mysqlnd_reverse_api.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_reverse_api.h b/ext/mysqlnd/mysqlnd_reverse_api.h index 79c0feb60a..58a1ddd087 100644 --- a/ext/mysqlnd/mysqlnd_reverse_api.h +++ b/ext/mysqlnd/mysqlnd_reverse_api.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c index a664f9b578..e25befbc15 100644 --- a/ext/mysqlnd/mysqlnd_statistics.c +++ b/ext/mysqlnd/mysqlnd_statistics.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_statistics.h b/ext/mysqlnd/mysqlnd_statistics.h index 0493d89396..bfc316ec59 100644 --- a/ext/mysqlnd/mysqlnd_statistics.h +++ b/ext/mysqlnd/mysqlnd_statistics.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index a50600f4bc..6be8b68034 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -23,7 +23,7 @@ #ifndef MYSQLND_STRUCTS_H #define MYSQLND_STRUCTS_H -#include "ext/standard/php_smart_str_public.h" +#include "zend_smart_str_public.h" #define MYSQLND_TYPEDEFED_METHODS @@ -56,9 +56,9 @@ struct st_mysqlnd_memory_pool_chunk size_t app; MYSQLND_MEMORY_POOL *pool; zend_uchar *ptr; - unsigned int size; enum_func_status (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC); void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC); + unsigned int size; zend_bool from_pool; }; @@ -869,11 +869,10 @@ struct st_mysqlnd_net_data struct st_mysqlnd_net { - struct st_mysqlnd_net_data * data; + /* cmd buffer */ + MYSQLND_CMD_BUFFER cmd_buffer; - /* sequence for simple checking of correct packets */ - zend_uchar packet_no; - zend_uchar compressed_envelope_packet_no; + struct st_mysqlnd_net_data * data; #ifdef MYSQLND_COMPRESSION_ENABLED MYSQLND_READ_BUFFER * uncompressed_data; @@ -881,10 +880,11 @@ struct st_mysqlnd_net void * unused_pad1; #endif - /* cmd buffer */ - MYSQLND_CMD_BUFFER cmd_buffer; - zend_bool persistent; + + /* sequence for simple checking of correct packets */ + zend_uchar packet_no; + zend_uchar compressed_envelope_packet_no; }; @@ -994,14 +994,17 @@ struct st_mysqlnd_result_metadata { MYSQLND_FIELD *fields; struct mysqlnd_field_hash_key *zend_hash_keys; - unsigned int current_field; - unsigned int field_count; + + struct st_mysqlnd_res_meta_methods * m; + + size_t bit_fields_total_len; /* trailing \0 not counted */ /* We need this to make fast allocs in rowp_read */ unsigned int bit_fields_count; - size_t bit_fields_total_len; /* trailing \0 not counted */ - zend_bool persistent; - struct st_mysqlnd_res_meta_methods * m; + unsigned int current_field; + unsigned int field_count; + + zend_bool persistent; }; @@ -1055,6 +1058,8 @@ struct st_mysqlnd_buffered_result_c struct st_mysqlnd_unbuffered_result { + struct st_mysqlnd_result_unbuffered_methods m; + uint64_t row_count; /* For unbuffered (both normal and PS) */ zval *last_row_data; @@ -1070,14 +1075,13 @@ struct st_mysqlnd_unbuffered_result struct st_mysqlnd_packet_row * row_packet; - uint64_t row_count; + unsigned int field_count; + zend_bool eof_reached; - unsigned int field_count; zend_bool ps; zend_bool persistent; - struct st_mysqlnd_result_unbuffered_methods m; }; diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index a6e2517b2b..1d86df7859 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -524,7 +524,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC int1store(p, packet->auth_data_len); ++p; /*!!!!! is the buffer big enough ??? */ - if ((sizeof(buffer) - (p - buffer)) < packet->auth_data_len) { + if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) { DBG_ERR("the stack buffer was not enough!!"); DBG_RETURN(0); } @@ -596,7 +596,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC } ZEND_HASH_FOREACH_END(); } #endif - if ((sizeof(buffer) - (p - buffer)) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len))) { + if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - buffer))) { p = php_mysqlnd_net_store_length(p, ca_payload_len); #ifdef OLD_CODE diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index b40808d595..5238715987 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -90,20 +90,20 @@ typedef struct st_mysqlnd_packet_greet { /* Client authenticates */ typedef struct st_mysqlnd_packet_auth { MYSQLND_PACKET_HEADER header; - uint32_t client_flags; - uint32_t max_packet_size; - uint8_t charset_no; const char *user; const zend_uchar *auth_data; size_t auth_data_len; const char *db; const char *auth_plugin_name; + uint32_t client_flags; + uint32_t max_packet_size; + uint8_t charset_no; /* Here the packet ends. This is user supplied data */ - size_t db_len; zend_bool send_auth_data; zend_bool is_change_user_packet; zend_bool silent; HashTable *connect_attr; + size_t db_len; } MYSQLND_PACKET_AUTH; /* Auth response packet */ diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index 33c57c23d5..a16018f6ba 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -27,7 +27,7 @@ #include "mysqlnd_statistics.h" #include "mysqlnd_reverse_api.h" #include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" /* {{{ mysqlnd_functions[] * diff --git a/ext/mysqlnd/php_mysqlnd.h b/ext/mysqlnd/php_mysqlnd.h index dc39028900..d81e0a0799 100644 --- a/ext/mysqlnd/php_mysqlnd.h +++ b/ext/mysqlnd/php_mysqlnd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 3c63692533..dba13ced93 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -33,7 +33,7 @@ #include "php.h" #include "ext/standard/info.h" #include "php_ini.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #if HAVE_OCI8 @@ -1383,9 +1383,9 @@ PHP_MINFO_FUNCTION(oci) php_info_print_table_start(); php_info_print_table_header(2, "Statistics", ""); - snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent)); + snprintf(buf, sizeof(buf), "%pd", OCI_G(num_persistent)); php_info_print_table_row(2, "Active Persistent Connections", buf); - snprintf(buf, sizeof(buf), "%ld", OCI_G(num_links)); + snprintf(buf, sizeof(buf), "%pd", OCI_G(num_links)); php_info_print_table_row(2, "Active Connections", buf); php_info_print_table_end(); } @@ -1758,9 +1758,9 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus php_oci_connection *connection; char *username, *password; char *dbname = NULL, *charset = NULL; - int username_len = 0, password_len = 0; - int dbname_len = 0, charset_len = 0; - long session_mode = OCI_DEFAULT; + size_t username_len = 0, password_len = 0; + size_t dbname_len = 0, charset_len = 0; + zend_long session_mode = OCI_DEFAULT; /* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) { @@ -1789,7 +1789,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus if (!connection) { RETURN_FALSE; } - RETURN_RESOURCE(connection->id); + RETURN_RES(connection->id); } /* }}} */ @@ -1799,7 +1799,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus * The real connect function. Allocates all the resources needed, establishes the connection and * returns the result handle (or NULL) */ -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC) +php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC) { zval *zvp; zend_resource *le; @@ -1815,7 +1815,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char ub2 charsetid_nls_lang = 0; if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%ld)", session_mode); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%pd)", session_mode); return NULL; } if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) { @@ -1889,7 +1889,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0); if (password_len) { - ulong password_hash; + zend_ulong password_hash; password_hash = zend_inline_hash_func(password, password_len); smart_str_append_unsigned_ex(&hashed_details, password_hash, 0); } @@ -1949,9 +1949,8 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char int type, link; void *ptr; - link = OCI8_PTR_TO_INT(le->ptr); - ptr = zend_list_find(link, &type); /* PHPNG TODO */ - if (ptr && (type == le_connection)) { + ptr = le->ptr; /* PHPNG TODO */ + if (ptr && (le->type == le_connection)) { connection = (php_oci_connection *)ptr; } } @@ -1972,7 +1971,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char */ if (connection && connection->is_persistent && connection->is_stub) { if (php_oci_create_session(connection, NULL, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) { - smart_str_free_ex(&hashed_details, 0); + smart_str_free(&hashed_details); zend_hash_del(&EG(persistent_list), connection->hash_key); return NULL; @@ -2007,10 +2006,10 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* okay, the connection is open and the server is still alive */ connection->used_this_request = 1; - tmp = (php_oci_connection *)zend_list_find(connection->id, &rsrc_type); + tmp = (php_oci_connection *)connection->id->ptr; if (tmp != NULL && rsrc_type == le_pconnection && tmp->hash_key->len == hashed_details.s->len && - memcmp(tmp->hash_key->val, hashed_details.s->val, tmp->hash_key->len) == 0 && zend_list_addref(connection->id) == SUCCESS) { + memcmp(tmp->hash_key->val, hashed_details.s->val, tmp->hash_key->len) == 0 && ++GC_REFCOUNT(connection->id) == SUCCESS) { /* do nothing */ } else { PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); @@ -2020,18 +2019,18 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char * decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { - zend_list_addref(connection->id); + ++GC_REFCOUNT(connection->id); } } - smart_str_free_ex(&hashed_details, 0); + smart_str_free(&hashed_details); return connection; } } /* server died */ } else { /* we do not ping non-persistent connections */ - smart_str_free_ex(&hashed_details, 0); - zend_list_addref(connection->id); + smart_str_free(&hashed_details); + ++GC_REFCOUNT(connection->id); return connection; } } /* is_open is true? */ @@ -2048,7 +2047,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* We have to do a hash_del but need to preserve the resource if there is a positive * refcount. Set the data pointer in the list entry to NULL */ - if (connection == zend_list_find(connection->id, &rsrc_type) && rsrc_type == le_pconnection) { + if (connection == connection->id->ptr && rsrc_type == le_pconnection) { le->ptr = NULL; } @@ -2083,7 +2082,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) { /* all persistent connactions are in use, fallback to non-persistent connection creation */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%ld)", OCI_G(num_persistent)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent)); alloc_non_persistent = 1; } } @@ -2131,7 +2130,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char if ((session_pool = php_oci_get_spool(username, username_len, password, password_len, dbname, dbname_len, charsetid ? charsetid:charsetid_nls_lang TSRMLS_CC))==NULL) { php_oci_connection_close(connection TSRMLS_CC); - smart_str_free_ex(&hashed_details, 0); + smart_str_free(&hashed_details); return NULL; } } @@ -2142,7 +2141,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* Mark password as unchanged by PHP during the duration of the database session */ connection->passwd_changed = 0; - smart_str_free_ex(&hashed_details, 0); + smart_str_free(&hashed_details); if (charsetid) { connection->charset = charsetid; @@ -2181,14 +2180,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char * refcount is decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { - zend_list_addref(connection->id); + ++GC_REFCOUNT(connection->id); } zend_hash_update_mem(&EG(persistent_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource)); OCI_G(num_persistent)++; OCI_G(num_links)++; } else if (!exclusive) { PHP_OCI_REGISTER_RESOURCE(connection, le_connection); - new_le.ptr = OCI8_INT_TO_PTR(connection->id); + new_le.ptr = connection->id; new_le.type = le_index_ptr; zend_hash_update_mem(&EG(regular_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource)); OCI_G(num_links)++; @@ -2564,15 +2563,15 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR } if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */ - ZVAL_RESOURCE(value, column->stmtid); - zend_list_addref(column->stmtid); + zend_register_resource(value, column->stmtid, 0 TSRMLS_CC); /* XXX type correct? */ + ++GC_REFCOUNT(column->stmtid); } else if (column->is_descr) { if (column->data_type != SQLT_RDD) { int rsrc_type; /* reset descriptor's length */ - descriptor = (php_oci_descriptor *) zend_list_find(column->descid, &rsrc_type); + descriptor = (php_oci_descriptor *) column->descid->ptr; if (!descriptor || rsrc_type != le_descriptor) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find LOB descriptor #%d", column->descid); @@ -2608,7 +2607,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR /* return the locator */ object_init_ex(value, oci_lob_class_entry_ptr); add_property_resource(value, "descriptor", column->descid); - zend_list_addref(column->descid); + ++GC_REFCOUNT(column->descid); } } else { switch (column->retcode) { @@ -2648,7 +2647,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg php_oci_out_column *column; ub4 nrows = 1; int i; - long fetch_mode = 0; + zend_long fetch_mode = 0; if (expected_args > 2) { /* only for ocifetchinto BC */ @@ -2762,19 +2761,18 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg } if (!(column->indicator == -1)) { - zval *element; + zval element; - MAKE_STD_ZVAL(element); - php_oci_column_to_zval(column, element, fetch_mode TSRMLS_CC); + php_oci_column_to_zval(column, &element, fetch_mode TSRMLS_CC); if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) { - add_index_zval(return_value, i, element); + add_index_zval(return_value, i, &element); } if (fetch_mode & PHP_OCI_ASSOC) { if (fetch_mode & PHP_OCI_NUM) { - Z_ADDREF_P(element); + Z_ADDREF(element); } - add_assoc_zval(return_value, column->name, element); + add_assoc_zval(return_value, column->name, &element); } } else { @@ -2789,7 +2787,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg if (expected_args > 2) { /* Only for ocifetchinto BC. In all other cases we return array, not long */ - REPLACE_ZVAL_VALUE(&array, return_value, 1); /* copy return_value to given reference */ + ZVAL_COPY_VALUE(array, return_value); /* copy return_value to given reference */ zval_dtor(return_value); RETURN_LONG(statement->ncolumns); } @@ -2976,6 +2974,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * zend_resource spool_le = {0}; zend_resource *spool_out_le = NULL; zend_bool iserror = 0; + zval *spool_out_zv = NULL; /* {{{ Create the spool hash key */ smart_str_appendl_ex(&spool_hashed_details, "oci8spool***", sizeof("oci8spool***") - 1, 0); @@ -2987,7 +2986,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * } smart_str_appendl_ex(&spool_hashed_details, "**", sizeof("**") - 1, 0); if (password_len) { - ulong password_hash; + zend_ulong password_hash; password_hash = zend_inline_hash_func(password, password_len); smart_str_append_unsigned_ex(&spool_hashed_details, password_hash, 0); } @@ -3007,7 +3006,12 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * php_strtolower(spool_hashed_details.s->val, spool_hashed_details.s->len); /* }}} */ - if ((spool_out_le = zend_hash_find(&EG(persistent_list), spool_hashed_details.s)) == NULL) { + spool_out_zv = zend_hash_find(&EG(persistent_list), spool_hashed_details.s); + if (spool_out_zv != NULL) { + spool_out_le = Z_RES_P(spool_out_zv); + } + + if (spool_out_le == NULL) { session_pool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, spool_hashed_details.s, charsetid TSRMLS_CC); @@ -3027,7 +3031,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * } exit_get_spool: - smart_str_free_ex(&spool_hashed_details, 0); + smart_str_free(&spool_hashed_details); if (iserror && session_pool) { php_oci_spool_close(session_pool TSRMLS_CC); session_pool = NULL; diff --git a/ext/oci8/oci8.dsp b/ext/oci8/oci8.dsp deleted file mode 100644 index f0b27fa824..0000000000 --- a/ext/oci8/oci8.dsp +++ /dev/null @@ -1,133 +0,0 @@ -# Microsoft Developer Studio Project File - Name="oci8" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=oci8 - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "oci8.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "oci8.mak" CFG="oci8 - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "oci8 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "oci8 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "oci8 - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\instantclient" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /D PHP_OCI8_HAVE_COLLECTIONS=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php4ts.lib oci.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_oci8.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\lib\instantclient" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "oci8 - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\instantclient" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTP_EXPORTS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /D PHP_OCI8_HAVE_COLLECTIONS=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php4ts_debug.lib oci.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_oci8.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\lib\instantclient"
-
-!ENDIF
-
-# Begin Target
-
-# Name "oci8 - Win32 Release_TS"
-# Name "oci8 - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\oci8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_collection.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_interface.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_lob.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_statement.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_oci8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_oci8_int.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index d525ef4a9b..341a983ef5 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -56,7 +56,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch collection->connection = connection; collection->collection = NULL; - zend_list_addref(collection->connection->id); + ++GC_REFCOUNT(collection->connection->id); /* get type handle by name */ PHP_OCI_CALL_RETURN(errstatus, OCITypeByName, @@ -260,7 +260,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC) /* {{{ php_oci_collection_max() Return max number of elements in the collection */ -int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC) +int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC) { php_oci_connection *connection = collection->connection; @@ -273,7 +273,7 @@ int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC) /* {{{ php_oci_collection_trim() Trim collection to the given number of elements */ -int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC) +int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC) { php_oci_connection *connection = collection->connection; sword errstatus; @@ -473,7 +473,7 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int /* {{{ php_oci_collection_element_get() Get the element with the given index */ -int php_oci_collection_element_get(php_oci_collection *collection, long index, zval **result_element TSRMLS_DC) +int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC) { php_oci_connection *connection = collection->connection; dvoid *element; @@ -483,8 +483,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z ub4 buff_len = 1024; sword errstatus; - MAKE_STD_ZVAL(*result_element); - ZVAL_NULL(*result_element); + ZVAL_NULL(result_element); connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ @@ -503,13 +502,11 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - FREE_ZVAL(*result_element); return 1; } if (exists == 0) { /* element doesn't exist */ - FREE_ZVAL(*result_element); return 1; } @@ -525,12 +522,11 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - FREE_ZVAL(*result_element); return 1; } - ZVAL_STRINGL(*result_element, (char *)buff, buff_len, 1); - Z_STRVAL_P(*result_element)[buff_len] = '\0'; + ZVAL_STRINGL(result_element, (char *)buff, buff_len); + Z_STRVAL_P(result_element)[buff_len] = '\0'; return 0; break; @@ -543,7 +539,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string)); if (str) { - ZVAL_STRING(*result_element, (char *)str, 1); + ZVAL_STRING(result_element, (char *)str); } return 0; } @@ -568,18 +564,16 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - FREE_ZVAL(*result_element); return 1; } - ZVAL_DOUBLE(*result_element, double_number); + ZVAL_DOUBLE(result_element, double_number); return 0; } break; default: php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode); - FREE_ZVAL(*result_element); return 1; break; } @@ -590,7 +584,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z /* {{{ php_oci_collection_element_set_null() Set the element with the given index to NULL */ -int php_oci_collection_element_set_null(php_oci_collection *collection, long index TSRMLS_DC) +int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC) { OCIInd null_index = OCI_IND_NULL; php_oci_connection *connection = collection->connection; @@ -611,7 +605,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, long ind /* {{{ php_oci_collection_element_set_date() Change element's value to the given DATE */ -int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC) +int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; @@ -652,7 +646,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind /* {{{ php_oci_collection_element_set_number() Change element's value to the given NUMBER */ -int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC) +int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; double element_double; @@ -694,7 +688,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i /* {{{ php_oci_collection_element_set_string() Change element's value to the given string */ -int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC) +int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC) { OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; @@ -733,7 +727,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i /* {{{ php_oci_collection_element_set() Collection element setter */ -int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC) +int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC) { if (value_len == 0) { return php_oci_collection_element_set_null(collection, index TSRMLS_CC); diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index 198493b946..6c73ad0a32 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -51,8 +51,8 @@ PHP_FUNCTION(oci_define_by_name) { zval *stmt, *var; char *name; - int name_len; - long type = 0; + size_t name_len; + zend_long type = 0; php_oci_statement *statement; php_oci_define *define, *tmp_define; @@ -74,7 +74,8 @@ PHP_FUNCTION(oci_define_by_name) define = ecalloc(1,sizeof(php_oci_define)); - if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { + //if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { + if ((tmp_define = zend_hash_add_new_ptr(statement->defines, zend_string_init(name, name_len, 0), define)) != NULL) { efree(define); define = tmp_define; } else { @@ -85,8 +86,8 @@ PHP_FUNCTION(oci_define_by_name) define->name = (text*) estrndup(name, name_len); define->name_len = name_len; define->type = type; - define->zval = var; - zval_add_ref(&var); + memmove(&define->zval, var, sizeof(zval)); + Z_ADDREF_P(var); RETURN_TRUE; } @@ -98,8 +99,8 @@ PHP_FUNCTION(oci_define_by_name) PHP_FUNCTION(oci_bind_by_name) { ub2 bind_type = SQLT_CHR; /* unterminated string */ - int name_len; - long maxlen = -1, type = 0; + size_t name_len; + zend_long maxlen = -1, type = 0; char *name; zval *z_statement; zval *bind_var = NULL; @@ -126,10 +127,10 @@ PHP_FUNCTION(oci_bind_by_name) Bind a PHP array to an Oracle PL/SQL type by name */ PHP_FUNCTION(oci_bind_array_by_name) { - int name_len; - long max_item_len = -1; - long max_array_len = 0; - long type = SQLT_AFC; + size_t name_len; + zend_long max_item_len = -1; + zend_long max_array_len = 0; + zend_long type = SQLT_AFC; char *name; zval *z_statement; zval *bind_var = NULL; @@ -161,7 +162,7 @@ PHP_FUNCTION(oci_bind_array_by_name) Deletes large object description */ PHP_FUNCTION(oci_free_descriptor) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; if (!getThis()) { @@ -170,12 +171,12 @@ PHP_FUNCTION(oci_free_descriptor) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); zend_list_delete(descriptor->id); RETURN_TRUE; @@ -186,11 +187,11 @@ PHP_FUNCTION(oci_free_descriptor) Saves a large object */ PHP_FUNCTION(oci_lob_save) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *data; - int data_len; - long offset = 0; + size_t data_len; + zend_long offset = 0; ub4 bytes_written; if (getThis()) { @@ -204,12 +205,12 @@ PHP_FUNCTION(oci_lob_save) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (offset < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0"); @@ -227,10 +228,10 @@ PHP_FUNCTION(oci_lob_save) Loads file into a LOB */ PHP_FUNCTION(oci_lob_import) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *filename; - int filename_len; + size_t filename_len; if (getThis()) { #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) @@ -259,12 +260,12 @@ PHP_FUNCTION(oci_lob_import) } #endif - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_import(descriptor, filename TSRMLS_CC)) { RETURN_FALSE; @@ -277,7 +278,7 @@ PHP_FUNCTION(oci_lob_import) Loads a large object */ PHP_FUNCTION(oci_lob_load) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *buffer = NULL; ub4 buffer_len; @@ -288,18 +289,18 @@ PHP_FUNCTION(oci_lob_load) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) { RETURN_FALSE; } if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); + RETURN_STRINGL(buffer, buffer_len); } else { RETURN_EMPTY_STRING(); @@ -311,9 +312,9 @@ PHP_FUNCTION(oci_lob_load) Reads particular part of a large object */ PHP_FUNCTION(oci_lob_read) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - long length; + zend_long length; char *buffer; ub4 buffer_len; @@ -328,12 +329,12 @@ PHP_FUNCTION(oci_lob_read) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (length <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0"); @@ -344,7 +345,7 @@ PHP_FUNCTION(oci_lob_read) RETURN_FALSE; } if (buffer_len > 0) { - RETURN_STRINGL(buffer, buffer_len, 0); + RETURN_STRINGL(buffer, buffer_len); } else { RETURN_EMPTY_STRING(); @@ -356,7 +357,7 @@ PHP_FUNCTION(oci_lob_read) Checks if EOF is reached */ PHP_FUNCTION(oci_lob_eof) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; ub4 lob_length; @@ -366,12 +367,12 @@ PHP_FUNCTION(oci_lob_eof) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (!php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC) && lob_length >= 0) { if (lob_length == descriptor->lob_current_position) { @@ -386,7 +387,7 @@ PHP_FUNCTION(oci_lob_eof) Tells LOB pointer position */ PHP_FUNCTION(oci_lob_tell) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; if (!getThis()) { @@ -395,12 +396,12 @@ PHP_FUNCTION(oci_lob_tell) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); RETURN_LONG(descriptor->lob_current_position); } @@ -410,7 +411,7 @@ PHP_FUNCTION(oci_lob_tell) Rewind pointer of a LOB */ PHP_FUNCTION(oci_lob_rewind) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; if (!getThis()) { @@ -419,12 +420,12 @@ PHP_FUNCTION(oci_lob_rewind) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); descriptor->lob_current_position = 0; @@ -436,9 +437,9 @@ PHP_FUNCTION(oci_lob_rewind) Moves the pointer of a LOB */ PHP_FUNCTION(oci_lob_seek) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - long offset, whence = PHP_OCI_SEEK_SET; + zend_long offset, whence = PHP_OCI_SEEK_SET; ub4 lob_length; if (getThis()) { @@ -452,12 +453,12 @@ PHP_FUNCTION(oci_lob_seek) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { RETURN_FALSE; @@ -488,7 +489,7 @@ PHP_FUNCTION(oci_lob_seek) Returns size of a large object */ PHP_FUNCTION(oci_lob_size) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; ub4 lob_length; @@ -498,12 +499,12 @@ PHP_FUNCTION(oci_lob_size) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { RETURN_FALSE; @@ -516,10 +517,10 @@ PHP_FUNCTION(oci_lob_size) Writes data to current position of a LOB */ PHP_FUNCTION(oci_lob_write) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - int data_len; - long write_len = 0; + size_t data_len; + zend_long write_len = 0; ub4 bytes_written; char *data; @@ -542,12 +543,12 @@ PHP_FUNCTION(oci_lob_write) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (data_len <= 0) { RETURN_LONG(0); @@ -564,7 +565,7 @@ PHP_FUNCTION(oci_lob_write) Appends data from a LOB to another LOB */ PHP_FUNCTION(oci_lob_append) { - zval **tmp_dest, **tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from; + zval *tmp_dest, *tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from; php_oci_descriptor *descriptor_dest, *descriptor_from; if (getThis()) { @@ -578,18 +579,18 @@ PHP_FUNCTION(oci_lob_append) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) { + if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); RETURN_FALSE; } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) { + if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest); - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from); if (php_oci_lob_append(descriptor_dest, descriptor_from TSRMLS_CC)) { RETURN_FALSE; @@ -603,9 +604,9 @@ PHP_FUNCTION(oci_lob_append) Truncates a LOB */ PHP_FUNCTION(oci_lob_truncate) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - long trim_length = 0; + zend_long trim_length = 0; ub4 ub_trim_length; if (getThis()) { @@ -619,7 +620,7 @@ PHP_FUNCTION(oci_lob_truncate) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } @@ -630,7 +631,7 @@ PHP_FUNCTION(oci_lob_truncate) } ub_trim_length = (ub4) trim_length; - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_truncate(descriptor, ub_trim_length TSRMLS_CC)) { RETURN_FALSE; @@ -643,10 +644,10 @@ PHP_FUNCTION(oci_lob_truncate) Erases a specified portion of the internal LOB, starting at a specified offset */ PHP_FUNCTION(oci_lob_erase) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; ub4 bytes_erased; - long offset = -1, length = -1; + zend_long offset = -1, length = -1; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &offset, &length) == FAILURE) { @@ -679,12 +680,12 @@ PHP_FUNCTION(oci_lob_erase) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased TSRMLS_CC)) { RETURN_FALSE; @@ -697,9 +698,9 @@ PHP_FUNCTION(oci_lob_erase) Flushes the LOB buffer */ PHP_FUNCTION(oci_lob_flush) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - long flush_flag = 0; + zend_long flush_flag = 0; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flush_flag) == FAILURE) { @@ -712,12 +713,12 @@ PHP_FUNCTION(oci_lob_flush) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { /* buffering wasn't enabled, there is nothing to flush */ @@ -735,7 +736,7 @@ PHP_FUNCTION(oci_lob_flush) Enables/disables buffering for a LOB */ PHP_FUNCTION(ocisetbufferinglob) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; zend_bool flag; @@ -750,12 +751,12 @@ PHP_FUNCTION(ocisetbufferinglob) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_set_buffering(descriptor, flag TSRMLS_CC)) { RETURN_FALSE; @@ -768,7 +769,7 @@ PHP_FUNCTION(ocisetbufferinglob) Returns current state of buffering for a LOB */ PHP_FUNCTION(ocigetbufferinglob) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; if (!getThis()) { @@ -777,12 +778,12 @@ PHP_FUNCTION(ocigetbufferinglob) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { RETURN_TRUE; @@ -795,26 +796,26 @@ PHP_FUNCTION(ocigetbufferinglob) Copies data from a LOB to another LOB */ PHP_FUNCTION(oci_lob_copy) { - zval **tmp_dest, **tmp_from, *z_descriptor_dest, *z_descriptor_from; + zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from; php_oci_descriptor *descriptor_dest, *descriptor_from; - long length = 0; + zend_long length = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) { return; } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) { + if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); RETURN_FALSE; } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) { + if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest); - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from); if (ZEND_NUM_ARGS() == 3 && length < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0"); @@ -837,7 +838,7 @@ PHP_FUNCTION(oci_lob_copy) Tests to see if two LOB/FILE locators are equal */ PHP_FUNCTION(oci_lob_is_equal) { - zval **tmp_first, **tmp_second, *z_descriptor_first, *z_descriptor_second; + zval *tmp_first, *tmp_second, *z_descriptor_first, *z_descriptor_second; php_oci_descriptor *descriptor_first, *descriptor_second; boolean is_equal; @@ -845,18 +846,18 @@ PHP_FUNCTION(oci_lob_is_equal) return; } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"), (void **)&tmp_first) == FAILURE) { + if ((tmp_first = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object"); RETURN_FALSE; } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"), (void **)&tmp_second) == FAILURE) { + if ((tmp_second = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_first, descriptor_first); - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_second, descriptor_second); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_first, descriptor_first); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_second, descriptor_second); if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal TSRMLS_CC)) { RETURN_FALSE; @@ -873,12 +874,12 @@ PHP_FUNCTION(oci_lob_is_equal) Writes a large object into a file */ PHP_FUNCTION(oci_lob_export) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *filename; char *buffer; - int filename_len; - long start = -1, length = -1, block_length; + size_t filename_len; + zend_long start = -1, length = -1, block_length; php_stream *stream; ub4 lob_length; @@ -927,12 +928,12 @@ PHP_FUNCTION(oci_lob_export) } #endif - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { RETURN_FALSE; @@ -1006,11 +1007,11 @@ PHP_FUNCTION(oci_lob_export) Writes temporary blob */ PHP_FUNCTION(oci_lob_write_temporary) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *data; - int data_len; - long type = OCI_TEMP_CLOB; + size_t data_len; + zend_long type = OCI_TEMP_CLOB; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) { @@ -1023,12 +1024,12 @@ PHP_FUNCTION(oci_lob_write_temporary) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) { RETURN_FALSE; @@ -1041,7 +1042,7 @@ PHP_FUNCTION(oci_lob_write_temporary) Closes lob descriptor */ PHP_FUNCTION(oci_lob_close) { - zval **tmp, *z_descriptor = getThis(); + zval *tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; if (!getThis()) { @@ -1050,12 +1051,12 @@ PHP_FUNCTION(oci_lob_close) } } - if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor); if (php_oci_lob_close(descriptor TSRMLS_CC)) { RETURN_FALSE; @@ -1071,7 +1072,7 @@ PHP_FUNCTION(oci_new_descriptor) zval *z_connection; php_oci_connection *connection; php_oci_descriptor *descriptor; - long type = OCI_DTYPE_LOB; + zend_long type = OCI_DTYPE_LOB; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_connection, &type) == FAILURE) { return; @@ -1146,7 +1147,7 @@ PHP_FUNCTION(oci_field_name) php_oci_out_column *column; if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) { - RETURN_STRINGL(column->name, column->name_len, 1); + RETURN_STRINGL(column->name, column->name_len); } RETURN_FALSE; } @@ -1210,64 +1211,64 @@ PHP_FUNCTION(oci_field_type) switch (column->data_type) { #ifdef SQLT_TIMESTAMP case SQLT_TIMESTAMP: - RETVAL_STRING("TIMESTAMP",1); + RETVAL_STRING("TIMESTAMP"); break; #endif #ifdef SQLT_TIMESTAMP_TZ case SQLT_TIMESTAMP_TZ: - RETVAL_STRING("TIMESTAMP WITH TIMEZONE",1); + RETVAL_STRING("TIMESTAMP WITH TIMEZONE"); break; #endif #ifdef SQLT_TIMESTAMP_LTZ case SQLT_TIMESTAMP_LTZ: - RETVAL_STRING("TIMESTAMP WITH LOCAL TIMEZONE",1); + RETVAL_STRING("TIMESTAMP WITH LOCAL TIMEZONE"); break; #endif #ifdef SQLT_INTERVAL_YM case SQLT_INTERVAL_YM: - RETVAL_STRING("INTERVAL YEAR TO MONTH",1); + RETVAL_STRING("INTERVAL YEAR TO MONTH"); break; #endif #ifdef SQLT_INTERVAL_DS case SQLT_INTERVAL_DS: - RETVAL_STRING("INTERVAL DAY TO SECOND",1); + RETVAL_STRING("INTERVAL DAY TO SECOND"); break; #endif case SQLT_DAT: - RETVAL_STRING("DATE",1); + RETVAL_STRING("DATE"); break; case SQLT_NUM: - RETVAL_STRING("NUMBER",1); + RETVAL_STRING("NUMBER"); break; case SQLT_LNG: - RETVAL_STRING("LONG",1); + RETVAL_STRING("LONG"); break; case SQLT_BIN: - RETVAL_STRING("RAW",1); + RETVAL_STRING("RAW"); break; case SQLT_LBI: - RETVAL_STRING("LONG RAW",1); + RETVAL_STRING("LONG RAW"); break; case SQLT_CHR: - RETVAL_STRING("VARCHAR2",1); + RETVAL_STRING("VARCHAR2"); break; case SQLT_RSET: - RETVAL_STRING("REFCURSOR",1); + RETVAL_STRING("REFCURSOR"); break; case SQLT_AFC: - RETVAL_STRING("CHAR",1); + RETVAL_STRING("CHAR"); break; case SQLT_BLOB: - RETVAL_STRING("BLOB",1); + RETVAL_STRING("BLOB"); break; case SQLT_CLOB: - RETVAL_STRING("CLOB",1); + RETVAL_STRING("CLOB"); break; case SQLT_BFILE: - RETVAL_STRING("BFILE",1); + RETVAL_STRING("BFILE"); break; case SQLT_RDD: - RETVAL_STRING("ROWID",1); + RETVAL_STRING("ROWID"); break; default: RETVAL_LONG(column->data_type); @@ -1318,7 +1319,7 @@ PHP_FUNCTION(oci_execute) { zval *z_statement; php_oci_statement *statement; - long mode = OCI_COMMIT_ON_SUCCESS; + zend_long mode = OCI_COMMIT_ON_SUCCESS; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &mode) == FAILURE) { return; @@ -1386,13 +1387,14 @@ PHP_FUNCTION(ocifetchinto) Fetch all rows of result data into an array */ PHP_FUNCTION(oci_fetch_all) { - zval *z_statement, *array, *element, *tmp; + zval *z_statement, *array; + zval element, tmp; php_oci_statement *statement; php_oci_out_column **columns; - zval ***outarrs; + zval **outarrs; ub4 nrows = 1; int i; - long rows = 0, flags = 0, skip = 0, maxrows = -1; + zend_long rows = 0, flags = 0, skip = 0, maxrows = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|lll", &z_statement, &array, &skip, &maxrows, &flags) == FAILURE) { return; @@ -1417,23 +1419,21 @@ PHP_FUNCTION(oci_fetch_all) } while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - zval *row; + zval row; - MAKE_STD_ZVAL(row); - array_init(row); + array_init(&row); for (i = 0; i < statement->ncolumns; i++) { - MAKE_STD_ZVAL(element); - php_oci_column_to_zval(columns[ i ], element, PHP_OCI_RETURN_LOBS TSRMLS_CC); + php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC); if (flags & PHP_OCI_NUM) { - zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL); + zend_hash_next_index_insert(Z_ARRVAL(row), &element); } else { /* default to ASSOC */ - zend_symtable_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); + zend_symtable_update(Z_ARRVAL(row), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &element); } } - zend_hash_next_index_insert(Z_ARRVAL_P(array), &row, sizeof(zval*), NULL); + zend_hash_next_index_insert(Z_ARRVAL_P(array), &row); rows++; if (maxrows != -1 && rows == maxrows) { @@ -1451,25 +1451,22 @@ PHP_FUNCTION(oci_fetch_all) for (i = 0; i < statement->ncolumns; i++) { columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - MAKE_STD_ZVAL(tmp); - array_init(tmp); - zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); + array_init(&tmp); + outarrs[ i ] = zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp); } } else { /* default to ASSOC */ for (i = 0; i < statement->ncolumns; i++) { columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - MAKE_STD_ZVAL(tmp); - array_init(tmp); - zend_symtable_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); + array_init(&tmp); + outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &tmp); } } while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { for (i = 0; i < statement->ncolumns; i++) { - MAKE_STD_ZVAL(element); - php_oci_column_to_zval(columns[ i ], element, PHP_OCI_RETURN_LOBS TSRMLS_CC); - zend_hash_index_update((*(outarrs[ i ]))->value.ht, rows, (void *)&element, sizeof(zval*), NULL); + php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC); + zend_hash_index_update(&(outarrs[ i ])->value.arr->ht, rows, &element); } rows++; @@ -1616,7 +1613,7 @@ PHP_FUNCTION(oci_error) } if (ZEND_NUM_ARGS() > 0) { - statement = (php_oci_statement *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement); + statement = (php_oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement); if (statement) { errh = statement->err; errcode = statement->errcode; @@ -1627,14 +1624,14 @@ PHP_FUNCTION(oci_error) goto go_out; } - connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection); + connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection); if (connection) { errh = connection->err; errcode = connection->errcode; goto go_out; } - connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection); + connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection); if (connection) { errh = connection->err; errcode = connection->errcode; @@ -1696,7 +1693,7 @@ PHP_FUNCTION(oci_parse) php_oci_connection *connection; php_oci_statement *statement; char *query; - int query_len; + size_t query_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &query, &query_len) == FAILURE) { return; @@ -1707,7 +1704,7 @@ PHP_FUNCTION(oci_parse) statement = php_oci_statement_create(connection, query, query_len TSRMLS_CC); if (statement) { - RETURN_RESOURCE(statement->id); + RETURN_RES(statement->id); } RETURN_FALSE; } @@ -1719,7 +1716,7 @@ PHP_FUNCTION(oci_set_prefetch) { zval *z_statement; php_oci_statement *statement; - long size; + zend_long size; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_statement, &size) == FAILURE) { return; @@ -1746,7 +1743,7 @@ PHP_FUNCTION(oci_set_client_identifier) zval *z_connection; php_oci_connection *connection; char *client_id; - int client_id_len; + size_t client_id_len; sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_id, &client_id_len) == FAILURE) { @@ -1796,7 +1793,7 @@ PHP_FUNCTION(oci_set_edition) { #if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2))) char *edition; - int edition_len; + size_t edition_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &edition, &edition_len) == FAILURE) { return; @@ -1830,7 +1827,7 @@ PHP_FUNCTION(oci_set_module_name) zval *z_connection; php_oci_connection *connection; char *module; - int module_len; + size_t module_len; sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &module, &module_len) == FAILURE) { @@ -1862,7 +1859,7 @@ PHP_FUNCTION(oci_set_action) zval *z_connection; php_oci_connection *connection; char *action; - int action_len; + size_t action_len; sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &action, &action_len) == FAILURE) { @@ -1894,7 +1891,7 @@ PHP_FUNCTION(oci_set_client_info) zval *z_connection; php_oci_connection *connection; char *client_info; - int client_info_len; + size_t client_info_len; sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_info, &client_info_len) == FAILURE) { @@ -1927,7 +1924,7 @@ PHP_FUNCTION(oci_set_db_operation) zval *z_connection; php_oci_connection *connection; char *dbop_name; - int dbop_name_len; + size_t dbop_name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &dbop_name, &dbop_name_len) == FAILURE) { return; @@ -1956,7 +1953,7 @@ PHP_FUNCTION(oci_password_change) { zval *z_connection; char *user, *pass_old, *pass_new, *dbname; - int user_len, pass_old_len, pass_new_len, dbname_len; + size_t user_len, pass_old_len, pass_new_len, dbname_len; php_oci_connection *connection; #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5) @@ -2006,7 +2003,7 @@ PHP_FUNCTION(oci_password_change) if (!connection) { RETURN_FALSE; } - RETURN_RESOURCE(connection->id); + RETURN_RES(connection->id); } WRONG_PARAM_COUNT; } @@ -2029,7 +2026,7 @@ PHP_FUNCTION(oci_new_cursor) statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC); if (statement) { - RETURN_RESOURCE(statement->id); + RETURN_RES(statement->id); } RETURN_FALSE; } @@ -2058,7 +2055,7 @@ PHP_FUNCTION(oci_client_version) char *version = NULL; php_oci_client_get_version(&version TSRMLS_CC); - RETURN_STRING(version, 0); + RETURN_STRING(version); } /* }}} */ @@ -2080,7 +2077,7 @@ PHP_FUNCTION(oci_server_version) RETURN_FALSE; } - RETURN_STRING(version, 0); + RETURN_STRING(version); } /* }}} */ @@ -2104,37 +2101,37 @@ PHP_FUNCTION(oci_statement_type) switch (type) { case OCI_STMT_SELECT: - RETVAL_STRING("SELECT",1); + RETVAL_STRING("SELECT"); break; case OCI_STMT_UPDATE: - RETVAL_STRING("UPDATE",1); + RETVAL_STRING("UPDATE"); break; case OCI_STMT_DELETE: - RETVAL_STRING("DELETE",1); + RETVAL_STRING("DELETE"); break; case OCI_STMT_INSERT: - RETVAL_STRING("INSERT",1); + RETVAL_STRING("INSERT"); break; case OCI_STMT_CREATE: - RETVAL_STRING("CREATE",1); + RETVAL_STRING("CREATE"); break; case OCI_STMT_DROP: - RETVAL_STRING("DROP",1); + RETVAL_STRING("DROP"); break; case OCI_STMT_ALTER: - RETVAL_STRING("ALTER",1); + RETVAL_STRING("ALTER"); break; case OCI_STMT_BEGIN: - RETVAL_STRING("BEGIN",1); + RETVAL_STRING("BEGIN"); break; case OCI_STMT_DECLARE: - RETVAL_STRING("DECLARE",1); + RETVAL_STRING("DECLARE"); break; case OCI_STMT_CALL: - RETVAL_STRING("CALL",1); + RETVAL_STRING("CALL"); break; default: - RETVAL_STRING("UNKNOWN",1); + RETVAL_STRING("UNKNOWN"); } } /* }}} */ @@ -2164,7 +2161,7 @@ PHP_FUNCTION(oci_num_rows) Deletes collection object*/ PHP_FUNCTION(oci_free_collection) { - zval **tmp, *z_collection = getThis(); + zval *tmp, *z_collection = getThis(); php_oci_collection *collection; if (!getThis()) { @@ -2173,12 +2170,12 @@ PHP_FUNCTION(oci_free_collection) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); zend_list_delete(collection->id); RETURN_TRUE; @@ -2189,10 +2186,10 @@ PHP_FUNCTION(oci_free_collection) Append an object to the collection */ PHP_FUNCTION(oci_collection_append) { - zval **tmp, *z_collection = getThis(); + zval *tmp, *z_collection = getThis(); php_oci_collection *collection; char *value; - int value_len; + size_t value_len; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) { @@ -2205,12 +2202,12 @@ PHP_FUNCTION(oci_collection_append) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_append(collection, value, value_len TSRMLS_CC)) { RETURN_FALSE; @@ -2223,10 +2220,10 @@ PHP_FUNCTION(oci_collection_append) Retrieve the value at collection index ndx */ PHP_FUNCTION(oci_collection_element_get) { - zval **tmp, *z_collection = getThis(); + zval *tmp, *z_collection = getThis(); php_oci_collection *collection; - long element_index; - zval *value; + zend_long element_index; + zval value; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &element_index) == FAILURE) { @@ -2239,20 +2236,18 @@ PHP_FUNCTION(oci_collection_element_get) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_element_get(collection, element_index, &value TSRMLS_CC)) { RETURN_FALSE; } - *return_value = *value; - zval_copy_ctor(return_value); - zval_ptr_dtor(&value); + RETURN_ZVAL(&value, 1, 1); } /* }}} */ @@ -2260,7 +2255,7 @@ PHP_FUNCTION(oci_collection_element_get) Assign a collection from another existing collection */ PHP_FUNCTION(oci_collection_assign) { - zval **tmp_dest, **tmp_from, *z_collection_dest = getThis(), *z_collection_from; + zval *tmp_dest, *tmp_from, *z_collection_dest = getThis(), *z_collection_from; php_oci_collection *collection_dest, *collection_from; if (getThis()) { @@ -2274,18 +2269,18 @@ PHP_FUNCTION(oci_collection_assign) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection_dest), "collection", sizeof("collection"), (void **)&tmp_dest) == FAILURE) { + if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_collection_dest), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The first argument should be valid collection object"); RETURN_FALSE; } - if (zend_hash_find(Z_OBJPROP_P(z_collection_from), "collection", sizeof("collection"), (void **)&tmp_from) == FAILURE) { + if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_collection_from), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The second argument should be valid collection object"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp_dest, collection_dest); - PHP_OCI_ZVAL_TO_COLLECTION(*tmp_from, collection_from); + PHP_OCI_ZVAL_TO_COLLECTION(tmp_dest, collection_dest); + PHP_OCI_ZVAL_TO_COLLECTION(tmp_from, collection_from); if (php_oci_collection_assign(collection_dest, collection_from TSRMLS_CC)) { RETURN_FALSE; @@ -2298,10 +2293,10 @@ PHP_FUNCTION(oci_collection_assign) Assign element val to collection at index ndx */ PHP_FUNCTION(oci_collection_element_assign) { - zval **tmp, *z_collection = getThis(); + zval *tmp, *z_collection = getThis(); php_oci_collection *collection; - int value_len; - long element_index; + size_t value_len; + zend_long element_index; char *value; if (getThis()) { @@ -2315,12 +2310,12 @@ PHP_FUNCTION(oci_collection_element_assign) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_element_set(collection, element_index, value, value_len TSRMLS_CC)) { RETURN_FALSE; @@ -2333,7 +2328,7 @@ PHP_FUNCTION(oci_collection_element_assign) Return the size of a collection */ PHP_FUNCTION(oci_collection_size) { - zval **tmp, *z_collection = getThis(); + zval *tmp, *z_collection = getThis(); php_oci_collection *collection; sb4 size = 0; @@ -2343,12 +2338,12 @@ PHP_FUNCTION(oci_collection_size) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_size(collection, &size TSRMLS_CC)) { RETURN_FALSE; @@ -2361,9 +2356,9 @@ PHP_FUNCTION(oci_collection_size) Return the max value of a collection. For a varray this is the maximum length of the array */ PHP_FUNCTION(oci_collection_max) { - zval **tmp, *z_collection = getThis(); + zval *tmp, *z_collection = getThis(); php_oci_collection *collection; - long max; + zend_long max; if (!getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) { @@ -2371,12 +2366,12 @@ PHP_FUNCTION(oci_collection_max) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_max(collection, &max TSRMLS_CC)) { RETURN_FALSE; @@ -2389,9 +2384,9 @@ PHP_FUNCTION(oci_collection_max) Trim num elements from the end of a collection */ PHP_FUNCTION(oci_collection_trim) { - zval **tmp, *z_collection = getThis(); + zval *tmp, *z_collection = getThis(); php_oci_collection *collection; - long trim_size; + zend_long trim_size; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &trim_size) == FAILURE) { @@ -2404,12 +2399,12 @@ PHP_FUNCTION(oci_collection_trim) } } - if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); RETURN_FALSE; } - PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection); + PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection); if (php_oci_collection_trim(collection, trim_size TSRMLS_CC)) { RETURN_FALSE; @@ -2426,7 +2421,7 @@ PHP_FUNCTION(oci_new_collection) php_oci_connection *connection; php_oci_collection *collection; char *tdo, *schema = NULL; - int tdo_len, schema_len = 0; + size_t tdo_len, schema_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) { return; @@ -2463,7 +2458,7 @@ PHP_FUNCTION(oci_get_implicit_resultset) if (imp_statement) { if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT TSRMLS_CC)) RETURN_FALSE; - RETURN_RESOURCE(imp_statement->id); + RETURN_RES(imp_statement->id); } RETURN_FALSE; } diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index 4982d0f88f..12986a8d3a 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -51,7 +51,7 @@ /* {{{ php_oci_lob_create() Create LOB descriptor and allocate all the resources needed */ -php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long type TSRMLS_DC) +php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_long type TSRMLS_DC) { php_oci_descriptor *descriptor; sword errstatus; @@ -63,7 +63,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ /* these three are allowed */ break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %ld", type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %pd", type); return NULL; break; } @@ -71,7 +71,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ descriptor = ecalloc(1, sizeof(php_oci_descriptor)); descriptor->type = type; descriptor->connection = connection; - zend_list_addref(descriptor->connection->id); + ++GC_REFCOUNT(descriptor->connection->id); PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); @@ -109,7 +109,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ return NULL; } - zend_hash_index_update(connection->descriptors,descriptor->index,&descriptor,sizeof(php_oci_descriptor *),NULL); + zend_hash_index_update_ptr(connection->descriptors, descriptor->index, &descriptor); } return descriptor; @@ -210,7 +210,7 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece /* {{{ php_oci_lob_calculate_buffer() Work out the size for LOB buffering */ -static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, long read_length TSRMLS_DC) +static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; ub4 chunk_size; @@ -241,7 +241,7 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, l /* {{{ php_oci_lob_read() Read specified portion of the LOB into the buffer */ -int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long initial_offset, char **data, ub4 *data_len TSRMLS_DC) +int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zend_long initial_offset, char **data, ub4 *data_len TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; ub4 length = 0; @@ -513,7 +513,7 @@ int php_oci_lob_get_buffering (php_oci_descriptor *descriptor) /* {{{ php_oci_lob_copy() Copy one LOB (or its part) to another one */ -int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, long length TSRMLS_DC) +int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC) { php_oci_connection *connection = descriptor_dest->connection; ub4 length_dest, length_from, copy_len; @@ -619,7 +619,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC) /* {{{ php_oci_lob_flush() Flush buffers for the LOB (only if they have been used) */ -int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC) +int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC) { OCILobLocator *lob = descriptor->descriptor; php_oci_connection *connection = descriptor->connection; @@ -635,7 +635,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC) /* only these two are allowed */ break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %ld", flush_flag); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %pd", flush_flag); return 1; break; } @@ -806,7 +806,7 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor /* {{{ php_oci_lob_truncate() Truncate LOB to the given length */ -int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC) +int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; @@ -848,7 +848,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TS /* {{{ php_oci_lob_erase() Erase (or fill with whitespaces, depending on LOB type) the LOB (or its part) */ -int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC) +int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; @@ -906,7 +906,7 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript /* {{{ php_oci_lob_write_tmp() Create temporary LOB and write data to it */ -int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data, int data_len TSRMLS_DC) +int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; @@ -919,7 +919,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data /* only these two are allowed */ break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %ld", type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %pd", type); return 1; break; } diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index f9d2a3a0ff..7dc0d5ee66 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -106,7 +106,7 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char statement->impres_child_stmt = NULL; statement->impres_count = 0; statement->impres_flag = PHP_OCI_IMPRES_UNKNOWN; /* may or may not have Implicit Result Set children */ - zend_list_addref(statement->connection->id); + ++GC_REFCOUNT(statement->connection->id); if (OCI_G(default_prefetch) >= 0) { php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch) TSRMLS_CC); @@ -166,8 +166,8 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T statement2->has_descr = 0; statement2->stmttype = 0; - zend_list_addref(statement->id); - zend_list_addref(statement2->connection->id); + Z_ADDREF_P(statement->id); + Z_ADDREF_P(statement2->connection->id); php_oci_statement_set_prefetch(statement2, statement->prefetch_count TSRMLS_CC); @@ -359,8 +359,8 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) continue; } - zval_dtor(column->define->zval); - php_oci_column_to_zval(column, column->define->zval, 0 TSRMLS_CC); + zval_dtor(&column->define->zval); + php_oci_column_to_zval(column, &column->define->zval, 0 TSRMLS_CC); } return 0; @@ -377,7 +377,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) /* {{{ php_oci_statement_get_column() Get column from the result set */ -php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, char *column_name, int column_name_len TSRMLS_DC) +php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC) { php_oci_out_column *column = NULL; int i; @@ -396,7 +396,7 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, l } } } else if (column_index != -1) { - if (zend_hash_index_find(statement->columns, column_index, (void **)&column) == FAILURE) { + if ((column = zend_hash_index_find_ptr(statement->columns, column_index)) == NULL) { return NULL; } return column; @@ -427,7 +427,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf return OCI_ERROR; } nested_stmt->parent_stmtid = outcol->statement->id; - zend_list_addref(outcol->statement->id); + ++GC_REFCOUNT(outcol->statement->id); outcol->nested_statement = nested_stmt; outcol->stmtid = nested_stmt->id; @@ -590,7 +590,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) for (counter = 1; counter <= colcount; counter++) { memset(&column,0,sizeof(php_oci_out_column)); - if (zend_hash_index_update(statement->columns, counter, &column, sizeof(php_oci_out_column), (void**) &outcol) == FAILURE) { + if ((outcol = zend_hash_index_update_ptr(statement->columns, counter, &column)) == NULL) { efree(statement->columns); /* out of memory */ return 1; @@ -683,7 +683,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) /* find a user-set define */ if (statement->defines) { - if (zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define) == SUCCESS) { + if ((outcol->define = zend_hash_str_find_ptr(statement->defines, outcol->name, outcol->name_len)) != NULL) { if (outcol->define->type) { outcol->data_type = outcol->define->type; } @@ -909,7 +909,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) *(int *)result = 0; - if (Z_TYPE_P(bind->zval) == IS_ARRAY) { + if (Z_TYPE(bind->zval) == IS_ARRAY) { /* These checks are currently valid for oci_bind_by_name, not * oci_bind_array_by_name. Also bind->type and * bind->indicator are not used for oci_bind_array_by_name. @@ -923,7 +923,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) case SQLT_CLOB: case SQLT_BLOB: case SQLT_RDD: - if (Z_TYPE_P(bind->zval) != IS_OBJECT) { + if (Z_TYPE(bind->zval) != IS_OBJECT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); *(int *)result = 1; } @@ -939,14 +939,14 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) case SQLT_LBI: case SQLT_BIN: case SQLT_LNG: - if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) { + if (Z_TYPE(bind->zval) == IS_RESOURCE || Z_TYPE(bind->zval) == IS_OBJECT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); *(int *)result = 1; } break; case SQLT_RSET: - if (Z_TYPE_P(bind->zval) != IS_RESOURCE) { + if (Z_TYPE(bind->zval) != IS_RESOURCE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); *(int *)result = 1; } @@ -969,27 +969,27 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) sword errstatus; if (bind->indicator == -1) { /* NULL */ - zval *val = bind->zval; + zval *val = &bind->zval; if (Z_TYPE_P(val) == IS_STRING) { *Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */ } zval_dtor(val); ZVAL_NULL(val); - } else if (Z_TYPE_P(bind->zval) == IS_STRING - && Z_STRLEN_P(bind->zval) > 0 - && Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') { + } else if (Z_TYPE(bind->zval) == IS_STRING + && Z_STRLEN(bind->zval) > 0 + && Z_STRVAL(bind->zval)[ Z_STRLEN(bind->zval) ] != '\0') { /* The post- PHP 5.3 feature for "interned" strings disallows * their reallocation but (i) any IN binds either interned or * not should already be null terminated and (ii) for OUT * binds, php_oci_bind_out_callback() should have allocated a * new string that we can modify here. */ - Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1); - Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0'; - } else if (Z_TYPE_P(bind->zval) == IS_ARRAY) { + Z_STR(bind->zval) = zend_string_realloc(Z_STR(bind->zval), Z_STRLEN(bind->zval)+1, 0); + Z_STRVAL(bind->zval)[ Z_STRLEN(bind->zval) ] = '\0'; + } else if (Z_TYPE(bind->zval) == IS_ARRAY) { int i; - zval **entry; - HashTable *hash = HASH_OF(bind->zval); + zval *entry = NULL; + HashTable *hash = HASH_OF(&bind->zval); zend_hash_internal_pointer_reset(hash); @@ -998,23 +998,23 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) case SQLT_INT: case SQLT_LNG: for (i = 0; i < bind->array.current_length; i++) { - if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { - zval_dtor(*entry); - ZVAL_LONG(*entry, ((ub4 *)(bind->array.elements))[i]); + if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { + zval_dtor(entry); + ZVAL_LONG(entry, ((ub4 *)(bind->array.elements))[i]); zend_hash_move_forward(hash); } else { - add_next_index_long(bind->zval, ((ub4 *)(bind->array.elements))[i]); + add_next_index_long(&bind->zval, ((ub4 *)(bind->array.elements))[i]); } } break; case SQLT_FLT: for (i = 0; i < bind->array.current_length; i++) { - if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { - zval_dtor(*entry); - ZVAL_DOUBLE(*entry, ((double *)(bind->array.elements))[i]); + if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { + zval_dtor(entry); + ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]); zend_hash_move_forward(hash); } else { - add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]); + add_next_index_double(&bind->zval, ((double *)(bind->array.elements))[i]); } } break; @@ -1025,17 +1025,17 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) memset((void*)buff,0,sizeof(buff)); - if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { + if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); - zval_dtor(*entry); + zval_dtor(entry); if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - ZVAL_NULL(*entry); + ZVAL_NULL(entry); } else { connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - ZVAL_STRINGL(*entry, (char *)buff, buff_len, 1); + ZVAL_STRINGL(entry, (char *)buff, buff_len); } zend_hash_move_forward(hash); } else { @@ -1043,10 +1043,10 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) if (errstatus != OCI_SUCCESS) { connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - add_next_index_null(bind->zval); + add_next_index_null(&bind->zval); } else { connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - add_next_index_stringl(bind->zval, (char *)buff, buff_len); + add_next_index_stringl(&bind->zval, (char *)buff, buff_len); } } } @@ -1061,12 +1061,12 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) for (i = 0; i < bind->array.current_length; i++) { /* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */ int curr_element_length = bind->array.element_lengths[i]; - if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { - zval_dtor(*entry); - ZVAL_STRINGL(*entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length, 1); + if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { + zval_dtor(entry); + ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length); zend_hash_move_forward(hash); } else { - add_next_index_stringl(bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length); + add_next_index_stringl(&bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length); } } break; @@ -1079,7 +1079,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) /* {{{ php_oci_bind_by_name() Bind zval to the given placeholder */ -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long maxlength, ub2 type TSRMLS_DC) +int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC) { php_oci_collection *bind_collection = NULL; php_oci_descriptor *bind_descriptor = NULL; @@ -1096,14 +1096,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, switch (type) { case SQLT_NTY: { - zval **tmp; + zval *tmp; - if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) { + if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "collection", sizeof("collection"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property"); return 1; } - PHP_OCI_ZVAL_TO_COLLECTION_EX(*tmp, bind_collection); + PHP_OCI_ZVAL_TO_COLLECTION_EX(tmp, bind_collection); value_sz = sizeof(void*); mode = OCI_DEFAULT; @@ -1118,14 +1118,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, case SQLT_BLOB: case SQLT_RDD: { - zval **tmp; + zval *tmp; - if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property"); return 1; } - PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(*tmp, bind_descriptor); + PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, bind_descriptor); value_sz = sizeof(void*); @@ -1213,21 +1213,19 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, } memset((void*)&bind,0,sizeof(php_oci_bind)); - if (zend_hash_find(statement->binds, name, name_len + 1, (void **)&old_bind) == SUCCESS) { + if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) { bindp = old_bind; - if (bindp->zval) { - zval_ptr_dtor(&bindp->zval); - } + zval_ptr_dtor(&bindp->zval); } else { - zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp); + bindp = zend_hash_update_ptr(statement->binds, zend_string_init(name, name_len + 1, 0), &bind); } bindp->descriptor = oci_desc; bindp->statement = oci_stmt; bindp->parent_statement = statement; - bindp->zval = var; + ZVAL_COPY(&bindp->zval, var); bindp->type = type; - zval_add_ref(&var); + Z_ADDREF_P(var); PHP_OCI_CALL_RETURN(errstatus, OCIBindByName, @@ -1316,7 +1314,7 @@ sb4 php_oci_bind_in_callback( zval *val; TSRMLS_FETCH(); - if (!(phpbind=(php_oci_bind *)ictxp) || !(val = phpbind->zval)) { + if (!(phpbind=(php_oci_bind *)ictxp) || !(val = &phpbind->zval)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); return OCI_ERROR; } @@ -1370,7 +1368,7 @@ sb4 php_oci_bind_out_callback( sb4 retval = OCI_ERROR; TSRMLS_FETCH(); - if (!(phpbind=(php_oci_bind *)octxp) || !(val = phpbind->zval)) { + if (!(phpbind=(php_oci_bind *)octxp) || !(val = &phpbind->zval)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value"); return retval; } @@ -1386,7 +1384,7 @@ sb4 php_oci_bind_out_callback( } retval = OCI_CONTINUE; } else if (Z_TYPE_P(val) == IS_OBJECT) { - zval **tmp; + zval *tmp; php_oci_descriptor *desc; if (!phpbind->descriptor) { @@ -1397,11 +1395,11 @@ sb4 php_oci_bind_out_callback( * out-bind as the contents would have been changed for in/out * binds (Bug #46994). */ - if (zend_hash_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find object outbind descriptor property"); return OCI_ERROR; } - PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(*tmp, desc); + PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, desc); desc->lob_size = -1; /* force OCI8 to update cached size */ *alenpp = &phpbind->dummy_len; @@ -1414,12 +1412,14 @@ sb4 php_oci_bind_out_callback( convert_to_string(val); zval_dtor(val); - Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ - Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1); - + //Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */ + //Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1); + // XXX is this right? + ZVAL_STRINGL(val, NULL, Z_STRLEN(phpbind->zval) + 1); + /* XXX we assume that zend-zval len has 4 bytes */ - *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval); - *bufpp = Z_STRVAL_P(phpbind->zval); + *alenpp = (ub4*) &Z_STRLEN(phpbind->zval); + *bufpp = Z_STRVAL(phpbind->zval); *piecep = OCI_ONE_PIECE; *rcodepp = &phpbind->retcode; *indpp = &phpbind->indicator; @@ -1442,7 +1442,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME return NULL; } - statement = (php_oci_statement *) zend_fetch_resource(&z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement); + statement = (php_oci_statement *) zend_fetch_resource(z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement); if (!statement) { return NULL; @@ -1466,7 +1466,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME convert_to_long(&tmp); column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0 TSRMLS_CC); if (!column) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL(tmp)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp)); zval_dtor(&tmp); return NULL; } @@ -1524,7 +1524,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR /* {{{ php_oci_bind_array_by_name() Bind arrays to PL/SQL types */ -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long max_table_length, long maxlength, long type TSRMLS_DC) +int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC) { php_oci_bind *bind, *bindp; sword errstatus; @@ -1532,7 +1532,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam convert_to_array(var); if (maxlength < -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%ld)", maxlength); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%pd)", maxlength); return 1; } @@ -1563,7 +1563,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection TSRMLS_CC); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %ld", type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %pd", type); return 1; break; } @@ -1578,18 +1578,18 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0); } - zend_hash_update(statement->binds, name, name_len + 1, bind, sizeof(php_oci_bind), (void **)&bindp); + bindp = zend_hash_update_ptr(statement->binds, zend_string_init(name, name_len + 1, 0), bind); bindp->descriptor = NULL; bindp->statement = NULL; bindp->parent_statement = statement; bindp->bind = NULL; - bindp->zval = var; + ZVAL_COPY(&bindp->zval, var); bindp->array.type = type; bindp->indicator = 0; /* not used for array binds */ bindp->type = 0; /* not used for array binds */ - zval_add_ref(&var); + Z_ADDREF_P(var); PHP_OCI_CALL_RETURN(errstatus, OCIBindByName, @@ -1626,21 +1626,21 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam /* {{{ php_oci_bind_array_helper_string() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, long maxlength TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC) { php_oci_bind *bind; ub4 i; HashTable *hash; - zval **entry; + zval *entry; hash = HASH_OF(var); if (maxlength == -1) { zend_hash_internal_pointer_reset(hash); - while (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) { + while ((entry = zend_hash_get_current_data(hash)) != NULL) { convert_to_string_ex(entry); - if (Z_STRLEN_PP(entry) > maxlength) { - maxlength = Z_STRLEN_PP(entry) + 1; + if (Z_STRLEN_P(entry) > maxlength) { + maxlength = Z_STRLEN_P(entry) + 1; } zend_hash_move_forward(hash); } @@ -1660,10 +1660,10 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, zend_hash_internal_pointer_reset(hash); for (i = 0; i < bind->array.current_length; i++) { - if (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) { + if ((entry = zend_hash_get_current_data(hash)) != NULL) { convert_to_string_ex(entry); - bind->array.element_lengths[i] = Z_STRLEN_PP(entry); - if (Z_STRLEN_PP(entry) == 0) { + bind->array.element_lengths[i] = Z_STRLEN_P(entry); + if (Z_STRLEN_P(entry) == 0) { bind->array.indicators[i] = -1; } zend_hash_move_forward(hash); @@ -1674,13 +1674,13 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, zend_hash_internal_pointer_reset(hash); for (i = 0; i < max_table_length; i++) { - if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { + if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { int element_length; convert_to_string_ex(entry); - element_length = (maxlength > Z_STRLEN_PP(entry)) ? Z_STRLEN_PP(entry) : maxlength; + element_length = (maxlength > Z_STRLEN_P(entry)) ? Z_STRLEN_P(entry) : maxlength; - memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_PP(entry), element_length); + memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_P(entry), element_length); ((text *)bind->array.elements)[i*maxlength + element_length] = '\0'; zend_hash_move_forward(hash); @@ -1696,12 +1696,12 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, /* {{{ php_oci_bind_array_helper_number() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC) { php_oci_bind *bind; ub4 i; HashTable *hash; - zval **entry; + zval *entry; hash = HASH_OF(var); @@ -1719,9 +1719,9 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length if (i < bind->array.current_length) { bind->array.element_lengths[i] = sizeof(ub4); } - if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { + if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { convert_to_long_ex(entry); - ((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_PP(entry); + ((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_P(entry); zend_hash_move_forward(hash); } else { ((ub4 *)bind->array.elements)[i] = 0; @@ -1735,12 +1735,12 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length /* {{{ php_oci_bind_array_helper_double() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC) { php_oci_bind *bind; ub4 i; HashTable *hash; - zval **entry; + zval *entry; hash = HASH_OF(var); @@ -1758,9 +1758,9 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length if (i < bind->array.current_length) { bind->array.element_lengths[i] = sizeof(double); } - if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { + if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { convert_to_double_ex(entry); - ((double *)bind->array.elements)[i] = (double) Z_DVAL_PP(entry); + ((double *)bind->array.elements)[i] = (double) Z_DVAL_P(entry); zend_hash_move_forward(hash); } else { ((double *)bind->array.elements)[i] = 0; @@ -1774,12 +1774,12 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length /* {{{ php_oci_bind_array_helper_date() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, php_oci_connection *connection TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC) { php_oci_bind *bind; ub4 i; HashTable *hash; - zval **entry; + zval *entry; sword errstatus; hash = HASH_OF(var); @@ -1799,10 +1799,10 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p if (i < bind->array.current_length) { bind->array.element_lengths[i] = sizeof(OCIDate); } - if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { + if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) { convert_to_string_ex(entry); - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_P(entry), Z_STRLEN_P(entry), NULL, 0, NULL, 0, &oci_date)); if (errstatus != OCI_SUCCESS) { /* failed to convert string to date */ diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 066812edad..d673a3c083 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 7cf3d170fa..852fe986f3 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -144,7 +144,7 @@ typedef struct { sb4 errcode; /* last ORA- error number */ HashTable *descriptors; /* descriptors hash, used to flush all the LOBs using this connection on commit */ - ulong descriptor_count; /* used to index the descriptors hash table. Not an accurate count */ + zend_ulong descriptor_count; /* used to index the descriptors hash table. Not an accurate count */ unsigned is_open:1; /* hels to determine if the connection is dead or not */ unsigned is_attached:1; /* hels to determine if we should detach from the server when closing/freeing the connection */ unsigned is_persistent:1; /* self-descriptive */ @@ -165,7 +165,7 @@ typedef struct { /* {{{ php_oci_descriptor */ typedef struct { zend_resource *id; - ulong index; /* descriptors hash table index */ + zend_ulong index; /* descriptors hash table index */ php_oci_connection *connection; /* parent connection handle */ dvoid *descriptor; /* OCI descriptor handle */ ub4 type; /* descriptor type (FILE/LOB) */ @@ -221,7 +221,7 @@ typedef struct { OCIStmt *stmt; /* statement handle */ char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor received from Oracle */ char impres_flag; /* PHP_OCI_IMPRES_*_ */ - long last_query_len; /* last query length */ + zend_long last_query_len; /* last query length */ HashTable *columns; /* hash containing all the result columns */ HashTable *binds; /* binds hash */ HashTable *defines; /* defines hash */ @@ -249,7 +249,7 @@ typedef struct { ub4 current_length; ub4 old_length; ub4 max_length; - long type; + zend_long type; } array; sb2 indicator; /* -1 means NULL */ ub2 retcode; @@ -361,20 +361,20 @@ typedef struct { } while (0) #define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \ - ZEND_FETCH_RESOURCE2(connection, php_oci_connection *, &zval, -1, "oci8 connection", le_connection, le_pconnection) + ZEND_FETCH_RESOURCE2(connection, php_oci_connection *, zval, -1, "oci8 connection", le_connection, le_pconnection) #define PHP_OCI_ZVAL_TO_STATEMENT(zval, statement) \ ZEND_FETCH_RESOURCE(statement, php_oci_statement *, zval, -1, "oci8 statement", le_statement) #define PHP_OCI_ZVAL_TO_DESCRIPTOR(zval, descriptor) \ - ZEND_FETCH_RESOURCE(descriptor, php_oci_descriptor *, &zval, -1, "oci8 descriptor", le_descriptor) + ZEND_FETCH_RESOURCE(descriptor, php_oci_descriptor *, zval, -1, "oci8 descriptor", le_descriptor) #define PHP_OCI_ZVAL_TO_COLLECTION(zval, collection) \ - ZEND_FETCH_RESOURCE(collection, php_oci_collection *, &zval, -1, "oci8 collection", le_collection) + ZEND_FETCH_RESOURCE(collection, php_oci_collection *, zval, -1, "oci8 collection", le_collection) #define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \ do { \ - var = (type) zend_fetch_resource(&zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \ + var = (type) zend_fetch_resource(zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \ if (!var) { \ return 1; \ } \ @@ -407,7 +407,7 @@ sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC); sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC); int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC); void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive); -php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); +php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC); int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC); int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC); int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC); @@ -422,22 +422,22 @@ void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode /* {{{ lob related prototypes */ -php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, long type TSRMLS_DC); +php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, zend_long type TSRMLS_DC); int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC); -int php_oci_lob_read(php_oci_descriptor *descriptor, long read_length, long inital_offset, char **data, ub4 *data_len TSRMLS_DC); +int php_oci_lob_read(php_oci_descriptor *descriptor, zend_long read_length, zend_long inital_offset, char **data, ub4 *data_len TSRMLS_DC); int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC); -int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC); +int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC); int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off TSRMLS_DC); int php_oci_lob_get_buffering(php_oci_descriptor *descriptor); -int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, long length TSRMLS_DC); +int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC); int php_oci_lob_close(php_oci_descriptor *descriptor TSRMLS_DC); int php_oci_temp_lob_close(php_oci_descriptor *descriptor TSRMLS_DC); -int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, long type, char *data, int data_len TSRMLS_DC); +int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC); void php_oci_lob_free(php_oci_descriptor *descriptor TSRMLS_DC); int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename TSRMLS_DC); int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC); -int php_oci_lob_truncate(php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC); -int php_oci_lob_erase(php_oci_descriptor *descriptor, long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC); +int php_oci_lob_truncate(php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC); +int php_oci_lob_erase(php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC); int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC); sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp); /* }}} */ @@ -446,15 +446,15 @@ sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC); int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC); -int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC); -int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC); +int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC); +int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC); int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC); -int php_oci_collection_element_get(php_oci_collection *collection, long index, zval **result_element TSRMLS_DC); -int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC); -int php_oci_collection_element_set_null(php_oci_collection *collection, long index TSRMLS_DC); -int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC); -int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC); -int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC); +int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC); +int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC); +int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC); +int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC); +int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC); +int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC); int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC); void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC); int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC); @@ -471,24 +471,24 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC); int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC); int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC); -php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, char *column_name, int column_name_len TSRMLS_DC); +php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC); int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC); int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC); void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC); int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC); int php_oci_bind_post_exec(void *data TSRMLS_DC); -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long maxlength, ub2 type TSRMLS_DC); +int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC); sb4 php_oci_bind_in_callback(dvoid *ictxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp); sb4 php_oci_bind_out_callback(dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp); php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data); int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC); int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC); int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC); -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long max_table_length, long maxlength, long type TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, long maxlength TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, php_oci_connection *connection TSRMLS_DC); +int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC); /* }}} */ @@ -496,14 +496,14 @@ ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ Module globals */ sb4 errcode; /* global last ORA- error number. Used when connect fails, for example */ OCIError *err; /* global error handle */ - long max_persistent; /* maximum number of persistent connections per process */ - long num_persistent; /* number of existing persistent connections */ - long num_links; /* non-persistent + persistent connections */ - long num_statements; /* number of statements open */ - long ping_interval; /* time interval between pings */ - long persistent_timeout; /* time period after which idle persistent connection is considered expired */ - long statement_cache_size; /* statement cache size. used with 9i+ clients only*/ - long default_prefetch; /* default prefetch setting */ + zend_long max_persistent; /* maximum number of persistent connections per process */ + zend_long num_persistent; /* number of existing persistent connections */ + zend_long num_links; /* non-persistent + persistent connections */ + zend_long num_statements; /* number of statements open */ + zend_long ping_interval; /* time interval between pings */ + zend_long persistent_timeout; /* time period after which idle persistent connection is considered expired */ + zend_long statement_cache_size; /* statement cache size. used with 9i+ clients only*/ + zend_long default_prefetch; /* default prefetch setting */ zend_bool privileged_connect; /* privileged connect flag (On/Off) */ zend_bool old_oci_close_semantics; /* old_oci_close_semantics flag (to determine the way oci_close() should behave) */ diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c index 09162ae61b..3857c6955c 100644 --- a/ext/odbc/birdstep.c +++ b/ext/odbc/birdstep.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/odbc/php_birdstep.h b/ext/odbc/php_birdstep.h index eb694577fb..eab1dcee7c 100644 --- a/ext/odbc/php_birdstep.h +++ b/ext/odbc/php_birdstep.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 02af2d94ca..13bd9e1628 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -2615,13 +2615,13 @@ try_and_get_another_connection: zend_resource *index_ptr, new_index_ptr; if ((index_ptr = zend_hash_str_find_ptr(&EG(regular_list), hashed_details, hashed_len)) != NULL) { - int conn_id; + zend_ulong conn_id; zend_resource *p; if (index_ptr->type != le_index_ptr) { RETURN_FALSE; } - conn_id = (int)index_ptr->ptr; + conn_id = (zend_ulong)index_ptr->ptr; p = zend_hash_index_find_ptr(&EG(regular_list), conn_id); /* check if the connection is still there */ if (p && p->ptr && (p->type == le_conn || p->type == le_pconn)) { diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h index bd78e88f52..9219fa87ad 100644 --- a/ext/odbc/php_odbc.h +++ b/ext/odbc/php_odbc.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index f44b897b9b..6a7e5c3756 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 3289299ce1..869bd3ccba 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -169,7 +169,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz case ZEND_FE_RESET: case ZEND_NEW: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: START_BLOCK_OP(ZEND_OP2(opline).opline_num); START_BLOCK_OP(opno + 1); break; @@ -204,14 +204,12 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz j = 0; for (i = 0; i< op_array->last_brk_cont; i++) { if (op_array->brk_cont_array[i].start >= 0 && - (op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE || - op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_SWITCH_FREE)) { + op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE) { int parent = op_array->brk_cont_array[i].parent; while (parent >= 0 && op_array->brk_cont_array[parent].start < 0 && - op_array->opcodes[op_array->brk_cont_array[parent].brk].opcode != ZEND_FREE && - op_array->opcodes[op_array->brk_cont_array[parent].brk].opcode != ZEND_SWITCH_FREE) { + op_array->opcodes[op_array->brk_cont_array[parent].brk].opcode != ZEND_FREE) { parent = op_array->brk_cont_array[parent].parent; } op_array->brk_cont_array[i].parent = parent; @@ -225,8 +223,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz j = 0; for (i = 0; i< op_array->last_brk_cont; i++) { if (op_array->brk_cont_array[i].start >= 0 && - (op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE || - op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_SWITCH_FREE)) { + op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE) { if (i != j) { op_array->brk_cont_array[j] = op_array->brk_cont_array[i]; } @@ -297,7 +294,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz case ZEND_FE_RESET: case ZEND_NEW: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: case ZEND_FE_FETCH: cur_block->op2_to = &blocks[ZEND_OP2(opline).opline_num]; /* break missing intentionally */ @@ -614,7 +611,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, end = opline + block->len; while ((op_array->T) && (opline < end)) { /* strip X = QM_ASSIGN(const) */ - if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR && + if ((ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) && VAR_SOURCE(opline->op1) && VAR_SOURCE(opline->op1)->opcode == ZEND_QM_ASSIGN && ZEND_OP1_TYPE(VAR_SOURCE(opline->op1)) == IS_CONST && @@ -633,7 +630,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, } /* T = QM_ASSIGN(C), F(T) => NOP, F(C) */ - if (ZEND_OP2_TYPE(opline) == IS_TMP_VAR && + if ((ZEND_OP2_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) && VAR_SOURCE(opline->op2) && VAR_SOURCE(opline->op2)->opcode == ZEND_QM_ASSIGN && ZEND_OP1_TYPE(VAR_SOURCE(opline->op2)) == IS_CONST) { @@ -880,10 +877,10 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, opline->opcode == ZEND_JMPNZ_EX || opline->opcode == ZEND_JMPNZ || opline->opcode == ZEND_JMPZNZ) && - ZEND_OP1_TYPE(opline) == IS_TMP_VAR && + (ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) && VAR_SOURCE(opline->op1) != NULL && (!used_ext[VAR_NUM(ZEND_OP1(opline).var)] || - (ZEND_RESULT_TYPE(opline) == IS_TMP_VAR && + ((ZEND_RESULT_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) && ZEND_RESULT(opline).var == ZEND_OP1(opline).var)) && (VAR_SOURCE(opline->op1)->opcode == ZEND_BOOL || VAR_SOURCE(opline->op1)->opcode == ZEND_QM_ASSIGN)) { @@ -913,7 +910,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, } old_len = Z_STRLEN(ZEND_OP1_LITERAL(last_op)); l = old_len + Z_STRLEN(ZEND_OP1_LITERAL(opline)); - if (IS_INTERNED(Z_STR(ZEND_OP1_LITERAL(last_op)))) { + if (!Z_REFCOUNTED(ZEND_OP1_LITERAL(last_op))) { zend_string *tmp = zend_string_alloc(l, 0); memcpy(tmp->val, Z_STRVAL(ZEND_OP1_LITERAL(last_op)), old_len); Z_STR(ZEND_OP1_LITERAL(last_op)) = tmp; @@ -925,7 +922,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, Z_STRVAL(ZEND_OP1_LITERAL(last_op))[l] = '\0'; zval_dtor(&ZEND_OP1_LITERAL(opline)); Z_STR(ZEND_OP1_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP1_LITERAL(last_op)) TSRMLS_CC); - if (IS_INTERNED(Z_STR(ZEND_OP1_LITERAL(opline)))) { + if (!Z_REFCOUNTED(ZEND_OP1_LITERAL(opline))) { Z_TYPE_FLAGS(ZEND_OP1_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); } ZVAL_NULL(&ZEND_OP1_LITERAL(last_op)); @@ -957,7 +954,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, COPY_NODE(opline->op1, src->op1); old_len = Z_STRLEN(ZEND_OP2_LITERAL(src)); l = old_len + Z_STRLEN(ZEND_OP2_LITERAL(opline)); - if (IS_INTERNED(Z_STR(ZEND_OP2_LITERAL(src)))) { + if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(src))) { zend_string *tmp = zend_string_alloc(l, 0); memcpy(tmp->val, Z_STRVAL(ZEND_OP2_LITERAL(src)), old_len); Z_STR(ZEND_OP2_LITERAL(last_op)) = tmp; @@ -969,7 +966,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, Z_STRVAL(ZEND_OP2_LITERAL(src))[l] = '\0'; zend_string_release(Z_STR(ZEND_OP2_LITERAL(opline))); Z_STR(ZEND_OP2_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)) TSRMLS_CC); - if (IS_INTERNED(Z_STR(ZEND_OP2_LITERAL(opline)))) { + if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(opline))) { Z_TYPE_FLAGS(ZEND_OP2_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); } ZVAL_NULL(&ZEND_OP2_LITERAL(src)); @@ -1049,7 +1046,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, opline->opcode = ZEND_QM_ASSIGN; zend_optimizer_update_op1_const(op_array, opline, &result TSRMLS_CC); } else if ((opline->opcode == ZEND_RETURN || opline->opcode == ZEND_EXIT) && - ZEND_OP1_TYPE(opline) == IS_TMP_VAR && + (ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) && VAR_SOURCE(opline->op1) && VAR_SOURCE(opline->op1)->opcode == ZEND_QM_ASSIGN) { /* T = QM_ASSIGN(X), RETURN(T) to RETURN(X) */ @@ -1058,25 +1055,6 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, COPY_NODE(opline->op1, src->op1); MAKE_NOP(src); } else if ((opline->opcode == ZEND_ADD_STRING || - opline->opcode == ZEND_ADD_CHAR) && - ZEND_OP1_TYPE(opline) == IS_TMP_VAR && - VAR_SOURCE(opline->op1) && - VAR_SOURCE(opline->op1)->opcode == ZEND_INIT_STRING) { - /* convert T = INIT_STRING(), T = ADD_STRING(T, X) to T = QM_ASSIGN(X) */ - /* CHECKME: Remove ZEND_ADD_VAR optimization, since some conversions - - namely, BOOL(false)->string - don't allocate memory but use empty_string - and ADD_CHAR fails */ - zend_op *src = VAR_SOURCE(opline->op1); - VAR_UNSET(opline->op1); - COPY_NODE(opline->op1, opline->op2); - if (opline->opcode == ZEND_ADD_CHAR) { - char c = (char)Z_LVAL(ZEND_OP2_LITERAL(opline)); - ZVAL_STRINGL(&ZEND_OP1_LITERAL(opline), &c, 1); - } - SET_UNUSED(opline->op2); - MAKE_NOP(src); - opline->opcode = ZEND_QM_ASSIGN; - } else if ((opline->opcode == ZEND_ADD_STRING || opline->opcode == ZEND_ADD_CHAR || opline->opcode == ZEND_ADD_VAR || opline->opcode == ZEND_CONCAT) && @@ -1097,28 +1075,11 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, opline->opcode = ZEND_CONCAT; literal_dtor(&ZEND_OP2_LITERAL(src)); /* will take care of empty_string too */ MAKE_NOP(src); -//??? This optimization can't work anymore because ADD_VAR returns IS_TMP_VAR -//??? and ZEND_CAST returns IS_VAR. -//??? BTW: it wan't used for long time, because we don't use INIT_STRING -#if 0 - } else if (opline->opcode == ZEND_ADD_VAR && - ZEND_OP1_TYPE(opline) == IS_TMP_VAR && - VAR_SOURCE(opline->op1) && - VAR_SOURCE(opline->op1)->opcode == ZEND_INIT_STRING) { - /* convert T = INIT_STRING(), T = ADD_VAR(T, X) to T = CAST(STRING, X) */ - zend_op *src = VAR_SOURCE(opline->op1); - VAR_UNSET(opline->op1); - COPY_NODE(opline->op1, opline->op2); - SET_UNUSED(opline->op2); - MAKE_NOP(src); - opline->opcode = ZEND_CAST; - opline->extended_value = IS_STRING; -#endif } else if ((opline->opcode == ZEND_ADD_STRING || opline->opcode == ZEND_ADD_CHAR || opline->opcode == ZEND_ADD_VAR || opline->opcode == ZEND_CONCAT) && - ZEND_OP1_TYPE(opline) == (IS_TMP_VAR|IS_VAR) && + (ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) && VAR_SOURCE(opline->op1) && VAR_SOURCE(opline->op1)->opcode == ZEND_CAST && VAR_SOURCE(opline->op1)->extended_value == IS_STRING) { @@ -1133,8 +1094,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, opline->opcode = ZEND_CONCAT; MAKE_NOP(src); } else if (opline->opcode == ZEND_QM_ASSIGN && - ZEND_OP1_TYPE(opline) == IS_TMP_VAR && - ZEND_RESULT_TYPE(opline) == IS_TMP_VAR && + ZEND_OP1_TYPE(opline) == ZEND_RESULT_TYPE(opline) && ZEND_OP1(opline).var == ZEND_RESULT(opline).var) { /* strip T = QM_ASSIGN(T) */ MAKE_NOP(opline); @@ -1366,10 +1326,9 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra } else if (0&& block->op1_to != block && block->op1_to != blocks && op_array->last_try_catch == 0 && - target->opcode != ZEND_FREE && - target->opcode != ZEND_SWITCH_FREE) { + target->opcode != ZEND_FREE) { /* Block Reordering (saves one JMP on each "for" loop iteration) - * It is disabled for some cases (ZEND_FREE/ZEND_SWITCH_FREE) + * It is disabled for some cases (ZEND_FREE) * which may break register allocation. */ zend_bool can_reorder = 0; diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c index 28e7a11314..091437e119 100644 --- a/ext/opcache/Optimizer/compact_literals.c +++ b/ext/opcache/Optimizer/compact_literals.c @@ -40,6 +40,7 @@ #define LITERAL_STATIC_PROPERTY 0x0700 #define LITERAL_METHOD 0x0800 #define LITERAL_PROPERTY 0x0900 +#define LITERAL_GLOBAL 0x0A00 #define LITERAL_EX_CLASS 0x4000 #define LITERAL_EX_OBJ 0x2000 @@ -278,6 +279,9 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx } } break; + case ZEND_BIND_GLOBAL: + LITERAL_INFO(opline->op2.constant, LITERAL_GLOBAL, 0, 1, 1); + break; default: if (ZEND_OP1_TYPE(opline) == IS_CONST) { LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1, 0, 1); diff --git a/ext/opcache/Optimizer/nop_removal.c b/ext/opcache/Optimizer/nop_removal.c index bea42229f6..651950148c 100644 --- a/ext/opcache/Optimizer/nop_removal.c +++ b/ext/opcache/Optimizer/nop_removal.c @@ -97,7 +97,7 @@ void zend_optimizer_nop_removal(zend_op_array *op_array) case ZEND_FE_RESET: case ZEND_NEW: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: ZEND_OP2(opline).opline_num -= shiftlist[ZEND_OP2(opline).opline_num]; break; case ZEND_JMPZNZ: diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index def060c66c..f06f5cc559 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -91,7 +91,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); - zend_optimizer_replace_tmp_by_const(op_array, opline + 1, tv, &result TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC); } break; @@ -101,6 +101,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML opline->extended_value != IS_OBJECT && opline->extended_value != IS_RESOURCE) { /* cast of constant operand */ + zend_uchar type = opline->result_type; uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */ zval res; res = ZEND_OP1_LITERAL(opline); @@ -126,11 +127,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML literal_dtor(&ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); - if (opline->result_type == IS_TMP_VAR) { - zend_optimizer_replace_tmp_by_const(op_array, opline + 1, tv, &res TSRMLS_CC); - } else /* if (opline->result_type == IS_VAR) */ { - zend_optimizer_replace_var_by_const(op_array, opline + 1, tv, &res TSRMLS_CC); - } + zend_optimizer_replace_by_const(op_array, opline + 1, type, tv, &res TSRMLS_CC); } else if (opline->extended_value == _IS_BOOL) { /* T = CAST(X, IS_BOOL) => T = BOOL(X) */ opline->opcode = ZEND_BOOL; @@ -157,7 +154,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML literal_dtor(&ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); - zend_optimizer_replace_tmp_by_const(op_array, opline + 1, tv, &result TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC); } break; @@ -251,7 +248,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); - zend_optimizer_replace_tmp_by_const(op_array, opline, tv, offset TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, offset TSRMLS_CC); } EG(current_execute_data) = orig_execute_data; break; @@ -271,7 +268,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML } literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); - zend_optimizer_replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC); } /* class constant */ @@ -332,7 +329,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML } literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); - zend_optimizer_replace_tmp_by_const(op_array, opline, tv, &t TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &t TSRMLS_CC); } } } @@ -388,7 +385,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML func->module->type == MODULE_PERSISTENT) { zval t; ZVAL_BOOL(&t, 1); - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { + if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); @@ -421,7 +418,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML } } - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { + if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); @@ -436,7 +433,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline + 1)), &t, 0 TSRMLS_CC)) { ZVAL_BOOL(&t, 1); - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { + if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); @@ -450,7 +447,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML zval t; if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline + 1)), &t, 1 TSRMLS_CC)) { - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { + if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); @@ -465,7 +462,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML zval t; ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline + 1))); - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { + if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); @@ -481,7 +478,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML zval t; ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline))); - zend_optimizer_replace_tmp_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC); literal_dtor(&ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); } @@ -494,7 +491,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML break; } ZVAL_TRUE(&c); - zend_optimizer_replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC); literal_dtor(&ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); } @@ -529,7 +526,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML case ZEND_NEW: case ZEND_DO_FCALL: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: collect_constants = 0; break; case ZEND_FETCH_R: diff --git a/ext/opcache/Optimizer/pass2.c b/ext/opcache/Optimizer/pass2.c index 5fa6560d48..859bc2f3bc 100644 --- a/ext/opcache/Optimizer/pass2.c +++ b/ext/opcache/Optimizer/pass2.c @@ -205,8 +205,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC) array_offset = jmp_to->parent; if (--nest_levels > 0) { if (opline->opcode == ZEND_BRK && - (op_array->opcodes[jmp_to->brk].opcode == ZEND_FREE || - op_array->opcodes[jmp_to->brk].opcode == ZEND_SWITCH_FREE)) { + op_array->opcodes[jmp_to->brk].opcode == ZEND_FREE) { dont_optimize = 1; break; } diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c index 511431bb2c..8d8cb50580 100644 --- a/ext/opcache/Optimizer/pass3.c +++ b/ext/opcache/Optimizer/pass3.c @@ -182,7 +182,7 @@ void zend_optimizer_pass3(zend_op_array *op_array TSRMLS_DC) break; case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) { break; } diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index 6d011afc60..cd75817e0c 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -262,15 +262,16 @@ check_numeric: } } -int zend_optimizer_replace_var_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val TSRMLS_DC) +int zend_optimizer_replace_by_const(zend_op_array *op_array, + zend_op *opline, + zend_uchar type, + uint32_t var, + zval *val TSRMLS_DC) { zend_op *end = op_array->opcodes + op_array->last; while (opline < end) { - if (ZEND_OP1_TYPE(opline) == IS_VAR && + if (ZEND_OP1_TYPE(opline) == type && ZEND_OP1(opline).var == var) { switch (opline->opcode) { case ZEND_FETCH_DIM_W: @@ -292,6 +293,25 @@ int zend_optimizer_replace_var_by_const(zend_op_array *op_array, opline->opcode = ZEND_SEND_VAL; } break; + /* In most cases IS_TMP_VAR operand may be used only once. + * The operands are usually destroyed by the opcode handler. + * ZEND_CASE is an exception, that keeps operand unchanged, + * and allows its reuse. The number of ZEND_CASE instructions + * usually terminated by ZEND_FREE that finally kills the value. + */ + case ZEND_CASE: { + zval old_val; + ZVAL_COPY_VALUE(&old_val, val); + zval_copy_ctor(val); + zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC); + ZVAL_COPY_VALUE(val, &old_val); + opline++; + continue; + } + case ZEND_FREE: + MAKE_NOP(opline); + zval_dtor(val); + return 1; default: break; } @@ -299,7 +319,7 @@ int zend_optimizer_replace_var_by_const(zend_op_array *op_array, break; } - if (ZEND_OP2_TYPE(opline) == IS_VAR && + if (ZEND_OP2_TYPE(opline) == type && ZEND_OP2(opline).var == var) { switch (opline->opcode) { case ZEND_ASSIGN_REF: @@ -316,55 +336,6 @@ int zend_optimizer_replace_var_by_const(zend_op_array *op_array, return 1; } -void zend_optimizer_replace_tmp_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val - TSRMLS_DC) -{ - zend_op *end = op_array->opcodes + op_array->last; - - while (opline < end) { - if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR && - ZEND_OP1(opline).var == var) { - - /* In most cases IS_TMP_VAR operand may be used only once. - * The operands are usually destroyed by the opcode handler. - * ZEND_CASE is an exception, that keeps operand unchanged, - * and allows its reuse. The number of ZEND_CASE instructions - * usually terminated by ZEND_FREE that finally kills the value. - */ - if (opline->opcode == ZEND_CASE) { - zval old_val; - ZVAL_COPY_VALUE(&old_val, val); - zval_copy_ctor(val); - zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC); - ZVAL_COPY_VALUE(val, &old_val); - } else if (opline->opcode == ZEND_FREE) { - MAKE_NOP(opline); - break; - } else { - zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC); - val = NULL; - break; - } - } - - if (ZEND_OP2_TYPE(opline) == IS_TMP_VAR && - ZEND_OP2(opline).var == var) { - - zend_optimizer_update_op2_const(op_array, opline, val TSRMLS_CC); - /* TMP_VAR may be used only once */ - val = NULL; - break; - } - opline++; - } - if (val) { - zval_dtor(val); - } -} - static void zend_optimize(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC) { @@ -467,7 +438,7 @@ static void zend_accel_optimize(zend_op_array *op_array, case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: case ZEND_NEW: case ZEND_FE_RESET: case ZEND_FE_FETCH: @@ -505,7 +476,7 @@ static void zend_accel_optimize(zend_op_array *op_array, case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: case ZEND_NEW: case ZEND_FE_RESET: case ZEND_FE_FETCH: diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h index ac87cf9f35..ba91b147c9 100644 --- a/ext/opcache/Optimizer/zend_optimizer_internal.h +++ b/ext/opcache/Optimizer/zend_optimizer_internal.h @@ -112,14 +112,11 @@ void zend_optimizer_update_op1_const(zend_op_array *op_array, void zend_optimizer_update_op2_const(zend_op_array *op_array, zend_op *opline, zval *val TSRMLS_DC); -int zend_optimizer_replace_var_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val TSRMLS_DC); -void zend_optimizer_replace_tmp_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val TSRMLS_DC); +int zend_optimizer_replace_by_const(zend_op_array *op_array, + zend_op *opline, + zend_uchar type, + uint32_t var, + zval *val TSRMLS_DC); void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC); void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC); diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index d72383ace8..b5c20f91e4 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -384,6 +384,9 @@ static void accel_use_shm_interned_strings(TSRMLS_D) if (p->key) { p->key = accel_new_interned_string(p->key TSRMLS_CC); } + if (Z_FUNC(p->val)->common.function_name) { + Z_FUNC(p->val)->common.function_name = accel_new_interned_string(Z_FUNC(p->val)->common.function_name TSRMLS_CC); + } } /* class table hash keys, class names, properties, methods, constants, etc */ @@ -425,6 +428,9 @@ static void accel_use_shm_interned_strings(TSRMLS_D) if (q->key) { q->key = accel_new_interned_string(q->key TSRMLS_CC); } + if (Z_FUNC(q->val)->common.function_name) { + Z_FUNC(q->val)->common.function_name = accel_new_interned_string(Z_FUNC(q->val)->common.function_name TSRMLS_CC); + } } for (j = 0; j < ce->constants_table.nNumUsed; j++) { @@ -1913,6 +1919,7 @@ static void accel_activate(void) * allocated block separately, but we like to call all the destructors and * callbacks in exactly the same order. */ +static void accel_fast_zval_dtor(zval *zvalue); static void accel_fast_hash_destroy(HashTable *ht) { @@ -1922,7 +1929,7 @@ static void accel_fast_hash_destroy(HashTable *ht) for (idx = 0; idx < ht->nNumUsed; idx++) { p = ht->arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; - ht->pDestructor(&p->val); + accel_fast_zval_dtor(&p->val); } } @@ -1936,7 +1943,6 @@ static void accel_fast_zval_dtor(zval *zvalue) if (Z_ARR_P(zvalue) != &EG(symbol_table)) { /* break possible cycles */ ZVAL_NULL(zvalue); - Z_ARRVAL_P(zvalue)->pDestructor = accel_fast_zval_dtor; accel_fast_hash_destroy(Z_ARRVAL_P(zvalue)); } } @@ -1978,61 +1984,29 @@ static int accel_clean_non_persistent_function(zval *zv TSRMLS_DC) return ZEND_HASH_APPLY_STOP; } else { if (function->op_array.static_variables) { - function->op_array.static_variables->pDestructor = accel_fast_zval_dtor; accel_fast_hash_destroy(function->op_array.static_variables); function->op_array.static_variables = NULL; } - return (--(*function->op_array.refcount) <= 0) ? - ZEND_HASH_APPLY_REMOVE : - ZEND_HASH_APPLY_KEEP; - } -} - -static int accel_cleanup_function_data(zval *zv TSRMLS_DC) -{ - zend_function *function = Z_PTR_P(zv); - - if (function->type == ZEND_USER_FUNCTION) { - if (function->op_array.static_variables) { - function->op_array.static_variables->pDestructor = accel_fast_zval_dtor; - accel_fast_hash_destroy(function->op_array.static_variables); - function->op_array.static_variables = NULL; - } - } - return 0; -} - -static int accel_clean_non_persistent_class(zval *zv TSRMLS_DC) -{ - zend_class_entry *ce = Z_PTR_P(zv); - - if (ce->type == ZEND_INTERNAL_CLASS) { - return ZEND_HASH_APPLY_STOP; - } else { - if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) { - zend_hash_apply(&ce->function_table, (apply_func_t) accel_cleanup_function_data TSRMLS_CC); - } - if (ce->static_members_table) { - int i; - - for (i = 0; i < ce->default_static_members_count; i++) { - accel_fast_zval_dtor(&ce->static_members_table[i]); - ZVAL_UNDEF(&ce->static_members_table[i]); - } - ce->static_members_table = NULL; - } return ZEND_HASH_APPLY_REMOVE; } } -static int accel_clean_non_persistent_constant(zval *zv TSRMLS_DC) +static inline void zend_accel_fast_del_bucket(HashTable *ht, uint32_t idx, Bucket *p) { - zend_constant *c = Z_PTR_P(zv); + uint32_t nIndex = p->h & ht->nTableMask; + uint32_t i = ht->arHash[nIndex]; - if (c->flags & CONST_PERSISTENT) { - return ZEND_HASH_APPLY_STOP; - } else { - return ZEND_HASH_APPLY_REMOVE; + ht->nNumUsed--; + ht->nNumOfElements--; + if (idx != i) { + Bucket *prev = ht->arData + i; + while (Z_NEXT(prev->val) != idx) { + i = Z_NEXT(prev->val); + prev = ht->arData + i; + } + Z_NEXT(prev->val) = Z_NEXT(p->val); + } else { + ht->arHash[p->h & ht->nTableMask] = Z_NEXT(p->val); } } @@ -2054,18 +2028,60 @@ static void zend_accel_fast_shutdown(TSRMLS_D) EG(symbol_table).ht.pDestructor = old_destructor; } zend_hash_init(&EG(symbol_table).ht, 8, NULL, NULL, 0); - old_destructor = EG(function_table)->pDestructor; - EG(function_table)->pDestructor = NULL; - zend_hash_reverse_apply(EG(function_table), (apply_func_t) accel_clean_non_persistent_function TSRMLS_CC); - EG(function_table)->pDestructor = old_destructor; - old_destructor = EG(class_table)->pDestructor; - EG(class_table)->pDestructor = NULL; - zend_hash_reverse_apply(EG(class_table), (apply_func_t) accel_clean_non_persistent_class TSRMLS_CC); - EG(class_table)->pDestructor = old_destructor; - old_destructor = EG(zend_constants)->pDestructor; - EG(zend_constants)->pDestructor = NULL; - zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) accel_clean_non_persistent_constant TSRMLS_CC); - EG(zend_constants)->pDestructor = old_destructor; + + ZEND_HASH_REVERSE_FOREACH(EG(function_table), 0) { + zend_function *func = Z_PTR(_p->val); + + if (func->type == ZEND_INTERNAL_FUNCTION) { + break; + } else { + if (func->op_array.static_variables) { + accel_fast_hash_destroy(func->op_array.static_variables); + } + zend_accel_fast_del_bucket(EG(function_table), _idx-1, _p); + } + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_REVERSE_FOREACH(EG(class_table), 0) { + zend_class_entry *ce = Z_PTR(_p->val); + + if (ce->type == ZEND_INTERNAL_CLASS) { + break; + } else { + if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) { + zend_function *func; + + ZEND_HASH_FOREACH_PTR(&ce->function_table, func) { + if (func->type == ZEND_USER_FUNCTION) { + if (func->op_array.static_variables) { + accel_fast_hash_destroy(func->op_array.static_variables); + func->op_array.static_variables = NULL; + } + } + } ZEND_HASH_FOREACH_END(); + } + if (ce->static_members_table) { + int i; + + for (i = 0; i < ce->default_static_members_count; i++) { + accel_fast_zval_dtor(&ce->static_members_table[i]); + ZVAL_UNDEF(&ce->static_members_table[i]); + } + ce->static_members_table = NULL; + } + zend_accel_fast_del_bucket(EG(class_table), _idx-1, _p); + } + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_REVERSE_FOREACH(EG(zend_constants), 0) { + zend_constant *c = Z_PTR(_p->val); + + if (c->flags & CONST_PERSISTENT) { + break; + } else { + zend_accel_fast_del_bucket(EG(zend_constants), _idx-1, _p); + } + } ZEND_HASH_FOREACH_END(); } CG(unclean_shutdown) = 1; } diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index e04b1ec7db..59977717f7 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -75,7 +75,7 @@ zend_persistent_script* create_persistent_script(void) zend_persistent_script *persistent_script = (zend_persistent_script *) emalloc(sizeof(zend_persistent_script)); memset(persistent_script, 0, sizeof(zend_persistent_script)); - zend_hash_init(&persistent_script->function_table, 128, NULL, (dtor_func_t) zend_accel_destroy_zend_function, 0); + zend_hash_init(&persistent_script->function_table, 128, NULL, ZEND_FUNCTION_DTOR, 0); /* class_table is usually destroyed by free_persistent_script() that * overrides destructor. ZEND_CLASS_DTOR may be used by standard * PHP compiler @@ -232,14 +232,14 @@ static inline zend_string *zend_clone_str(zend_string *str TSRMLS_DC) if (IS_INTERNED(str)) { ret = str; - } else if (zend_string_refcount(str) <= 1 || (ret = accel_xlat_get(str)) == NULL) { + } else if (GC_REFCOUNT(str) <= 1 || (ret = accel_xlat_get(str)) == NULL) { ret = zend_string_dup(str, 0); GC_FLAGS(ret) = GC_FLAGS(str); - if (zend_string_refcount(str) > 1) { + if (GC_REFCOUNT(str) > 1) { accel_xlat_set(str, ret); } } else { - zend_string_addref(ret); + GC_REFCOUNT(ret)++; } return ret; } diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index b2b863c5a9..6491b9d781 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -373,7 +373,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: - case ZEND_JMP_SET_VAR: + case ZEND_COALESCE: case ZEND_NEW: case ZEND_FE_RESET: case ZEND_FE_FETCH: diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 76d1b043b0..d2de94f05c 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -120,7 +120,7 @@ static uint zend_persist_zval_calc(zval *z TSRMLS_DC) case IS_CONSTANT: flags = Z_GC_FLAGS_P(z) & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT); ADD_INTERNED_STRING(Z_STR_P(z), 0); - if (IS_INTERNED(Z_STR_P(z))) { + if (!Z_REFCOUNTED_P(z)) { Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); } Z_GC_FLAGS_P(z) |= flags; diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4 index a97114f808..701e488385 100644 --- a/ext/openssl/config0.m4 +++ b/ext/openssl/config0.m4 @@ -8,6 +8,9 @@ PHP_ARG_WITH(openssl, for OpenSSL support, PHP_ARG_WITH(kerberos, for Kerberos support, [ --with-kerberos[=DIR] OPENSSL: Include Kerberos support], no, no) +PHP_ARG_WITH(system-ciphers, whether to use system default cipher list instead of hardcoded value, +[ --with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value], no, no) + if test "$PHP_OPENSSL" != "no"; then PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared) PHP_SUBST(OPENSSL_SHARED_LIBADD) @@ -25,4 +28,7 @@ if test "$PHP_OPENSSL" != "no"; then ], [ AC_MSG_ERROR([OpenSSL check failed. Please check config.log for more information.]) ]) + if test "$PHP_SYSTEM_CIPHERS" != "no"; then + AC_DEFINE(USE_OPENSSL_SYSTEM_CIPHERS,1,[ Use system default cipher list instead of hardcoded value ]) + fi fi diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index f2219dcd1e..c4b155b478 100755 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -4386,7 +4386,7 @@ PHP_FUNCTION(openssl_private_encrypt) if (successful) { zval_dtor(crypted); cryptedbuf->val[cryptedlen] = '\0'; - ZVAL_STR(crypted, cryptedbuf); + ZVAL_NEW_STR(crypted, cryptedbuf); cryptedbuf = NULL; RETVAL_TRUE; } @@ -4451,7 +4451,7 @@ PHP_FUNCTION(openssl_private_decrypt) if (successful) { zval_dtor(crypted); cryptedbuf->val[cryptedlen] = '\0'; - ZVAL_STR(crypted, cryptedbuf); + ZVAL_NEW_STR(crypted, cryptedbuf); cryptedbuf = NULL; RETVAL_TRUE; } @@ -4509,7 +4509,7 @@ PHP_FUNCTION(openssl_public_encrypt) if (successful) { zval_dtor(crypted); cryptedbuf->val[cryptedlen] = '\0'; - ZVAL_STR(crypted, cryptedbuf); + ZVAL_NEW_STR(crypted, cryptedbuf); cryptedbuf = NULL; RETVAL_TRUE; } @@ -4576,7 +4576,7 @@ PHP_FUNCTION(openssl_public_decrypt) if (successful) { zval_dtor(crypted); cryptedbuf->val[cryptedlen] = '\0'; - ZVAL_STR(crypted, cryptedbuf); + ZVAL_NEW_STR(crypted, cryptedbuf); cryptedbuf = NULL; RETVAL_TRUE; } @@ -4660,7 +4660,7 @@ PHP_FUNCTION(openssl_sign) zval_dtor(signature); sigbuf->val[siglen] = '\0'; sigbuf->len = siglen; - ZVAL_STR(signature, sigbuf); + ZVAL_NEW_STR(signature, sigbuf); RETVAL_TRUE; } else { efree(sigbuf); @@ -4812,7 +4812,7 @@ PHP_FUNCTION(openssl_seal) if (len1 + len2 > 0) { zval_dtor(sealdata); buf[len1 + len2] = '\0'; - ZVAL_STR(sealdata, zend_string_init((char*)buf, len1 + len2, 0)); + ZVAL_NEW_STR(sealdata, zend_string_init((char*)buf, len1 + len2, 0)); efree(buf); zval_dtor(ekeys); @@ -4903,7 +4903,7 @@ PHP_FUNCTION(openssl_open) } else { zval_dtor(opendata); buf[len1 + len2] = '\0'; - ZVAL_STR(opendata, zend_string_init((char*)buf, len1 + len2, 0)); + ZVAL_NEW_STR(opendata, zend_string_init((char*)buf, len1 + len2, 0)); efree(buf); RETVAL_TRUE; } diff --git a/ext/openssl/openssl.dsp b/ext/openssl/openssl.dsp deleted file mode 100644 index 857666a6a3..0000000000 --- a/ext/openssl/openssl.dsp +++ /dev/null @@ -1,111 +0,0 @@ -# Microsoft Developer Studio Project File - Name="openssl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=openssl - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "openssl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "openssl.mak" CFG="openssl - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "openssl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "openssl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "openssl - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENSSL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_OPENSSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OPENSSL_EXT=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib ssleay32.lib libeay32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_openssl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "openssl - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENSSL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_OPENSSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OPENSSL_EXT=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib ssleay32.lib libeay32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_openssl.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "openssl - Win32 Release_TS"
-# Name "openssl - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\openssl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\xp_ssl.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_openssl.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/openssl/openssl.mak b/ext/openssl/openssl.mak index a0c6fa483e..9bc053b662 100644 --- a/ext/openssl/openssl.mak +++ b/ext/openssl/openssl.mak @@ -4,7 +4,7 @@ PROJECT_ROOT = ..\.. # Module details MODULE_NAME = php_ossl -MODULE_DESC = "PHP 5 - OpenSSL Extension" +MODULE_DESC = "PHP 7 - OpenSSL Extension" VMAJ = 1 VMIN = 0 VREV = 0 diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 968919eb64..08a9656b71 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/openssl/tests/bug65729.pem b/ext/openssl/tests/bug65729.pem index dbeed6efd3..f0d44a4c78 100644 --- a/ext/openssl/tests/bug65729.pem +++ b/ext/openssl/tests/bug65729.pem @@ -1,28 +1,28 @@ -----BEGIN CERTIFICATE----- -MIICCTCCAXICCQDNMI29sowT7TANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJT +MIICCTCCAXICCQCx2JwIhbRefzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJT RzESMBAGA1UECBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UE -AxQKKi50ZXN0LmNvbTAeFw0xMzA5MjEwNzUyMjRaFw0xNDA5MjEwNzUyMjRaMEkx +AxQKKi50ZXN0LmNvbTAeFw0xNDA5MjQxMTMzNTRaFw0yNDA5MjExMTMzNTRaMEkx CzAJBgNVBAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGli YmF3MRMwEQYDVQQDFAoqLnRlc3QuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB -iQKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK03oAd1jTe -Vd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOXZPG3UViD -rtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQABMA0GCSqG -SIb3DQEBBQUAA4GBAAS07u/Ke+EhEHidz6CG3Qcr+zg483JKRgZFyGz+YUKyyKKy -fmLs7JieGJxYQjOmIpj/6X9Gnb2HjIPDnI6A+MV1emXDTnnmsgf2/lZGcthhpZn2 -rMbj9bI0iH6HwOVGtp4ZJA5fB7nj3J+gWNTCQzDDOxwX36d2LL9ua+UMnk/g +iQKBgQDBnR8DYzsN90kISI87kBvw40TQknS7/fuymWCmSrtRQLED8p2QL8PiYCZ8 +UdcFVsv+di7MJvUOzW6dRo2DCu8Rojx3ML8dAtPsQkDdaCXDnOvCTQCAqFmxa1A9 +c5kp0hbzCrucKGckb355A4NumFgX1fjQ705MfjGPgQef1ZtozQIDAQABMA0GCSqG +SIb3DQEBBQUAA4GBAGP07nJo0pI4FdsXuAHWr97XxV4EhHopFMw6svOZ3UtsRzmW +ScmmMdgd3c8ciVxOsztgnzvFq/nrUkw/3n/Xz/gtE7kZt9aS18SnCyyHPJcXmmUE +NsbyZ/7srIqCSrxUkP+N//nToqHxg1pqA/A8RzOOQUAp+UIVF6Zl/kkFNgt8 -----END CERTIFICATE----- -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK0 -3oAd1jTeVd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOX -ZPG3UViDrtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQAB -AoGAeyzTwKPDl5QMRejHQL57GOwlH1vLcXrjv+VzwHZZKQ0IoKM++5fCQYf29KXp -XPahaluGW2u9sWa8R/7wGcd0Q4RtquGzsgT3+AQsIc5KfIamyOyDaRVM/ymX3fWg -gHIU7OOzB+ihOU8sHyRIwfbk01/kmrBXLRj8E31sy3i3PIECQQDQQYE+aN7Acrdt -yN5CaqvbkiCGjRvASlemiTzPosgOtndyp21w1gakJwKYhYDk1N6A6Qb8REMZqM/U -wFypldV/AkEAwfq6NFuhpGL6hDA7MvlyY1KiZ0cHetPUX+PgdNqy2DA+1Sv4i7gm -Wd/uA651K7aPXuUaf9dKtPCmZwI4M6SEsQJBALW89HTqP7niYoDEEnITdPaghxHk -gptERUln6lGo1L1CLus3gSI/JHyMLo+7scgAnEwTD62GRKhX0Ubwt+ymfTECQAY5 -fHYnppU20+EgBxZIqOIFCc8UmWnYmE0Ha/Fz/x8u1SVUBuK84wYpSGL32yyu7ATY -hzQo/W229zABAzqtAdECQQCUdB7IBFpPnsfv/EUBFX7X/7zAc9JpACmu9It5ju8C -KIsMuz/02D+TQoJNjdAngBM+4AJDIaGFgTMIfaDMh5L7 +MIICXgIBAAKBgQDBnR8DYzsN90kISI87kBvw40TQknS7/fuymWCmSrtRQLED8p2Q +L8PiYCZ8UdcFVsv+di7MJvUOzW6dRo2DCu8Rojx3ML8dAtPsQkDdaCXDnOvCTQCA +qFmxa1A9c5kp0hbzCrucKGckb355A4NumFgX1fjQ705MfjGPgQef1ZtozQIDAQAB +AoGADAnkAsbpxh2JKf2xAkgcpKbNAZcJsSLCwsEstEpTSWMXXqJ4T53YtTu7SOGh +2BAkkQbyM/l8JVZ6uUbIx8wnPzqAuB2hEDQHKZVyftDyJh+54Uyz0xV0JdWGWrFh +A+uDt/Zncx2g+qlkQG5J5nHnrd9OAns89wJXpBWA6twlsuECQQD/HC4wxOJzh1XI +YSWHWQulOnlNgZ2zERfmJeRfJ0ncmDOV2ofxOFQ+dMJ36XghPaH52KdxqWI1yQaE +yesx8ygFAkEAwkoF4lBuYdsXucJNDYf8o9MlBvazoriH0y26B/YozJ7iAEFqVvcC +TN+iKDIyiRALwR6a3nzhyFYJ4xyzgSIAKQJBAMnw3seQMsnM6aTS8cgwPr2uifNG +lTT4ZPi0KhEAosFSYhNPh6j1NAq0lnQhhgyaIywJypJ4yNtWpChdRiamGpkCQQDB +iUExPpOmMLwCk7VzrCmS+6pftHIevpi2WU99zMy5f+969665MFb/QqniRpamh/Bd +kGIPDPFQQbyZmqaJFNh5AkEAzy0YVbUT3C/QvstPr5i7ztj7WiW/1zJMamFwY/ZS +1J7e7lqHgRICie5uv1Yvh3w/qmV/7lTLhmlQZd9SJMpXhg== -----END RSA PRIVATE KEY----- diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 7954fb753a..54562c22e5 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -28,7 +28,7 @@ #include "ext/standard/file.h" #include "ext/standard/url.h" #include "streams/php_streams_int.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "php_openssl.h" #include "php_network.h" #include <openssl/ssl.h> @@ -1453,13 +1453,16 @@ int php_openssl_setup_crypto(php_stream *stream, } GET_VER_OPT_STRING("ciphers", cipherlist); +#ifndef USE_OPENSSL_SYSTEM_CIPHERS if (!cipherlist) { cipherlist = OPENSSL_DEFAULT_STREAM_CIPHERS; } - if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) { - return FAILURE; +#endif + if (cipherlist) { + if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) { + return FAILURE; + } } - if (FAILURE == set_local_cert(sslsock->ctx, stream TSRMLS_CC)) { return FAILURE; } @@ -1820,7 +1823,7 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun to hang forever. To avoid this scenario we poll with a timeout before performing the actual read. If it times out we're finished. */ - if (sock->is_blocked) { + if (sock->is_blocked && SSL_pending(sslsock->ssl_handle) == 0) { php_openssl_stream_wait_for_data(sock); if (sock->timeout_event) { stream->eof = 1; @@ -2146,17 +2149,19 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS case PHP_STREAM_AS_FD_FOR_SELECT: if (ret) { - if (sslsock->ssl_active) { - /* OpenSSL has an internal buffer which select() cannot see. If we don't - fetch it into the stream's buffer, no activity will be reported on the - stream even though there is data waiting to be read - but we only fetch - the number of bytes OpenSSL has ready to give us since we weren't asked - for any data at this stage. This is only likely to cause issues with - non-blocking streams, but it's harmless to always do it. */ - int bytes; - while ((bytes = SSL_pending(sslsock->ssl_handle)) > 0) { - php_stream_fill_read_buffer(stream, (size_t)bytes); - } + /* OpenSSL has an internal buffer which select() cannot see. If we don't + * fetch it into the stream's buffer, no activity will be reported on the + * stream even though there is data waiting to be read - but we only fetch + * the lower of bytes OpenSSL has ready to give us or chunk_size since we + * weren't asked for any data at this stage. This is only likely to cause + * issues with non-blocking streams, but it's harmless to always do it. */ + size_t pending; + if (stream->writepos == stream->readpos + && sslsock->ssl_active + && (pending = (size_t)SSL_pending(sslsock->ssl_handle)) > 0) { + php_stream_fill_read_buffer(stream, pending < stream->chunk_size + ? pending + : stream->chunk_size); } *(php_socket_t *)ret = sslsock->s.socket; diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 5595f31b58..11ad1018ec 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h index 05c7f45566..d02d6867f4 100644 --- a/ext/pcntl/php_pcntl.h +++ b/ext/pcntl/php_pcntl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c index 9f308d793c..aa2139342c 100644 --- a/ext/pcntl/php_signal.c +++ b/ext/pcntl/php_signal.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h index 5c61b10396..fc69fac756 100644 --- a/ext/pcntl/php_signal.h +++ b/ext/pcntl/php_signal.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 89c5f1155b..67857da2c7 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -23,7 +23,7 @@ #include "php_globals.h" #include "php_pcre.h" #include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #if HAVE_PCRE || HAVE_BUNDLED_PCRE @@ -782,7 +782,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } /* Add MARK, if available */ if (mark) { - add_assoc_string(&result_set, "MARK", (char *) mark); + add_assoc_string_ex(&result_set, "MARK", sizeof("MARK") - 1, (char *)mark); } /* And add it to the output array */ zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &result_set); @@ -822,7 +822,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } /* Add MARK, if available */ if (mark) { - add_assoc_string(subpats, "MARK", (char *) mark); + add_assoc_string_ex(subpats, "MARK", sizeof("MARK") - 1, (char *)mark); } } diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h index fb90395f75..cd6621372f 100644 --- a/ext/pcre/php_pcre.h +++ b/ext/pcre/php_pcre.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c index 88df420c37..61c68ff46d 100644 --- a/ext/pdo/pdo.c +++ b/ext/pdo/pdo.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index eb7f940528..aca52ebf20 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -425,7 +425,7 @@ static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry return object; } /* }}} */ -static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */ +static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */ { zval query_string; zval z_key; @@ -556,7 +556,7 @@ static PHP_METHOD(PDO, prepare) ZVAL_UNDEF(&stmt->lazy_object_ref); if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options TSRMLS_CC)) { - pdo_stmt_construct(stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC); + pdo_stmt_construct(execute_data, stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC); return; } @@ -1109,7 +1109,7 @@ static PHP_METHOD(PDO, query) stmt->executed = 1; } if (ret) { - pdo_stmt_construct(stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC); + pdo_stmt_construct(execute_data, stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC); return; } } diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index 0db82c6068..9dd7305723 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -1,7 +1,7 @@ /* Generated by re2c 0.13.5 */ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -406,10 +406,10 @@ yy45: struct placeholder { char *pos; + char *quoted; /* quoted value */ int len; int bindno; int qlen; /* quoted length of value */ - char *quoted; /* quoted value */ int freeq; struct placeholder *next; }; diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index 94ad04b983..79e167ba1d 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c index e3585844c6..94829a01a2 100644 --- a/ext/pdo/pdo_sqlstate.c +++ b/ext/pdo/pdo_sqlstate.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index dd8b01a5b4..5781de78e6 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -2267,7 +2267,7 @@ static zend_object *dbstmt_clone_obj(zval *zobject TSRMLS_DC) } zend_object_handlers pdo_dbstmt_object_handlers; -static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); +static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC); void pdo_stmt_init(TSRMLS_D) { @@ -2700,7 +2700,7 @@ zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC) return &row->std; } -static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) +static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDORow instances may not be serialized"); return FAILURE; diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h index 0dca85779a..ce5b3a229d 100644 --- a/ext/pdo/php_pdo.h +++ b/ext/pdo/php_pdo.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 279619ee0d..de9780e226 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -528,10 +528,10 @@ static inline pdo_dbh_object_t *php_pdo_dbh_fetch_object(zend_object *obj) { /* describes a column */ struct pdo_column_data { char *name; - int namelen; zend_ulong maxlen; - enum pdo_param_type param_type; zend_ulong precision; + enum pdo_param_type param_type; + int namelen; /* don't touch this unless your name is dbdo */ void *dbdo_data; @@ -539,18 +539,21 @@ struct pdo_column_data { /* describes a bound parameter */ struct pdo_bound_param_data { + zval parameter; /* the variable itself */ + + zval driver_params; /* optional parameter(s) for the driver */ + zend_long paramno; /* if -1, then it has a name, and we don't know the index *yet* */ zend_string *name; zend_long max_value_len; /* as a hint for pre-allocation */ - - zval parameter; /* the variable itself */ - enum pdo_param_type param_type; /* desired or suggested type */ - zval driver_params; /* optional parameter(s) for the driver */ void *driver_data; pdo_stmt_t *stmt; /* for convenience in dtor */ + + enum pdo_param_type param_type; /* desired or suggested variable type */ + int is_param; /* parameter or column ? */ }; diff --git a/ext/pdo/php_pdo_error.h b/ext/pdo/php_pdo_error.h index 60bb89a8f8..e89a2b8811 100644 --- a/ext/pdo/php_pdo_error.h +++ b/ext/pdo/php_pdo_error.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index 27cca7c29f..23de705ec1 100644 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index ddf182b190..40d4114879 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index 6bd2a5976e..a29405b24e 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index 2801ece8f1..3afd885df5 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_dblib/php_pdo_dblib.h b/ext/pdo_dblib/php_pdo_dblib.h index f7de387b96..5198976d25 100644 --- a/ext/pdo_dblib/php_pdo_dblib.h +++ b/ext/pdo_dblib/php_pdo_dblib.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index df15b229e0..e247b5c19e 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index ab4612a119..298d2539e3 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 622cbc39a3..d46a67d504 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c index 4eea0b69de..4e2c816460 100644 --- a/ext/pdo_firebird/pdo_firebird.c +++ b/ext/pdo_firebird/pdo_firebird.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/php_pdo_firebird.h b/ext/pdo_firebird/php_pdo_firebird.h index f7e9f17f12..3f1fc9a76c 100644 --- a/ext/pdo_firebird/php_pdo_firebird.h +++ b/ext/pdo_firebird/php_pdo_firebird.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h index 1fc610ce78..18670fee18 100644 --- a/ext/pdo_firebird/php_pdo_firebird_int.h +++ b/ext/pdo_firebird/php_pdo_firebird_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 0cf5b55bdd..7e4945a7b8 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 5eddc832a1..20d3ede0f6 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index 3a06741a05..d9c04470a4 100644 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h index e4d37c88ab..b5f6afd9eb 100644 --- a/ext/pdo_mysql/php_pdo_mysql.h +++ b/ext/pdo_mysql/php_pdo_mysql.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h index 31ccb5d02a..f6cdb0a8f2 100644 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ b/ext/pdo_mysql/php_pdo_mysql_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index a8e7913fa7..9132999461 100644 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index 4e341c08be..7c86a23dcc 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_oci/pdo_oci.c b/ext/pdo_oci/pdo_oci.c index 8eabb7e7c5..896f392664 100644 --- a/ext/pdo_oci/pdo_oci.c +++ b/ext/pdo_oci/pdo_oci.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_oci/php_pdo_oci.h b/ext/pdo_oci/php_pdo_oci.h index 3299dfe269..3448638fc1 100644 --- a/ext/pdo_oci/php_pdo_oci.h +++ b/ext/pdo_oci/php_pdo_oci.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h index 4979aadb13..36d45d0af7 100644 --- a/ext/pdo_oci/php_pdo_oci_int.h +++ b/ext/pdo_oci/php_pdo_oci_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index e99463de58..c0034d43ea 100644 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 274ce9b0d6..7491ec685d 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c index 1fe17c1c30..914b8bc980 100644 --- a/ext/pdo_odbc/pdo_odbc.c +++ b/ext/pdo_odbc/pdo_odbc.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/php_pdo_odbc.h b/ext/pdo_odbc/php_pdo_odbc.h index cd01ae45e5..52e8e6f8e7 100644 --- a/ext/pdo_odbc/php_pdo_odbc.h +++ b/ext/pdo_odbc/php_pdo_odbc.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h index 90d9d5d505..0d6d488b65 100644 --- a/ext/pdo_odbc/php_pdo_odbc_int.h +++ b/ext/pdo_odbc/php_pdo_odbc_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c index 5fbad7d4a0..5ca4b07a23 100644 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ b/ext/pdo_pgsql/pdo_pgsql.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index dfc6f4025a..327d70218b 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 7a315c7f08..05b8f79b27 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/php_pdo_pgsql.h b/ext/pdo_pgsql/php_pdo_pgsql.h index 9c01d9886c..31d89096ad 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql.h +++ b/ext/pdo_pgsql/php_pdo_pgsql.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index d6f7ad48aa..722d63706e 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/tests/getnotify.phpt b/ext/pdo_pgsql/tests/getnotify.phpt index c093e0357a..c54a31604d 100644 --- a/ext/pdo_pgsql/tests/getnotify.phpt +++ b/ext/pdo_pgsql/tests/getnotify.phpt @@ -70,14 +70,16 @@ var_dump($db->pgsqlGetNotify()); // Test second parameter, should wait 2 seconds because no notify is queued $t = microtime(1); $notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 1000); -var_dump((microtime(1) - $t) >= 1); +$diff = microtime(1) - $t; +var_dump($diff >= 1 || 1 - abs($diff) < .01); var_dump($notify); // Test second parameter, should return immediately because a notify is queued $db->exec("NOTIFY notifies_phpt"); $t = microtime(1); $notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 5000); -var_dump((microtime(1) - $t) < 1); +$diff = microtime(1) - $t; +var_dump($diff < 1 || abs(1 - abs($diff)) < .01); var_dump(count($notify)); ?> diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c index 33cffee821..0014de4e3b 100644 --- a/ext/pdo_sqlite/pdo_sqlite.c +++ b/ext/pdo_sqlite/pdo_sqlite.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h index 607b3ddedb..9413e1bb70 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite.h +++ b/ext/pdo_sqlite/php_pdo_sqlite.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h index 188856a3d1..133893bf8f 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite_int.h +++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index c76841bae2..413b50b9d4 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index 2cf271c0d3..378d8bb337 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index e3f64e0ed0..207764b165 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -35,7 +35,7 @@ #include "php.h" #include "php_ini.h" #include "ext/standard/php_standard.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/ereg/php_regex.h" #ifdef PHP_WIN32 # include "win32/time.h" @@ -5484,26 +5484,26 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z char *name; array_init(&elem); /* pg_attribute.attnum */ - add_assoc_long(&elem, "num", atoi(PQgetvalue(pg_result,i,1))); + add_assoc_long_ex(&elem, "num", sizeof("num") - 1, atoi(PQgetvalue(pg_result, i, 1))); /* pg_type.typname */ - add_assoc_string(&elem, "type", PQgetvalue(pg_result,i,2)); + add_assoc_string_ex(&elem, "type", sizeof("type") - 1, PQgetvalue(pg_result, i, 2)); /* pg_attribute.attlen */ - add_assoc_long(&elem, "len", atoi(PQgetvalue(pg_result,i,3))); + add_assoc_long_ex(&elem, "len", sizeof("len") - 1, atoi(PQgetvalue(pg_result,i,3))); /* pg_attribute.attnonull */ - add_assoc_bool(&elem, "not null", !strcmp(PQgetvalue(pg_result,i,4), "t")); + add_assoc_bool_ex(&elem, "not null", sizeof("not null") - 1, !strcmp(PQgetvalue(pg_result, i, 4), "t")); /* pg_attribute.atthasdef */ - add_assoc_bool(&elem, "has default", !strcmp(PQgetvalue(pg_result,i,5), "t")); + add_assoc_bool_ex(&elem, "has default", sizeof("has default") - 1, !strcmp(PQgetvalue(pg_result,i,5), "t")); /* pg_attribute.attndims */ - add_assoc_long(&elem, "array dims", atoi(PQgetvalue(pg_result,i,6))); + add_assoc_long_ex(&elem, "array dims", sizeof("array dims") - 1, atoi(PQgetvalue(pg_result, i, 6))); /* pg_type.typtype */ - add_assoc_bool(&elem, "is enum", !strcmp(PQgetvalue(pg_result,i,7), "e")); + add_assoc_bool_ex(&elem, "is enum", sizeof("is enum") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "e")); if (extended) { /* pg_type.typtype */ - add_assoc_bool(&elem, "is base", !strcmp(PQgetvalue(pg_result,i,7), "b")); - add_assoc_bool(&elem, "is composite", !strcmp(PQgetvalue(pg_result,i,7), "c")); - add_assoc_bool(&elem, "is pesudo", !strcmp(PQgetvalue(pg_result,i,7), "p")); + add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b")); + add_assoc_bool_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c")); + add_assoc_bool_ex(&elem, "is pesudo", sizeof("is pesudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "p")); /* pg_description.description */ - add_assoc_string(&elem, "description", PQgetvalue(pg_result,i,8)); + add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8)); } /* pg_attribute.attname */ name = PQgetvalue(pg_result,i,0); @@ -5701,7 +5701,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) if (should_free) { zval_ptr_dtor(src); } - ZVAL_STR(src, str.s); + ZVAL_NEW_STR(src, str.s); return SUCCESS; } @@ -5971,7 +5971,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con /* better to use PGSQLescapeLiteral since PGescapeStringConn does not handle special \ */ str->len = PQescapeStringConn(pg_link, str->val, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL); str = zend_string_realloc(str, str->len, 0); - ZVAL_STR(&new_val, str); + ZVAL_NEW_STR(&new_val, str); php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC); } break; @@ -6268,7 +6268,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con smart_str_appendl(&s, Z_STRVAL(new_val), Z_STRLEN(new_val)); smart_str_0(&s); zval_ptr_dtor(&new_val); - ZVAL_STR(&new_val, s.s); + ZVAL_NEW_STR(&new_val, s.s); } break; diff --git a/ext/pgsql/pgsql.dsp b/ext/pgsql/pgsql.dsp deleted file mode 100644 index 098469f36d..0000000000 --- a/ext/pgsql/pgsql.dsp +++ /dev/null @@ -1,167 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pgsql" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=pgsql - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pgsql.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pgsql.mak" CFG="pgsql - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pgsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pgsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pgsql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pgsql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pgsql - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PGSQL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpqdll.lib php5ts.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../../Release/pgsql.dll" /libpath:"..\..\..\PostgreSQL\lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "pgsql - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PGSQL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"../../Debug/pgsql.dll" /pdbtype:sept
-
-!ELSEIF "$(CFG)" == "pgsql - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\PostgreSQL\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "ZTS" /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D ZTS=1 /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "ZTS" /D ZEND_DEBUG=0 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpqdll.lib php5ts.lib /nologo /dll /machine:I386 /libpath:"..\..\..\PostgreSQL\lib" /libpath:"..\..\Release_TS"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpq.lib php5ts.lib /nologo /dll /machine:I386 /out:"../../Release_TS/php_pgsql.dll" /libpath:"..\..\..\php_build\postgresql\src\interfaces\libpq\Release" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "pgsql - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D ZTS=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D "ZTS" /D ZEND_DEBUG=1 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libpq.lib /nologo /dll /debug /machine:I386 /out:"../../Debug_TS/pgsql.dll" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "pgsql - Win32 Release"
-# Name "pgsql - Win32 Debug"
-# Name "pgsql - Win32 Release_TS"
-# Name "pgsql - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\pgsql.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_pgsql.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 9bfbf142f9..661c02f77f 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 4c02e1aecf..8f17c771d1 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1618,7 +1618,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a #ifndef MAX_WBITS #define MAX_WBITS 15 #endif - add_assoc_long(&filterparams, "window", MAX_WBITS + 32); + add_assoc_long_ex(&filterparams, "window", sizeof("window") - 1, MAX_WBITS + 32); /* entire file is gzip-compressed, uncompress to temporary file */ if (!(temp = php_stream_fopen_tmpfile())) { @@ -1630,7 +1630,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a if (!filter) { err = 1; - add_assoc_long(&filterparams, "window", MAX_WBITS); + add_assoc_long_ex(&filterparams, "window", sizeof("window") - 1, MAX_WBITS); filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRMLS_CC); zval_dtor(&filterparams); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 77df0a71c2..f49143bc8c 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -35,6 +35,7 @@ #include "zend_operators.h" #include "zend_qsort.h" #include "zend_vm.h" +#include "zend_smart_str.h" #include "main/php_streams.h" #include "main/streams/php_stream_plain_wrapper.h" #include "main/SAPI.h" @@ -49,7 +50,6 @@ #include "ext/standard/md5.h" #include "ext/standard/sha1.h" #include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" #include "ext/standard/php_versioning.h" #ifndef PHP_WIN32 #include "TSRM/tsrm_strtok_r.h" diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index ed3e60a0ea..f82b825631 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -87,7 +87,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char zend_string *str = strpprintf(4096, "phar://%s%s", fname, entry); ZVAL_STR(&temp, Z_STR_P(stuff)); - ZVAL_STR(stuff, str); + ZVAL_NEW_STR(stuff, str); zend_hash_str_update(_SERVER, "PHAR_PATH_TRANSLATED", sizeof("PHAR_PATH_TRANSLATED")-1, &temp); } @@ -134,7 +134,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char zend_string *str = strpprintf(4096, "phar://%s%s", fname, entry); ZVAL_STR(&temp, Z_STR_P(stuff)); - ZVAL_STR(stuff, str); + ZVAL_NEW_STR(stuff, str); zend_hash_str_update(_SERVER, "PHAR_SCRIPT_FILENAME", sizeof("PHAR_SCRIPT_FILENAME")-1, &temp); } @@ -553,6 +553,7 @@ PHP_METHOD(Phar, webPhar) int entry_len, code, not_cgi; phar_archive_data *phar = NULL; phar_entry_info *info = NULL; + size_t sapi_mod_name_len = strlen(sapi_module.name); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) { return; @@ -587,9 +588,9 @@ PHP_METHOD(Phar, webPhar) ++basename; } - if ((strlen(sapi_module.name) == sizeof("cgi-fcgi")-1 && !strncmp(sapi_module.name, "cgi-fcgi", sizeof("cgi-fcgi")-1)) - || (strlen(sapi_module.name) == sizeof("fpm-fcgi")-1 && !strncmp(sapi_module.name, "fpm-fcgi", sizeof("fpm-fcgi")-1)) - || (strlen(sapi_module.name) == sizeof("cgi")-1 && !strncmp(sapi_module.name, "cgi", sizeof("cgi")-1))) { + if ((sapi_mod_name_len == sizeof("cgi-fcgi") - 1 && !strncmp(sapi_module.name, "cgi-fcgi", sizeof("cgi-fcgi") - 1)) + || (sapi_mod_name_len == sizeof("fpm-fcgi") - 1 && !strncmp(sapi_module.name, "fpm-fcgi", sizeof("fpm-fcgi") - 1)) + || (sapi_mod_name_len == sizeof("cgi") - 1 && !strncmp(sapi_module.name, "cgi", sizeof("cgi") - 1))) { if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF) { HashTable *_server = Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]); @@ -1382,10 +1383,10 @@ struct _phar_t { phar_archive_object *p; zend_class_entry *c; char *b; - uint l; zval *ret; - int count; php_stream *fp; + uint l; + int count; }; static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ @@ -3550,7 +3551,7 @@ PHP_METHOD(Phar, offsetGet) } sfname = strpprintf(0, "phar://%s/%s", phar_obj->archive->fname, fname); - ZVAL_STR(&zfname, sfname); + ZVAL_NEW_STR(&zfname, sfname); spl_instantiate_arg_ex1(phar_obj->spl.info_class, return_value, &zfname TSRMLS_CC); zval_ptr_dtor(&zfname); } diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 985abd14a9..76862f7cdb 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -570,7 +570,7 @@ bail: phar_destroy_phar_data(myphar TSRMLS_CC); return FAILURE; } - } while (read != 0); + } while (!php_stream_eof(fp)); if (zend_hash_str_exists(&(myphar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1)) { myphar->is_data = 0; diff --git a/ext/phar/zip.c b/ext/phar/zip.c index a314498813..4fe0bf05c8 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -241,7 +241,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, mydata->metadata_len = 0; /* if not valid serialized data, it is a regular string */ - ZVAL_STR(&mydata->metadata, zend_string_init(metadata, PHAR_GET_16(locator.comment_len), mydata->is_persistent)); + ZVAL_NEW_STR(&mydata->metadata, zend_string_init(metadata, PHAR_GET_16(locator.comment_len), mydata->is_persistent)); } } else { ZVAL_UNDEF(&mydata->metadata); @@ -529,7 +529,7 @@ foundit: entry.metadata_len = 0; /* if not valid serialized data, it is a regular string */ - ZVAL_STR(&entry.metadata, zend_string_init(buf, PHAR_GET_16(zipentry.comment_len), entry.is_persistent)); + ZVAL_NEW_STR(&entry.metadata, zend_string_init(buf, PHAR_GET_16(zipentry.comment_len), entry.is_persistent)); } } else { ZVAL_UNDEF(&entry.metadata); diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h index 8ace07c1c0..ebd449231d 100644 --- a/ext/posix/php_posix.h +++ b/ext/posix/php_posix.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 091b42cfdd..ca7d34c645 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pspell/php_pspell.h b/ext/pspell/php_pspell.h index 83103fae74..bd0956c2ba 100644 --- a/ext/pspell/php_pspell.h +++ b/ext/pspell/php_pspell.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c index bf01f28df6..72165ae78e 100644 --- a/ext/pspell/pspell.c +++ b/ext/pspell/pspell.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/pspell/pspell.dsp b/ext/pspell/pspell.dsp deleted file mode 100644 index f310099d89..0000000000 --- a/ext/pspell/pspell.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pspell" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=pspell - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pspell.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pspell.mak" CFG="pspell - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pspell - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pspell - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pspell - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "pspell___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "pspell___Win32_Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "..\..\..\aspell\include\pspell" /I "..\..\..\php_build\include\pspell." /D ZEND_DEBUG=1 /D "_DEBUG" /D ZTS=1 /D HAVE_PSPELL=1 /D "COMPILE_DL_PSPELL" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_pspell.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-# ADD LINK32 php5ts_debug.lib aspell-15.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_pspell.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\aspell\lib"
-
-!ELSEIF "$(CFG)" == "pspell - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "pspell___Win32_Release_TS"
-# PROP BASE Intermediate_Dir "pspell___Win32_Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "..\..\..\aspell\include\pspell" /I "..\..\..\php_build\include\pspell" /D ZEND_DEBUG=0 /D "NDEBUG" /D ZTS=1 /D HAVE_PSPELL=1 /D "COMPILE_DL_PSPELL" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib aspell-15.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_pspell.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\aspell\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "pspell - Win32 Debug_TS"
-# Name "pspell - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\pspell.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_pspell.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h index 5660bdb7f6..7a014164fc 100644 --- a/ext/readline/php_readline.h +++ b/ext/readline/php_readline.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 5299f839dc..0e7b146174 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index c7fb0438e9..ff0671ce9f 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ #include "php_main.h" #include "fopen_wrappers.h" #include "ext/standard/php_standard.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #ifdef __riscos__ #include <unixlib/local.h> diff --git a/ext/readline/readline_cli.h b/ext/readline/readline_cli.h index becd9d3342..6e57c83408 100644 --- a/ext/readline/readline_cli.h +++ b/ext/readline/readline_cli.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -20,7 +20,7 @@ /* $Id$ */ #include "php.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str_public.h" ZEND_BEGIN_MODULE_GLOBALS(cli_readline) char *pager; diff --git a/ext/recode/php_recode.h b/ext/recode/php_recode.h index 76ae292c56..265af7f148 100644 --- a/ext/recode/php_recode.h +++ b/ext/recode/php_recode.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/recode/recode.c b/ext/recode/recode.c index 2e044301cb..a70a4fcb2c 100644 --- a/ext/recode/recode.c +++ b/ext/recode/recode.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index ad6a2fb841..fc279e2d12 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -83,7 +83,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection) /* Method macros */ #define METHOD_NOTSTATIC(ce) \ - if (!Z_OBJ(EG(This)) || !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) { \ + if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce TSRMLS_CC)) { \ php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C)); \ return; \ } \ @@ -209,10 +209,10 @@ typedef enum { /* Struct for reflection objects */ typedef struct { zval dummy; /* holder for the second property */ - void *ptr; - reflection_type_t ref_type; zval obj; + void *ptr; zend_class_entry *ce; + reflection_type_t ref_type; unsigned int ignore_visibility:1; zend_object zo; } reflection_object; @@ -941,7 +941,7 @@ static void _property_string(string *str, zend_property_info *prop, char *prop_n string_printf(str, "static "); } - zend_unmangle_property_name(prop->name->val, prop->name->len, &class_name, (const char**)&prop_name); + zend_unmangle_property_name(prop->name, &class_name, (const char**)&prop_name); string_printf(str, "$%s", prop_name); } @@ -995,9 +995,12 @@ static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list arg int *num_classes = va_arg(args, int*); if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module && !strcasecmp(ce->info.internal.module->name, module->name)) { - string_printf(str, "\n"); - _class_string(str, ce, NULL, indent TSRMLS_CC); - (*num_classes)++; + /* dump class if it is not an alias */ + if (!zend_binary_strcasecmp(ce->name->val, ce->name->len, hash_key->key->val, hash_key->key->len)) { + string_printf(str, "\n"); + _class_string(str, ce, NULL, indent TSRMLS_CC); + (*num_classes)++; + } } return ZEND_HASH_APPLY_KEEP; } @@ -1178,7 +1181,7 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSR reflection_object *intern; zval name; - ZVAL_STR(&name, zend_string_copy(ce->name)); + ZVAL_STR_COPY(&name, ce->name); reflection_instantiate(reflection_class_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); intern->ptr = ce; @@ -1251,7 +1254,7 @@ static void reflection_function_factory(zend_function *function, zval *closure_o reflection_object *intern; zval name; - ZVAL_STR(&name, zend_string_copy(function->common.function_name)); + ZVAL_STR_COPY(&name, function->common.function_name); reflection_instantiate(reflection_function_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); @@ -1273,9 +1276,9 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho zval name; zval classname; - ZVAL_STR(&name, zend_string_copy((method->common.scope && method->common.scope->trait_aliases)? - zend_resolve_method_name(ce, method) : method->common.function_name)); - ZVAL_STR(&classname, zend_string_copy(method->common.scope->name)); + ZVAL_STR_COPY(&name, (method->common.scope && method->common.scope->trait_aliases)? + zend_resolve_method_name(ce, method) : method->common.function_name); + ZVAL_STR_COPY(&classname, method->common.scope->name); reflection_instantiate(reflection_method_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); intern->ptr = method; @@ -1298,15 +1301,16 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info zval classname; property_reference *reference; const char *class_name, *prop_name; + size_t prop_name_len; - zend_unmangle_property_name(prop->name->val, prop->name->len, &class_name, &prop_name); + zend_unmangle_property_name_ex(prop->name, &class_name, &prop_name, &prop_name_len); if (!(prop->flags & ZEND_ACC_PRIVATE)) { /* we have to search the class hierarchy for this (implicit) public or protected property */ zend_class_entry *tmp_ce = ce, *store_ce = ce; zend_property_info *tmp_info = NULL; - while (tmp_ce && (tmp_info = zend_hash_str_find_ptr(&tmp_ce->properties_info, prop_name, strlen(prop_name))) == NULL) { + while (tmp_ce && (tmp_info = zend_hash_str_find_ptr(&tmp_ce->properties_info, prop_name, prop_name_len)) == NULL) { ce = tmp_ce; tmp_ce = tmp_ce->parent; } @@ -1318,8 +1322,8 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info } } - ZVAL_STRING(&name, prop_name); - ZVAL_STR(&classname, zend_string_copy(prop->ce->name)); + ZVAL_STRINGL(&name, prop_name, prop_name_len); + ZVAL_STR_COPY(&classname, prop->ce->name); reflection_instantiate(reflection_property_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); @@ -1622,7 +1626,7 @@ ZEND_METHOD(reflection_function, __construct) return; } - ZVAL_STR(&name, zend_string_copy(fptr->common.function_name)); + ZVAL_STR_COPY(&name, fptr->common.function_name); reflection_update_property(object, "name", &name); intern->ptr = fptr; intern->ref_type = REF_TYPE_FUNCTION; @@ -2739,9 +2743,9 @@ ZEND_METHOD(reflection_method, __construct) } efree(lcname); - ZVAL_STR(&name, zend_string_copy(mptr->common.scope->name)); + ZVAL_STR_COPY(&name, mptr->common.scope->name); reflection_update_property(object, "class", &name); - ZVAL_STR(&name, zend_string_copy(mptr->common.function_name)); + ZVAL_STR_COPY(&name, mptr->common.function_name); reflection_update_property(object, "name", &name); intern->ptr = mptr; intern->ref_type = REF_TYPE_FUNCTION; @@ -3304,7 +3308,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob } if (Z_TYPE_P(argument) == IS_OBJECT) { - ZVAL_STR(&classname, zend_string_copy(Z_OBJCE_P(argument)->name)); + ZVAL_STR_COPY(&classname, Z_OBJCE_P(argument)->name); reflection_update_property(object, "name", &classname); intern->ptr = Z_OBJCE_P(argument); if (is_object) { @@ -3320,7 +3324,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob return; } - ZVAL_STR(&classname, zend_string_copy(ce->name)); + ZVAL_STR_COPY(&classname, ce->name); reflection_update_property(object, "name", &classname); intern->ptr = ce; @@ -3794,7 +3798,7 @@ ZEND_METHOD(reflection_class, hasProperty) RETURN_TRUE; } else { if (Z_TYPE(intern->obj) != IS_UNDEF && Z_OBJ_HANDLER(intern->obj, has_property)) { - ZVAL_STR(&property, zend_string_copy(name)); + ZVAL_STR_COPY(&property, name); if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL TSRMLS_CC)) { zval_ptr_dtor(&property); RETURN_TRUE; @@ -3905,7 +3909,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend { zval property; zend_class_entry *ce = *va_arg(args, zend_class_entry**); - zval *retval = va_arg(args, zval*), member; + zval *retval = va_arg(args, zval*); /* under some circumstances, the properties hash table may contain numeric * properties (e.g. when casting from array). This is a WONT FIX bug, at @@ -3918,8 +3922,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend return 0; /* non public cannot be dynamic */ } - ZVAL_STR(&member, hash_key->key); - if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) { + if (zend_get_property_info(ce, hash_key->key, 1 TSRMLS_CC) == &EG(std_property_info)) { EG(std_property_info).flags = ZEND_ACC_IMPLICIT_PUBLIC; reflection_property_factory(ce, &EG(std_property_info), &property TSRMLS_CC); add_next_index_zval(retval, &property); @@ -4733,7 +4736,6 @@ ZEND_METHOD(reflection_property, __construct) { zval propname, cname, *classname; char *name_str; - const char *class_name, *prop_name; size_t name_len; int dynam_prop = 0; zval *object; @@ -4797,11 +4799,13 @@ ZEND_METHOD(reflection_property, __construct) } if (dynam_prop == 0) { - zend_unmangle_property_name(property_info->name->val, property_info->name->len, &class_name, &prop_name); - ZVAL_STR(&cname, zend_string_copy(property_info->ce->name)); - ZVAL_STRING(&propname, prop_name); + const char *class_name, *prop_name; + size_t prop_name_len; + zend_unmangle_property_name_ex(property_info->name, &class_name, &prop_name, &prop_name_len); + ZVAL_STR_COPY(&cname, property_info->ce->name); + ZVAL_STRINGL(&propname, prop_name, prop_name_len); } else { - ZVAL_STR(&cname, zend_string_copy(ce->name)); + ZVAL_STR_COPY(&cname, ce->name); ZVAL_STRINGL(&propname, name_str, name_len); } reflection_update_property(object, "class", &cname); @@ -4950,12 +4954,14 @@ ZEND_METHOD(reflection_property, getValue) ZVAL_DUP(return_value, &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]); } else { const char *class_name, *prop_name; + size_t prop_name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) { return; } - zend_unmangle_property_name(ref->prop.name->val, ref->prop.name->len, &class_name, &prop_name); - member_p = zend_read_property(ref->ce, object, prop_name, strlen(prop_name), 1 TSRMLS_CC); + + zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len); + member_p = zend_read_property(ref->ce, object, prop_name, prop_name_len, 1 TSRMLS_CC); ZVAL_DUP(return_value, member_p); } } @@ -5024,12 +5030,14 @@ ZEND_METHOD(reflection_property, setValue) } } else { const char *class_name, *prop_name; + size_t prop_name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) { return; } - zend_unmangle_property_name(ref->prop.name->val, ref->prop.name->len, &class_name, &prop_name); - zend_update_property(ref->ce, object, prop_name, strlen(prop_name), value TSRMLS_CC); + + zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len); + zend_update_property(ref->ce, object, prop_name, prop_name_len, value TSRMLS_CC); } } /* }}} */ @@ -5043,18 +5051,17 @@ ZEND_METHOD(reflection_property, getDeclaringClass) zend_class_entry *tmp_ce, *ce; zend_property_info *tmp_info; const char *prop_name, *class_name; - int prop_name_len; + size_t prop_name_len; if (zend_parse_parameters_none() == FAILURE) { return; } GET_REFLECTION_OBJECT_PTR(ref); - if (zend_unmangle_property_name(ref->prop.name->val, ref->prop.name->len, &class_name, &prop_name) != SUCCESS) { + if (zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len) != SUCCESS) { RETURN_FALSE; } - prop_name_len = strlen(prop_name); ce = tmp_ce = ref->ce; while (tmp_ce && (tmp_info = zend_hash_str_find_ptr(&tmp_ce->properties_info, prop_name, prop_name_len)) != NULL) { if (tmp_info->flags & ZEND_ACC_PRIVATE || tmp_info->flags & ZEND_ACC_SHADOW) { @@ -5280,7 +5287,7 @@ static int _addinientry(zval *el TSRMLS_DC, int num_args, va_list args, zend_has if (ini_entry->value) { zval zv; - ZVAL_STR(&zv, zend_string_copy(ini_entry->value)); + ZVAL_STR_COPY(&zv, ini_entry->value); zend_symtable_update(Z_ARRVAL_P(retval), ini_entry->name, &zv); } else { zend_symtable_update(Z_ARRVAL_P(retval), ini_entry->name, &EG(uninitialized_zval)); @@ -5316,11 +5323,20 @@ static int add_extension_class(zval *zv TSRMLS_DC, int num_args, va_list args, z int add_reflection_class = va_arg(args, int); if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module && !strcasecmp(ce->info.internal.module->name, module->name)) { + zend_string *name; + + if (zend_binary_strcasecmp(ce->name->val, ce->name->len, hash_key->key->val, hash_key->key->len)) { + /* This is an class alias, use alias name */ + name = hash_key->key; + } else { + /* Use class name */ + name = ce->name; + } if (add_reflection_class) { zend_reflection_class_factory(ce, &zclass TSRMLS_CC); - zend_hash_update(Z_ARRVAL_P(class_array), ce->name, &zclass); + zend_hash_update(Z_ARRVAL_P(class_array), name, &zclass); } else { - add_next_index_str(class_array, zend_string_copy(ce->name)); + add_next_index_str(class_array, zend_string_copy(name)); } } return ZEND_HASH_APPLY_KEEP; diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h index 2c03bd6e7e..1c436d7dcc 100644 --- a/ext/reflection/php_reflection.h +++ b/ext/reflection/php_reflection.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index bc87ef9e1e..cb61c8a221 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -57,13 +57,13 @@ #endif typedef struct { - int fd; char *lastkey; char *basedir; size_t basedir_len; size_t dirdepth; size_t st_size; int filemode; + int fd; } ps_files; ps_module ps_mod_files = { diff --git a/ext/session/mod_files.h b/ext/session/mod_files.h index d1d26cd39b..a56dce1d36 100644 --- a/ext/session/mod_files.h +++ b/ext/session/mod_files.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index 319f1d3c79..bf48436a7e 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_mm.h b/ext/session/mod_mm.h index cafbfa0932..e0f2c1239f 100644 --- a/ext/session/mod_mm.h +++ b/ext/session/mod_mm.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 5d69712543..5d474deab5 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -44,7 +44,7 @@ ps_module ps_mod_user = { #define SESS_ZVAL_STR(vl, a) \ { \ - ZVAL_STR(a, zend_string_copy(vl)); \ + ZVAL_STR_COPY(a, vl); \ } static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRMLS_DC) diff --git a/ext/session/mod_user.h b/ext/session/mod_user.h index b1f3688a25..72a119cbab 100644 --- a/ext/session/mod_user.h +++ b/ext/session/mod_user.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c index 35a681babd..7e2960cc32 100644 --- a/ext/session/mod_user_class.c +++ b/ext/session/mod_user_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/session/php_session.h b/ext/session/php_session.h index 790e116528..9fb6477056 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/session/session.c b/ext/session/session.c index de8cf23310..63bb00e06a 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -48,7 +48,7 @@ #include "ext/standard/url_scanner_ex.h" #include "ext/standard/php_rand.h" /* for RAND_MAX */ #include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/url.h" #include "ext/standard/basic_functions.h" #include "ext/standard/head.h" @@ -1268,7 +1268,8 @@ static void php_session_remove_cookie(TSRMLS_D) { zend_llist_element *current; char *session_cookie; zend_string *e_session_name; - int session_cookie_len, len = sizeof("Set-Cookie")-1; + int session_cookie_len; + uint len = sizeof("Set-Cookie")-1; e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name))); spprintf(&session_cookie, 0, "Set-Cookie: %s=", e_session_name->val); diff --git a/ext/shmop/php_shmop.h b/ext/shmop/php_shmop.h index b9eaba6f07..4ee6d4f61c 100644 --- a/ext/shmop/php_shmop.h +++ b/ext/shmop/php_shmop.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/shmop/shmop.dsp b/ext/shmop/shmop.dsp deleted file mode 100644 index 848f0bdc91..0000000000 --- a/ext/shmop/shmop.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="shmop" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=shmop - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "shmop.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "shmop.mak" CFG="shmop - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "shmop - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "shmop - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "shmop - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHMOP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /D "WIN32" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D "NDEBUG" /D "PHP_EXPORTS" /D "HAVE_SHMOP" /D COMPILE_DL_SHMOP=1 /D ZEND_DEBUG=0 /D "ZTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_shmop.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "shmop - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHMOP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /D "WIN32" /D ZEND_DEBUG=1 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_EXPORTS" /D "COMPILE_DL_SHMOP" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SHMOP=1 /D ZTS=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_shmop.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "shmop - Win32 Release_TS"
-# Name "shmop - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\shmop.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_shmop.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h index b908e4c722..780974c0c9 100644 --- a/ext/simplexml/php_simplexml.h +++ b/ext/simplexml/php_simplexml.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h index 6cdda1be4a..82e5aff9e4 100644 --- a/ext/simplexml/php_simplexml_exports.h +++ b/ext/simplexml/php_simplexml_exports.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index db4944ff5a..366a6f0d3b 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/simplexml/simplexml.dsp b/ext/simplexml/simplexml.dsp deleted file mode 100644 index 79df918703..0000000000 --- a/ext/simplexml/simplexml.dsp +++ /dev/null @@ -1,111 +0,0 @@ -# Microsoft Developer Studio Project File - Name="simplexml" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=simplexml - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "simplexml.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "simplexml.mak" CFG="simplexml - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "simplexml - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "simplexml - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "simplexml - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "c:\php\5d\extensions"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php5" /I "..\..\..\php5\main" /I "..\..\..\php5\Zend" /I "..\..\..\php5\TSRM" /D ZEND_DEBUG=1 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D COMPILE_DL_SIMPLEXML=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php5\Debug_TS"
-
-!ELSEIF "$(CFG)" == "simplexml - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\php5\main" /I "..\..\..\php5\Zend" /I "..\..\..\php5\TSRM" /I "..\..\..\php5\win32" /I "..\..\..\php5" /D ZTS=1 /D ZEND_DEBUG=0 /D "ZEND_WIN32" /D "PHP_WIN32" /D COMPILE_DL_SIMPLEXML=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /D "LIBXML_THREAD_ENABLED" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\..\..\php5\Release_TS" /libpath:"..\..\..\php5\Release_TS_Inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "simplexml - Win32 Debug_TS"
-# Name "simplexml - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\simplexml.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_simplexml.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c index e237d2fb95..27d1e9b0f2 100644 --- a/ext/simplexml/sxe.c +++ b/ext/simplexml/sxe.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/simplexml/sxe.h b/ext/simplexml/sxe.h index 629e7b31d4..a08c8f7300 100644 --- a/ext/simplexml/sxe.h +++ b/ext/simplexml/sxe.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/skeleton/skeleton.dsp b/ext/skeleton/skeleton.dsp deleted file mode 100644 index c3c67c7e34..0000000000 --- a/ext/skeleton/skeleton.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="extname" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=extname - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak" CFG="extname - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "extname - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "extname - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "extname - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_extname.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "extname - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_extname.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "extname - Win32 Release_TS"
-# Name "extname - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\extname.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_extname.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/skeleton/tests/001.phpt b/ext/skeleton/tests/001.phpt index a375577e1b..88f5795650 100644 --- a/ext/skeleton/tests/001.phpt +++ b/ext/skeleton/tests/001.phpt @@ -13,7 +13,7 @@ echo "extname extension is available"; to pass, differences between the output and the expected text are interpreted as failure - see php5/README.TESTING for further information on + see php7/README.TESTING for further information on writing regression tests */ ?> diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h index 6e170ffe71..610fff11c7 100644 --- a/ext/snmp/php_snmp.h +++ b/ext/snmp/php_snmp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index f2eb434b9c..250b1f0ebe 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/snmp/snmp.dsp b/ext/snmp/snmp.dsp deleted file mode 100644 index 3cc62338bd..0000000000 --- a/ext/snmp/snmp.dsp +++ /dev/null @@ -1,109 +0,0 @@ -# Microsoft Developer Studio Project File - Name="snmp" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=snmp - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "snmp.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "snmp.mak" CFG="snmp - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "snmp - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "snmp - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "snmp - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_SNMP" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SNMP_EXPORTS" /D "COMPILE_DL_SNMP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SNMP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_snmp.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "snmp - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_SNMP" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SNMP_EXPORTS" /D "COMPILE_DL_SNMP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SNMP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_snmp.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "snmp - Win32 Release_TS"
-# Name "snmp - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\snmp.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_snmp.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 802a0773cb..d34587b85e 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -813,7 +813,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML } } str->val[str->len] = '\0'; - ZVAL_STR(ret, str); + ZVAL_NEW_STR(ret, str); } else { ZVAL_EMPTY_STRING(ret); } @@ -1201,7 +1201,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC) /* Hack for bug #32455 */ zend_property_info *property_info; - property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC); + property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC); EG(scope) = old_scope; if (property_info && zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) { zval_ptr_dtor(&member); @@ -1984,7 +1984,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo if (Z_TYPE_P(data) == IS_OBJECT) { const char *class_name; - zend_unmangle_property_name(str_key->val, str_key->len, &class_name, &prop_name); + zend_unmangle_property_name(str_key, &class_name, &prop_name); } else { prop_name = str_key->val; } @@ -2441,7 +2441,7 @@ iterator_done: smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1); } smart_str_appendc(&array_type, '['); - smart_str_append(&array_type, &array_size); + smart_str_append_smart_str(&array_type, &array_size); smart_str_appendc(&array_type, ']'); smart_str_0(&array_type); set_ns_prop(xmlParam, SOAP_1_1_ENC_NAMESPACE, "arrayType", array_type.s->val); diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h index adcccd3612..4424116524 100644 --- a/ext/soap/php_encoding.h +++ b/ext/soap/php_encoding.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index d1fd2d51ae..a1cee555a8 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -595,7 +595,7 @@ try_again: smart_str_append_const(&soap_headers, "User-Agent: PHP-SOAP/"PHP_VERSION"\r\n"); } - smart_str_append(&soap_headers, &soap_headers_z); + smart_str_append_smart_str(&soap_headers, &soap_headers_z); if (soap_version == SOAP_1_2) { smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=utf-8"); diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h index 3fcc053741..b752641b1b 100644 --- a/ext/soap/php_http.h +++ b/ext/soap/php_http.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c index 12fc31786f..52fa71d4e0 100644 --- a/ext/soap/php_packet_soap.c +++ b/ext/soap/php_packet_soap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h index dacf5055a2..632470f255 100644 --- a/ext/soap/php_packet_soap.h +++ b/ext/soap/php_packet_soap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index 2c4c6c9189..b5aa5f21c2 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h index d68db88edc..55595f2ad8 100644 --- a/ext/soap/php_schema.h +++ b/ext/soap/php_schema.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 587695b943..798c06fdd2 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -292,7 +292,7 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC) zval new_header; rest += 2; - ZVAL_STR(&new_header, zend_string_alloc(Z_STRLEN_P(header) - (rest - s), 0)); + ZVAL_NEW_STR(&new_header, zend_string_alloc(Z_STRLEN_P(header) - (rest - s), 0)); memcpy(Z_STRVAL(new_header), Z_STRVAL_P(header), s - Z_STRVAL_P(header)); memcpy(Z_STRVAL(new_header) + (s - Z_STRVAL_P(header)), rest, Z_STRLEN_P(header) - (rest - Z_STRVAL_P(header)) + 1); ZVAL_COPY(&ctx->old_header, header); @@ -3250,8 +3250,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC) smart_str_appends(&proxy,Z_STRVAL(str_port)); smart_str_0(&proxy); zval_dtor(&str_port); - ZVAL_STR(&str_proxy, zend_string_copy(proxy.s)); - smart_str_free(&proxy); + ZVAL_NEW_STR(&str_proxy, proxy.s); if (!context) { context = php_stream_context_alloc(TSRMLS_C); @@ -3289,9 +3288,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC) } smart_str_0(&headers); - ZVAL_STR(&str_headers, zend_string_copy(headers.s)); + ZVAL_NEW_STR(&str_headers, headers.s); php_stream_context_set_option(context, "http", "header", &str_headers); - smart_str_free(&headers); zval_ptr_dtor(&str_headers); } diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h index a29e2e9a1a..cf6e26b179 100644 --- a/ext/soap/php_sdl.h +++ b/ext/soap/php_sdl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_soap.dsp b/ext/soap/php_soap.dsp deleted file mode 100644 index 4157c63320..0000000000 --- a/ext/soap/php_soap.dsp +++ /dev/null @@ -1,156 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php_soap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php_soap - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php_soap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php_soap.mak" CFG="php_soap - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php_soap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php_soap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php_soap - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTSWS" /D "PHP_SOAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=0 /D "COMPILE_DL_SOAP" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_soap.dll" /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Release_TS"
-
-!ELSEIF "$(CFG)" == "php_soap - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=1 /D "COMPILE_DL_SOAP" /FR"Debug_TS/" /Fp"Debug_TS/soap.pch" /YX /Fo"Debug_TS/" /Fd"Debug_TS/" /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_soap.dll" /pdbtype:sept /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Debug_TS"
-# SUBTRACT LINK32 /pdb:none /incremental:no
-
-!ENDIF
-
-# Begin Target
-
-# Name "php_soap - Win32 Release_TS"
-# Name "php_soap - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_encoding.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_http.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_packet_soap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_schema.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_sdl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_xml.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\soap.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_encoding.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_http.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_packet_soap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_schema.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_sdl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_soap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_xml.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index efa0ac0baf..6d36792981 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -29,7 +29,7 @@ #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) #include "ext/session/php_session.h" #endif -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "php_ini.h" #include "SAPI.h" #include <libxml/parser.h> diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c index f7c8fd51e5..5ad5548c40 100644 --- a/ext/soap/php_xml.c +++ b/ext/soap/php_xml.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h index 1eddcf9503..42d9dc9c6b 100644 --- a/ext/soap/php_xml.h +++ b/ext/soap/php_xml.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 554957d512..51c62f5cd6 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -78,7 +78,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const int _old_soap_version = SOAP_GLOBAL(soap_version);\ SOAP_GLOBAL(use_soap_error_handler) = 1;\ SOAP_GLOBAL(error_code) = "Server";\ - Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EG(This)); + Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This)); #define SOAP_SERVER_END_CODE() \ SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\ @@ -97,7 +97,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const int _bailout = 0;\ SOAP_GLOBAL(use_soap_error_handler) = 1;\ SOAP_GLOBAL(error_code) = "Client";\ - Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EG(This));\ + Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This));\ zend_try { #define SOAP_CLIENT_END_CODE() \ @@ -946,7 +946,7 @@ PHP_METHOD(SoapFault, __toString) fci.function_table = &Z_OBJCE_P(getThis())->function_table; ZVAL_STRINGL(&fci.function_name, "gettraceasstring", sizeof("gettraceasstring")-1); fci.symbol_table = NULL; - fci.object = Z_OBJ(EG(This)); + fci.object = Z_OBJ(EX(This)); fci.retval = &trace; fci.param_count = 0; fci.params = NULL; @@ -1429,7 +1429,7 @@ PHP_METHOD(SoapServer, addFunction) return; } - ZVAL_STR(&function_copy, zend_string_copy(f->common.function_name)); + ZVAL_STR_COPY(&function_copy, f->common.function_name); zend_hash_update(service->soap_functions.ft, key, &function_copy); zend_string_release(key); @@ -1452,7 +1452,7 @@ PHP_METHOD(SoapServer, addFunction) zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0); } - ZVAL_STR(&function_copy, zend_string_copy(f->common.function_name)); + ZVAL_STR_COPY(&function_copy, f->common.function_name); zend_hash_update(service->soap_functions.ft, key, &function_copy); zend_string_release(key); } else if (Z_TYPE_P(function_name) == IS_LONG) { @@ -1713,7 +1713,7 @@ PHP_METHOD(SoapServer, handle) if (zend_hash_str_exists(&Z_OBJCE(tmp_soap)->function_table, php_strtolower(class_name, class_name_len), class_name_len)) { zval c_ret, constructor; - ZVAL_STR(&constructor, zend_string_copy(service->soap_class.ce->name)); + ZVAL_STR_COPY(&constructor, service->soap_class.ce->name); if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor"); } @@ -2621,7 +2621,8 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act return ret; } -static void do_soap_call(zval* this_ptr, +static void do_soap_call(zend_execute_data *execute_data, + zval* this_ptr, char* function, size_t function_len, int arg_count, @@ -2936,7 +2937,7 @@ PHP_METHOD(SoapClient, __call) if (output_headers) { array_init(output_headers); } - do_soap_call(this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC); + do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC); if (arg_count > 0) { efree(real_args); } diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index febfa9abd8..d808271728 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -6,7 +6,7 @@ #endif #include <Zend/zend_llist.h> -#include <ext/standard/php_smart_str.h> +#include <zend_smart_str.h> #ifndef PHP_WIN32 # include <sys/types.h> @@ -175,7 +175,7 @@ static void do_from_to_zval_err(struct err_s *err, err->should_free = 1; efree(user_msg); - smart_str_free_ex(&path, 0); + smart_str_free(&path); } ZEND_ATTRIBUTE_FORMAT(printf, 2 ,3) static void do_from_zval_err(ser_context *ctx, const char *fmt, ...) @@ -562,7 +562,7 @@ static void to_zval_read_sin_addr(const char *data, zval *zv, res_context *ctx) zend_string *str = zend_string_alloc(size - 1, 0); memset(str->val, '\0', size); - ZVAL_STR(zv, str); + ZVAL_NEW_STR(zv, str); if (inet_ntop(AF_INET, addr, Z_STRVAL_P(zv), size) == NULL) { do_to_zval_err(ctx, "could not convert IPv4 address to string " @@ -614,7 +614,7 @@ static void to_zval_read_sin6_addr(const char *data, zval *zv, res_context *ctx) memset(str->val, '\0', size); - ZVAL_STR(zv, str); + ZVAL_NEW_STR(zv, str); if (inet_ntop(AF_INET6, addr, Z_STRVAL_P(zv), size) == NULL) { do_to_zval_err(ctx, "could not convert IPv6 address to string " @@ -1212,7 +1212,7 @@ static void to_zval_read_iov(const char *msghdr_c, zval *zv, res_context *ctx) memcpy(buf->val, msghdr->msg_iov[i].iov_base, buf->len); buf->val[buf->len] = '\0'; - ZVAL_STR(&elem, buf); + ZVAL_NEW_STR(&elem, buf); add_next_index_zval(zv, &elem); bytes_left -= len; } diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index d0bddf674a..3c076b4e7c 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index 29eb54efd8..de76dfcec7 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h index 86729650e4..b1ee5798c9 100644 --- a/ext/sockets/php_sockets.h +++ b/ext/sockets/php_sockets.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index 91867d99e3..dcaa60ac7a 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 0da81e74f5..0dab51bed6 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1586,7 +1586,7 @@ PHP_FUNCTION(socket_recv) /* Rebuild buffer zval */ zval_dtor(buf); - ZVAL_STR(buf, recv_buf); + ZVAL_NEW_STR(buf, recv_buf); } if (retval == -1) { @@ -1673,7 +1673,7 @@ PHP_FUNCTION(socket_recvfrom) zval_dtor(arg2); zval_dtor(arg5); - ZVAL_STR(arg2, recv_buf); + ZVAL_NEW_STR(arg2, recv_buf); ZVAL_STRING(arg5, s_un.sun_path); break; @@ -1703,7 +1703,7 @@ PHP_FUNCTION(socket_recvfrom) address = inet_ntoa(sin.sin_addr); - ZVAL_STR(arg2, recv_buf); + ZVAL_NEW_STR(arg2, recv_buf); ZVAL_STRING(arg5, address ? address : "0.0.0.0"); ZVAL_LONG(arg6, ntohs(sin.sin_port)); break; @@ -1735,7 +1735,7 @@ PHP_FUNCTION(socket_recvfrom) memset(addr6, 0, INET6_ADDRSTRLEN); inet_ntop(AF_INET6, &sin6.sin6_addr, addr6, INET6_ADDRSTRLEN); - ZVAL_STR(arg2, recv_buf); + ZVAL_NEW_STR(arg2, recv_buf); ZVAL_STRING(arg5, addr6[0] ? addr6 : "::"); ZVAL_LONG(arg6, ntohs(sin6.sin6_port)); break; diff --git a/ext/sockets/sockets.dsp b/ext/sockets/sockets.dsp deleted file mode 100644 index 961bab784d..0000000000 --- a/ext/sockets/sockets.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sockets" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=sockets - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "sockets.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "sockets.mak" CFG="sockets - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "sockets - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "sockets - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "sockets - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOCKETS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_SOCKETS" /D ZTS=1 /D HAVE_SOCKETS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_sockets.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT LINK32 /debug
-
-!ELSEIF "$(CFG)" == "sockets - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOCKETS_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_SOCKETS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SOCKETS=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_sockets.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "sockets - Win32 Release_TS"
-# Name "sockets - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_sockets_win.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\sockets.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_sockets.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_sockets_win.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/sockets/unix_socket_constants.h b/ext/sockets/unix_socket_constants.h index 485b2534d2..7d183b83ae 100644 --- a/ext/sockets/unix_socket_constants.h +++ b/ext/sockets/unix_socket_constants.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sockets/win32_socket_constants.h b/ext/sockets/win32_socket_constants.h index 848e14fb51..2d707e9074 100644 --- a/ext/sockets/win32_socket_constants.h +++ b/ext/sockets/win32_socket_constants.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sockets/windows_common.h b/ext/sockets/windows_common.h index 9cc01ae129..5536d88a4a 100644 --- a/ext/sockets/windows_common.h +++ b/ext/sockets/windows_common.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index ad3bb85313..44078733d6 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -346,7 +346,7 @@ PHP_FUNCTION(spl_autoload) * The "scope" is determined by an opcode, if it is ZEND_FETCH_CLASS we know function was called indirectly by * the Zend engine. */ - zend_execute_data *ex = EG(current_execute_data); + zend_execute_data *ex = EX(prev_execute_data); while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { ex = ex->prev_execute_data; diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index c2b1837e8d..534a03885e 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -60,10 +60,10 @@ PHP_MINFO_FUNCTION(spl); ZEND_BEGIN_MODULE_GLOBALS(spl) zend_string *autoload_extensions; HashTable *autoload_functions; - int autoload_running; intptr_t hash_mask_handle; intptr_t hash_mask_handlers; int hash_mask_init; + int autoload_running; ZEND_END_MODULE_GLOBALS(spl) #ifdef ZTS diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 84c3714da2..211180a08d 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -26,7 +26,7 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "zend_interfaces.h" #include "zend_exceptions.h" diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h index 23ca80bc8f..c27e55bbec 100644 --- a/ext/spl/spl_array.h +++ b/ext/spl/spl_array.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 0694e8f335..73588ff1bd 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -821,12 +821,12 @@ SPL_METHOD(DirectoryIterator, seek) if (intern->u.dir.index > pos) { /* we first rewind */ - zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_rewind, "rewind", NULL); + zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_rewind, "rewind", NULL); } while (intern->u.dir.index < pos) { int valid = 0; - zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_valid, "valid", &retval); + zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_valid, "valid", &retval); if (!Z_ISUNDEF(retval)) { valid = zend_is_true(&retval TSRMLS_CC); zval_ptr_dtor(&retval); @@ -834,7 +834,7 @@ SPL_METHOD(DirectoryIterator, seek) if (!valid) { break; } - zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_next, "next", NULL); + zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_next, "next", NULL); } } /* }}} */ @@ -2170,7 +2170,8 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV)) { return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL TSRMLS_CC); } else { - zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(getThis()), &intern->u.file.func_getCurr, "getCurrentLine", &retval); + zend_execute_data *execute_data = EG(current_execute_data); + zend_call_method_with_0_params(this_ptr, Z_OBJCE(EX(This)), &intern->u.file.func_getCurr, "getCurrentLine", &retval); } if (!Z_ISUNDEF(retval)) { if (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) { @@ -2883,7 +2884,12 @@ SPL_METHOD(SplFileObject, fwrite) } if (ZEND_NUM_ARGS() > 1) { - str_len = MAX(0, MIN(length, str_len)); + if (length >= 0) { + str_len = MAX(0, MIN((size_t)length, str_len)); + } else { + /* Negative length given, nothing to write */ + str_len = 0; + } } if (!str_len) { RETURN_LONG(0); @@ -2911,7 +2917,7 @@ SPL_METHOD(SplFileObject, fread) RETURN_FALSE; } - ZVAL_STR(return_value, zend_string_alloc(length, 0)); + ZVAL_NEW_STR(return_value, zend_string_alloc(length, 0)); Z_STRLEN_P(return_value) = php_stream_read(intern->u.file.stream, Z_STRVAL_P(return_value), length); /* needed because recv/read/gzread doesnt put a null at the end*/ diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h index 4993f67b1f..f1db1f69b9 100644 --- a/ext/spl/spl_directory.h +++ b/ext/spl/spl_directory.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index e02b9b2e83..0a6f97c563 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -29,7 +29,7 @@ #include "php_spl.h" #include "ext/standard/info.h" #include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "spl_functions.h" #include "spl_engine.h" #include "spl_iterators.h" @@ -101,8 +101,8 @@ struct _spl_dllist_object { /* define an overloaded iterator structure */ struct _spl_dllist_it { zend_user_iterator intern; - int traverse_position; spl_ptr_llist_element *traverse_pointer; + int traverse_position; int flags; }; diff --git a/ext/spl/spl_dllist.h b/ext/spl/spl_dllist.h index c6f82ce57a..b8bd98ef6d 100644 --- a/ext/spl/spl_dllist.h +++ b/ext/spl/spl_dllist.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c index 99a18c69f0..1e51484394 100644 --- a/ext/spl/spl_engine.c +++ b/ext/spl/spl_engine.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index fc82b4fe53..a621355ba4 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c index 221b25df47..3c6b724b5c 100644 --- a/ext/spl/spl_exceptions.c +++ b/ext/spl/spl_exceptions.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_exceptions.h b/ext/spl/spl_exceptions.h index 5e4e0f702c..e061c86118 100644 --- a/ext/spl/spl_exceptions.h +++ b/ext/spl/spl_exceptions.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index a025a376ab..ee5ef6b990 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_fixedarray.h b/ext/spl/spl_fixedarray.h index 9011e8c1d5..a61f7ef486 100644 --- a/ext/spl/spl_fixedarray.h +++ b/ext/spl/spl_fixedarray.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c index 13440355ce..f409927271 100644 --- a/ext/spl/spl_functions.c +++ b/ext/spl/spl_functions.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -84,8 +84,7 @@ void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_fla if ((tmp = zend_hash_find(Z_ARRVAL_P(list), pce->name)) == NULL) { zval t; - zend_string_addref(pce->name); - ZVAL_STR(&t, pce->name); + ZVAL_STR_COPY(&t, pce->name); zend_hash_add(Z_ARRVAL_P(list), pce->name, &t); } } diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h index 88ae478a02..3381975e6c 100644 --- a/ext/spl/spl_functions.h +++ b/ext/spl/spl_functions.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 97d95d2acf..d29150c1d6 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_heap.h b/ext/spl/spl_heap.h index a3ac4a8f5c..7d0a8a319d 100644 --- a/ext/spl/spl_heap.h +++ b/ext/spl/spl_heap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index dcc2a8a573..dddc8c5e73 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -35,7 +35,7 @@ #include "spl_directory.h" #include "spl_array.h" #include "spl_exceptions.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #ifdef accept #undef accept @@ -2264,7 +2264,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren) zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); if (!EG(exception)) { - ZVAL_STR(®ex, zend_string_copy(intern->u.regex.regex)); + ZVAL_STR_COPY(®ex, intern->u.regex.regex); spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, ®ex TSRMLS_CC); zval_ptr_dtor(®ex); } diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h index 7435ce7f27..f0740275dc 100644 --- a/ext/spl/spl_iterators.h +++ b/ext/spl/spl_iterators.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -154,12 +154,12 @@ typedef struct _spl_dual_it_object { } append; #if HAVE_PCRE || HAVE_BUNDLED_PCRE struct { - int use_flags; - zend_long flags; - regex_mode mode; - zend_long preg_flags; + zend_long flags; + zend_long preg_flags; pcre_cache_entry *pce; zend_string *regex; + regex_mode mode; + int use_flags; } regex; #endif _spl_cbfilter_it_intern *cbfilter; diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index bcb316a744..d3ce72aaa3 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -28,7 +28,7 @@ #include "ext/standard/info.h" #include "ext/standard/php_array.h" #include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "zend_interfaces.h" #include "zend_exceptions.h" diff --git a/ext/spl/spl_observer.h b/ext/spl/spl_observer.h index 51573d732f..640f79cde3 100644 --- a/ext/spl/spl_observer.h +++ b/ext/spl/spl_observer.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sqlite3/php_sqlite3.h b/ext/sqlite3/php_sqlite3.h index 2c19b9d9c4..5c7dfcfa5a 100644 --- a/ext/sqlite3/php_sqlite3.h +++ b/ext/sqlite3/php_sqlite3.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h index 5a291a9a50..3036809856 100644 --- a/ext/sqlite3/php_sqlite3_structs.h +++ b/ext/sqlite3/php_sqlite3_structs.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 4981fad416..af3dec0681 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/array.c b/ext/standard/array.c index 09aaddfbf5..c8e79957b5 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -45,7 +45,7 @@ #include "basic_functions.h" #include "php_string.h" #include "php_rand.h" -#include "php_smart_str.h" +#include "zend_smart_str.h" #ifdef HAVE_SPL #include "ext/spl/spl_array.h" #endif @@ -706,12 +706,12 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* if (f->key == NULL) { ZVAL_LONG(&args[0], f->h); } else { - ZVAL_STR(&args[0], zend_string_copy(f->key)); + ZVAL_STR_COPY(&args[0], f->key); } if (s->key == NULL) { ZVAL_LONG(&args[1], s->h); } else { - ZVAL_STR(&args[1], zend_string_copy(s->key)); + ZVAL_STR_COPY(&args[1], s->key); } BG(user_compare_fci).param_count = 2; @@ -1427,7 +1427,7 @@ PHP_FUNCTION(extract) if (var_exists && var_name->len == sizeof("this")-1 && !strcmp(var_name->val, "this") && EG(scope) && EG(scope)->name->len != 0) { break; } - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); break; case EXTR_PREFIX_IF_EXISTS: @@ -1438,7 +1438,7 @@ PHP_FUNCTION(extract) case EXTR_PREFIX_SAME: if (!var_exists && var_name->len != 0) { - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); } /* break omitted intentionally */ @@ -1453,14 +1453,14 @@ PHP_FUNCTION(extract) if (!php_valid_var_name(var_name->val, var_name->len)) { php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC); } else { - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); } } break; default: if (!var_exists) { - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); } break; } @@ -1528,7 +1528,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu PHP_FUNCTION(compact) { zval *args = NULL; /* function arguments array */ - int num_args, i; + uint32_t num_args, i; zend_array *symbol_table; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) { @@ -1826,7 +1826,7 @@ static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */ for (j = 0; j < n_elems; j++) { p = hash->arData + j; - if (p->key && !IS_INTERNED(p->key)) { + if (p->key) { zend_string_release(p->key); } p->h = j; @@ -2085,7 +2085,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) zend_hash_rehash(Z_ARRVAL_P(stack)); } } - } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) { + } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= (zend_ulong)(Z_ARRVAL_P(stack)->nNextFreeElement - 1)) { Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1; } @@ -2605,7 +2605,7 @@ PHP_FUNCTION(array_keys) if (add_key) { if (str_idx) { - ZVAL_STR(&new_val, zend_string_copy(str_idx)); + ZVAL_STR_COPY(&new_val, str_idx); } else { ZVAL_LONG(&new_val, num_idx); } @@ -2889,14 +2889,14 @@ PHP_FUNCTION(array_flip) ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) { if (Z_TYPE_P(entry) == IS_LONG) { if (str_idx) { - ZVAL_STR(&data, zend_string_copy(str_idx)); + ZVAL_STR_COPY(&data, str_idx); } else { ZVAL_LONG(&data, num_idx); } zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_P(entry), &data); } else if (Z_TYPE_P(entry) == IS_STRING) { if (str_idx) { - ZVAL_STR(&data, zend_string_copy(str_idx)); + ZVAL_STR_COPY(&data, str_idx); } else { ZVAL_LONG(&data, num_idx); } @@ -3174,7 +3174,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int int arr_argc, i, c = 0; uint idx; Bucket **lists, *list, **ptrs, *p; - int req_args; + uint32_t req_args; char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; @@ -3598,7 +3598,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ int arr_argc, i, c; uint idx; Bucket **lists, *list, **ptrs, *p; - int req_args; + uint32_t req_args; char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; @@ -4366,9 +4366,9 @@ PHP_FUNCTION(array_filter) } } else { if (use_type == ARRAY_FILTER_USE_BOTH) { - ZVAL_STR(&args[1], zend_string_copy(string_key)); + ZVAL_STR_COPY(&args[1], string_key); } else if (use_type == ARRAY_FILTER_USE_KEY) { - ZVAL_STR(&args[0], zend_string_copy(string_key)); + ZVAL_STR_COPY(&args[0], string_key); } } } @@ -4423,7 +4423,8 @@ PHP_FUNCTION(array_map) zval result; zend_fcall_info fci = empty_fcall_info; zend_fcall_info_cache fci_cache = empty_fcall_info_cache; - int i, k, maxlen = 0; + int i; + uint32_t k, maxlen = 0; #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) { diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 94fee5a1ce..65472170e2 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -59,7 +59,7 @@ static PHP_INI_MH(OnChangeCallback) /* {{{ */ ZVAL_UNDEF(&ASSERTG(callback)); } if (new_value && (Z_TYPE(ASSERTG(callback)) != IS_UNDEF || new_value->len)) { - ZVAL_STR(&ASSERTG(callback), zend_string_copy(new_value)); + ZVAL_STR_COPY(&ASSERTG(callback), new_value); } } else { if (ASSERTG(cb)) { diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 0a4093f185..fd1c910234 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -59,10 +59,6 @@ PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) / unsigned char *p; zend_string *result; - if (length < 0) { - return NULL; - } - result = zend_string_alloc(((length + 2) / 3) * 4 * sizeof(char), 0); p = (unsigned char *)result->val; diff --git a/ext/standard/base64.h b/ext/standard/base64.h index 43324e4911..a31a799c3a 100644 --- a/ext/standard/base64.h +++ b/ext/standard/base64.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index b45db8a9b4..5bcd3d3386 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -4178,8 +4178,9 @@ static int parse_opts(char * opts, opt_struct ** result) { opt_struct * paras = NULL; unsigned int i, count = 0; + unsigned int opts_len = (unsigned int)strlen(opts); - for (i = 0; i < strlen(opts); i++) { + for (i = 0; i < opts_len; i++) { if ((opts[i] >= 48 && opts[i] <= 57) || (opts[i] >= 65 && opts[i] <= 90) || (opts[i] >= 97 && opts[i] <= 122) @@ -4785,15 +4786,15 @@ PHP_FUNCTION(forward_static_call) return; } - if (!EG(current_execute_data)->prev_execute_data->func->common.scope) { + if (!EX(prev_execute_data)->func->common.scope) { zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active"); } fci.retval = &retval; - if (EG(current_execute_data)->called_scope && - instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) { - fci_cache.called_scope = EG(current_execute_data)->called_scope; + if (EX(called_scope) && + instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) { + fci_cache.called_scope = EX(called_scope); } if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { @@ -4817,9 +4818,9 @@ PHP_FUNCTION(forward_static_call_array) zend_fcall_info_args(&fci, params TSRMLS_CC); fci.retval = &retval; - if (EG(current_execute_data)->called_scope && - instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) { - fci_cache.called_scope = EG(current_execute_data)->called_scope; + if (EX(called_scope) && + instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) { + fci_cache.called_scope = EX(called_scope); } if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { @@ -4861,9 +4862,11 @@ static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */ zend_string *function_name; if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) { - php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name->val); if (function_name) { + php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name->val); zend_string_release(function_name); + } else { + php_error(E_WARNING, "(Registered shutdown functions) Unable to call - function does not exist"); } return 0; } @@ -5009,7 +5012,11 @@ PHP_FUNCTION(register_shutdown_function) /* Prevent entering of anything but valid callback (syntax check only!) */ if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val); + if (callback_name) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback passed"); + } efree(shutdown_function_entry.arguments); RETVAL_FALSE; } else { @@ -5119,7 +5126,7 @@ PHP_FUNCTION(php_strip_whitespace) char *filename; size_t filename_len; zend_lex_state original_lex_state; - zend_file_handle file_handle = {0}; + zend_file_handle file_handle = {{0}}; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { RETURN_FALSE; @@ -5254,7 +5261,7 @@ static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, ze if (ini_entry->value) { zval zv; - ZVAL_STR(&zv, zend_string_copy(ini_entry->value)); + ZVAL_STR_COPY(&zv, ini_entry->value); zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &zv); } else { zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &EG(uninitialized_zval)); diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 64a6c5363c..eaac7a1609 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -204,11 +204,11 @@ typedef struct _php_basic_globals { zend_class_entry *incomplete_class; unsigned serialize_lock; /* whether to use the locally supplied var_hash instead (__sleep/__wakeup) */ struct { - void *var_hash; + struct php_serialize_data *data; unsigned level; } serialize; struct { - void *var_hash; + struct php_unserialize_data *data; unsigned level; } unserialize; diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index c65d0c55c8..a76fb136a3 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -221,7 +221,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb static int browscap_read_file(char *filename, browser_data *browdata, int persistent TSRMLS_DC) /* {{{ */ { - zend_file_handle fh = {0}; + zend_file_handle fh = {{0}}; if (filename == NULL || filename[0] == '\0') { return FAILURE; @@ -379,15 +379,13 @@ static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list ar number of characters changed in the user agent being checked versus the previous match found and the current match. */ if (Z_TYPE_P(found_browser_entry) == IS_ARRAY) { - int i, prev_len = 0, curr_len = 0, ua_len; - zval *current_match; + size_t i, prev_len = 0, curr_len = 0; + zval *current_match = zend_hash_str_find(Z_ARRVAL_P(browser), "browser_name_pattern", sizeof("browser_name_pattern")-1); - if ((current_match = zend_hash_str_find(Z_ARRVAL_P(browser), "browser_name_pattern", sizeof("browser_name_pattern")-1)) == NULL) { + if (!current_match) { return 0; } - ua_len = lookup_browser_length; - for (i = 0; i < Z_STRLEN_P(previous_match); i++) { switch (Z_STRVAL_P(previous_match)[i]) { case '?': @@ -414,7 +412,7 @@ static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list ar /* Pick which browser pattern replaces the least amount of characters when compared to the original user agent string... */ - if (ua_len - prev_len > ua_len - curr_len) { + if (prev_len < curr_len) { ZVAL_COPY_VALUE(found_browser_entry, browser); } } diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index b3a0593f41..a515b492b8 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/crc32.h b/ext/standard/crc32.h index be9a99e6e2..222967dd25 100644 --- a/ext/standard/crc32.h +++ b/ext/standard/crc32.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 6df81ca029..1aeff9e679 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/credits.h b/ext/standard/credits.h index a1f57360a5..0a501526f8 100644 --- a/ext/standard/credits.h +++ b/ext/standard/credits.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h index f77bbdf157..fa1b1325e0 100644 --- a/ext/standard/credits_ext.h +++ b/ext/standard/credits_ext.h @@ -1,9 +1,9 @@ /* DO NOT EDIT THIS FILE! - it has been automaticaly created by php5/scripts/credits from - the information found in the various php5/ext/.../CREDITS and - php5/sapi/.../CREDITS files + it has been automaticaly created by php7/scripts/credits from + the information found in the various php7/ext/.../CREDITS and + php7/sapi/.../CREDITS files if you want to change an entry you have to edit the appropriate CREDITS file instead diff --git a/ext/standard/credits_sapi.h b/ext/standard/credits_sapi.h index 634a370329..8f0b8264ce 100644 --- a/ext/standard/credits_sapi.h +++ b/ext/standard/credits_sapi.h @@ -1,9 +1,9 @@ /* DO NOT EDIT THIS FILE! - it has been automaticaly created by php5/scripts/credits from - the information found in the various php5/ext/.../CREDITS and - php5/sapi/.../CREDITS files + it has been automaticaly created by php7/scripts/credits from + the information found in the various php7/ext/.../CREDITS and + php7/sapi/.../CREDITS files if you want to change an entry you have to edit the appropriate CREDITS file instead diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 1a9acf5bd6..9599e2f056 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -207,11 +207,11 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch crypt_res = php_crypt_blowfish_rn(password, salt, output, sizeof(output)); if (!crypt_res) { - memset(output, 0, PHP_MAX_SALT_LEN + 1); + ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1); return NULL; } else { result = zend_string_init(output, strlen(output), 0); - memset(output, 0, PHP_MAX_SALT_LEN + 1); + ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1); return result; } } else { diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c index e53f488805..5f28bd7b9f 100644 --- a/ext/standard/crypt_sha256.c +++ b/ext/standard/crypt_sha256.c @@ -520,7 +520,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b if (rounds_custom) { #ifdef PHP_WIN32 - int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha256_rounds_prefix, rounds); + int n = _snprintf(cp, MAX(0, buflen), "%s" ZEND_ULONG_FMT "$", sha256_rounds_prefix, rounds); #else int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha256_rounds_prefix, rounds); #endif @@ -571,18 +571,17 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b inside the SHA256 implementation as well. */ sha256_init_ctx(&ctx); sha256_finish_ctx(&ctx, alt_result); - memset(temp_result, '\0', sizeof(temp_result)); - memset(p_bytes, '\0', key_len); - memset(s_bytes, '\0', salt_len); - memset(&ctx, '\0', sizeof(ctx)); - memset(&alt_ctx, '\0', sizeof(alt_ctx)); + ZEND_SECURE_ZERO(temp_result, sizeof(temp_result)); + ZEND_SECURE_ZERO(p_bytes, key_len); + ZEND_SECURE_ZERO(s_bytes, salt_len); + ZEND_SECURE_ZERO(&ctx, sizeof(ctx)); + ZEND_SECURE_ZERO(&alt_ctx, sizeof(alt_ctx)); if (copied_key != NULL) { - memset(copied_key, '\0', key_len); - + ZEND_SECURE_ZERO(copied_key, key_len); } if (copied_salt != NULL) { - memset(copied_salt, '\0', salt_len); + ZEND_SECURE_ZERO(copied_salt, salt_len); } return buffer; diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c index a673bfac1c..df5f3d109e 100644 --- a/ext/standard/crypt_sha512.c +++ b/ext/standard/crypt_sha512.c @@ -555,7 +555,7 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) if (rounds_custom) { #ifdef PHP_WIN32 - int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha512_rounds_prefix, rounds); + int n = _snprintf(cp, MAX(0, buflen), "%s" ZEND_ULONG_FMT "$", sha512_rounds_prefix, rounds); #else int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha512_rounds_prefix, rounds); #endif @@ -619,16 +619,16 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) inside the SHA512 implementation as well. */ sha512_init_ctx(&ctx); sha512_finish_ctx(&ctx, alt_result); - memset(temp_result, '\0', sizeof(temp_result)); - memset(p_bytes, '\0', key_len); - memset(s_bytes, '\0', salt_len); - memset(&ctx, '\0', sizeof(ctx)); - memset(&alt_ctx, '\0', sizeof(alt_ctx)); + ZEND_SECURE_ZERO(temp_result, sizeof(temp_result)); + ZEND_SECURE_ZERO(p_bytes, key_len); + ZEND_SECURE_ZERO(s_bytes, salt_len); + ZEND_SECURE_ZERO(&ctx, sizeof(ctx)); + ZEND_SECURE_ZERO(&alt_ctx, sizeof(alt_ctx)); if (copied_key != NULL) { - memset(copied_key, '\0', key_len); + ZEND_SECURE_ZERO(copied_key, key_len); } if (copied_salt != NULL) { - memset(copied_salt, '\0', salt_len); + ZEND_SECURE_ZERO(copied_salt, salt_len); } return buffer; diff --git a/ext/standard/css.c b/ext/standard/css.c index 9ce6138015..f4469bea30 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/css.h b/ext/standard/css.h index b3c79f2429..408abc1787 100644 --- a/ext/standard/css.h +++ b/ext/standard/css.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index e36b8c8d69..1718b75729 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -201,11 +201,11 @@ _cyr_mac = { * d - x-cp866 * m - x-mac-cyrillic *****************************************************************************/ -static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to TSRMLS_DC) +static char * php_convert_cyr_string(unsigned char *str, size_t length, char from, char to TSRMLS_DC) { const unsigned char *from_table, *to_table; unsigned char tmp; - int i; + size_t i; from_table = NULL; to_table = NULL; @@ -258,8 +258,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from, if (!str) return (char *)str; - for( i = 0; i<length; i++) - { + for (i = 0; i < length; i++) { tmp = (from_table == NULL)? str[i] : from_table[ str[i] ]; str[i] = (to_table == NULL) ? tmp : to_table[tmp + 256]; } @@ -281,7 +280,7 @@ PHP_FUNCTION(convert_cyr_string) str = zend_string_init(input, input_len, 0); - php_convert_cyr_string(str->val, str->len, fr_cs[0], to_cs[0] TSRMLS_CC); + php_convert_cyr_string((unsigned char *) str->val, str->len, fr_cs[0], to_cs[0] TSRMLS_CC); RETVAL_NEW_STR(str); } /* }}} */ diff --git a/ext/standard/cyr_convert.h b/ext/standard/cyr_convert.h index 6b16be2960..41cce1aaa3 100644 --- a/ext/standard/cyr_convert.h +++ b/ext/standard/cyr_convert.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 7b6a912244..39f8669038 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h index bb6673497c..0edaff1b00 100644 --- a/ext/standard/datetime.h +++ b/ext/standard/datetime.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 40632a0cf5..7b4ab1cd3e 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 7a2a1648d4..6ea69e5b81 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/dl.h b/ext/standard/dl.h index eee70472b5..50ed19afc0 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/dns.c b/ext/standard/dns.c index b43bd9160a..13a1ab75df 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -535,7 +535,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t } if (n) { memcpy(tp->val + l2 , cp + l1 + 1, n); - add_next_index_stringl(&entries, cp + l1 + 1, n); + add_next_index_stringl(&entries, (char *) cp + l1 + 1, n); } l1 = l1 + n + 1; l2 = l2 + n; diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index aab31891da..865ad30b3e 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2008-2009 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 94c5a26937..28f01b338f 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/exec.h b/ext/standard/exec.h index 8ffe471408..79b0574e28 100644 --- a/ext/standard/exec.h +++ b/ext/standard/exec.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/file.c b/ext/standard/file.c index 20a956df9d..446da20fb3 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -35,7 +35,7 @@ #include "php_open_temporary_file.h" #include "ext/standard/basic_functions.h" #include "php_ini.h" -#include "php_smart_str.h" +#include "zend_smart_str.h" #include <stdio.h> #include <stdlib.h> @@ -1210,7 +1210,7 @@ PHPAPI PHP_FUNCTION(fwrite) num_bytes = arg2len; } else { if (arg3 > 0) { - num_bytes = MAX(0, MIN((size_t)arg3, arg2len)); + num_bytes = MIN((size_t)arg3, arg2len); } else { num_bytes = 0; } @@ -1943,7 +1943,7 @@ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char } smart_str_appendc(&csvline, enclosure); } else { - smart_str_appendl(&csvline, field_str->val, field_str->len); + smart_str_append(&csvline, field_str); } if (++i != count) { diff --git a/ext/standard/file.h b/ext/standard/file.h index 4551d5ec44..fdace75d3b 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 992f99d24e..6a06a55d94 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1235,18 +1235,18 @@ PHP_FUNCTION(realpath_cache_get) /* bucket->key is unsigned long */ if (ZEND_LONG_MAX >= bucket->key) { - add_assoc_long(&entry, "key", bucket->key); + add_assoc_long_ex(&entry, "key", sizeof("key") - 1, bucket->key); } else { - add_assoc_double(&entry, "key", (double)bucket->key); + add_assoc_double_ex(&entry, "key", sizeof("key") - 1, (double)bucket->key); } - add_assoc_bool(&entry, "is_dir", bucket->is_dir); - add_assoc_stringl(&entry, "realpath", bucket->realpath, bucket->realpath_len); - add_assoc_long(&entry, "expires", bucket->expires); + add_assoc_bool_ex(&entry, "is_dir", sizeof("is_dir") - 1, bucket->is_dir); + add_assoc_stringl_ex(&entry, "realpath", sizeof("realpath") - 1, bucket->realpath, bucket->realpath_len); + add_assoc_long_ex(&entry, "expires", sizeof("expires") - 1, bucket->expires); #ifdef PHP_WIN32 - add_assoc_bool(&entry, "is_rvalid", bucket->is_rvalid); - add_assoc_bool(&entry, "is_wvalid", bucket->is_wvalid); - add_assoc_bool(&entry, "is_readable", bucket->is_readable); - add_assoc_bool(&entry, "is_writable", bucket->is_writable); + add_assoc_bool_ex(&entry, "is_rvalid", sizeof("is_rvalid") - 1, bucket->is_rvalid); + add_assoc_bool_ex(&entry, "is_wvalid", sizeof("is_wvalid") - 1, bucket->is_wvalid); + add_assoc_bool_ex(&entry, "is_readable", sizeof("is_readable") - 1, bucket->is_readable); + add_assoc_bool_ex(&entry, "is_writable", sizeof("is_writable") - 1, bucket->is_writable); #endif zend_hash_str_update(Z_ARRVAL_P(return_value), bucket->path, bucket->path_len, &entry); bucket = bucket->next; diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 9ab9f652fe..f0f49950bb 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -27,7 +27,7 @@ #include "ext/standard/basic_functions.h" #include "ext/standard/file.h" #include "ext/standard/php_string.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" /* {{{ rot13 stream filter implementation */ static char rot13_from[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; @@ -263,7 +263,7 @@ static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zv ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(filterparams), tmp) { convert_to_string_ex(tmp); smart_str_appendc(&tags_ss, '<'); - smart_str_appendl(&tags_ss, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); + smart_str_append(&tags_ss, Z_STR_P(tmp)); smart_str_appendc(&tags_ss, '>'); } ZEND_HASH_FOREACH_END(); smart_str_0(&tags_ss); @@ -322,14 +322,14 @@ struct _php_conv { typedef struct _php_conv_base64_encode { php_conv _super; - unsigned char erem[3]; + const char *lbchars; + size_t lbchars_len; size_t erem_len; unsigned int line_ccnt; unsigned int line_len; - const char *lbchars; int lbchars_dup; - size_t lbchars_len; int persistent; + unsigned char erem[3]; } php_conv_base64_encode; static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *inst, const char **in_p, size_t *in_left, char **out_p, size_t *out_left); @@ -735,12 +735,12 @@ static php_conv_err_t php_conv_base64_decode_convert(php_conv_base64_decode *ins typedef struct _php_conv_qprint_encode { php_conv _super; + const char *lbchars; + size_t lbchars_len; int opts; unsigned int line_ccnt; unsigned int line_len; - const char *lbchars; int lbchars_dup; - size_t lbchars_len; int persistent; unsigned int lb_ptr; unsigned int lb_cnt; @@ -987,11 +987,11 @@ static php_conv_err_t php_conv_qprint_encode_ctor(php_conv_qprint_encode *inst, typedef struct _php_conv_qprint_decode { php_conv _super; + const char *lbchars; + size_t lbchars_len; int scan_stat; unsigned int next_char; - const char *lbchars; int lbchars_dup; - size_t lbchars_len; int persistent; unsigned int lb_ptr; unsigned int lb_cnt; @@ -1699,7 +1699,7 @@ static int strfilter_convert_append_bucket( } } - if (out_buf_size - ocnt > 0) { + if (out_buf_size > ocnt) { if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) { goto out_failure; } @@ -1831,9 +1831,9 @@ static php_stream_filter_factory strfilter_convert_factory = { /* {{{ consumed filter implementation */ typedef struct _php_consumed_filter_data { - int persistent; size_t consumed; - off_t offset; + zend_off_t offset; + int persistent; } php_consumed_filter_data; static php_stream_filter_status_t consumed_filter_filter( @@ -1926,8 +1926,8 @@ typedef enum _php_chunked_filter_state { } php_chunked_filter_state; typedef struct _php_chunked_filter_data { - php_chunked_filter_state state; size_t chunk_size; + php_chunked_filter_state state; int persistent; } php_chunked_filter_data; diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c index 05e0175311..d5d73f4c36 100644 --- a/ext/standard/flock_compat.c +++ b/ext/standard/flock_compat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index ab9c445561..14405022b6 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 587474346a..8f211d0236 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -378,7 +378,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) int always_sign; int format_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(param_count TSRMLS_CC, "+", &args, &argc) == FAILURE) { return NULL; } diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 4fcdff276a..090d3f8f32 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h index 8ecb889162..7a9b67eb8c 100644 --- a/ext/standard/fsock.h +++ b/ext/standard/fsock.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index 497b283524..536fccaa3e 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index cb96c190db..2bf4e02a41 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -636,7 +636,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count /* Trim off trailing whitespace characters */ tmp_len--; - while (tmp_len >= 0 && + while (tmp_len > 0 && (ent->d_name[tmp_len] == '\n' || ent->d_name[tmp_len] == '\r' || ent->d_name[tmp_len] == '\t' || ent->d_name[tmp_len] == ' ')) { ent->d_name[tmp_len--] = '\0'; diff --git a/ext/standard/head.c b/ext/standard/head.c index 9dae9f8759..3dd18ee0fd 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/head.h b/ext/standard/head.h index 59b1518676..e32810a6f3 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/html.c b/ext/standard/html.c index a7c58d5bce..dfe30d9b3e 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -392,9 +392,9 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC) if (zenc != NULL) { charset_hint = (char *)zend_multibyte_get_encoding_name(zenc); if (charset_hint != NULL && (len=strlen(charset_hint)) != 0) { - if ((len == 4) /* sizeof (none|auto|pass) */ && + if ((len == 4) /* sizeof (auto|pass) */ && + /* XXX should the "wchar" be ignored as well?? */ (!memcmp("pass", charset_hint, 4) || - !memcmp("auto", charset_hint, 4) || !memcmp("auto", charset_hint, 4))) { charset_hint = NULL; len = 0; diff --git a/ext/standard/html.h b/ext/standard/html.h index 0777130e0f..c7c297c90b 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/html_tables.h b/ext/standard/html_tables.h index 83c78b5d78..4680343f2c 100644 --- a/ext/standard/html_tables.h +++ b/ext/standard/html_tables.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1094,18 +1094,17 @@ static const uni_to_enc unimap_macroman[] = { #define ENT_STAGE3_INDEX(k) ((k) & 0x3F) #define ENT_CODE_POINT_FROM_STAGES(i,j,k) (((i) << 12) | ((j) << 6) | (k)) -/* Table should be organized with a leading row telling the size of - * the table and the default entity (maybe NULL) and the rest being - * normal rows ordered by code point so that we can do a binary search */ +/* The default entity may be NULL. Binary search is still possible while + is senseless as there are just two rows (see also find_entity_for_char()). */ typedef union { struct { - unsigned size; /* number of remaining entries in the table */ const char *default_entity; + unsigned size; /* number of remaining entries in the table */ unsigned short default_entity_len; } leading_entry; struct { - unsigned second_cp; /* second code point */ const char *entity; + unsigned second_cp; /* second code point */ unsigned short entity_len; } normal_entry; } entity_multicodepoint_row; @@ -1145,258 +1144,258 @@ typedef struct { /* {{{ Start of double code point tables for HTML5 */ static const entity_multicodepoint_row multi_cp_html5_0003C[] = { - { {01, "lt", 2} }, - { {0x020D2, "nvlt", 4} }, + { {"lt", 01, 2} }, + { {"nvlt", 0x020D2, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_0003D[] = { - { {01, "equals", 6} }, - { {0x020E5, "bne", 3} }, + { {"equals", 01, 6} }, + { {"bne", 0x020E5, 3} }, }; static const entity_multicodepoint_row multi_cp_html5_0003E[] = { - { {01, "gt", 2} }, - { {0x020D2, "nvgt", 4} }, + { {"gt", 01, 2} }, + { {"nvgt", 0x020D2, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_00066[] = { - { {01, NULL , 0} }, - { {0x0006A, "fjlig", 5} }, + { {NULL, 01, 0} }, + { {"fjlig", 0x0006A, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_0205F[] = { - { {01, "MediumSpace", 11} }, - { {0x0200A, "ThickSpace", 10} }, + { {"MediumSpace", 01, 11} }, + { {"ThickSpace", 0x0200A, 10} }, }; static const entity_multicodepoint_row multi_cp_html5_0219D[] = { - { {01, "rarrw", 5} }, - { {0x00338, "nrarrw", 6} }, + { {"rarrw", 01, 5} }, + { {"nrarrw", 0x00338, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_02202[] = { - { {01, "part", 4} }, - { {0x00338, "npart", 5} }, + { {"part", 01, 4} }, + { {"npart", 0x00338, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_02220[] = { - { {01, "angle", 5} }, - { {0x020D2, "nang", 4} }, + { {"angle", 01, 5} }, + { {"nang", 0x020D2, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_02229[] = { - { {01, "cap", 3} }, - { {0x0FE00, "caps", 4} }, + { {"cap", 01, 3} }, + { {"caps", 0x0FE00, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_0222A[] = { - { {01, "cup", 3} }, - { {0x0FE00, "cups", 4} }, + { {"cup", 01, 3} }, + { {"cups", 0x0FE00, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_0223C[] = { - { {01, "sim", 3} }, - { {0x020D2, "nvsim", 5} }, + { {"sim", 01, 3} }, + { {"nvsim", 0x020D2, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_0223D[] = { - { {01, "bsim", 4} }, - { {0x00331, "race", 4} }, + { {"bsim", 01, 4} }, + { {"race", 0x00331, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_0223E[] = { - { {01, "ac", 2} }, - { {0x00333, "acE", 3} }, + { {"ac", 01, 2} }, + { {"acE", 0x00333, 3} }, }; static const entity_multicodepoint_row multi_cp_html5_02242[] = { - { {01, "esim", 4} }, - { {0x00338, "nesim", 5} }, + { {"esim", 01, 4} }, + { {"nesim", 0x00338, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_0224B[] = { - { {01, "apid", 4} }, - { {0x00338, "napid", 5} }, + { {"apid", 01, 4} }, + { {"napid", 0x00338, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_0224D[] = { - { {01, "CupCap", 6} }, - { {0x020D2, "nvap", 4} }, + { {"CupCap", 01, 6} }, + { {"nvap", 0x020D2, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_0224E[] = { - { {01, "bump", 4} }, - { {0x00338, "nbump", 5} }, + { {"bump", 01, 4} }, + { {"nbump", 0x00338, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_0224F[] = { - { {01, "HumpEqual", 9} }, - { {0x00338, "nbumpe", 6} }, + { {"HumpEqual", 01, 9} }, + { {"nbumpe", 0x00338, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_02250[] = { - { {01, "esdot", 5} }, - { {0x00338, "nedot", 5} }, + { {"esdot", 01, 5} }, + { {"nedot", 0x00338, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_02261[] = { - { {01, "Congruent", 9} }, - { {0x020E5, "bnequiv", 7} }, + { {"Congruent", 01, 9} }, + { {"bnequiv", 0x020E5, 7} }, }; static const entity_multicodepoint_row multi_cp_html5_02264[] = { - { {01, "leq", 3} }, - { {0x020D2, "nvle", 4} }, + { {"leq", 01, 3} }, + { {"nvle", 0x020D2, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_02265[] = { - { {01, "ge", 2} }, - { {0x020D2, "nvge", 4} }, + { {"ge", 01, 2} }, + { {"nvge", 0x020D2, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_02266[] = { - { {01, "lE", 2} }, - { {0x00338, "nlE", 3} }, + { {"lE", 01, 2} }, + { {"nlE", 0x00338, 3} }, }; static const entity_multicodepoint_row multi_cp_html5_02267[] = { - { {01, "geqq", 4} }, - { {0x00338, "NotGreaterFullEqual", 19} }, + { {"geqq", 01, 4} }, + { {"NotGreaterFullEqual", 0x00338, 19} }, }; static const entity_multicodepoint_row multi_cp_html5_02268[] = { - { {01, "lneqq", 5} }, - { {0x0FE00, "lvertneqq", 9} }, + { {"lneqq", 01, 5} }, + { {"lvertneqq", 0x0FE00, 9} }, }; static const entity_multicodepoint_row multi_cp_html5_02269[] = { - { {01, "gneqq", 5} }, - { {0x0FE00, "gvertneqq", 9} }, + { {"gneqq", 01, 5} }, + { {"gvertneqq", 0x0FE00, 9} }, }; static const entity_multicodepoint_row multi_cp_html5_0226A[] = { - { {02, "ll", 2} }, - { {0x00338, "nLtv", 4} }, - { {0x020D2, "nLt", 3} }, + { {"ll", 02, 2} }, + { {"nLtv", 0x00338, 4} }, + { {"nLt", 0x020D2, 3} }, }; static const entity_multicodepoint_row multi_cp_html5_0226B[] = { - { {02, "gg", 2} }, - { {0x00338, "NotGreaterGreater", 17} }, - { {0x020D2, "nGt", 3} }, + { {"gg", 02, 2} }, + { {"NotGreaterGreater", 0x00338, 17} }, + { {"nGt", 0x020D2, 3} }, }; static const entity_multicodepoint_row multi_cp_html5_0227F[] = { - { {01, "SucceedsTilde", 13} }, - { {0x00338, "NotSucceedsTilde", 16} }, + { {"SucceedsTilde", 01, 13} }, + { {"NotSucceedsTilde", 0x00338, 16} }, }; static const entity_multicodepoint_row multi_cp_html5_02282[] = { - { {01, "sub", 3} }, - { {0x020D2, "vnsub", 5} }, + { {"sub", 01, 3} }, + { {"vnsub", 0x020D2, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_02283[] = { - { {01, "sup", 3} }, - { {0x020D2, "nsupset", 7} }, + { {"sup", 01, 3} }, + { {"nsupset", 0x020D2, 7} }, }; static const entity_multicodepoint_row multi_cp_html5_0228A[] = { - { {01, "subsetneq", 9} }, - { {0x0FE00, "vsubne", 6} }, + { {"subsetneq", 01, 9} }, + { {"vsubne", 0x0FE00, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_0228B[] = { - { {01, "supsetneq", 9} }, - { {0x0FE00, "vsupne", 6} }, + { {"supsetneq", 01, 9} }, + { {"vsupne", 0x0FE00, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_0228F[] = { - { {01, "sqsub", 5} }, - { {0x00338, "NotSquareSubset", 15} }, + { {"sqsub", 01, 5} }, + { {"NotSquareSubset", 0x00338, 15} }, }; static const entity_multicodepoint_row multi_cp_html5_02290[] = { - { {01, "sqsupset", 8} }, - { {0x00338, "NotSquareSuperset", 17} }, + { {"sqsupset", 01, 8} }, + { {"NotSquareSuperset", 0x00338, 17} }, }; static const entity_multicodepoint_row multi_cp_html5_02293[] = { - { {01, "sqcap", 5} }, - { {0x0FE00, "sqcaps", 6} }, + { {"sqcap", 01, 5} }, + { {"sqcaps", 0x0FE00, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_02294[] = { - { {01, "sqcup", 5} }, - { {0x0FE00, "sqcups", 6} }, + { {"sqcup", 01, 5} }, + { {"sqcups", 0x0FE00, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_022B4[] = { - { {01, "LeftTriangleEqual", 17} }, - { {0x020D2, "nvltrie", 7} }, + { {"LeftTriangleEqual", 01, 17} }, + { {"nvltrie", 0x020D2, 7} }, }; static const entity_multicodepoint_row multi_cp_html5_022B5[] = { - { {01, "RightTriangleEqual", 18} }, - { {0x020D2, "nvrtrie", 7} }, + { {"RightTriangleEqual", 01, 18} }, + { {"nvrtrie", 0x020D2, 7} }, }; static const entity_multicodepoint_row multi_cp_html5_022D8[] = { - { {01, "Ll", 2} }, - { {0x00338, "nLl", 3} }, + { {"Ll", 01, 2} }, + { {"nLl", 0x00338, 3} }, }; static const entity_multicodepoint_row multi_cp_html5_022D9[] = { - { {01, "Gg", 2} }, - { {0x00338, "nGg", 3} }, + { {"Gg", 01, 2} }, + { {"nGg", 0x00338, 3} }, }; static const entity_multicodepoint_row multi_cp_html5_022DA[] = { - { {01, "lesseqgtr", 9} }, - { {0x0FE00, "lesg", 4} }, + { {"lesseqgtr", 01, 9} }, + { {"lesg", 0x0FE00, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_022DB[] = { - { {01, "gtreqless", 9} }, - { {0x0FE00, "gesl", 4} }, + { {"gtreqless", 01, 9} }, + { {"gesl", 0x0FE00, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_022F5[] = { - { {01, "isindot", 7} }, - { {0x00338, "notindot", 8} }, + { {"isindot", 01, 7} }, + { {"notindot", 0x00338, 8} }, }; static const entity_multicodepoint_row multi_cp_html5_022F9[] = { - { {01, "isinE", 5} }, - { {0x00338, "notinE", 6} }, + { {"isinE", 01, 5} }, + { {"notinE", 0x00338, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_02933[] = { - { {01, "rarrc", 5} }, - { {0x00338, "nrarrc", 6} }, + { {"rarrc", 01, 5} }, + { {"nrarrc", 0x00338, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_029CF[] = { - { {01, "LeftTriangleBar", 15} }, - { {0x00338, "NotLeftTriangleBar", 18} }, + { {"LeftTriangleBar", 01, 15} }, + { {"NotLeftTriangleBar", 0x00338, 18} }, }; static const entity_multicodepoint_row multi_cp_html5_029D0[] = { - { {01, "RightTriangleBar", 16} }, - { {0x00338, "NotRightTriangleBar", 19} }, + { {"RightTriangleBar", 01, 16} }, + { {"NotRightTriangleBar", 0x00338, 19} }, }; static const entity_multicodepoint_row multi_cp_html5_02A6D[] = { - { {01, "congdot", 7} }, - { {0x00338, "ncongdot", 8} }, + { {"congdot", 01, 7} }, + { {"ncongdot", 0x00338, 8} }, }; static const entity_multicodepoint_row multi_cp_html5_02A70[] = { - { {01, "apE", 3} }, - { {0x00338, "napE", 4} }, + { {"apE", 01, 3} }, + { {"napE", 0x00338, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_02A7D[] = { - { {01, "les", 3} }, - { {0x00338, "nles", 4} }, + { {"les", 01, 3} }, + { {"nles", 0x00338, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_02A7E[] = { - { {01, "ges", 3} }, - { {0x00338, "nges", 4} }, + { {"ges", 01, 3} }, + { {"nges", 0x00338, 4} }, }; static const entity_multicodepoint_row multi_cp_html5_02AA1[] = { - { {01, "LessLess", 8} }, - { {0x00338, "NotNestedLessLess", 17} }, + { {"LessLess", 01, 8} }, + { {"NotNestedLessLess", 0x00338, 17} }, }; static const entity_multicodepoint_row multi_cp_html5_02AA2[] = { - { {01, "GreaterGreater", 14} }, - { {0x00338, "NotNestedGreaterGreater", 23} }, + { {"GreaterGreater", 01, 14} }, + { {"NotNestedGreaterGreater", 0x00338, 23} }, }; static const entity_multicodepoint_row multi_cp_html5_02AAC[] = { - { {01, "smte", 4} }, - { {0x0FE00, "smtes", 5} }, + { {"smte", 01, 4} }, + { {"smtes", 0x0FE00, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_02AAD[] = { - { {01, "late", 4} }, - { {0x0FE00, "lates", 5} }, + { {"late", 01, 4} }, + { {"lates", 0x0FE00, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_02AAF[] = { - { {01, "preceq", 6} }, - { {0x00338, "NotPrecedesEqual", 16} }, + { {"preceq", 01, 6} }, + { {"NotPrecedesEqual", 0x00338, 16} }, }; static const entity_multicodepoint_row multi_cp_html5_02AB0[] = { - { {01, "SucceedsEqual", 13} }, - { {0x00338, "NotSucceedsEqual", 16} }, + { {"SucceedsEqual", 01, 13} }, + { {"NotSucceedsEqual", 0x00338, 16} }, }; static const entity_multicodepoint_row multi_cp_html5_02AC5[] = { - { {01, "subE", 4} }, - { {0x00338, "nsubE", 5} }, + { {"subE", 01, 4} }, + { {"nsubE", 0x00338, 5} }, }; static const entity_multicodepoint_row multi_cp_html5_02AC6[] = { - { {01, "supseteqq", 9} }, - { {0x00338, "nsupseteqq", 10} }, + { {"supseteqq", 01, 9} }, + { {"nsupseteqq", 0x00338, 10} }, }; static const entity_multicodepoint_row multi_cp_html5_02ACB[] = { - { {01, "subsetneqq", 10} }, - { {0x0FE00, "vsubnE", 6} }, + { {"subsetneqq", 01, 10} }, + { {"vsubnE", 0x0FE00, 6} }, }; static const entity_multicodepoint_row multi_cp_html5_02ACC[] = { - { {01, "supnE", 5} }, - { {0x0FE00, "varsupsetneqq", 13} }, + { {"supnE", 01, 5} }, + { {"varsupsetneqq", 0x0FE00, 13} }, }; static const entity_multicodepoint_row multi_cp_html5_02AFD[] = { - { {01, "parsl", 5} }, - { {0x020E5, "nparsl", 6} }, + { {"parsl", 01, 5} }, + { {"nparsl", 0x020E5, 6} }, }; /* End of double code point tables }}} */ diff --git a/ext/standard/html_tables/html_table_gen.php b/ext/standard/html_tables/html_table_gen.php index 2aae24475a..45ae5f832b 100644 --- a/ext/standard/html_tables/html_table_gen.php +++ b/ext/standard/html_tables/html_table_gen.php @@ -1,7 +1,7 @@ <?php /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ @@ -23,7 +23,7 @@ $t = <<<CODE /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-%s The PHP Group | +----------------------------------------------------------------------+ @@ -371,18 +371,17 @@ $t = <<<'CODE' #define ENT_STAGE3_INDEX(k) ((k) & 0x3F) #define ENT_CODE_POINT_FROM_STAGES(i,j,k) (((i) << 12) | ((j) << 6) | (k)) -/* Table should be organized with a leading row telling the size of - * the table and the default entity (maybe NULL) and the rest being - * normal rows ordered by code point so that we can do a binary search */ +/* The default entity may be NULL. Binary search is still possible while + is senseless as there are just two rows (see also find_entity_for_char()). */ typedef union { struct { - unsigned size; /* number of remaining entries in the table */ const char *default_entity; + unsigned size; /* number of remaining entries in the table */ unsigned short default_entity_len; } leading_entry; struct { - unsigned second_cp; /* second code point */ const char *entity; + unsigned second_cp; /* second code point */ unsigned short entity_len; } normal_entry; } entity_multicodepoint_row; @@ -475,16 +474,16 @@ foreach ($multicp_rows as $k => $v) { if (key_exists("default", $v)) { if ($v['default'] == 'GT') /* hack to make > translate to > not GT; */ $v['default'] = "gt"; - echo "\t{ {", sprintf("%02d", count($v) - 1), - ",\t\t", sprintf("\"%-21s", $v["default"].'",'), "\t", + echo "\t{ {", sprintf("\"%-21s", $v["default"].'",'), + "\t", sprintf("%02d", (count($v) - 1)), ",\t\t", sprintf("% 2d", strlen($v["default"])), '} },', "\n"; } else { - echo "\t{ {", sprintf("%02d", count($v)), - ",\t\t", sprintf("%-22s", 'NULL'), ",\t0} },\n"; + echo "\t{ {", sprintf("%-22s", 'NULL,'), + "\t", sprintf("%02d", count($v)), ",\t\t0} },\n"; } unset($v["default"]); foreach ($v as $l => $w) { - echo "\t{ {", sprintf("0x%05s", $l), ",\t", sprintf("\"%-21s", $w.'",'), "\t", + echo "\t{ {", sprintf("\"%-21s", $w.'",'), "\t", sprintf("0x%05s", $l), ",\t", sprintf("% 2d", strlen($w)), '} },', "\n"; } echo "};\n"; diff --git a/ext/standard/http.c b/ext/standard/http.c index 62b05ed7b5..9174163b7d 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -66,7 +66,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, /* private or protected property access outside of the class */ continue; } - zend_unmangle_property_name_ex(key->val, key->len, &tmp, &prop_name, (int *)&prop_len); + zend_unmangle_property_name_ex(key, &tmp, &prop_name, &prop_len); } else { prop_name = key->val; prop_len = key->len; @@ -159,18 +159,14 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, } else { ekey = php_url_encode(prop_name, prop_len); } - smart_str_appendl(formstr, ekey->val, ekey->len); + smart_str_append(formstr, ekey); zend_string_free(ekey); } else { - char *ekey; - int ekey_len; /* Numeric key */ if (num_prefix) { smart_str_appendl(formstr, num_prefix, num_prefix_len); } - ekey_len = spprintf(&ekey, 0, "%pd", idx); - smart_str_appendl(formstr, ekey, ekey_len); - efree(ekey); + smart_str_append_long(formstr, idx); } smart_str_appendl(formstr, key_suffix, key_suffix_len); smart_str_appendl(formstr, "=", 1); @@ -182,18 +178,12 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, } else { ekey = php_url_encode(Z_STRVAL_P(zdata), Z_STRLEN_P(zdata)); } - smart_str_appendl(formstr, ekey->val, ekey->len); + smart_str_append(formstr, ekey); zend_string_free(ekey); } break; case IS_LONG: - { - char *ekey; - int ekey_len; - ekey_len = spprintf(&ekey, 0, "%pd", Z_LVAL_P(zdata)); - smart_str_appendl(formstr, ekey, ekey_len); - efree(ekey); - } + smart_str_append_long(formstr, Z_LVAL_P(zdata)); break; case IS_FALSE: smart_str_appendl(formstr, "0", sizeof("0")-1); @@ -221,7 +211,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, } else { ekey = php_url_encode(Z_STRVAL(copyzval), Z_STRLEN(copyzval)); } - smart_str_appendl(formstr, ekey->val, ekey->len); + smart_str_append(formstr, ekey); zval_ptr_dtor(©zval); zend_string_free(ekey); } diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 4bf86a4947..27c6cf6248 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -27,7 +27,7 @@ #include "php_network.h" #include "php_ini.h" #include "ext/standard/basic_functions.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include <stdio.h> #include <stdlib.h> @@ -422,7 +422,7 @@ finish: ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(tmpzval), tmpheader) { if (Z_TYPE_P(tmpheader) == IS_STRING) { - smart_str_appendl(&tmpstr, Z_STRVAL_P(tmpheader), Z_STRLEN_P(tmpheader)); + smart_str_append(&tmpstr, Z_STR_P(tmpheader)); smart_str_appendl(&tmpstr, "\r\n", sizeof("\r\n") - 1); } } ZEND_HASH_FOREACH_END(); @@ -437,7 +437,7 @@ finish: /* Remove newlines and spaces from start and end php_trim will estrndup() */ tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC); } - if (tmp && strlen(tmp) > 0) { + if (tmp && tmp[0] != '\0') { char *s; user_headers = estrdup(tmp); diff --git a/ext/standard/image.c b/ext/standard/image.c index b2b5dcd369..54159e3785 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -366,8 +366,8 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC) { unsigned char a[2]; - /* just return 0 if we hit the end-of-file */ - if((php_stream_read(stream, (char*)a, sizeof(a))) <= 0) return 0; + /* return 0 if we couldn't read enough data */ + if((php_stream_read(stream, a, sizeof(a))) < sizeof(a)) return 0; return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]); } @@ -647,7 +647,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) #endif result->channels = php_read2(stream TSRMLS_CC); /* Csiz */ - if (result->channels < 0 || result->channels > 256) { + if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) { efree(result); return NULL; } diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 4a6a39d4ed..011407da29 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/info.c b/ext/standard/info.c index a1a44cbae6..bc0ddddcc0 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -219,7 +219,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) php_info_print(string_key->val); } } else { - php_info_printf("%pd", num_key); + php_info_printf(ZEND_ULONG_FMT, num_key); } php_info_print("\"]"); if (!sapi_module.phpinfo_as_text) { @@ -585,6 +585,8 @@ PHPAPI zend_string *php_get_uname(char mode) char *winver = php_get_windows_name(); char wincpu[20]; + ZEND_ASSERT(winver != NULL); + php_get_windows_cpu(wincpu, sizeof(wincpu)); dwBuild = (DWORD)(HIWORD(dwVersion)); diff --git a/ext/standard/info.h b/ext/standard/info.h index 8be58160ed..a28ac564ab 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index e815c6bfb1..75bbdd22ce 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -300,8 +300,8 @@ PHP_FUNCTION(iptcparse) { int inx = 0, len; unsigned int tagsfound = 0; - unsigned char *buffer, recnum, dataset, key[ 16 ]; - char *str; + unsigned char *buffer, recnum, dataset; + char *str, key[16]; size_t str_len; zval values, *element; diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 051dfc61c8..8bfa05555b 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index 14d75bf571..df822f45d4 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/link.c b/ext/standard/link.c index fcd6b8eed9..4618ffe983 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c index a1b745af8d..ab904d9571 100644 --- a/ext/standard/link_win32.c +++ b/ext/standard/link_win32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 3404ebe2ac..96363f4cb9 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/math.c b/ext/standard/math.c index c957ca4698..7014e6c938 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -220,7 +220,7 @@ static double php_asinh(double z) return(asinh(z)); #else # ifdef _WIN64 - if (z > 0) { + if (z >= 0) { return log(z + sqrt(z * z + 1)); } else { diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 4938babf7a..e5359c2bcf 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -61,7 +61,7 @@ PHP_NAMED_FUNCTION(php_if_md5) PHP_MD5Update(&context, arg->val, arg->len); PHP_MD5Final(digest, &context); if (raw_output) { - RETURN_STRINGL(digest, 16); + RETURN_STRINGL((char *) digest, 16); } else { make_digest_ex(md5str, digest, 16); RETVAL_STRING(md5str); @@ -99,16 +99,20 @@ PHP_NAMED_FUNCTION(php_if_md5_file) PHP_MD5Update(&context, buf, n); } - PHP_MD5Final(digest, &context); - - php_stream_close(stream); + /* XXX this probably can be improved with some number of retries */ + if (!php_stream_eof(stream)) { + php_stream_close(stream); + PHP_MD5Final(digest, &context); - if (n<0) { RETURN_FALSE; } + php_stream_close(stream); + + PHP_MD5Final(digest, &context); + if (raw_output) { - RETURN_STRINGL(digest, 16); + RETURN_STRINGL((char *) digest, 16); } else { make_digest_ex(md5str, digest, 16); RETVAL_STRING(md5str); @@ -384,5 +388,5 @@ PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx) result[14] = ctx->d >> 16; result[15] = ctx->d >> 24; - memset(ctx, 0, sizeof(*ctx)); + ZEND_SECURE_ZERO(ctx, sizeof(*ctx)); } diff --git a/ext/standard/md5.h b/ext/standard/md5.h index 43f425e402..d62ade6b26 100644 --- a/ext/standard/md5.h +++ b/ext/standard/md5.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index f2feb72ebf..5327869a50 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index e20223b011..811731ee20 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/microtime.h b/ext/standard/microtime.h index 2af8a677c5..0a8b0dc666 100644 --- a/ext/standard/microtime.h +++ b/ext/standard/microtime.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/pack.c b/ext/standard/pack.c index d0792c1c17..f2bcb09723 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/pack.h b/ext/standard/pack.h index 601cc202c2..dc4c7d6173 100644 --- a/ext/standard/pack.h +++ b/ext/standard/pack.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 61a4ae6ec2..8db9995d27 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h index 204fb85c19..ec5823246a 100644 --- a/ext/standard/pageinfo.h +++ b/ext/standard/pageinfo.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/password.c b/ext/standard/password.c index cda10cbac0..0f75272d0e 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -86,7 +86,7 @@ static int php_password_salt_to64(const char *str, const size_t str_len, const s if ((int) str_len < 0) { return FAILURE; } - buffer = php_base64_encode((unsigned char*) str, (int) str_len); + buffer = php_base64_encode((unsigned char*) str, str_len); if (buffer->len < out_len) { /* Too short of an encoded string generated */ zend_string_release(buffer); @@ -163,7 +163,7 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */ efree(result); return FAILURE; } - memcpy(ret, result, (int) length); + memcpy(ret, result, length); efree(result); efree(buffer); ret[length] = 0; @@ -182,11 +182,6 @@ PHP_FUNCTION(password_get_info) return; } - if (hash_len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied password hash too long to safely identify"); - RETURN_FALSE; - } - array_init(&options); algo = php_password_determine_algo(hash, (size_t) hash_len); @@ -225,11 +220,6 @@ PHP_FUNCTION(password_needs_rehash) return; } - if (hash_len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied password hash too long to safely identify"); - RETURN_FALSE; - } - algo = php_password_determine_algo(hash, (size_t) hash_len); if (algo != new_algo) { @@ -409,7 +399,7 @@ PHP_FUNCTION(password_hash) salt_len = required_salt_len; } else { salt = safe_emalloc(required_salt_len, 1, 1); - memcpy(salt, buffer, (int) required_salt_len); + memcpy(salt, buffer, required_salt_len); salt_len = required_salt_len; } efree(buffer); diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index c001ee5509..d86121b277 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h index 04c85427c3..d8029b2f4f 100644 --- a/ext/standard/php_assert.h +++ b/ext/standard/php_assert.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h index dbe1891af3..467809dbf5 100644 --- a/ext/standard/php_browscap.h +++ b/ext/standard/php_browscap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h index a23811c320..c861187649 100644 --- a/ext/standard/php_crypt.h +++ b/ext/standard/php_crypt.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index 3098f247ef..dc4e27b112 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -1,7 +1,7 @@ /* $Id$ */ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -206,7 +206,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { } /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); + ZEND_SECURE_ZERO(final, sizeof(final)); /* Then something really weird... */ for (i = pwl; i != 0; i >>= 1) { @@ -288,7 +288,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { *p = '\0'; - memset(final, 0, sizeof(final)); + ZEND_SECURE_ZERO(final, sizeof(final)); _destroyCtx1: diff --git a/ext/standard/php_crypt_r.h b/ext/standard/php_crypt_r.h index 8b78d95d3d..da5744c9df 100644 --- a/ext/standard/php_crypt_r.h +++ b/ext/standard/php_crypt_r.h @@ -1,7 +1,7 @@ /* $Id$ */ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h index 2b9313aac4..c7999277da 100644 --- a/ext/standard/php_dir.h +++ b/ext/standard/php_dir.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h index 5823f5f20f..f37bce539a 100644 --- a/ext/standard/php_dns.h +++ b/ext/standard/php_dns.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h index e3fc582cd2..6e915bdf1d 100644 --- a/ext/standard/php_ext_syslog.h +++ b/ext/standard/php_ext_syslog.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h index 4f29553aea..e32c4a2cb9 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 3859e5b9a4..575e8fff98 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index 341c7ad829..084efc291c 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_ftok.h b/ext/standard/php_ftok.h index 7e702c942f..54666031fe 100644 --- a/ext/standard/php_ftok.h +++ b/ext/standard/php_ftok.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 54321b39a2..0979348314 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -22,7 +22,7 @@ #define PHP_HTTP_H #include "php.h" -#include "php_smart_str.h" +#include "zend_smart_str.h" PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *num_prefix, int num_prefix_len, diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h index c8bb4ccc7a..3853b0e6c3 100644 --- a/ext/standard/php_image.h +++ b/ext/standard/php_image.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index efca24acce..6001e35bbe 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_iptc.h b/ext/standard/php_iptc.h index a076aea343..af0269ce78 100644 --- a/ext/standard/php_iptc.h +++ b/ext/standard/php_iptc.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h index 82141e6af2..dcc82e9511 100644 --- a/ext/standard/php_lcg.h +++ b/ext/standard/php_lcg.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_link.h b/ext/standard/php_link.h index 1ca4acee25..2633a33ae4 100644 --- a/ext/standard/php_link.h +++ b/ext/standard/php_link.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index 925f58ebd5..f7ee5e983a 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index afdf54166f..7fb6909e7f 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h index 14da9d8191..100b1a8bc2 100644 --- a/ext/standard/php_metaphone.h +++ b/ext/standard/php_metaphone.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_password.h b/ext/standard/php_password.h index a38af97626..66adc07934 100644 --- a/ext/standard/php_password.h +++ b/ext/standard/php_password.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h index 6ec0f38706..bbdf16d385 100644 --- a/ext/standard/php_rand.h +++ b/ext/standard/php_rand.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h deleted file mode 100644 index 8b79e3edbc..0000000000 --- a/ext/standard/php_smart_str.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_SMART_STR_H -#define PHP_SMART_STR_H - -#include "php_smart_str_public.h" - -#include <stdlib.h> -#ifndef SMART_STR_USE_REALLOC -#include <zend.h> -#endif - -#define smart_str_0(x) do { \ - if ((x)->s) { \ - (x)->s->val[(x)->s->len] = '\0'; \ - } \ -} while (0) - -#ifndef SMART_STR_PREALLOC -#define SMART_STR_PREALLOC 128 -#endif - -#ifndef SMART_STR_START_SIZE -#define SMART_STR_START_SIZE 78 -#endif - - -#ifdef SMART_STR_USE_REALLOC -#define SMART_STR_DO_REALLOC(b, w) do { \ - int oldlen = (b)->s->len; \ - (b)->s = erealloc((buf)->s, _STR_HEADER_SIZE + (b)->a + 1); \ - (b)->s->len = oldlen; \ -} while (0) -#else -#define SMART_STR_DO_REALLOC(b, w) do { \ - (b)->s = perealloc((b)->s, _STR_HEADER_SIZE + (b)->a + 1, (w)); \ -} while (0) -#endif - - -#define smart_str_alloc4(d, n, what, newlen) do { \ - if (!(d)->s) { \ - newlen = (n); \ - (d)->a = newlen < SMART_STR_START_SIZE \ - ? SMART_STR_START_SIZE \ - : newlen + SMART_STR_PREALLOC; \ - (d)->s = zend_string_alloc((d)->a, (what)); \ - (d)->s->len = 0; \ - } else { \ - newlen = (d)->s->len + (n); \ - if (newlen >= (d)->a) { \ - (d)->a = newlen + SMART_STR_PREALLOC; \ - SMART_STR_DO_REALLOC((d), (what)); \ - } \ - } \ -} while (0) - -#define smart_str_alloc(d, n, what) \ - smart_str_alloc4((d), (n), (what), newlen) - -/* wrapper */ - -#define smart_str_appends_ex(dest, src, what) \ - smart_str_appendl_ex((dest), (src), strlen(src), (what)) -#define smart_str_appends(dest, src) \ - smart_str_appendl((dest), (src), strlen(src)) - -#define smart_str_appendc(dest, c) \ - smart_str_appendc_ex((dest), (c), 0) -#define smart_str_free(s) \ - smart_str_free_ex((s), 0) -#define smart_str_appendl(dest, src, len) \ - smart_str_appendl_ex((dest), (src), (len), 0) -#define smart_str_append(dest, src) \ - smart_str_append_ex((dest), (src), 0) -#define smart_str_append_long(dest, val) \ - smart_str_append_long_ex((dest), (val), 0) -#define smart_str_append_off_t(dest, val) \ - smart_str_append_off_t_ex((dest), (val), 0) -#define smart_str_append_unsigned(dest, val) \ - smart_str_append_unsigned_ex((dest), (val), 0) - -#define smart_str_appendc_ex(dest, ch, what) do { \ - register size_t __nl; \ - smart_str_alloc4((dest), 1, (what), __nl); \ - (dest)->s->len = __nl; \ - ((unsigned char *) (dest)->s->val)[(dest)->s->len - 1] = (ch); \ -} while (0) - -#define smart_str_free_ex(buf, what) do { \ - smart_str *__s = (smart_str *) (buf); \ - if (__s->s) { \ - zend_string_release(__s->s); \ - __s->s = NULL; \ - } \ - __s->a = 0; \ -} while (0) - -#define smart_str_appendl_ex(dest, src, nlen, what) do { \ - register size_t __nl; \ - smart_str *__dest = (smart_str *) (dest); \ - \ - smart_str_alloc4(__dest, (nlen), (what), __nl); \ - memcpy(__dest->s->val + __dest->s->len, (src), (nlen)); \ - __dest->s->len = __nl; \ -} while (0) - -/* - * these could be replaced using a braced-group inside an expression - * for GCC compatible compilers, e.g. - * - * #define f(..) ({char *r;..;__r;}) - */ - -static inline char *smart_str_print_long(char *buf, zend_long num) { - char *r; - _zend_print_signed_to_buf(buf, num, zend_long, r); - return r; -} - -static inline char *smart_str_print_unsigned(char *buf, zend_long num) { - char *r; - _zend_print_unsigned_to_buf(buf, num, zend_ulong, r); - return r; -} - -#define smart_str_append_generic_ex(dest, num, type, vartype, func) do { \ - char __b[32]; \ - char *__t; \ - _zend_print##func##_to_buf (__b + sizeof(__b) - 1, (num), vartype, __t); \ - smart_str_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type)); \ -} while (0) - -#define smart_str_append_unsigned_ex(dest, num, type) \ - smart_str_append_generic_ex((dest), (num), (type), zend_ulong, _unsigned) - -#define smart_str_append_long_ex(dest, num, type) \ - smart_str_append_generic_ex((dest), (num), (type), zend_ulong, _signed) - -#define smart_str_append_off_t_ex(dest, num, type) \ - smart_str_append_generic_ex((dest), (num), (type), zend_off_t, _signed) - -#define smart_str_append_ex(dest, src, what) do { \ - if ((src)->s && (src)->s->len) { \ - smart_str_appendl_ex((dest), (src)->s->val, (src)->s->len, (what)); \ - } \ -} while(0) - -#define smart_str_setl(dest, src, nlen) do { \ - smart_str_free((dest)); \ - smart_str_appendl_ex((dest), (src), (nlen), 0); \ -} while (0) - -#define smart_str_sets(dest, src) \ - smart_str_setl((dest), (src), strlen(src)); - -#endif diff --git a/ext/standard/php_smart_string.h b/ext/standard/php_smart_string.h index 91530d94d3..e052574a34 100644 --- a/ext/standard/php_smart_string.h +++ b/ext/standard/php_smart_string.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -89,8 +89,6 @@ smart_string_append_ex((dest), (src), 0) #define smart_string_append_long(dest, val) \ smart_string_append_long_ex((dest), (val), 0) -#define smart_string_append_off_t(dest, val) \ - smart_string_append_off_t_ex((dest), (val), 0) #define smart_string_append_unsigned(dest, val) \ smart_string_append_unsigned_ex((dest), (val), 0) @@ -119,33 +117,17 @@ __dest->len = __nl; \ } while (0) -static inline char *smart_string_print_long(char *buf, zend_long num) { - char *r; - _zend_print_signed_to_buf(buf, num, unsigned long, r); - return r; -} - -static inline char *smart_string_print_unsigned(char *buf, zend_long num) { - char *r; - _zend_print_unsigned_to_buf(buf, num, unsigned long, r); - return r; -} - #define smart_string_append_generic_ex(dest, num, type, vartype, func) do { \ char __b[32]; \ - char *__t; \ - _zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num), vartype, __t); \ + char *__t = zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num)); \ smart_string_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type)); \ } while (0) #define smart_string_append_unsigned_ex(dest, num, type) \ - smart_string_append_generic_ex((dest), (num), (type), unsigned long, _unsigned) + smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _ulong) #define smart_string_append_long_ex(dest, num, type) \ - smart_string_append_generic_ex((dest), (num), (type), unsigned long, _signed) - -#define smart_string_append_off_t_ex(dest, num, type) \ - smart_string_append_generic_ex((dest), (num), (type), off_t, _signed) + smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _long) #define smart_string_append_ex(dest, src, what) \ smart_string_appendl_ex((dest), ((smart_string *)(src))->c, \ diff --git a/ext/standard/php_smart_string_public.h b/ext/standard/php_smart_string_public.h index 215f182224..d4cd1180a4 100644 --- a/ext/standard/php_smart_string_public.h +++ b/ext/standard/php_smart_string_public.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h index d7476cb397..5f1716d849 100644 --- a/ext/standard/php_standard.h +++ b/ext/standard/php_standard.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index bb173ee85a..9e872222fd 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h index 8b71f87e5e..e6d8152b1b 100644 --- a/ext/standard/php_type.h +++ b/ext/standard/php_type.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h index f1dda2de45..0c8ceb72a3 100644 --- a/ext/standard/php_uuencode.h +++ b/ext/standard/php_uuencode.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index 2dc13f4012..23225cdc42 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -22,7 +22,7 @@ #define PHP_VAR_H #include "ext/standard/basic_functions.h" -#include "ext/standard/php_smart_str_public.h" +#include "zend_smart_str_public.h" PHP_FUNCTION(var_dump); PHP_FUNCTION(var_export); @@ -38,7 +38,10 @@ PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC); PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC); -typedef HashTable* php_serialize_data_t; +struct php_serialize_data { + HashTable ht; + uint32_t n; +}; struct php_unserialize_data { void *first; @@ -47,71 +50,67 @@ struct php_unserialize_data { void *last_dtor; }; -typedef struct php_unserialize_data* php_unserialize_data_t; +typedef struct php_serialize_data *php_serialize_data_t; +typedef struct php_unserialize_data *php_unserialize_data_t; -PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *var_hash TSRMLS_DC); +PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC); PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC); PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC); PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC); -#define PHP_VAR_SERIALIZE_INIT(var_hash_ptr) \ +#define PHP_VAR_SERIALIZE_INIT(d) \ do { \ /* fprintf(stderr, "SERIALIZE_INIT == lock: %u, level: %u\n", BG(serialize_lock), BG(serialize).level); */ \ if (BG(serialize_lock) || !BG(serialize).level) { \ - ALLOC_HASHTABLE(var_hash_ptr); \ - zend_hash_init((var_hash_ptr), 16, NULL, NULL, 0); \ + (d) = (php_serialize_data_t) emalloc(sizeof(struct php_serialize_data)); \ + zend_hash_init(&(d)->ht, 16, NULL, ZVAL_PTR_DTOR, 0); \ + (d)->n = 0; \ if (!BG(serialize_lock)) { \ - BG(serialize).var_hash = (void *)(var_hash_ptr); \ + BG(serialize).data = d; \ BG(serialize).level = 1; \ } \ } else { \ - (var_hash_ptr) = (php_serialize_data_t)BG(serialize).var_hash; \ + (d) = BG(serialize).data; \ ++BG(serialize).level; \ } \ } while(0) -#define PHP_VAR_SERIALIZE_DESTROY(var_hash_ptr) \ +#define PHP_VAR_SERIALIZE_DESTROY(d) \ do { \ /* fprintf(stderr, "SERIALIZE_DESTROY == lock: %u, level: %u\n", BG(serialize_lock), BG(serialize).level); */ \ - if (BG(serialize_lock) || !BG(serialize).level) { \ - zend_hash_destroy((var_hash_ptr)); \ - FREE_HASHTABLE(var_hash_ptr); \ - } else { \ - if (!--BG(serialize).level) { \ - zend_hash_destroy((php_serialize_data_t)BG(serialize).var_hash); \ - FREE_HASHTABLE((php_serialize_data_t)BG(serialize).var_hash); \ - BG(serialize).var_hash = NULL; \ - } \ + if (BG(serialize_lock) || BG(serialize).level == 1) { \ + zend_hash_destroy(&(d)->ht); \ + efree((d)); \ + } \ + if (!BG(serialize_lock) && !--BG(serialize).level) { \ + BG(serialize).data = NULL; \ } \ } while (0) -#define PHP_VAR_UNSERIALIZE_INIT(var_hash_ptr) \ +#define PHP_VAR_UNSERIALIZE_INIT(d) \ do { \ /* fprintf(stderr, "UNSERIALIZE_INIT == lock: %u, level: %u\n", BG(serialize_lock), BG(unserialize).level); */ \ if (BG(serialize_lock) || !BG(unserialize).level) { \ - (var_hash_ptr) = (php_unserialize_data_t)ecalloc(1, sizeof(struct php_unserialize_data)); \ + (d) = (php_unserialize_data_t)ecalloc(1, sizeof(struct php_unserialize_data)); \ if (!BG(serialize_lock)) { \ - BG(unserialize).var_hash = (void *)(var_hash_ptr); \ + BG(unserialize).data = (d); \ BG(unserialize).level = 1; \ } \ } else { \ - (var_hash_ptr) = (php_unserialize_data_t)BG(unserialize).var_hash; \ + (d) = BG(unserialize).data; \ ++BG(unserialize).level; \ } \ } while (0) -#define PHP_VAR_UNSERIALIZE_DESTROY(var_hash_ptr) \ +#define PHP_VAR_UNSERIALIZE_DESTROY(d) \ do { \ /* fprintf(stderr, "UNSERIALIZE_DESTROY == lock: %u, level: %u\n", BG(serialize_lock), BG(unserialize).level); */ \ - if (BG(serialize_lock) || !BG(unserialize).level) { \ - var_destroy(&(var_hash_ptr)); \ - efree(var_hash_ptr); \ - } else { \ - if (!--BG(unserialize).level) { \ - var_destroy(&(var_hash_ptr)); \ - efree((var_hash_ptr)); \ - BG(unserialize).var_hash = NULL; \ - } \ + if (BG(serialize_lock) || BG(unserialize).level == 1) { \ + var_destroy(&(d)); \ + efree((d)); \ + } \ + if (!BG(serialize_lock) && !--BG(unserialize).level) { \ + BG(unserialize).data = NULL; \ } \ } while (0) @@ -120,50 +119,4 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval *val); PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval *rval); PHPAPI void var_destroy(php_unserialize_data_t *var_hash); -PHPAPI zend_class_entry *php_create_empty_class(char *class_name, int len); - -static inline int php_varname_check(char *name, int name_len, zend_bool silent TSRMLS_DC) /* {{{ */ -{ - if (name_len == sizeof("GLOBALS") - 1 && !memcmp(name, "GLOBALS", sizeof("GLOBALS") - 1)) { - if (!silent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted GLOBALS variable overwrite"); - } - return FAILURE; - } else if (name[0] == '_' && - ( - (name_len == sizeof("_GET") - 1 && !memcmp(name, "_GET", sizeof("_GET") - 1)) || - (name_len == sizeof("_POST") - 1 && !memcmp(name, "_POST", sizeof("_POST") - 1)) || - (name_len == sizeof("_COOKIE") - 1 && !memcmp(name, "_COOKIE", sizeof("_COOKIE") - 1)) || - (name_len == sizeof("_ENV") - 1 && !memcmp(name, "_ENV", sizeof("_ENV") - 1)) || - (name_len == sizeof("_SERVER") - 1 && !memcmp(name, "_SERVER", sizeof("_SERVER") - 1)) || - (name_len == sizeof("_SESSION") - 1 && !memcmp(name, "_SESSION", sizeof("_SESSION") - 1)) || - (name_len == sizeof("_FILES") - 1 && !memcmp(name, "_FILES", sizeof("_FILES") - 1)) || - (name_len == sizeof("_REQUEST") -1 && !memcmp(name, "_REQUEST", sizeof("_REQUEST") - 1)) - ) - ) { - if (!silent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted super-global (%s) variable overwrite", name); - } - return FAILURE; - } else if (name[0] == 'H' && - ( - (name_len == sizeof("HTTP_POST_VARS") - 1 && !memcmp(name, "HTTP_POST_VARS", sizeof("HTTP_POST_VARS") - 1)) || - (name_len == sizeof("HTTP_GET_VARS") - 1 && !memcmp(name, "HTTP_GET_VARS", sizeof("HTTP_GET_VARS") - 1)) || - (name_len == sizeof("HTTP_COOKIE_VARS") - 1 && !memcmp(name, "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS") - 1)) || - (name_len == sizeof("HTTP_ENV_VARS") - 1 && !memcmp(name, "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS") - 1)) || - (name_len == sizeof("HTTP_SERVER_VARS") - 1 && !memcmp(name, "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS") - 1)) || - (name_len == sizeof("HTTP_SESSION_VARS") - 1 && !memcmp(name, "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS") - 1)) || - (name_len == sizeof("HTTP_RAW_POST_DATA") - 1 && !memcmp(name, "HTTP_RAW_POST_DATA", sizeof("HTTP_RAW_POST_DATA") - 1)) || - (name_len == sizeof("HTTP_POST_FILES") - 1 && !memcmp(name, "HTTP_POST_FILES", sizeof("HTTP_POST_FILES") - 1)) - ) - ) { - if (!silent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted long input array (%s) overwrite", name); - } - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - #endif /* PHP_VAR_H */ diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h index b3ea4f8f4d..3e34b8f8be 100644 --- a/ext/standard/php_versioning.h +++ b/ext/standard/php_versioning.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 8f79fffdf8..66c0c2e7e3 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h index 8545f201f2..955cca2e3d 100644 --- a/ext/standard/proc_open.h +++ b/ext/standard/proc_open.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 8abccaf820..c7eddc576b 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h index 7055d05717..99d3db8451 100644 --- a/ext/standard/quot_print.h +++ b/ext/standard/quot_print.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/rand.c b/ext/standard/rand.c index fdc86632cd..55388e3c13 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 83fd551c19..62437831bb 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index 8d5fee22e1..ddb9803512 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 8a05f50416..249828fb3d 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -46,10 +46,10 @@ PHP_FUNCTION(sha1) sha1str[0] = '\0'; PHP_SHA1Init(&context); - PHP_SHA1Update(&context, arg->val, arg->len); + PHP_SHA1Update(&context, (unsigned char *) arg->val, arg->len); PHP_SHA1Final(digest, &context); if (raw_output) { - RETURN_STRINGL(digest, 20); + RETURN_STRINGL((char *) digest, 20); } else { make_digest_ex(sha1str, digest, 20); RETVAL_STRING(sha1str); @@ -71,7 +71,7 @@ PHP_FUNCTION(sha1_file) unsigned char buf[1024]; unsigned char digest[20]; PHP_SHA1_CTX context; - int n; + size_t n; php_stream *stream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) { @@ -85,7 +85,7 @@ PHP_FUNCTION(sha1_file) PHP_SHA1Init(&context); - while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) { + while ((n = php_stream_read(stream, (char *) buf, sizeof(buf))) > 0) { PHP_SHA1Update(&context, buf, n); } @@ -93,12 +93,8 @@ PHP_FUNCTION(sha1_file) php_stream_close(stream); - if (n<0) { - RETURN_FALSE; - } - if (raw_output) { - RETURN_STRINGL(digest, 20); + RETURN_STRINGL((char *) digest, 20); } else { make_digest_ex(sha1str, digest, 20); RETVAL_STRING(sha1str); diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h index f852386a62..14787892e7 100644 --- a/ext/standard/sha1.h +++ b/ext/standard/sha1.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index ede06637fa..feb9a6780e 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 5557ba1356..f864994d28 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index 926cf2d5b5..a65f86e3a4 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/string.c b/ext/standard/string.c index 0c41249473..4a37f7a5b3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -56,7 +56,7 @@ #include "zend_execute.h" #include "php_globals.h" #include "basic_functions.h" -#include "php_smart_str.h" +#include "zend_smart_str.h" #include <Zend/zend_exceptions.h> #ifdef ZTS #include "TSRM.h" @@ -780,7 +780,7 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM */ PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC) { - register zend_long i; + register size_t i; size_t trimmed = 0; char mask[256]; @@ -802,12 +802,15 @@ PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *re c += trimmed; } if (mode & 2) { - for (i = len - 1; i >= 0; i--) { - if (mask[(unsigned char)c[i]]) { - len--; - } else { - break; - } + if (len > 0) { + i = len - 1; + do { + if (mask[(unsigned char)c[i]]) { + len--; + } else { + break; + } + } while (i-- != 0); } } @@ -1147,7 +1150,7 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC) again: switch (Z_TYPE_P(tmp)) { case IS_STRING: - smart_str_appendl(&implstr, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); + smart_str_append(&implstr, Z_STR_P(tmp)); break; case IS_LONG: @@ -1176,14 +1179,14 @@ again: default: str = zval_get_string(tmp); - smart_str_appendl(&implstr, str->val, str->len); + smart_str_append(&implstr, str); zend_string_release(str); break; } if (++i != numelems) { - smart_str_appendl(&implstr, Z_STRVAL_P(delim), Z_STRLEN_P(delim)); + smart_str_append(&implstr, Z_STR_P(delim)); } } ZEND_HASH_FOREACH_END(); @@ -1810,7 +1813,7 @@ PHP_FUNCTION(strpos) ZEND_PARSE_PARAMETERS_END(); #endif - if (offset < 0 || offset > haystack->len) { + if (offset < 0 || (size_t)offset > haystack->len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string"); RETURN_FALSE; } @@ -1860,7 +1863,7 @@ PHP_FUNCTION(stripos) return; } - if (offset < 0 || offset > haystack->len) { + if (offset < 0 || (size_t)offset > haystack->len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string"); RETURN_FALSE; } @@ -1948,20 +1951,20 @@ PHP_FUNCTION(strrpos) } if (offset >= 0) { - if (offset > haystack->len) { + if ((size_t)offset > haystack->len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } - p = haystack->val + offset; + p = haystack->val + (size_t)offset; e = haystack->val + haystack->len - needle_len; } else { - if (offset < -INT_MAX || -offset > haystack->len) { + if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } p = haystack->val; - if (needle_len > -offset) { + if (needle_len > (size_t)(-offset)) { e = haystack->val + haystack->len - needle_len; } else { e = haystack->val + haystack->len + offset; @@ -2026,7 +2029,7 @@ PHP_FUNCTION(strripos) /* Single character search can shortcut memcmps Can also avoid tolower emallocs */ if (offset >= 0) { - if (offset > haystack->len) { + if ((size_t)offset > haystack->len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } @@ -2034,7 +2037,7 @@ PHP_FUNCTION(strripos) e = haystack->val + haystack->len - 1; } else { p = haystack->val; - if (offset < -INT_MAX || -offset > haystack->len) { + if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } @@ -2057,7 +2060,7 @@ PHP_FUNCTION(strripos) php_strtolower(haystack_dup, haystack->len); if (offset >= 0) { - if (offset > haystack->len) { + if ((size_t)offset > haystack->len) { efree(needle_dup); efree(haystack_dup); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); @@ -2066,14 +2069,14 @@ PHP_FUNCTION(strripos) p = haystack_dup + offset; e = haystack_dup + haystack->len - needle_len; } else { - if (offset < -INT_MAX || -offset > haystack->len) { + if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) { efree(needle_dup); efree(haystack_dup); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } p = haystack_dup; - if (needle_len > -offset) { + if (needle_len > (size_t)(-offset)) { e = haystack_dup + haystack->len - needle_len; } else { e = haystack_dup + haystack->len + offset; @@ -2197,7 +2200,7 @@ PHP_FUNCTION(chunk_split) RETURN_FALSE; } - if (chunklen > str->len) { + if ((size_t)chunklen > str->len) { /* to maintain BC, we must return original string + ending */ result = zend_string_alloc(endlen + str->len, 0); memcpy(result->val, str->val, str->len); @@ -2210,7 +2213,7 @@ PHP_FUNCTION(chunk_split) RETURN_EMPTY_STRING(); } - result = php_chunk_split(str->val, str->len, end, endlen, chunklen); + result = php_chunk_split(str->val, str->len, end, endlen, (size_t)chunklen); if (result) { RETURN_STR(result); @@ -2242,7 +2245,7 @@ PHP_FUNCTION(substr) #endif if (argc > 2) { - if ((l < 0 && -l > str->len)) { + if ((l < 0 && (size_t)(-l) > str->len)) { RETURN_FALSE; } else if (l > (zend_long)str->len) { l = str->len; @@ -2556,7 +2559,7 @@ PHP_FUNCTION(substr_replace) if (str_index) { zval tmp; - ZVAL_STR(&tmp, result); + ZVAL_NEW_STR(&tmp, result); zend_symtable_update(Z_ARRVAL_P(return_value), str_index, &tmp); } else { add_index_str(return_value, num_index, result); @@ -2904,7 +2907,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl entry = zend_hash_str_find(pats, key, len); if (entry != NULL) { zend_string *str = zval_get_string(entry); - smart_str_appendl(&result, str->val, str->len); + smart_str_append(&result, str); pos += len; found = 1; zend_string_release(str); @@ -2929,7 +2932,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl entry = zend_hash_str_find(pats, key, len); if (entry != NULL) { zend_string *str = zval_get_string(entry); - smart_str_appendl(&result, str->val, str->len); + smart_str_append(&result, str); pos += len; found = 1; zend_string_release(str); @@ -3794,7 +3797,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit zval result; zend_string *string_key; zend_ulong num_key; - zend_long count = 0; + size_t count = 0; int argc = ZEND_NUM_ARGS(); #ifndef FAST_ZPP @@ -3980,7 +3983,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines) while (1) { char_count=0; - while ((!max_chars || max_chars > 0 && char_count < max_chars) && begin > 0) { + while ((!max_chars || (max_chars > 0 && char_count < max_chars)) && begin > 0) { char_count++; begin--; if (begin <= 0 || _isnewline(heb_str[begin])) { @@ -4156,7 +4159,7 @@ PHP_FUNCTION(strip_tags) if (allow != NULL) { convert_to_string_ex(allow); // TODO: reimplement to avoid reallocation ??? - if (IS_INTERNED(Z_STR_P(allow))) { + if (!Z_REFCOUNTED_P(allow)) { allowed_tags = estrndup(Z_STRVAL_P(allow), Z_STRLEN_P(allow)); allowed_tags_len = Z_STRLEN_P(allow); } else { @@ -4169,7 +4172,7 @@ PHP_FUNCTION(strip_tags) buf->len = php_strip_tags_ex(buf->val, str->len, NULL, allowed_tags, allowed_tags_len, 0); // TODO: reimplement to avoid reallocation ??? - if (allow && IS_INTERNED(Z_STR_P(allow))) { + if (allow && !Z_REFCOUNTED_P(allow)) { efree(allowed_tags); } RETURN_STR(buf); @@ -4999,7 +5002,7 @@ PHP_FUNCTION(substr_count) RETURN_FALSE; } - if (offset > haystack_len) { + if ((size_t)offset > haystack_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset); RETURN_FALSE; } @@ -5058,7 +5061,7 @@ PHP_FUNCTION(str_pad) /* If resulting string turns out to be shorter than input string, we simply copy the input and return. */ - if (pad_length < 0 || pad_length <= input->len) { + if (pad_length < 0 || (size_t)pad_length <= input->len) { RETURN_STRINGL(input->val, input->len); } @@ -5347,7 +5350,7 @@ PHP_FUNCTION(str_split) } - if (0 == str->len || split_length >= str->len) { + if (0 == str->len || (size_t)split_length >= str->len) { array_init_size(return_value, 1); add_next_index_stringl(return_value, str->val, str->len); return; @@ -5424,7 +5427,7 @@ PHP_FUNCTION(substr_compare) offset = (offset < 0) ? 0 : offset; } - if (offset >= s1->len) { + if ((size_t)offset >= s1->len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length"); RETURN_FALSE; } diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c index face191a6e..de6f727343 100644 --- a/ext/standard/strnatcmp.c +++ b/ext/standard/strnatcmp.c @@ -108,8 +108,9 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len int fractional, result; short leading = 1; - if (a_len == 0 || b_len == 0) - return a_len - b_len; + if (a_len == 0 || b_len == 0) { + return (a_len == b_len ? 0 : (a_len > b_len ? 1 : -1)); + } ap = a; bp = b; diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 900b118a4e..036c189e75 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/tests/file/bug41655_1-win32.phpt b/ext/standard/tests/file/bug41655_1-win32.phpt new file mode 100644 index 0000000000..631d91079b --- /dev/null +++ b/ext/standard/tests/file/bug41655_1-win32.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #41655 (open_basedir bypass via glob()) 1/2 +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die('skip only for Windows'); +} +?> +--CREDITS-- +Dave Kelsey <d_kelsey@uk.ibm.com> +--INI-- +open_basedir=/tmp +--FILE-- +<?php +$a=glob("./*.jpeg"); +var_dump($a); +echo "Done\n"; +?> +--EXPECT-- +array(0) { +} +Done diff --git a/ext/standard/tests/file/bug41655_1.phpt b/ext/standard/tests/file/bug41655_1.phpt index 62d64dfb1e..e4466821f9 100644 --- a/ext/standard/tests/file/bug41655_1.phpt +++ b/ext/standard/tests/file/bug41655_1.phpt @@ -1,5 +1,11 @@ --TEST-- Bug #41655 (open_basedir bypass via glob()) 1/2 +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip not for Windows'); +} +?> --CREDITS-- Dave Kelsey <d_kelsey@uk.ibm.com> --INI-- @@ -12,4 +18,4 @@ echo "Done\n"; ?> --EXPECT-- bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/file/bug65701.phpt b/ext/standard/tests/file/bug65701.phpt index 2b1b5d491d..42d8d3e628 100644 --- a/ext/standard/tests/file/bug65701.phpt +++ b/ext/standard/tests/file/bug65701.phpt @@ -6,7 +6,9 @@ Boro Sitnikovski <buritomath@yahoo.com> <?php $file_path = dirname(__FILE__) . "/bug65701/"; -mkdir($file_path); +if (!is_dir($file_path)) { + mkdir($file_path); +} $src = $file_path . '/srcbug65701_file.txt'; $dst = tempnam($file_path, 'dstbug65701_file.txt'); diff --git a/ext/standard/tests/file/file_put_contents_variation5.phpt b/ext/standard/tests/file/file_put_contents_variation5.phpt index 4ecb5213ac..baaa7a65d9 100644 --- a/ext/standard/tests/file/file_put_contents_variation5.phpt +++ b/ext/standard/tests/file/file_put_contents_variation5.phpt @@ -48,4 +48,3 @@ File written in working directory File written in working directory File written in working directory ===DONE=== - diff --git a/ext/standard/tests/serialize/counting_of_references.phpt b/ext/standard/tests/serialize/counting_of_references.phpt new file mode 100644 index 0000000000..e7ead96759 --- /dev/null +++ b/ext/standard/tests/serialize/counting_of_references.phpt @@ -0,0 +1,14 @@ +--TEST-- +References are not counted twice +--FILE-- +<?php + +$ref1 = 1; +$ref2 = 2; + +$arr = [&$ref1, &$ref1, &$ref2, &$ref2]; +var_dump(serialize($arr)); + +?> +--EXPECT-- +string(38) "a:4:{i:0;i:1;i:1;R:2;i:2;i:2;i:3;R:3;}" diff --git a/ext/standard/tests/streams/proc_open_bug51800.phpt b/ext/standard/tests/streams/proc_open_bug51800.phpt new file mode 100644 index 0000000000..53cafd8555 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800.phpt @@ -0,0 +1,95 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever +--SKIPIF-- +<?php + echo 'skip expected to fail or take too long'; + if (getenv("SKIP_SLOW_TESTS")) { + die("skip slow test"); + } +?> +--XFAIL-- +pipes have to be read/written simultaneously +--FILE-- +<?php +/* This is the wrong way to do it. The parent will block till it has read all the STDIN. +The smaller the pipe buffer is, the longer it will take. It might even pass at the end, +after taking inappropriately long. Pipes have to be read simultaneously in smaller chunks, +so then the pipe buffer is emptied more often and the child has chance to continue its +write. The behaviour might look some better if write/read in a separate thread, however +this is much more resource greedy and complexer to integrate into the user script. */ + +$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php + +$how_much = 10000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +fwrite(STDOUT, $data0); +fwrite(STDERR, $data1); + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1])) + $stdout .= fread($pipes[1], 1024); + fclose($pipes[1]); + + while (!feof($pipes[2])) + $stderr .= fread($pipes[2], 1024); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(10000) "a%s" + ["stderr"]=> + string(10000) "b%s" +} +int(10000) +int(10000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug51800_right.phpt b/ext/standard/tests/streams/proc_open_bug51800_right.phpt new file mode 100644 index 0000000000..b14fed2e5d --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800_right.phpt @@ -0,0 +1,78 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever, the right way to do it +--FILE-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php + +$how_much = 10000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +fwrite(STDOUT, $data0); +fwrite(STDERR, $data1); + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1]) || !feof($pipes[2])) { + $stdout .= fread($pipes[1], 1024); + $stderr .= fread($pipes[2], 1024); + } + fclose($pipes[1]); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(10000) "a%s" + ["stderr"]=> + string(10000) "b%s" +} +int(10000) +int(10000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug51800_right2.phpt b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt new file mode 100644 index 0000000000..1e742745c1 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt @@ -0,0 +1,84 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever, the right way to do it with more data +--FILE-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php +$how_much = 1000000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +$i0 = $i1 = 0; +$step = 1024; + +while ($i0 < strlen($data0) && $i1 < strlen($data1)) { + fwrite(STDOUT, substr($data0, $i0, $step)); + fwrite(STDERR, substr($data1, $i1, $step)); + $i0 += $step; + $i1 += $step; +} + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1]) || !feof($pipes[2])) { + $stdout .= fread($pipes[1], 1024); + $stderr .= fread($pipes[2], 1024); + } + fclose($pipes[1]); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(1000000) "a%s" + ["stderr"]=> + string(1000000) "b%s" +} +int(1000000) +int(1000000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug60120.phpt b/ext/standard/tests/streams/proc_open_bug60120.phpt new file mode 100644 index 0000000000..8768257a2e --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug60120.phpt @@ -0,0 +1,71 @@ +--TEST-- +Bug #60120 proc_open hangs with stdin/out with 2048+ bytes +--FILE-- +<?php +error_reporting(E_ALL); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; +} else { + $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; +} +$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); +$stdin = str_repeat('*', 1024 * 16) . '!'; +$stdin = str_repeat('*', 2049 ); + +$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); + +foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); +} +$writePipes = array($pipes[0]); +$stdinLen = strlen($stdin); +$stdinOffset = 0; + +unset($pipes[0]); + +while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + $n = stream_select($r, $w, $e, 60); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + } + if ($w) { + $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + var_dump($data); + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } +} + + +?> +===DONE=== +--EXPECTF-- +string(2049) "%s" +string(2049) "%s" +string(0) "" +string(0) "" +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug64438.phpt b/ext/standard/tests/streams/proc_open_bug64438.phpt new file mode 100644 index 0000000000..b3857d09d4 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug64438.phpt @@ -0,0 +1,70 @@ +--TEST-- +Bug #64438 proc_open hangs with stdin/out with 4097+ bytes +--FILE-- +<?php + +error_reporting(E_ALL); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; +} else { + $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; +} +$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); +$stdin = str_repeat('*', 4097); + +$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); + +foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); +} +$writePipes = array($pipes[0]); +$stdinLen = strlen($stdin); +$stdinOffset = 0; + +unset($pipes[0]); + +while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + $n = stream_select($r, $w, $e, 60); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + } + if ($w) { + $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + var_dump($data); + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } +} + +?> +===DONE=== +--EXPECTF-- +string(4097) "%s" +string(4097) "%s" +string(0) "" +string(0) "" +===DONE=== + diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index 10ae22fe0c..5ebdfe8d50 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -20,9 +20,9 @@ echo "*** Testing setlocale() : usage variations ***\n"; function good_locale($locale) { /** - * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/show_bug.cgi?id=532487 + * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/971416 **/ - return $locale !== 'tt_RU@iqtelif.UTF-8' && substr($locale, 0, 5) !== "no_NO"; + return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1'; } /* Prototype : array list_system_locales( void ) diff --git a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt index fb0fb79ae5..e74f6b73e9 100644 --- a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt +++ b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt @@ -48,8 +48,8 @@ str_dump($a, $b); --EXPECT-- *** Testing strnatcasecmp() : variation *** int(1) -int(6) -int(-2) +int(1) +int(-1) int(-1) int(0) int(0) diff --git a/ext/standard/type.c b/ext/standard/type.c index b320d9e5c5..fa5cd4639e 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c index 65cbcf12c3..1014f5d9ba 100644 --- a/ext/standard/uniqid.c +++ b/ext/standard/uniqid.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h index 0ea57fa52a..2247e8c2ee 100644 --- a/ext/standard/uniqid.h +++ b/ext/standard/uniqid.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/url.c b/ext/standard/url.c index 60ce808f4e..81f9b2ac9a 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/url.h b/ext/standard/url.h index d23f0a1f17..4d7a1f5b56 100644 --- a/ext/standard/url.h +++ b/ext/standard/url.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 1f085f9c77..3d7aa985b8 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -2,7 +2,7 @@ #line 1 "ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ #define url_scanner url_scanner_ex -#include "php_smart_str.h" +#include "zend_smart_str.h" static void tag_dtor(zval *zv) { @@ -166,7 +166,7 @@ scan: if (yych >= ';') goto yy4; ++YYCURSOR; #line 125 "ext/standard/url_scanner_ex.re" - { smart_str_append(dest, url); return; } + { smart_str_append_smart_str(dest, url); return; } #line 171 "ext/standard/url_scanner_ex.c" yy4: ++YYCURSOR; @@ -195,17 +195,17 @@ done: /* Don't modify URLs of the format "#mark" */ if (bash && bash - url->s->val == 0) { - smart_str_append(dest, url); + smart_str_append_smart_str(dest, url); return; } if (bash) smart_str_appendl(dest, url->s->val, bash - url->s->val); else - smart_str_append(dest, url); + smart_str_append_smart_str(dest, url); smart_str_appends(dest, sep); - smart_str_append(dest, url_app); + smart_str_append_smart_str(dest, url_app); if (bash) smart_str_appendl(dest, bash, q - bash); @@ -230,7 +230,7 @@ static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSR if (f) { append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); } else { - smart_str_append(&ctx->result, &ctx->val); + smart_str_append_smart_str(&ctx->result, &ctx->val); } if (quotes) smart_str_appendc(&ctx->result, type); @@ -304,7 +304,7 @@ static void handle_form(STD_PARA) } if (doit) - smart_str_append(&ctx->result, &ctx->form_app); + smart_str_append_smart_str(&ctx->result, &ctx->form_app); } } @@ -958,7 +958,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_ } smart_str_0(&ctx->result); if (do_flush) { - smart_str_appendl(&ctx->result, ctx->buf.s->val, ctx->buf.s->len); + smart_str_append(&ctx->result, ctx->buf.s); *newlen += ctx->buf.s->len; smart_str_free(&ctx->buf); smart_str_free(&ctx->val); @@ -1007,7 +1007,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * } else if (BG(url_adapt_state_ex).url_app.s->len == 0) { url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex); if (ctx->buf.s && ctx->buf.s->len) { - smart_str_appendl(&ctx->result, ctx->buf.s->val, ctx->buf.s->len); + smart_str_append(&ctx->result, ctx->buf.s); smart_str_appendl(&ctx->result, output, output_len); *handled_output = estrndup(ctx->result.s->val, ctx->result.s->len); @@ -1048,12 +1048,12 @@ PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int va smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); - smart_str_append(&BG(url_adapt_state_ex).url_app, &val); + smart_str_append_smart_str(&BG(url_adapt_state_ex).url_app, &val); smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); smart_str_appendl(&BG(url_adapt_state_ex).form_app, name, name_len); smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" value=\""); - smart_str_append(&BG(url_adapt_state_ex).form_app, &val); + smart_str_append_smart_str(&BG(url_adapt_state_ex).form_app, &val); smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" />"); if (urlencode) { diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index 0a7925e245..3c5b68c95b 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -31,7 +31,7 @@ PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, co PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC); PHPAPI int php_url_scanner_reset_vars(TSRMLS_D); -#include "php_smart_str_public.h" +#include "zend_smart_str_public.h" typedef struct { /* Used by the mainloop of the scanner */ diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index a2cb7ff8d9..2e74b1fb30 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -40,7 +40,7 @@ #define url_scanner url_scanner_ex -#include "php_smart_str.h" +#include "zend_smart_str.h" static void tag_dtor(zval *zv) { @@ -122,7 +122,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st scan: /*!re2c - ":" { smart_str_append(dest, url); return; } + ":" { smart_str_append_smart_str(dest, url); return; } "?" { sep = separator; goto scan; } "#" { bash = p - 1; goto done; } (any\[:?#])+ { goto scan; } @@ -131,17 +131,17 @@ done: /* Don't modify URLs of the format "#mark" */ if (bash && bash - url->s->val == 0) { - smart_str_append(dest, url); + smart_str_append_smart_str(dest, url); return; } if (bash) smart_str_appendl(dest, url->s->val, bash - url->s->val); else - smart_str_append(dest, url); + smart_str_append_smart_str(dest, url); smart_str_appends(dest, sep); - smart_str_append(dest, url_app); + smart_str_append_smart_str(dest, url_app); if (bash) smart_str_appendl(dest, bash, q - bash); @@ -166,7 +166,7 @@ static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSR if (f) { append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); } else { - smart_str_append(&ctx->result, &ctx->val); + smart_str_append_smart_str(&ctx->result, &ctx->val); } if (quotes) smart_str_appendc(&ctx->result, type); @@ -240,7 +240,7 @@ static void handle_form(STD_PARA) } if (doit) - smart_str_append(&ctx->result, &ctx->form_app); + smart_str_append_smart_str(&ctx->result, &ctx->form_app); } } @@ -410,7 +410,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_ } smart_str_0(&ctx->result); if (do_flush) { - smart_str_appendl(&ctx->result, ctx->buf.s->val, ctx->buf.s->len); + smart_str_append(&ctx->result, ctx->buf.s); *newlen += ctx->buf.s->len; smart_str_free(&ctx->buf); smart_str_free(&ctx->val); @@ -459,7 +459,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * } else if (BG(url_adapt_state_ex).url_app.s->len == 0) { url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex); if (ctx->buf.s && ctx->buf.s->len) { - smart_str_appendl(&ctx->result, ctx->buf.s->val, ctx->buf.s->len); + smart_str_append(&ctx->result, ctx->buf.s); smart_str_appendl(&ctx->result, output, output_len); *handled_output = estrndup(ctx->result.s->val, ctx->result.s->len); @@ -500,12 +500,12 @@ PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int va smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); - smart_str_append(&BG(url_adapt_state_ex).url_app, &val); + smart_str_append_smart_str(&BG(url_adapt_state_ex).url_app, &val); smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); smart_str_appendl(&BG(url_adapt_state_ex).form_app, name, name_len); smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" value=\""); - smart_str_append(&BG(url_adapt_state_ex).form_app, &val); + smart_str_append_smart_str(&BG(url_adapt_state_ex).form_app, &val); smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" />"); if (urlencode) { diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index ea73662db6..19e8e454df 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index 40ab379a30..6582e7de65 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/standard/var.c b/ext/standard/var.c index f005258fcb..53fd54c647 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -28,7 +28,7 @@ #include "php.h" #include "php_string.h" #include "php_var.h" -#include "php_smart_str.h" +#include "zend_smart_str.h" #include "basic_functions.h" #include "php_incomplete_class.h" @@ -74,7 +74,7 @@ static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *ke if (key == NULL) { /* numeric key */ php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); } else { /* string key */ - int unmangle = zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name); + int unmangle = zend_unmangle_property_name(key, &class_name, &prop_name); php_printf("%*c[", level + 1, ' '); if (class_name && unmangle == SUCCESS) { @@ -247,7 +247,7 @@ static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *k if (key == NULL) { /* numeric key */ php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); } else { /* string key */ - zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name); + zend_unmangle_property_name(key, &class_name, &prop_name); php_printf("%*c[", level + 1, ' '); if (class_name) { @@ -299,7 +299,7 @@ again: case IS_STRING: php_printf("%sstring(%d) \"", COMMON, Z_STRLEN_P(struc)); PHPWRITE(Z_STRVAL_P(struc), Z_STRLEN_P(struc)); - php_printf("\" refcount(%u)\n", IS_INTERNED(Z_STR_P(struc)) ? 1 : Z_REFCOUNT_P(struc)); + php_printf("\" refcount(%u)\n", Z_REFCOUNTED_P(struc) ? Z_REFCOUNT_P(struc) : 1); break; case IS_ARRAY: myht = Z_ARRVAL_P(struc); @@ -413,7 +413,7 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke buffer_append_spaces(buf, level + 1); smart_str_appendc(buf, '\''); - smart_str_appendl(buf, tmp_str->val, tmp_str->len); + smart_str_append(buf, tmp_str); smart_str_appendl(buf, "' => ", 5); zend_string_free(ckey); @@ -430,16 +430,15 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k { buffer_append_spaces(buf, level + 2); if (key != NULL) { - const char *class_name; /* ignored, but must be passed to unmangle */ - const char *pname; + const char *class_name, *prop_name; + size_t prop_name_len; zend_string *pname_esc; - zend_unmangle_property_name(key->val, key->len, - &class_name, &pname); - pname_esc = php_addcslashes(pname, strlen(pname), 0, "'\\", 2 TSRMLS_CC); + zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len); + pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2 TSRMLS_CC); smart_str_appendc(buf, '\''); - smart_str_appendl(buf, pname_esc->val, pname_esc->len); + smart_str_append(buf, pname_esc); smart_str_appendc(buf, '\''); zend_string_release(pname_esc); } else { @@ -487,7 +486,7 @@ again: ztmp2 = php_str_to_str_ex(ztmp->val, ztmp->len, "\0", 1, "' . \"\\0\" . '", 12, 0, NULL); smart_str_appendc(buf, '\''); - smart_str_appendl(buf, ztmp2->val, ztmp2->len); + smart_str_append(buf, ztmp2); smart_str_appendc(buf, '\''); zend_string_free(ztmp); @@ -536,7 +535,7 @@ again: } class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc), 0 TSRMLS_CC); - smart_str_appendl(buf, class_name->val, class_name->len); + smart_str_append(buf, class_name); smart_str_appendl(buf, "::__set_state(array(\n", 21); zend_string_release(class_name); @@ -599,54 +598,51 @@ PHP_FUNCTION(var_export) } /* }}} */ -static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var_hash TSRMLS_DC); +static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC); -static inline int php_add_var_hash(HashTable *var_hash, zval *var_ptr, zval *var_old TSRMLS_DC) /* {{{ */ +static inline uint32_t php_add_var_hash(php_serialize_data_t data, zval *var TSRMLS_DC) /* {{{ */ { - zval var_no, *zv; - char id[32], *p; - register int len; - zval *var = var_ptr; + zval *zv; + zend_ulong key; + zend_bool is_ref = Z_ISREF_P(var); - if (Z_ISREF_P(var)) { - var = Z_REFVAL_P(var); + data->n += 1; + + if (!is_ref && Z_TYPE_P(var) != IS_OBJECT) { + return 0; } - if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) { - p = smart_str_print_long(id + sizeof(id) - 1, - (zend_long) Z_OBJ_P(var)); - *(--p) = 'O'; - len = id + sizeof(id) - 1 - p; - } else if (var_ptr != var) { - p = smart_str_print_long(id + sizeof(id) - 1, - (zend_long) Z_REF_P(var_ptr)); - *(--p) = 'R'; - len = id + sizeof(id) - 1 - p; - } else { - p = smart_str_print_long(id + sizeof(id) - 1, (zend_long) var); - len = id + sizeof(id) - 1 - p; + + /* References to objects are treated as if the reference didn't exist */ + if (is_ref && Z_TYPE_P(Z_REFVAL_P(var)) == IS_OBJECT) { + var = Z_REFVAL_P(var); } - if ((zv = zend_hash_str_find(var_hash, p, len)) != NULL) { - ZVAL_COPY_VALUE(var_old, zv); - if (var == var_ptr) { - /* we still need to bump up the counter, since non-refs will - * be counted separately by unserializer */ - ZVAL_LONG(&var_no, -1); - zend_hash_next_index_insert(var_hash, &var_no); + /* Index for the variable is stored using the numeric value of the pointer to + * the zend_refcounted struct */ + key = (zend_ulong) (zend_uintptr_t) Z_COUNTED_P(var); + zv = zend_hash_index_find(&data->ht, key); + + if (zv) { + /* References are only counted once, undo the data->n increment above */ + if (is_ref) { + data->n -= 1; } -#if 0 - fprintf(stderr, "- had var (%d): %lu\n", Z_TYPE_P(var), **(zend_ulong**)var_old); -#endif - return FAILURE; - } - /* +1 because otherwise hash will think we are trying to store NULL pointer */ - ZVAL_LONG(&var_no, zend_hash_num_elements(var_hash) + 1); - zend_hash_str_add(var_hash, p, len, &var_no); -#if 0 - fprintf(stderr, "+ add var (%d): %lu\n", Z_TYPE_P(var), Z_LVAL(var_no)); -#endif - return SUCCESS; + return Z_LVAL_P(zv); + } else { + zval zv_n; + ZVAL_LONG(&zv_n, data->n); + zend_hash_index_add_new(&data->ht, key, &zv_n); + + /* Additionally to the index, we also store the variable, to ensure that it is + * not destroyed during serialization and its pointer reused. The variable is + * stored at the numeric value of the pointer + 1, which cannot be the location + * of another zend_refcounted structure. */ + zend_hash_index_add_new(&data->ht, key + 1, var); + Z_ADDREF_P(var); + + return 0; + } } /* }}} */ @@ -658,10 +654,10 @@ static inline void php_var_serialize_long(smart_str *buf, zend_long val) /* {{{ } /* }}} */ -static inline void php_var_serialize_string(smart_str *buf, char *str, int len) /* {{{ */ +static inline void php_var_serialize_string(smart_str *buf, char *str, size_t len) /* {{{ */ { smart_str_appendl(buf, "s:", 2); - smart_str_append_long(buf, len); + smart_str_append_unsigned(buf, len); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, str, len); smart_str_appendl(buf, "\";", 2); @@ -674,18 +670,18 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc PHP_SET_CLASS_ATTRIBUTES(struc); smart_str_appendl(buf, "O:", 2); - smart_str_append_long(buf, (int)class_name->len); + smart_str_append_unsigned(buf, class_name->len); smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, class_name->val, class_name->len); + smart_str_append(buf, class_name); smart_str_appendl(buf, "\":", 2); PHP_CLEANUP_CLASS_ATTRIBUTES(); return incomplete_class; } /* }}} */ -static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, HashTable *var_hash TSRMLS_DC) /* {{{ */ +static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */ { - int count; + uint32_t count; zend_bool incomplete_class; incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); @@ -695,7 +691,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt if (incomplete_class) { --count; } - smart_str_append_long(buf, count); + smart_str_append_unsigned(buf, count); smart_str_appendl(buf, ":{", 2); if (count > 0) { @@ -781,28 +777,24 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt } /* }}} */ -static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var_hash TSRMLS_DC) /* {{{ */ +static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */ { - int i; - zval var_already; + uint32_t var_already; HashTable *myht; if (EG(exception)) { return; } - ZVAL_UNDEF(&var_already); - - if (var_hash && - php_add_var_hash(var_hash, struc, &var_already TSRMLS_CC) == FAILURE) { + if (var_hash && (var_already = php_add_var_hash(var_hash, struc TSRMLS_CC))) { if (Z_ISREF_P(struc)) { smart_str_appendl(buf, "R:", 2); - smart_str_append_long(buf, Z_LVAL(var_already)); + smart_str_append_long(buf, var_already); smart_str_appendc(buf, ';'); return; } else if (Z_TYPE_P(struc) == IS_OBJECT) { smart_str_appendl(buf, "r:", 2); - smart_str_append_long(buf, Z_LVAL(var_already)); + smart_str_append_long(buf, var_already); smart_str_appendc(buf, ';'); return; } @@ -855,18 +847,18 @@ again: if (ce && ce->serialize != NULL) { /* has custom handler */ unsigned char *serialized_data = NULL; - uint32_t serialized_length; + size_t serialized_length; if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) { smart_str_appendl(buf, "C:", 2); - smart_str_append_long(buf, (int)Z_OBJCE_P(struc)->name->len); + smart_str_append_unsigned(buf, Z_OBJCE_P(struc)->name->len); smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, Z_OBJCE_P(struc)->name->val, Z_OBJCE_P(struc)->name->len); + smart_str_append(buf, Z_OBJCE_P(struc)->name); smart_str_appendl(buf, "\":", 2); - smart_str_append_long(buf, (int)serialized_length); + smart_str_append_unsigned(buf, serialized_length); smart_str_appendl(buf, ":{", 2); - smart_str_appendl(buf, serialized_data, serialized_length); + smart_str_appendl(buf, (char *) serialized_data, serialized_length); smart_str_appendc(buf, '}'); } else { smart_str_appendl(buf, "N;", 2); @@ -909,6 +901,7 @@ again: /* fall-through */ } case IS_ARRAY: { + uint32_t i; zend_bool incomplete_class = 0; if (Z_TYPE_P(struc) == IS_ARRAY) { smart_str_appendl(buf, "a:", 2); @@ -923,7 +916,7 @@ again: if (i > 0 && incomplete_class) { --i; } - smart_str_append_long(buf, i); + smart_str_append_unsigned(buf, i); smart_str_appendl(buf, ":{", 2); if (i > 0) { zend_string *key; @@ -972,9 +965,9 @@ again: } /* }}} */ -PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *var_hash TSRMLS_DC) /* {{{ */ +PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC) /* {{{ */ { - php_var_serialize_intern(buf, struc, *var_hash TSRMLS_CC); + php_var_serialize_intern(buf, struc, *data TSRMLS_CC); smart_str_0(buf); } /* }}} */ diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 7e6789daaa..c94f3eec58 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -2,7 +2,7 @@ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -700,7 +700,7 @@ yy20: /* Call unserialize callback */ ZVAL_STRING(&user_func, PG(unserialize_callback_func)); - ZVAL_STR(&args[0], zend_string_copy(class_name)); + ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { BG(serialize_lock)--; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 39161353f8..a11f556f7e 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -755,7 +755,7 @@ object ":" uiv ":" ["] { /* Call unserialize callback */ ZVAL_STRING(&user_func, PG(unserialize_callback_func)); - ZVAL_STR(&args[0], zend_string_copy(class_name)); + ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { BG(serialize_lock)--; diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index e6f5e480ae..ffdd5abf0d 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index 12afe6f278..c079ff383d 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sybase_ct/php_sybase_ct.h b/ext/sybase_ct/php_sybase_ct.h index 8e4993e0ed..476e620588 100644 --- a/ext/sybase_ct/php_sybase_ct.h +++ b/ext/sybase_ct/php_sybase_ct.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sybase_ct/sybase_ct.dsp b/ext/sybase_ct/sybase_ct.dsp deleted file mode 100644 index be2f890bab..0000000000 --- a/ext/sybase_ct/sybase_ct.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sybase_ct" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=sybase_ct - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "sybase_ct.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "sybase_ct.mak" CFG="sybase_ct - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "sybase_ct - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "sybase_ct - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "sybase_ct - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D HAVE_SYBASE_CT=1 /D ZTS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libct.lib libcs.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_sybase_ct.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "sybase_ct - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SYBASE_CT=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_sybase_ct.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "sybase_ct - Win32 Release_TS"
-# Name "sybase_ct - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_sybase_ct.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_sybase_ct.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg.h index 53ac7fc0ee..139d37fe38 100644 --- a/ext/sysvmsg/php_sysvmsg.h +++ b/ext/sysvmsg/php_sysvmsg.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index d6b8638ddd..d158366ea5 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -27,7 +27,7 @@ #include "ext/standard/info.h" #include "php_sysvmsg.h" #include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" /* In order to detect MSG_EXCEPT use at run time; we have no way * of knowing what the bit definitions are, so we can't just define diff --git a/ext/sysvsem/php_sysvsem.h b/ext/sysvsem/php_sysvsem.h index 964c3d3de4..8c2c2e5d3b 100644 --- a/ext/sysvsem/php_sysvsem.h +++ b/ext/sysvsem/php_sysvsem.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index 6f7948519e..299c725c6b 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -66,6 +66,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_acquire, 0, 0, 1) ZEND_ARG_INFO(0, sem_identifier) + ZEND_ARG_INFO(0, nowait) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_release, 0, 0, 1) @@ -299,11 +300,18 @@ PHP_FUNCTION(sem_get) static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire) { zval *arg_id; + zend_bool nowait = 0; sysvsem_sem *sem_ptr; struct sembuf sop; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) { - return; + if (acquire) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &arg_id, &nowait) == FAILURE) { + return; + } + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) { + return; + } } ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem); @@ -315,11 +323,13 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire) sop.sem_num = SYSVSEM_SEM; sop.sem_op = acquire ? -1 : 1; - sop.sem_flg = SEM_UNDO; + sop.sem_flg = SEM_UNDO | (nowait ? IPC_NOWAIT : 0); while (semop(sem_ptr->semid, &sop, 1) == -1) { if (errno != EINTR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno)); + if (errno != EAGAIN) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno)); + } RETURN_FALSE; } } diff --git a/ext/sysvsem/tests/nowait.phpt b/ext/sysvsem/tests/nowait.phpt new file mode 100644 index 0000000000..0a6fdf4a50 --- /dev/null +++ b/ext/sysvsem/tests/nowait.phpt @@ -0,0 +1,103 @@ +--TEST-- +sem_acquire with nowait +--SKIPIF-- +<?php // vim600: ts=4 sw=4 syn=php fdm=marker +if(!extension_loaded('sysvsem') || !extension_loaded('pcntl')) { + die("skip sysvsem and pcntl required"); +} +?> +--FILE-- +<?php +$SEMKEY = ftok(__FILE__, 'P'); // Semaphore key + +$pid = pcntl_fork(); + +if ($pid) { + echo "Parent.\n"; + + pcntl_signal(SIGCHLD, SIG_IGN); + + // Get semaphore + $sem_id = sem_get($SEMKEY, 1); + if ($sem_id === FALSE) { + echo "P: fail to get semaphore"; + exit; + } + echo "P: got semaphore $sem_id.\n"; + + register_shutdown_function(function () use ($sem_id) { + echo "P: cleanup.\n"; + sem_remove($sem_id); + }); + + // Acquire semaphore + if (! sem_acquire($sem_id)) { + echo "P: fail to acquire semaphore $sem_id.\n"; + sem_remove($sem_id); + exit; + } + echo "P: success acquire semaphore $sem_id.\n"; + + usleep(20000); + + echo "P: releases.\n"; + sem_release($sem_id); + + usleep(5000); + + // Acquire semaphore + if (! sem_acquire($sem_id)) { + echo "P: fail to acquire semaphore $sem_id.\n"; + sem_remove($sem_id); + exit; + } + echo "P: success acquire semaphore $sem_id.\n"; + + $status = null; + pcntl_waitpid($pid, $status); + +} else { + usleep(10000); + echo "Child.\n"; + + // Get semaphore + $sem_id = sem_get($SEMKEY, 1); + if ($sem_id === FALSE) { + echo "C: fail to get semaphore"; + exit; + } + echo "C: got semaphore $sem_id.\n"; + + // Acquire semaphore + if (! sem_acquire($sem_id)) { + echo "C: fail to acquire semaphore $sem_id.\n"; + exit; + } + echo "C: success acquire semaphore $sem_id.\n"; + + echo "C: releases.\n"; + sem_release($sem_id); + + usleep(10000); + + // Acquire semaphore + if (! sem_acquire($sem_id, true)) { + echo "C: fail to acquire semaphore $sem_id.\n"; + exit; + } + echo "C: success acquire semaphore $sem_id.\n"; +} + +?> +--EXPECTF-- +Parent. +P: got semaphore Resource id #%i. +P: success acquire semaphore Resource id #%i. +Child. +C: got semaphore Resource id #%i. +P: releases. +C: success acquire semaphore Resource id #%i. +C: releases. +P: success acquire semaphore Resource id #%i. +C: fail to acquire semaphore Resource id #%i. +P: cleanup. diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt index 6f52f3bd7e..ccfcf03d32 100644 --- a/ext/sysvsem/tests/sysv.phpt +++ b/ext/sysvsem/tests/sysv.phpt @@ -9,8 +9,8 @@ if(!extension_loaded('sysvsem') || !extension_loaded('sysvshm')) { --FILE-- <?php $MEMSIZE = 512; // size of shared memory to allocate -$SEMKEY = 1; // Semaphore key -$SHMKEY = 2; // Shared memory key +$SEMKEY = ftok(__FILE__, 'P'); // Semaphore key +$SHMKEY = ftok(__FILE__, 'Q'); // Shared memory key echo "Start.\n"; // Get semaphore diff --git a/ext/sysvshm/php_sysvshm.h b/ext/sysvshm/php_sysvshm.h index 0d174002b1..9dd9272dfe 100644 --- a/ext/sysvshm/php_sysvshm.h +++ b/ext/sysvshm/php_sysvshm.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c index 2a0d0e8246..c87be09e4f 100644 --- a/ext/sysvshm/sysvshm.c +++ b/ext/sysvshm/sysvshm.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -36,7 +36,7 @@ #include "php_sysvshm.h" #include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "php_ini.h" /* {{{ arginfo */ diff --git a/ext/tidy/examples/cleanhtml.php b/ext/tidy/examples/cleanhtml.php index 2644210cbf..b47384b810 100644 --- a/ext/tidy/examples/cleanhtml.php +++ b/ext/tidy/examples/cleanhtml.php @@ -34,7 +34,3 @@ echo tidy_get_output(); ?> - - - -
\ No newline at end of file diff --git a/ext/tidy/examples/cleanhtml5.php b/ext/tidy/examples/cleanhtml5.php index 2ce683acad..c5a1fcd338 100644 --- a/ext/tidy/examples/cleanhtml5.php +++ b/ext/tidy/examples/cleanhtml5.php @@ -33,7 +33,3 @@ echo $tidy; ?> - - - - diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h index efeba3baa9..cd78f37a17 100644 --- a/ext/tidy/php_tidy.h +++ b/ext/tidy/php_tidy.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 7fdf6087b4..63ccf52370 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/tidy/tidy.dsp b/ext/tidy/tidy.dsp deleted file mode 100755 index fe44fa7a51..0000000000 --- a/ext/tidy/tidy.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tidy" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=tidy - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tidy.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tidy.mak" CFG="tidy - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tidy - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "tidy - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tidy - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tidy.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
-
-!ELSEIF "$(CFG)" == "tidy - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tidy.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "tidy - Win32 Release_TS"
-# Name "tidy - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\tidy.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_tidy.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h index 1b5490d257..c6946c7078 100644 --- a/ext/tokenizer/php_tokenizer.h +++ b/ext/tokenizer/php_tokenizer.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index 1847b0537d..26e05c2be3 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -185,7 +185,7 @@ PHP_FUNCTION(token_get_all) return; } - ZVAL_STR(&source_zval, zend_string_copy(source)); + ZVAL_STR_COPY(&source_zval, source); zend_save_lexical_state(&original_lex_state TSRMLS_CC); if (zend_prepare_string_for_scanning(&source_zval, "" TSRMLS_CC) == FAILURE) { diff --git a/ext/tokenizer/tokenizer.dsp b/ext/tokenizer/tokenizer.dsp deleted file mode 100644 index 9844574a8a..0000000000 --- a/ext/tokenizer/tokenizer.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tokenizer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=tokenizer - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tokenizer.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tokenizer.mak" CFG="tokenizer - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tokenizer - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "tokenizer - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tokenizer - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tokenizer.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "tokenizer - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tokenizer.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "tokenizer - Win32 Release_TS"
-# Name "tokenizer - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\tokenizer.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_tokenizer.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/tokenizer/tokenizer_data.c b/ext/tokenizer/tokenizer_data.c index beb9ea8e5b..49dec7c150 100644 --- a/ext/tokenizer/tokenizer_data.c +++ b/ext/tokenizer/tokenizer_data.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/tokenizer/tokenizer_data_gen.sh b/ext/tokenizer/tokenizer_data_gen.sh index 1ed76e3617..a00d341528 100755 --- a/ext/tokenizer/tokenizer_data_gen.sh +++ b/ext/tokenizer/tokenizer_data_gen.sh @@ -14,7 +14,7 @@ fi echo '/* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/wddx/php_wddx.h b/ext/wddx/php_wddx.h index 7e823f7c8f..3809c0a3e1 100644 --- a/ext/wddx/php_wddx.h +++ b/ext/wddx/php_wddx.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h index d20f007345..5c47109ee3 100644 --- a/ext/wddx/php_wddx_api.h +++ b/ext/wddx/php_wddx_api.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -21,7 +21,7 @@ #ifndef PHP_WDDX_API_H #define PHP_WDDX_API_H -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str_public.h" #define WDDX_ARRAY_S "<array length='%d'>" #define WDDX_ARRAY_E "</array>" diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 931ea81c4e..705babd885 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -35,7 +35,7 @@ #include "ext/standard/php_incomplete_class.h" #include "ext/standard/base64.h" #include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/html.h" #include "ext/standard/php_string.h" #include "ext/date/php_date.h" @@ -289,7 +289,7 @@ PS_SERIALIZER_DECODE_FUNC(wddx) zval retval; zval *ent; zend_string *key; - ulong idx; + zend_ulong idx; int ret; if (vallen == 0) { @@ -442,7 +442,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj) zval *ent, fname, *varname; zval retval; zend_string *key; - ulong idx; + zend_ulong idx; char tmp_buf[WDDX_BUF_LEN]; HashTable *objhash, *sleephash; TSRMLS_FETCH(); @@ -505,10 +505,11 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj) } if (key) { const char *class_name, *prop_name; + size_t prop_name_len; zend_string *tmp; - zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name); - tmp = zend_string_init(prop_name, strlen(prop_name), 0); + zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len); + tmp = zend_string_init(prop_name, prop_name_len, 0); php_wddx_serialize_var(packet, ent, tmp TSRMLS_CC); zend_string_release(tmp); } else { @@ -532,10 +533,10 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr) zval *ent; zend_string *key; int is_struct = 0; - ulong idx; + zend_ulong idx; HashTable *target_hash; char tmp_buf[WDDX_BUF_LEN]; - ulong ind = 0; + zend_ulong ind = 0; TSRMLS_FETCH(); target_hash = HASH_OF(arr); diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 81f5cb9667..c046e150da 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h index dab9812122..54673f9ad0 100644 --- a/ext/xml/expat_compat.h +++ b/ext/xml/expat_compat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h index 0195bb5836..cdb08f812e 100644 --- a/ext/xml/php_xml.h +++ b/ext/xml/php_xml.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -134,8 +134,8 @@ PHP_FUNCTION(utf8_decode); PHP_FUNCTION(xml_parse_into_struct); PHPAPI char *_xml_zval_strdup(zval *); -PHPAPI zend_string *xml_utf8_decode(const XML_Char *, int, const XML_Char *); -PHPAPI zend_string *xml_utf8_encode(const char *, int, const XML_Char *); +PHPAPI zend_string *xml_utf8_decode(const XML_Char *, size_t, const XML_Char *); +PHPAPI zend_string *xml_utf8_encode(const char *, size_t, const XML_Char *); #endif /* HAVE_LIBEXPAT */ diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 2ad53e77e9..f1a3442b6d 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -554,9 +554,9 @@ static xml_encoding *xml_get_encoding(const XML_Char *name) /* }}} */ /* {{{ xml_utf8_encode() */ -PHPAPI zend_string *xml_utf8_encode(const char *s, int len, const XML_Char *encoding) +PHPAPI zend_string *xml_utf8_encode(const char *s, size_t len, const XML_Char *encoding) { - int pos = len; + size_t pos = len; zend_string *str; unsigned int c; unsigned short (*encoder)(unsigned char) = NULL; @@ -605,7 +605,7 @@ PHPAPI zend_string *xml_utf8_encode(const char *s, int len, const XML_Char *enco /* }}} */ /* {{{ xml_utf8_decode() */ -PHPAPI zend_string *xml_utf8_decode(const XML_Char *s, int len, const XML_Char *encoding) +PHPAPI zend_string *xml_utf8_decode(const XML_Char *s, size_t len, const XML_Char *encoding) { size_t pos = 0; unsigned int c; @@ -627,7 +627,7 @@ PHPAPI zend_string *xml_utf8_decode(const XML_Char *s, int len, const XML_Char * str = zend_string_alloc(len, 0); str->len = 0; - while (pos < (size_t)len) { + while (pos < len) { int status = FAILURE; c = php_next_utf8_char((const unsigned char*)s, (size_t) len, &pos, &status); diff --git a/ext/xml/xml.mak b/ext/xml/xml.mak index ab60f28eed..b712dea1d6 100644 --- a/ext/xml/xml.mak +++ b/ext/xml/xml.mak @@ -4,7 +4,7 @@ PROJECT_ROOT = ..\.. # Module details MODULE_NAME = php_xml -MODULE_DESC = "PHP 5 - XML Extension" +MODULE_DESC = "PHP 7 - XML Extension" VMAJ = 3 VMIN = 0 VREV = 0 diff --git a/ext/xmlreader/README b/ext/xmlreader/README index 0d946f62da..f85e4a2121 100644 --- a/ext/xmlreader/README +++ b/ext/xmlreader/README @@ -2,4 +2,4 @@ XMLReader represents a reader that provides non-cached, forward-only access to XML data. It is based upon the xmlTextReader api from libxml -This extension is designed to only work under PHP 5. +This extension is designed to only work under PHP 5+. diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index a90f727cb8..43e585dd33 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h index 4107396d39..7a721dcc6f 100644 --- a/ext/xmlreader/php_xmlreader.h +++ b/ext/xmlreader/php_xmlreader.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xmlreader/xmlreader.dsp b/ext/xmlreader/xmlreader.dsp deleted file mode 100644 index 7b21518ba3..0000000000 --- a/ext/xmlreader/xmlreader.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlreader" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xmlreader - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xmlreader.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xmlreader.mak" CFG="xmlreader - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xmlreader - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xmlreader - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xmlreader - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "xmlreader___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "xmlreader___Win32_Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XMLREADER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-
-!ELSEIF "$(CFG)" == "xmlreader - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "xmlreader___Win32_Release_TS0"
-# PROP BASE Intermediate_Dir "xmlreader___Win32_Release_TS0"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c
-# SUBTRACT CPP /Fr
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-# ADD LINK32 php5ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /incremental:no /machine:I386 /out:"..\..\Release_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /debug
-
-!ENDIF
-
-# Begin Target
-
-# Name "xmlreader - Win32 Debug_TS"
-# Name "xmlreader - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_xmlreader.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xmlreader.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/xmlrpc/php_xmlrpc.h b/ext/xmlrpc/php_xmlrpc.h index 286711b505..4e059788de 100644 --- a/ext/xmlrpc/php_xmlrpc.h +++ b/ext/xmlrpc/php_xmlrpc.h @@ -35,7 +35,7 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index b5b7e87161..d43a31be11 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -35,7 +35,7 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -472,7 +472,7 @@ static void set_output_options(php_output_options* options, zval* output_opts) static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht) { int bArray = 0, bStruct = 0, bMixed = 0; - unsigned long num_index, last_num = 0; + zend_ulong num_index, last_num = 0; zend_string* my_key; ZEND_HASH_FOREACH_KEY(ht, num_index, my_key) { @@ -541,7 +541,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep break; case xmlrpc_vector: { - unsigned long num_index; + zend_ulong num_index; zval* pIter; zend_string* my_key; HashTable *ht = NULL; diff --git a/ext/xmlrpc/xmlrpc.dsp b/ext/xmlrpc/xmlrpc.dsp deleted file mode 100644 index 8c455d3fcd..0000000000 --- a/ext/xmlrpc/xmlrpc.dsp +++ /dev/null @@ -1,211 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlrpc" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xmlrpc - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xmlrpc.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xmlrpc.mak" CFG="xmlrpc - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xmlrpc - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xmlrpc - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xmlrpc - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "_DEBUG"
-# ADD RSC /l 0x1009 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_xmlrpc.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "xmlrpc - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "NDEBUG"
-# ADD RSC /l 0x1009 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlrpc.dll" /libpath:"..\..\Release_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "xmlrpc - Win32 Debug_TS"
-# Name "xmlrpc - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=".\xmlrpc-epi-php.c"
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xmlrpc.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "libxmlrpc"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\libxmlrpc\base64.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\base64.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\encodings.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\encodings.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\queue.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\queue.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\simplestring.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\simplestring.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\system_methods.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\system_methods_private.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_element.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_element.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_dandarpc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_dandarpc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_soap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_soap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_xmlrpc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_xmlrpc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_introspection.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_introspection.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_introspection_private.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_private.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/xmlwriter/TODO b/ext/xmlwriter/TODO index bfc895d769..858ad6be27 100644 --- a/ext/xmlwriter/TODO +++ b/ext/xmlwriter/TODO @@ -1,4 +1,4 @@ -- Fix up config file for PHP 5 to use libxml extension configuration +- Fix up config file for PHP 7 to use libxml extension configuration - Add tests for Namespace functions/methods - Sync with xmlwriter (new dtd func?) - Write documentations in docbook diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index becfbc2157..6e3475e8d0 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xmlwriter/php_xmlwriter.h b/ext/xmlwriter/php_xmlwriter.h index a4f43baaf5..fc00a9d578 100644 --- a/ext/xmlwriter/php_xmlwriter.h +++ b/ext/xmlwriter/php_xmlwriter.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xmlwriter/xmlwriter.dsp b/ext/xmlwriter/xmlwriter.dsp deleted file mode 100644 index e5eca77be5..0000000000 --- a/ext/xmlwriter/xmlwriter.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlwriter" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xmlwriter - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xmlwriter.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xmlwriter.mak" CFG="xmlwriter - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xmlwriter - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xmlwriter - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xmlwriter - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_XMLWRITER=1 /D "LIBXML_STATIC" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-# ADD LINK32 wsock32.lib php4ts.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlwriter.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /debug
-
-!ELSEIF "$(CFG)" == "xmlwriter - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "xmlwriter___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "xmlwriter___Win32_Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 wsock32.lib php4ts_debug.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "xmlwriter - Win32 Release_TS"
-# Name "xmlwriter - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_xmlwriter.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xmlwriter.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index bda02498ed..2763d83326 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h index 375cb32fb0..b6603321a3 100644 --- a/ext/xsl/php_xsl.h +++ b/ext/xsl/php_xsl.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xsl/xsl.dsp b/ext/xsl/xsl.dsp deleted file mode 100644 index ff7257d161..0000000000 --- a/ext/xsl/xsl.dsp +++ /dev/null @@ -1,120 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xsl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xsl - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xsl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xsl.mak" CFG="xsl - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xsl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xsl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xsl - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 wsock32.lib php5ts.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xsl.dll" /implib:".Release_TS/php_xsl.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "xsl - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xsl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
-
-!ENDIF
-
-# Begin Target
-
-# Name "xsl - Win32 Release_TS"
-# Name "xsl - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_xsl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\xsltprocessor.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xsl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\xsl_fe.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h index 89726da724..e987554a4d 100644 --- a/ext/xsl/xsl_fe.h +++ b/ext/xsl/xsl_fe.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index cd828c75a0..20af855aa4 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -791,7 +791,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter) intern = Z_XSL_P(id); - ZVAL_STR(&new_string, zend_string_copy(value)); + ZVAL_STR_COPY(&new_string, value); zend_hash_update(intern->parameter, name, &new_string); RETURN_TRUE; diff --git a/ext/zip/lib/config.h b/ext/zip/lib/config.h index 8c11baa5e2..3d524f3923 100644 --- a/ext/zip/lib/config.h +++ b/ext/zip/lib/config.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c index 02fa1272d6..4793c54534 100644 --- a/ext/zip/lib/zip_set_name.c +++ b/ext/zip/lib/zip_set_name.c @@ -58,7 +58,7 @@ _zip_set_name(struct zip *za, zip_uint64_t idx, const char *name, zip_flags_t fl return -1; } - if (name && strlen(name) > 0) { + if (name && name[0] != '\0') { /* TODO: check for string too long */ if ((str=_zip_string_new((const zip_uint8_t *)name, (zip_uint16_t)strlen(name), flags, &za->error)) == NULL) return -1; diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 734ee19d0e..4accc22e30 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -956,7 +956,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */ HashTable *props; zip_prop_handler *hnd; zend_string *key; - ulong num_key; + zend_ulong num_key; obj = Z_ZIP_P(object); props = zend_std_get_properties(object TSRMLS_CC); @@ -1609,9 +1609,11 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* RETURN_FALSE; } - if (remove_path && remove_path_len > 1 && (remove_path[strlen(remove_path) - 1] == '/' || - remove_path[strlen(remove_path) - 1] == '\\')) { - remove_path[strlen(remove_path) - 1] = '\0'; + if (remove_path && remove_path_len > 1) { + size_t real_len = strlen(remove_path); + if (real_len > 1 && remove_path[real_len - 1] == '/' || remove_path[real_len - 1] == '\\') { + remove_path[real_len - 1] = '\0'; + } } if (type == 1) { diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 15c085271a..7fab823297 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -76,11 +76,11 @@ typedef struct _ze_zip_read_rsrc { /* Extends zend object */ typedef struct _ze_zip_object { struct zip *za; - int buffers_cnt; char **buffers; HashTable *prop_handler; char *filename; int filename_len; + int buffers_cnt; zend_object zo; } ze_zip_object; diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index 44d5507b77..c542340170 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index f76e4c2266..ba829b5888 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -49,13 +49,13 @@ typedef struct _php_zlib_context { ZEND_BEGIN_MODULE_GLOBALS(zlib) /* variables for transparent gzip encoding */ - int compression_coding; zend_long output_compression; zend_long output_compression_level; char *output_handler; php_zlib_context *ob_gzhandler; zend_long output_compression_default; zend_bool handler_registered; + int compression_coding; ZEND_END_MODULE_GLOBALS(zlib); php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 8e7bd6c40c..000b96ad8e 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/zlib/zlib.dsp b/ext/zlib/zlib.dsp deleted file mode 100644 index 8986bc6f05..0000000000 --- a/ext/zlib/zlib.dsp +++ /dev/null @@ -1,121 +0,0 @@ -# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=zlib - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "zlib - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "zlib - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_zlib.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\zlib\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "zlib - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_zlib.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\zlib\Debug" - -!ENDIF - -# Begin Target - -# Name "zlib - Win32 Release_TS" -# Name "zlib - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\zlib.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_filter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_zlib.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index 53bc2e4269..6966c2a9ff 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -25,12 +25,12 @@ /* Passed as opaque in malloc callbacks */ typedef struct _php_zlib_filter_data { - int persistent; z_stream strm; char *inbuf; size_t inbuf_len; char *outbuf; size_t outbuf_len; + int persistent; zend_bool finished; } php_zlib_filter_data; diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index 713a6ecfb2..796b8a54e0 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -37,13 +37,14 @@ static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_ struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; int read; + /* XXX this needs to be looped for the case count > UINT_MAX */ read = gzread(self->gz_file, buf, count); if (gzeof(self->gz_file)) { stream->eof = 1; } - return (read < 0) ? 0 : read; + return (size_t)((read < 0) ? 0 : read); } static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) @@ -51,9 +52,10 @@ static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; int wrote; + /* XXX this needs to be looped for the case count > UINT_MAX */ wrote = gzwrite(self->gz_file, (char *) buf, count); - return (wrote < 0) ? 0 : wrote; + return (size_t)((wrote < 0) ? 0 : wrote); } static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt index a4e01a4845..0c46a88831 100644 --- a/ext/zlib/zlib_win32_howto.txt +++ b/ext/zlib/zlib_win32_howto.txt @@ -7,7 +7,7 @@ php_build\zlib\include\zlib.h php_build\zlib\include\zconf.h php_build\zlib\lib\zlibstat.lib -php_build is a directory at the same level as php5. +php_build is a directory at the same level as php7. Start Visual Studio, load php_modules.dsw, select the ZLIB projects, and build it. @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/SAPI.c b/main/SAPI.c index 750b95cc0f..50ea8c0a16 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -739,7 +739,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) return SUCCESS; } else { /* new line/NUL character safety check */ - int i; + uint i; for (i = 0; i < header_line_len; i++) { /* RFC 2616 allows new lines if followed by SP or HT */ int illegal_break = diff --git a/main/SAPI.h b/main/SAPI.h index 9172a3e4dd..79661371d9 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/build-defs.h.in b/main/build-defs.h.in index aa1fbf0321..6821b631f5 100644 --- a/main/build-defs.h.in +++ b/main/build-defs.h.in @@ -1,6 +1,6 @@ /* -*- C -*- +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index e375bdf413..8d6bf3d0bc 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -226,12 +226,13 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path /* Resolve open_basedir to resolved_basedir */ if (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL) { + int basedir_len = (int)strlen(basedir); /* Handler for basedirs that end with a / */ - resolved_basedir_len = strlen(resolved_basedir); + resolved_basedir_len = (int)strlen(resolved_basedir); #if defined(PHP_WIN32) || defined(NETWARE) - if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR || basedir[strlen(basedir) - 1] == '/') { + if (basedir[basedir_len - 1] == PHP_DIR_SEPARATOR || basedir[basedir_len - 1] == '/') { #else - if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) { + if (basedir[basedir_len - 1] == PHP_DIR_SEPARATOR) { #endif if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) { resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR; @@ -758,10 +759,15 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co cwd_state new_state; char cwd[MAXPATHLEN]; int copy_len; + int path_len; if (!filepath[0]) { return NULL; - } else if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { + } + + path_len = (int)strlen(filepath); + + if (IS_ABSOLUTE_PATH(filepath, path_len)) { cwd[0] = '\0'; } else { const char *iam = SG(request_info).path_translated; @@ -784,7 +790,7 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co /* return a relative file path if for any reason * we cannot cannot getcwd() and the requested, * relatively referenced file is accessible */ - copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); + copy_len = path_len > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : path_len; if (real_path) { memcpy(real_path, filepath, copy_len); real_path[copy_len] = '\0'; diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h index 4dde0e35eb..b58f54dce8 100644 --- a/main/fopen_wrappers.h +++ b/main/fopen_wrappers.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/getopt.c b/main/getopt.c index 315467a095..8126d577b4 100644 --- a/main/getopt.c +++ b/main/getopt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in index f1e66b160a..3f02921ddf 100644 --- a/main/internal_functions.c.in +++ b/main/internal_functions.c.in @@ -1,6 +1,6 @@ /* -*- C -*- +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c index 86ba57d486..dcb84c346c 100644 --- a/main/internal_functions_nw.c +++ b/main/internal_functions_nw.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c index 8b5518ca90..355013f501 100644 --- a/main/internal_functions_win32.c +++ b/main/internal_functions_win32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/main.c b/main/main.c index fde2902d64..63144de418 100644 --- a/main/main.c +++ b/main/main.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1149,10 +1149,10 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR ) { #ifdef PHP_WIN32 - fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); + fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno); fflush(stderr); #else - fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); + fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno); #endif } else { php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); @@ -2023,7 +2023,7 @@ void dummy_invalid_parameter_handler( called = 1; if (function) { if (file) { - len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws' (%ws:%d)", function, file, line); + len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws' (%ws:%u)", function, file, line); } else { len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws'", function); } diff --git a/main/network.c b/main/network.c index 0b018c2e87..bb21f0ffe4 100644 --- a/main/network.c +++ b/main/network.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/output.c b/main/output.c index b51892c140..f44ae178b4 100644 --- a/main/output.c +++ b/main/output.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php.h b/main/php.h index 11a8a64401..2a683e1924 100644 --- a/main/php.h +++ b/main/php.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_compat.h b/main/php_compat.h index 20951ba427..5e6af03c59 100644 --- a/main/php_compat.h +++ b/main/php_compat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_content_types.c b/main/php_content_types.c index c8db921421..8765a507bc 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_content_types.h b/main/php_content_types.h index ed5346c843..0a49d1e2cd 100644 --- a/main/php_content_types.h +++ b/main/php_content_types.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_getopt.h b/main/php_getopt.h index f536ac8a96..8f70181786 100644 --- a/main/php_getopt.h +++ b/main/php_getopt.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_globals.h b/main/php_globals.h index 14d0a03868..a60efe69de 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_ini.c b/main/php_ini.c index b3dcd3e546..c90dc9f29f 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_ini.h b/main/php_ini.h index 2e118d14e3..99f6a07a07 100644 --- a/main/php_ini.h +++ b/main/php_ini.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_main.h b/main/php_main.h index 92dafde4d8..07d7dc2280 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h index 229ed1902e..a7823817bc 100644 --- a/main/php_memory_streams.h +++ b/main/php_memory_streams.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_network.h b/main/php_network.h index 1528447c73..b0b1787ea5 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index ebe5350ef2..a52619ed47 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h index 873bffcb0a..a11cb79014 100644 --- a/main/php_open_temporary_file.h +++ b/main/php_open_temporary_file.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_output.h b/main/php_output.h index f8b961c7c3..02b2b85d13 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -143,12 +143,12 @@ typedef struct _php_output_handler { } php_output_handler; ZEND_BEGIN_MODULE_GLOBALS(output) - int flags; zend_stack handlers; php_output_handler *active; php_output_handler *running; const char *output_start_filename; int output_start_lineno; + int flags; ZEND_END_MODULE_GLOBALS(output) /* there should not be a need to use OG() from outside of output.c */ diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h index 2f2e99c0b4..5aac0262a8 100644 --- a/main/php_reentrancy.h +++ b/main/php_reentrancy.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_scandir.c b/main/php_scandir.c index 36c0c648e1..7dfec7bff7 100644 --- a/main/php_scandir.c +++ b/main/php_scandir.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_scandir.h b/main/php_scandir.h index 90708c6872..848f525732 100644 --- a/main/php_scandir.h +++ b/main/php_scandir.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_sprintf.c b/main/php_sprintf.c index e9f956f8dd..f93c16e9aa 100644 --- a/main/php_sprintf.c +++ b/main/php_sprintf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_stdint.h b/main/php_stdint.h index 527ee3493d..4d0d723af6 100644 --- a/main/php_stdint.h +++ b/main/php_stdint.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_streams.h b/main/php_streams.h index 9a6e84dfe6..34d7676f09 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_syslog.h b/main/php_syslog.h index f8280a8a50..d39fc9b5b2 100644 --- a/main/php_syslog.h +++ b/main/php_syslog.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_ticks.c b/main/php_ticks.c index 248b5a9e04..daa6cde6ff 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_ticks.h b/main/php_ticks.h index b511949d80..0f8277cc7f 100644 --- a/main/php_ticks.h +++ b/main/php_ticks.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_variables.c b/main/php_variables.c index 37af78b98d..a0acb38264 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -23,7 +23,7 @@ #include "php.h" #include "ext/standard/php_standard.h" #include "ext/standard/credits.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "php_variables.h" #include "php_globals.h" #include "php_content_types.h" @@ -243,7 +243,7 @@ typedef struct post_var_data { static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC) { - char *ksep, *vsep; + char *ksep, *vsep, *val; size_t klen, vlen; /* FIXME: string-size_t */ size_t new_vlen; @@ -274,15 +274,17 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR vlen = 0; } - php_url_decode(var->ptr, klen); + + val = estrndup(ksep, vlen); if (vlen) { - vlen = php_url_decode(ksep, vlen); + vlen = php_url_decode(val, vlen); } - if (sapi_module.input_filter(PARSE_POST, var->ptr, &ksep, vlen, &new_vlen TSRMLS_CC)) { - php_register_variable_safe(var->ptr, ksep, new_vlen, arr TSRMLS_CC); + if (sapi_module.input_filter(PARSE_POST, var->ptr, &val, vlen, &new_vlen TSRMLS_CC)) { + php_register_variable_safe(var->ptr, val, new_vlen, arr TSRMLS_CC); } + efree(val); var->ptr = vsep + (vsep != var->end); return 1; diff --git a/main/php_variables.h b/main/php_variables.h index 70f5e1dc7f..08abeb5267 100644 --- a/main/php_variables.h +++ b/main/php_variables.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/reentrancy.c b/main/reentrancy.c index dd411f478b..4aca23eb1a 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/rfc1867.c b/main/rfc1867.c index 0f2941ef98..0eacf896c3 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/rfc1867.h b/main/rfc1867.h index b76e3598f5..ab5f50f8d6 100644 --- a/main/rfc1867.h +++ b/main/rfc1867.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/snprintf.c b/main/snprintf.c index 0675538ac5..062ccc4eee 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/snprintf.h b/main/snprintf.h index 6cef41f3f4..d133ad7aaa 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/spprintf.c b/main/spprintf.c index 67ab15dce5..cf730dd964 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -111,7 +111,7 @@ #define FLOAT_DIGITS 6 #define EXPONENT_LENGTH 10 -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/php_smart_string.h" /* {{{ macros */ diff --git a/main/spprintf.h b/main/spprintf.h index 1e4782843f..1e7c034cfa 100644 --- a/main/spprintf.h +++ b/main/spprintf.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/cast.c b/main/streams/cast.c index cb4f081655..3291a9ca8f 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/filter.c b/main/streams/filter.c index a74802eb14..36585fa9bf 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index f0c8a347f0..e62fbfb662 100644 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/memory.c b/main/streams/memory.c index f08c192581..9788954988 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/mmap.c b/main/streams/mmap.c index a99c8994aa..8746959bbe 100644 --- a/main/streams/mmap.c +++ b/main/streams/mmap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h index c0b70934c6..ac90a0ba3c 100644 --- a/main/streams/php_stream_context.h +++ b/main/streams/php_stream_context.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h index 31e73ff6e4..dfa4ae2937 100644 --- a/main/streams/php_stream_filter_api.h +++ b/main/streams/php_stream_filter_api.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h index b6746b72ed..69b67d4c85 100644 --- a/main/streams/php_stream_glob_wrapper.h +++ b/main/streams/php_stream_glob_wrapper.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h index 5d200d729a..a25c4ac6b9 100644 --- a/main/streams/php_stream_mmap.h +++ b/main/streams/php_stream_mmap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index 4370867995..7d5278c620 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index a6797ed898..9674314c49 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -142,21 +142,21 @@ typedef struct _php_stream_xport_param { struct { char *name; size_t namelen; - int backlog; struct timeval *timeout; struct sockaddr *addr; - socklen_t addrlen; char *buf; size_t buflen; - long flags; + zend_long flags; + socklen_t addrlen; + int backlog; } inputs; struct { php_stream *client; - int returncode; struct sockaddr *addr; socklen_t addrlen; zend_string *textaddr; zend_string *error_text; + int returncode; int error_code; } outputs; } php_stream_xport_param; @@ -191,18 +191,18 @@ PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRML END_EXTERN_C() typedef struct _php_stream_xport_crypto_param { - enum { - STREAM_XPORT_CRYPTO_OP_SETUP, - STREAM_XPORT_CRYPTO_OP_ENABLE - } op; struct { + php_stream *session; int activate; php_stream_xport_crypt_method_t method; - php_stream *session; } inputs; struct { int returncode; } outputs; + enum { + STREAM_XPORT_CRYPTO_OP_SETUP, + STREAM_XPORT_CRYPTO_OP_ENABLE + } op; } php_stream_xport_crypto_param; BEGIN_EXTERN_C() diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h index 28985a5e1e..7a03690a8f 100644 --- a/main/streams/php_stream_userspace.h +++ b/main/streams/php_stream_userspace.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index 489e18b26f..d8799fcefb 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 36b56645c2..28328c3cd5 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -348,6 +348,34 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS assert(data != NULL); if (data->fd >= 0) { +#ifdef PHP_WIN32 + php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract; + + if (self->is_pipe || self->is_process_pipe) { + HANDLE ph = (HANDLE)_get_osfhandle(data->fd); + int retry = 0; + DWORD avail_read = 0; + + do { + /* Look ahead to get the available data amount to read. Do the same + as read() does, however not blocking forever. In case it failed, + no data will be read (better than block). */ + if (!PeekNamedPipe(ph, NULL, 0, NULL, &avail_read, NULL)) { + break; + } + /* If there's nothing to read, wait in 100ms periods. */ + if (0 == avail_read) { + usleep(100000); + } + } while (0 == avail_read && retry++ < 320); + + /* Reduce the required data amount to what is available, otherwise read() + will block.*/ + if (avail_read < count) { + count = avail_read; + } + } +#endif ret = read(data->fd, buf, PLAIN_WRAP_BUF_SIZE(count)); if (ret == (size_t)-1 && errno == EINTR) { @@ -1336,7 +1364,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url break; #endif case PHP_STREAM_META_ACCESS: - mode = (mode_t)*(long *)value; + mode = (mode_t)*(zend_long *)value; ret = VCWD_CHMOD(url, mode); break; default: diff --git a/main/streams/streams.c b/main/streams/streams.c index 5cce2c66bf..bc84d52655 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/transports.c b/main/streams/transports.c index b1f0acfa73..a75f77c5bd 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/userspace.c b/main/streams/userspace.c index a286104e29..1ff80cdfa6 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index 12111511d6..bce6a09fb0 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/strlcat.c b/main/strlcat.c index b7aa06e8a2..65811e90c2 100644 --- a/main/strlcat.c +++ b/main/strlcat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/strlcpy.c b/main/strlcpy.c index 7738238bd5..737036c4a1 100644 --- a/main/strlcpy.c +++ b/main/strlcpy.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/win32_internal_function_disabled.h b/main/win32_internal_function_disabled.h index 7365262772..a412305ea3 100644 --- a/main/win32_internal_function_disabled.h +++ b/main/win32_internal_function_disabled.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/win95nt.h b/main/win95nt.h index ce2b002f38..76bec05ea5 100644 --- a/main/win95nt.h +++ b/main/win95nt.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -37,8 +37,8 @@ sed -e "s/PVERSION/$VERSION/g" \ -e "s/TARDIR/$TARDIR/g" \ -e "s/PREQUIRES/$PREQUIRES/g" \ > $SPEC <<'EOF' -Summary: PHP 5 - A powerful scripting language -Name: php5 +Summary: PHP 7 - A powerful scripting language +Name: php7 Version: PVERSION Release: PRELEASE Group: Networking/Daemons @@ -48,7 +48,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Requires: PREQUIRES %description -PHP 5 is a powerful apache module that adds scripting and database connection +PHP 7 is a powerful apache module that adds scripting and database connection capabilities to the apache server. This version includes the "php_cgi" binary for suExec and stand alone php scripts too. @@ -103,7 +103,7 @@ mv php.keepme sapi/cgi/php %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache -install -m 0755 .libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/apache +install -m 0755 .libs/libphp7.so $RPM_BUILD_ROOT%{_libdir}/apache mkdir -p $RPM_BUILD_ROOT%{_bindir} install -m 0755 sapi/cli/php $RPM_BUILD_ROOT%{_bindir} install -m 0755 sapi/cgi/php $RPM_BUILD_ROOT%{_bindir}/php_cgi @@ -168,7 +168,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%{_libdir}/apache/libphp5.so +%{_libdir}/apache/libphp7.so %{_bindir}/php %{_bindir}/php_cgi %{_mandir}/man1/php.1* diff --git a/netware/start.c b/netware/start.c index e0569b1b89..d2445bbda0 100644 --- a/netware/start.c +++ b/netware/start.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/php.ini-development b/php.ini-development index 562816fc44..594ddb6ceb 100644 --- a/php.ini-development +++ b/php.ini-development @@ -867,8 +867,8 @@ default_socket_timeout = 60 ; ; Windows Extensions ; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) -; extension folders as well as the separate PECL DLL download (PHP 5). +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). ; Be sure to appropriately set the extension_dir directive. ; ;extension=php_bz2.dll @@ -1758,7 +1758,7 @@ mssql.secure_connection = Off ;mbstring.encoding_translation = Off ; automatic encoding detection order. -; "auto" detect order is changed accoding to mbstring.language +; "auto" detect order is changed according to mbstring.language ; http://php.net/mbstring.detect-order ;mbstring.detect_order = auto diff --git a/php.ini-production b/php.ini-production index 34f91fe293..c07ed21c38 100644 --- a/php.ini-production +++ b/php.ini-production @@ -865,8 +865,8 @@ default_socket_timeout = 60 ; ; Windows Extensions ; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) -; extension folders as well as the separate PECL DLL download (PHP 5). +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). ; Be sure to appropriately set the extension_dir directive. ; ;extension=php_bz2.dll @@ -1756,7 +1756,7 @@ mssql.secure_connection = Off ;mbstring.encoding_translation = Off ; automatic encoding detection order. -; "auto" detect order is changed accoding to mbstring.language +; "auto" detect order is changed according to mbstring.language ; http://php.net/mbstring.detect-order ;mbstring.detect_order = auto diff --git a/php5.spec.in b/php7.spec.in index 97a84b5fb2..97a84b5fb2 100644 --- a/php5.spec.in +++ b/php7.spec.in diff --git a/run-tests.php b/run-tests.php index 1b5bcec253..7de8cf8001 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2,7 +2,7 @@ <?php /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ @@ -1189,6 +1189,7 @@ function run_test($php, $file, $env) global $no_clean; global $valgrind_version; global $JUNIT; + global $SHOW_ONLY_GROUPS; $temp_filenames = null; $org_file = $file; @@ -1363,7 +1364,9 @@ TEST $file } } - show_test($test_idx, $shortname); + if (!$SHOW_ONLY_GROUPS) { + show_test($test_idx, $shortname); + } if (is_array($IN_REDIRECT)) { $temp_dir = $test_dir = $IN_REDIRECT['dir']; @@ -2569,7 +2572,7 @@ function show_result($result, $tested, $tested_file, $extra = '', $temp_filename if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) { echo "$result $tested [$tested_file] $extra\n"; - } else { + } else if (!$SHOW_ONLY_GROUPS) { // Write over the last line to avoid random trailing chars on next echo echo str_repeat(" ", $line_length), "\r"; } diff --git a/sapi/aolserver/README b/sapi/aolserver/README index 80c186ea5d..86af6a54b3 100644 --- a/sapi/aolserver/README +++ b/sapi/aolserver/README @@ -60,7 +60,7 @@ Then enable the PHP module: ns_section "ns/server/${servername}/modules" ... -ns_param php ${bindir}/libphp5.so +ns_param php ${bindir}/libphp7.so ============================================================================= diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c index 13091b908a..2796dd23a5 100644 --- a/sapi/aolserver/aolserver.c +++ b/sapi/aolserver/aolserver.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/aolserver/php5aolserver.dsp b/sapi/aolserver/php5aolserver.dsp deleted file mode 100644 index dd6ad71c53..0000000000 --- a/sapi/aolserver/php5aolserver.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5aolserver" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5aolserver - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5aolserver.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5aolserver.mak" CFG="php5aolserver - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5aolserver - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5aolserver - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5aolserver - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5aolserver - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "NDEBUG" /D "PHP5AOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 nsd.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /out:"../../Release_TS/php5aolserver.so" /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5aolserver - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS_inline"
-# PROP BASE Intermediate_Dir "Release_TS_inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "PHPAOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 nsd.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /out:"../../Release_TS_inline/php5aolserver.so" /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5aolserver - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PHP5AOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 nsd.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /debug /machine:I386 /out:"..\..\Debug_TS/php5aolserver.so" /pdbtype:sept /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5aolserver - Win32 Release_TS"
-# Name "php5aolserver - Win32 Release_TS_inline"
-# Name "php5aolserver - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\aolserver.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/sapi/apache/apMakefile.tmpl b/sapi/apache/apMakefile.tmpl index 5f77d9c9c9..c8b174775e 100644 --- a/sapi/apache/apMakefile.tmpl +++ b/sapi/apache/apMakefile.tmpl @@ -1,38 +1,38 @@ ## -## Apache 1.3 Makefile template for PHP 5.0 Module -## [src/modules/php5/Makefile.tmpl] +## Apache 1.3 Makefile template for PHP 7.0 Module +## [src/modules/php7/Makefile.tmpl] ## # the parametrized target -LIB=libphp5.$(LIBEXT) +LIB=libphp7.$(LIBEXT) # objects for building the static library -OBJS=mod_php5.o -OBJS_LIB=libmodphp5.a +OBJS=mod_php7.o +OBJS_LIB=libmodphp7.a # objects for building the shared object library -SHLIB_OBJS=mod_php5.so-o -SHLIB_OBJS_LIB=libmodphp5.a +SHLIB_OBJS=mod_php7.so-o +SHLIB_OBJS_LIB=libmodphp7.a # the general targets all: lib lib: $(LIB) # build the static library by merging the object files -libphp5.a: $(OBJS) $(OBJS_LIB) +libphp7.a: $(OBJS) $(OBJS_LIB) cp $(OBJS_LIB) $@ ar r $@ $(OBJS) $(RANLIB) $@ # ugly hack to support older Apache-1.3 betas that don't set $LIBEXT -libphp5.: $(OBJS) $(OBJS_LIB) +libphp7.: $(OBJS) $(OBJS_LIB) cp $(OBJS_LIB) $@ ar r $@ $(OBJS) $(RANLIB) $@ - cp libphp5. libphp5.a + cp libphp7. libphp7.a # build the shared object library by linking the object files -libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) +libphp7.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) rm -f $@ $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS) @@ -69,9 +69,9 @@ depend: $(OBJS): Makefile # DO NOT REMOVE -mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ +mod_php7.o: mod_php7.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ $(INCDIR)/buff.h \ $(INCDIR)/http_config.h \ $(INCDIR)/http_core.h $(INCDIR)/http_main.h \ $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ - $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php5.h + $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php7.h diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 index 7b0ee562eb..f5bfde4d68 100644 --- a/sapi/apache/config.m4 +++ b/sapi/apache/config.m4 @@ -78,7 +78,7 @@ if test "$PHP_APXS" != "no"; then *darwin*) MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD" PHP_SUBST(MH_BUNDLE_FLAGS) - SAPI_SHARED=libs/libphp5.so + SAPI_SHARED=libs/libphp7.so build_type=bundle ;; *) @@ -86,26 +86,26 @@ if test "$PHP_APXS" != "no"; then ;; esac - PHP_SELECT_SAPI(apache, $build_type, sapi_apache.c mod_php5.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) + PHP_SELECT_SAPI(apache, $build_type, sapi_apache.c mod_php7.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) # Test whether apxs support -S option $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1 if test "$?" != "0"; then - APACHE_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option + APACHE_INSTALL="$APXS -i -a -n php7 $SAPI_SHARED" # Old apxs does not have -S option else APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` if test -z `$APXS -q SYSCONFDIR`; then APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5 $SAPI_SHARED" + -i -n php7 $SAPI_SHARED" else APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5 $SAPI_SHARED" + -i -a -n php7 $SAPI_SHARED" fi fi @@ -135,7 +135,7 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then PHP_APACHE=/usr/local/apache fi - APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php5.* sapi/apache/libphp5.module" + APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php7.* sapi/apache/libphp7.module" AC_DEFINE(HAVE_APACHE,1,[ ]) APACHE_MODULE=yes @@ -144,7 +144,7 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then if test -f $PHP_APACHE/src/httpd.h; then APACHE_INCLUDE=-I$PHP_APACHE/src APACHE_TARGET=$PHP_APACHE/src - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) + PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET" PHP_LIBS="-L. -lphp3" AC_MSG_RESULT([yes - Apache 1.2.x]) @@ -159,13 +159,13 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then elif test -f $PHP_APACHE/src/main/httpd.h; then APACHE_HAS_REGEX=1 APACHE_INCLUDE="-I$PHP_APACHE/src/main -I$PHP_APACHE/src/os/unix -I$PHP_APACHE/src/ap" - APACHE_TARGET=$PHP_APACHE/src/modules/php5 + APACHE_TARGET=$PHP_APACHE/src/modules/php7 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" + PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) + APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp7.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + PHP_LIBS="-Lmodules/php7 -L../modules/php7 -L../../modules/php7 -lmodphp7" AC_MSG_RESULT([yes - Apache 1.3.x]) STRONGHOLD= if test -f $PHP_APACHE/src/include/ap_config.h; then @@ -183,13 +183,13 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then elif test -f $PHP_APACHE/src/include/httpd.h; then APACHE_HAS_REGEX=1 APACHE_INCLUDE="-I$PHP_APACHE/src/include -I$PHP_APACHE/src/os/unix" - APACHE_TARGET=$PHP_APACHE/src/modules/php5 + APACHE_TARGET=$PHP_APACHE/src/modules/php7 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) + PHP_LIBS="-Lmodules/php7 -L../modules/php7 -L../../modules/php7 -lmodphp7" + APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp7.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" AC_MSG_RESULT([yes - Apache 1.3.x]) STRONGHOLD= if test -f $PHP_APACHE/src/include/ap_config.h; then @@ -207,9 +207,9 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then elif test -f $PHP_APACHE/apache/httpd.h; then APACHE_INCLUDE="-I$PHP_APACHE/apache -I$PHP_APACHE/ssl/include" APACHE_TARGET=$PHP_APACHE/apache - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET" + PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) + PHP_LIBS="-Lmodules/php7 -L../modules/php7 -L../../modules/php7 -lmodphp7" + APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp7.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET" STRONGHOLD=-DSTRONGHOLD=1 AC_MSG_RESULT([yes - StrongHold]) if test -f $PHP_APACHE/apache/ap_config.h; then @@ -247,13 +247,13 @@ dnl Build as static module if test "$APACHE_MODULE" = "yes"; then PHP_TARGET_RDYNAMIC $php_shtool mkdir -p sapi/apache - PHP_OUTPUT(sapi/apache/libphp5.module) + PHP_OUTPUT(sapi/apache/libphp7.module) fi dnl General if test -n "$APACHE_INSTALL"; then if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then - APXS_EXP=-bE:sapi/apache/mod_php5.exp + APXS_EXP=-bE:sapi/apache/mod_php7.exp fi PHP_APACHE_FD_CHECK diff --git a/sapi/apache/config.w32 b/sapi/apache/config.w32 index e876d7500e..e5b72f1bcf 100644 --- a/sapi/apache/config.w32 +++ b/sapi/apache/config.w32 @@ -15,9 +15,9 @@ if (PHP_APACHE != "no") { ";" + PHP_PHP_BUILD + "\\apache\\src\\corer")) { // We need to play tricks to get our readdir.h used by apache // headers - SAPI('apache', 'mod_php5.c sapi_apache.c php_apache.c', + SAPI('apache', 'mod_php7.c sapi_apache.c php_apache.c', 'php' + PHP_VERSION + 'apache.dll', - '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32'); + '/D APACHEPHP7_EXPORTS /D APACHE_READDIR_H /I win32'); } else { WARNING("Could not find apache libraries/headers"); } diff --git a/sapi/apache/libphp5.module.in b/sapi/apache/libphp7.module.in index 00d9c49f40..892df4d5cc 100644 --- a/sapi/apache/libphp5.module.in +++ b/sapi/apache/libphp7.module.in @@ -1,4 +1,4 @@ -Name: php5_module +Name: php7_module ConfigStart RULE_WANTHSREGEX=no RULE_HIDE=yes diff --git a/sapi/apache/libpre.c b/sapi/apache/libpre.c index ca10e34cdd..f7ab68b62c 100644 --- a/sapi/apache/libpre.c +++ b/sapi/apache/libpre.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/apache/mod_php5.exp b/sapi/apache/mod_php5.exp deleted file mode 100644 index 9ad0f0a0ad..0000000000 --- a/sapi/apache/mod_php5.exp +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php7.c index 04ff6e5d30..687586952f 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php7.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -60,12 +60,12 @@ static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, HashTable *con static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); -/* ### these should be defined in mod_php5.h or somewhere else */ +/* ### these should be defined in mod_php7.h or somewhere else */ #define USE_PATH 1 #define IGNORE_URL 2 #define MAX_STATUS_LENGTH sizeof("xxxx LONGEST POSSIBLE STATUS DESCRIPTION") -module MODULE_VAR_EXPORT php5_module; +module MODULE_VAR_EXPORT php7_module; int saved_umask; static unsigned char apache_php_initialized; @@ -622,7 +622,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) return DECLINED; } - per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); + per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php7_module); if (per_dir_conf) { zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); } @@ -909,7 +909,7 @@ static int php_xbithack_handler(request_rec * r) if (!(r->finfo.st_mode & S_IXUSR)) { return DECLINED; } - per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); + per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php7_module); if (per_dir_conf) { zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); } @@ -1006,9 +1006,9 @@ command_rec php_commands[] = }; /* }}} */ -/* {{{ odule MODULE_VAR_EXPORT php5_module +/* {{{ odule MODULE_VAR_EXPORT php7_module */ -module MODULE_VAR_EXPORT php5_module = +module MODULE_VAR_EXPORT php7_module = { STANDARD_MODULE_STUFF, php_init_handler, /* initializer */ diff --git a/sapi/apache/mod_php7.exp b/sapi/apache/mod_php7.exp new file mode 100644 index 0000000000..1469b0314d --- /dev/null +++ b/sapi/apache/mod_php7.exp @@ -0,0 +1 @@ +php7_module diff --git a/sapi/apache/mod_php5.h b/sapi/apache/mod_php7.h index 3bc7857380..947d8b44d4 100644 --- a/sapi/apache/mod_php5.h +++ b/sapi/apache/mod_php7.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -17,8 +17,8 @@ */ /* $Id$ */ -#ifndef MOD_PHP5_H -#define MOD_PHP5_H +#ifndef MOD_PHP7_H +#define MOD_PHP7_H #if !defined(WIN32) && !defined(WINNT) #ifndef MODULE_VAR_EXPORT @@ -50,7 +50,7 @@ extern php_apache_info_struct php_apache_info; # define MODULE_VAR_EXPORT PHPAPI #endif -#endif /* MOD_PHP5_H */ +#endif /* MOD_PHP7_H */ /* * Local variables: diff --git a/sapi/apache/php.sym b/sapi/apache/php.sym index 9ad0f0a0ad..1469b0314d 100644 --- a/sapi/apache/php.sym +++ b/sapi/apache/php.sym @@ -1 +1 @@ -php5_module +php7_module diff --git a/sapi/apache/php5apache.dsp b/sapi/apache/php5apache.dsp deleted file mode 100644 index fbdb7612b8..0000000000 --- a/sapi/apache/php5apache.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5apache - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5apache.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5apache.mak" CFG="php5apache - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5apache - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5apache - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5apache - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5apache - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\release" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" /libpath:"C:\Program Files\Apache Group\Apache\libexec"
-
-!ELSEIF "$(CFG)" == "php5apache - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts_debug.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /incremental:yes /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php_build\release" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" /libpath:"C:\Program Files\Apache Group\Apache\libexec"
-
-!ELSEIF "$(CFG)" == "php5apache - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS_inline"
-# PROP BASE Intermediate_Dir "Release_TS_inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\release" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" /libpath:"C:\Program Files\Apache Group\Apache\libexec"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5apache - Win32 Release_TS"
-# Name "php5apache - Win32 Debug_TS"
-# Name "php5apache - Win32 Release_TS_inline"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mod_php5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_apache.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\sapi_apache.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\mod_php5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_apache_http.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c index 3a88a1210e..f6e9e61203 100644 --- a/sapi/apache/php_apache.c +++ b/sapi/apache/php_apache.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h index a18e5dbac2..ed586372d7 100644 --- a/sapi/apache/php_apache_http.h +++ b/sapi/apache/php_apache_http.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -67,4 +67,4 @@ #include "php_ini.h" #include "ext/standard/php_standard.h" -#include "mod_php5.h" +#include "mod_php7.h" diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c index f19586da1f..466cf6b8ff 100644 --- a/sapi/apache/sapi_apache.c +++ b/sapi/apache/sapi_apache.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c index 6de4b3ab36..f87a04bbd1 100644 --- a/sapi/apache2filter/apache_config.c +++ b/sapi/apache2filter/apache_config.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4 index b6524fd874..11cc051015 100644 --- a/sapi/apache2filter/config.m4 +++ b/sapi/apache2filter/config.m4 @@ -71,14 +71,14 @@ if test "$PHP_APXS2FILTER" != "no"; then if test -z `$APXS -q SYSCONFDIR`; then INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5" + -i -n php7" else APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5" + -i -a -n php7" fi case $host_alias in @@ -101,7 +101,7 @@ if test "$PHP_APXS2FILTER" != "no"; then MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS" PHP_SUBST(MH_BUNDLE_FLAGS) PHP_SELECT_SAPI(apache2filter, bundle, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - SAPI_SHARED=libs/libphp5.so + SAPI_SHARED=libs/libphp7.so INSTALL_IT="$INSTALL_IT $SAPI_SHARED" ;; *beos*) diff --git a/sapi/apache2filter/php.sym b/sapi/apache2filter/php.sym index 9ad0f0a0ad..1469b0314d 100644 --- a/sapi/apache2filter/php.sym +++ b/sapi/apache2filter/php.sym @@ -1 +1 @@ -php5_module +php7_module diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h index 8410414dc0..7918cf6de8 100644 --- a/sapi/apache2filter/php_apache.h +++ b/sapi/apache2filter/php_apache.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -26,7 +26,7 @@ #include "http_core.h" /* Declare this so we can get to it from outside the sapi_apache2.c file */ -extern module AP_MODULE_DECLARE_DATA php5_module; +extern module AP_MODULE_DECLARE_DATA php7_module; /* A way to specify the location of the php.ini dir in an apache directive */ extern char *apache2_php_ini_path_override; diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c index 3a0b3ee0b9..ea137384f2 100644 --- a/sapi/apache2filter/php_functions.c +++ b/sapi/apache2filter/php_functions.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -22,7 +22,7 @@ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS #include "php.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/info.h" #include "SAPI.h" diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index 4fd45041ba..389686124d 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -30,7 +30,7 @@ #include "php_variables.h" #include "SAPI.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #ifndef NETWARE #include "ext/standard/php_standard.h" #else @@ -456,7 +456,7 @@ static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC) static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) { php_struct *ctx; - void *conf = ap_get_module_config(f->r->per_dir_config, &php5_module); + void *conf = ap_get_module_config(f->r->per_dir_config, &php7_module); char *p = get_php_config(conf, "engine", sizeof("engine")); zend_file_handle zfd; php_apr_bucket_brigade *pbb; @@ -740,7 +740,7 @@ static size_t php_apache_fsizer_stream(void *handle TSRMLS_DC) return 0; } -AP_MODULE_DECLARE_DATA module php5_module = { +AP_MODULE_DECLARE_DATA module php7_module = { STANDARD20_MODULE_STUFF, create_php_config, /* create per-directory config structure */ merge_php_config, /* merge per-directory config structures */ diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c index 09d42b5440..9eed8dba0f 100644 --- a/sapi/apache2handler/apache_config.c +++ b/sapi/apache2handler/apache_config.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 index a0080a654a..59e17393dd 100644 --- a/sapi/apache2handler/config.m4 +++ b/sapi/apache2handler/config.m4 @@ -70,20 +70,20 @@ if test "$PHP_APXS2" != "no"; then if test -z `$APXS -q SYSCONFDIR`; then INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5" + -i -n php7" else APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5" + -i -a -n php7" fi case $host_alias in *aix*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) + PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" ;; *darwin*) @@ -99,7 +99,7 @@ if test "$PHP_APXS2" != "no"; then fi MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS" PHP_SUBST(MH_BUNDLE_FLAGS) - PHP_SELECT_SAPI(apache2handler, bundle, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) + PHP_SELECT_SAPI(apache2handler, bundle, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) SAPI_SHARED=libs/libphp7.so INSTALL_IT="$INSTALL_IT $SAPI_SHARED" ;; @@ -107,11 +107,11 @@ if test "$PHP_APXS2" != "no"; then if test -f _APP_; then `rm _APP_`; fi `ln -s $APXS_BINDIR/httpd _APP_` EXTRA_LIBS="$EXTRA_LIBS _APP_" - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) + PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" ;; *) - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) + PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" ;; esac diff --git a/sapi/apache2handler/config.w32 b/sapi/apache2handler/config.w32 index a7547514d8..d15dcfaf03 100644 --- a/sapi/apache2handler/config.w32 +++ b/sapi/apache2handler/config.w32 @@ -11,7 +11,7 @@ if (PHP_APACHE2HANDLER != "no") { CHECK_LIB("libapr.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") && CHECK_LIB("libaprutil.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") ) { - SAPI('apache2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c', + SAPI('apache2handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c', 'php' + PHP_VERSION + 'apache2.dll', '/D PHP_APACHE2_EXPORTS /I win32'); } else { @@ -29,7 +29,7 @@ if (PHP_APACHE2_2HANDLER != "no") { CHECK_LIB("libapr-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") && CHECK_LIB("libaprutil-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") ) { - SAPI('apache2_2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c', + SAPI('apache2_2handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c', 'php' + PHP_VERSION + 'apache2_2.dll', '/D PHP_APACHE2_EXPORTS /I win32', 'sapi\\apache2_2handler'); @@ -47,7 +47,7 @@ if (PHP_APACHE2_4HANDLER != "no") { CHECK_LIB("libapr-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") && CHECK_LIB("libaprutil-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") ) { - SAPI('apache2_4handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c', + SAPI('apache2_4handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c', 'php' + PHP_VERSION + 'apache2_4.dll', '/D PHP_APACHE2_EXPORTS /I win32', 'sapi\\apache2handler'); diff --git a/sapi/apache2handler/mod_php5.c b/sapi/apache2handler/mod_php7.c index 4a01ebfd5f..ddc98e153c 100644 --- a/sapi/apache2handler/mod_php5.c +++ b/sapi/apache2handler/mod_php7.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -25,7 +25,7 @@ #include "php.h" #include "php_apache.h" -AP_MODULE_DECLARE_DATA module php5_module = { +AP_MODULE_DECLARE_DATA module php7_module = { STANDARD20_MODULE_STUFF, create_php_config, /* create per-directory config structure */ merge_php_config, /* merge per-directory config structures */ diff --git a/sapi/apache2handler/php.sym b/sapi/apache2handler/php.sym index 9ad0f0a0ad..1469b0314d 100644 --- a/sapi/apache2handler/php.sym +++ b/sapi/apache2handler/php.sym @@ -1 +1 @@ -php5_module +php7_module diff --git a/sapi/apache2handler/php5apache2.dsp b/sapi/apache2handler/php5apache2.dsp deleted file mode 100644 index 40cd58cb92..0000000000 --- a/sapi/apache2handler/php5apache2.dsp +++ /dev/null @@ -1,146 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5apache2 - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5apache2.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5apache2.mak" CFG="php5apache2 - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5apache2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5apache2 - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5apache2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5apache2 - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5apache2 - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS_inline"
-# PROP BASE Intermediate_Dir "Release_TS_inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS_inline/php5apache2.dll" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5apache2 - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5apache2 - Win32 Release_TS"
-# Name "php5apache2 - Win32 Release_TS_inline"
-# Name "php5apache2 - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\apache_config.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mod_php5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_functions.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\sapi_apache2.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_apache.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h index f1033c9539..f6f4f7a7c9 100644 --- a/sapi/apache2handler/php_apache.h +++ b/sapi/apache2handler/php_apache.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -29,7 +29,7 @@ #include "main/php_streams.h" /* Declare this so we can get to it from outside the sapi_apache2.c file */ -extern module AP_MODULE_DECLARE_DATA php5_module; +extern module AP_MODULE_DECLARE_DATA php7_module; /* A way to specify the location of the php.ini dir in an apache directive */ extern char *apache2_php_ini_path_override; diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index 084f411c2f..d9ae4d97ea 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -21,7 +21,7 @@ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS #include "php.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/info.h" #include "ext/standard/head.h" #include "php_ini.h" diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index d39a25a74e..fe200304fd 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -30,7 +30,7 @@ #include <fcntl.h> -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #ifndef NETWARE #include "ext/standard/php_standard.h" #else @@ -67,7 +67,7 @@ #define PHP_MAGIC_TYPE "application/x-httpd-php" #define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source" -#define PHP_SCRIPT "php5-script" +#define PHP_SCRIPT "php7-script" /* A way to specify the location of the php.ini dir in an apache directive */ char *apache2_php_ini_path_override = NULL; @@ -482,7 +482,11 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) r->no_local_copy = 1; content_length = (char *) apr_table_get(r->headers_in, "Content-Length"); - SG(request_info).content_length = (content_length ? atol(content_length) : 0); + if (content_length) { + ZEND_ATOL(SG(request_info).content_length, content_length); + } else { + SG(request_info).content_length = 0; + } apr_table_unset(r->headers_out, "Content-Length"); apr_table_unset(r->headers_out, "Last-Modified"); @@ -515,7 +519,7 @@ typedef struct { HashTable config; } php_conf_rec; zend_string *str; - php_conf_rec *c = ap_get_module_config(r->per_dir_config, &php5_module); + php_conf_rec *c = ap_get_module_config(r->per_dir_config, &php7_module); ZEND_HASH_FOREACH_STR_KEY(&c->config, str) { zend_restore_ini_entry(str, ZEND_INI_STAGE_SHUTDOWN); @@ -540,7 +544,7 @@ static int php_handler(request_rec *r) #define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC); - conf = ap_get_module_config(r->per_dir_config, &php5_module); + conf = ap_get_module_config(r->per_dir_config, &php7_module); /* apply_config() needs r in some cases, so allocate server_context early */ ctx = SG(server_context); diff --git a/sapi/apache_hooks/apMakefile.tmpl b/sapi/apache_hooks/apMakefile.tmpl index 4054e8e119..1e5e465f65 100644 --- a/sapi/apache_hooks/apMakefile.tmpl +++ b/sapi/apache_hooks/apMakefile.tmpl @@ -1,38 +1,38 @@ ## ## Apache 1.3 Makefile template for PHP 4.0 Module -## [src/modules/php5/Makefile.tmpl] +## [src/modules/php7/Makefile.tmpl] ## # the parametrized target -LIB=libphp5.$(LIBEXT) +LIB=libphp7.$(LIBEXT) # objects for building the static library -OBJS=mod_php5.o -OBJS_LIB=libmodphp5.a +OBJS=mod_php7.o +OBJS_LIB=libmodphp7.a # objects for building the shared object library -SHLIB_OBJS=mod_php5.so-o -SHLIB_OBJS_LIB=libmodphp5.a +SHLIB_OBJS=mod_php7.so-o +SHLIB_OBJS_LIB=libmodphp7.a # the general targets all: lib lib: $(LIB) # build the static library by merging the object files -libphp5.a: $(OBJS) $(OBJS_LIB) +libphp7.a: $(OBJS) $(OBJS_LIB) cp $(OBJS_LIB) $@ ar r $@ $(OBJS) $(RANLIB) $@ # ugly hack to support older Apache-1.3 betas that don't set $LIBEXT -libphp5.: $(OBJS) $(OBJS_LIB) +libphp7.: $(OBJS) $(OBJS_LIB) cp $(OBJS_LIB) $@ ar r $@ $(OBJS) $(RANLIB) $@ - cp libphp5. libphp5.a + cp libphp7. libphp7.a # build the shared object library by linking the object files -libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) +libphp7.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) rm -f $@ $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS) @@ -69,9 +69,9 @@ depend: $(OBJS): Makefile # DO NOT REMOVE -mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ +mod_php7.o: mod_php7.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ $(INCDIR)/buff.h \ $(INCDIR)/http_config.h \ $(INCDIR)/http_core.h $(INCDIR)/http_main.h \ $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ - $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php5.h + $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php7.h diff --git a/sapi/apache_hooks/config.m4 b/sapi/apache_hooks/config.m4 index e2c71b4274..a1ee213492 100644 --- a/sapi/apache_hooks/config.m4 +++ b/sapi/apache_hooks/config.m4 @@ -79,7 +79,7 @@ if test "$PHP_APACHE_HOOKS" != "no"; then *darwin*) MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD" PHP_SUBST(MH_BUNDLE_FLAGS) - SAPI_SHARED=libs/libphp5.so + SAPI_SHARED=libs/libphp7.so build_type=bundle ;; *) @@ -87,26 +87,26 @@ if test "$PHP_APACHE_HOOKS" != "no"; then ;; esac - PHP_SELECT_SAPI(apache_hooks, $build_type, sapi_apache.c mod_php5.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) + PHP_SELECT_SAPI(apache_hooks, $build_type, sapi_apache.c mod_php7.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) # Test whether apxs support -S option $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1 if test "$?" != "0"; then - APACHE_HOOKS_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option + APACHE_HOOKS_INSTALL="$APXS -i -a -n php7 $SAPI_SHARED" # Old apxs does not have -S option else APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` if test -z `$APXS -q SYSCONFDIR`; then APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5 $SAPI_SHARED" + -i -n php7 $SAPI_SHARED" else APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5 $SAPI_SHARED" + -i -a -n php7 $SAPI_SHARED" fi fi @@ -137,7 +137,7 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$ PHP_APACHE_HOOKS_STATIC=/usr/local/apache fi - APACHE_HOOKS_INSTALL_FILES="\$(srcdir)/sapi/apache_hooks/mod_php5.* sapi/apache_hooks/libphp5.module" + APACHE_HOOKS_INSTALL_FILES="\$(srcdir)/sapi/apache_hooks/mod_php7.* sapi/apache_hooks/libphp7.module" AC_DEFINE(HAVE_APACHE,1,[ ]) APACHE_HOOKS_MODULE=yes @@ -146,7 +146,7 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$ if test -f $PHP_APACHE_HOOKS_STATIC/src/httpd.h; then APACHE_INCLUDE=-I$PHP_APACHE_HOOKS_STATIC/src APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) + PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET" PHP_LIBS="-L. -lphp3" AC_MSG_RESULT([yes - Apache 1.2.x]) @@ -161,13 +161,13 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$ elif test -f $PHP_APACHE_HOOKS_STATIC/src/main/httpd.h; then APACHE_HAS_REGEX=1 APACHE_INCLUDE="-I$PHP_APACHE_HOOKS_STATIC/src/main -I$PHP_APACHE_HOOKS_STATIC/src/os/unix -I$PHP_APACHE_HOOKS_STATIC/src/ap" - APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src/modules/php5 + APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src/modules/php7 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" + PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) + APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp7.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + PHP_LIBS="-Lmodules/php7 -L../modules/php7 -L../../modules/php7 -lmodphp7" AC_MSG_RESULT([yes - Apache 1.3.x]) STRONGHOLD= if test -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_config.h; then @@ -185,13 +185,13 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$ elif test -f $PHP_APACHE_HOOKS_STATIC/src/include/httpd.h; then APACHE_HAS_REGEX=1 APACHE_INCLUDE="-I$PHP_APACHE_HOOKS_STATIC/src/include -I$PHP_APACHE_HOOKS_STATIC/src/os/unix" - APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src/modules/php5 + APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src/modules/php7 if test ! -d $APACHE_TARGET; then mkdir $APACHE_TARGET fi - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) + PHP_LIBS="-Lmodules/php7 -L../modules/php7 -L../../modules/php7 -lmodphp7" + APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp7.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" AC_MSG_RESULT([yes - Apache 1.3.x]) STRONGHOLD= if test -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_config.h; then @@ -209,9 +209,9 @@ if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$ elif test -f $PHP_APACHE_HOOKS_STATIC/apache/httpd.h; then APACHE_INCLUDE="-I$PHP_APACHE_HOOKS_STATIC/apache -I$PHP_APACHE_HOOKS_STATIC/ssl/include" APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/apache - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET" + PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php7.c php_apache.c, $APACHE_INCLUDE) + PHP_LIBS="-Lmodules/php7 -L../modules/php7 -L../../modules/php7 -lmodphp7" + APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp7.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET" STRONGHOLD=-DSTRONGHOLD=1 AC_MSG_RESULT([yes - StrongHold]) if test -f $PHP_APACHE_HOOKS_STATIC/apache/ap_config.h; then @@ -249,13 +249,13 @@ dnl Build as static module if test "$APACHE_HOOKS_MODULE" = "yes"; then PHP_TARGET_RDYNAMIC $php_shtool mkdir -p sapi/apache_hooks - PHP_OUTPUT(sapi/apache_hooks/libphp5.module) + PHP_OUTPUT(sapi/apache_hooks/libphp7.module) fi dnl General if test -n "$APACHE_HOOKS_INSTALL"; then if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then - APXS_EXP=-bE:sapi/apache_hooks/mod_php5.exp + APXS_EXP=-bE:sapi/apache_hooks/mod_php7.exp fi PHP_APACHE_FD_CHECK diff --git a/sapi/apache_hooks/config.w32 b/sapi/apache_hooks/config.w32 index 85dc624d60..1c9129e615 100644 --- a/sapi/apache_hooks/config.w32 +++ b/sapi/apache_hooks/config.w32 @@ -12,9 +12,9 @@ if (PHP_APACHE_HOOKS != "no") { ";" + PHP_PHP_BUILD + "\\apache\\src\\corer")) { // We need to play tricks to get our readdir.h used by apache // headers - SAPI('apache_hooks', 'mod_php5.c sapi_apache.c php_apache.c', + SAPI('apache_hooks', 'mod_php7.c sapi_apache.c php_apache.c', 'php' + PHP_VERSION + 'apache_hooks.dll', - '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32'); + '/D APACHEPHP7_EXPORTS /D APACHE_READDIR_H /I win32'); } else { WARNING("Could not find apache libraries/headers"); } diff --git a/sapi/apache_hooks/libphp5.module.in b/sapi/apache_hooks/libphp7.module.in index 8488181897..5bea79ef95 100644 --- a/sapi/apache_hooks/libphp5.module.in +++ b/sapi/apache_hooks/libphp7.module.in @@ -1,4 +1,4 @@ -Name: php5_module +Name: php7_module ConfigStart RULE_WANTHSREGEX=no RULE_HIDE=yes diff --git a/sapi/apache_hooks/mod_php5.exp b/sapi/apache_hooks/mod_php5.exp deleted file mode 100644 index 9ad0f0a0ad..0000000000 --- a/sapi/apache_hooks/mod_php5.exp +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php7.c index 901d3b57a3..33e0931fb6 100644 --- a/sapi/apache_hooks/mod_php5.c +++ b/sapi/apache_hooks/mod_php7.c @@ -84,11 +84,11 @@ static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, php_per_dir_co static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); -/* ### these should be defined in mod_php5.h or somewhere else */ +/* ### these should be defined in mod_php7.h or somewhere else */ #define USE_PATH 1 #define IGNORE_URL 2 -module MODULE_VAR_EXPORT php5_module; +module MODULE_VAR_EXPORT php7_module; int saved_umask; /* static int setup_env = 0; */ @@ -667,7 +667,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) return DECLINED; } - per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); if (per_dir_conf) { zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); } @@ -934,7 +934,7 @@ static CONST_PREFIX char *php_set_server_handler(server_rec *s, char *arg1, long handler->type = handler_type; handler->stage = handler_stage; handler->name = strdup(arg1); - conf = get_module_config(s->module_config, &php5_module); + conf = get_module_config(s->module_config, &php7_module); switch(handler_stage) { case AP_URI_TRANS: sapi_stack_push(&conf->uri_handlers, handler); @@ -1184,7 +1184,7 @@ static int php_xbithack_handler(request_rec * r) r->allowed |= (1 << METHODS) - 1; return DECLINED; } - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); if (conf) { zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); } @@ -1266,7 +1266,7 @@ static int php_run_hook(php_handler *handler, request_rec *r) TSRMLS_FETCH(); if(!AP(apache_config_loaded)) { - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); if (conf) zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); AP(apache_config_loaded) = 1; @@ -1298,7 +1298,7 @@ static int php_uri_translation(request_rec *r) php_per_server_config *conf; TSRMLS_FETCH(); AP(current_hook) = AP_URI_TRANS; - conf = (php_per_server_config *) get_module_config(r->server->module_config, &php5_module); + conf = (php_per_server_config *) get_module_config(r->server->module_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_equals(&conf->uri_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r, OK); @@ -1309,7 +1309,7 @@ static int php_header_hook(request_rec *r) php_per_dir_config *conf; TSRMLS_FETCH(); AP(current_hook) = AP_HEADER_PARSE; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_http_error(&conf->headers_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); @@ -1320,7 +1320,7 @@ static int php_auth_hook(request_rec *r) php_per_dir_config *conf; TSRMLS_FETCH(); AP(current_hook) = AP_AUTHENTICATION; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_equals(&conf->auth_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r, OK); @@ -1332,7 +1332,7 @@ static int php_access_hook(request_rec *r) int status = DECLINED; TSRMLS_FETCH(); AP(current_hook) = AP_ACCESS_CONTROL; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); status = sapi_stack_apply_with_argument_stop_if_http_error(&conf->access_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); @@ -1345,7 +1345,7 @@ static int php_type_hook(request_rec *r) php_per_dir_config *conf; TSRMLS_FETCH(); AP(current_hook) = AP_TYPE_CHECKING; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_equals(&conf->type_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, @@ -1357,7 +1357,7 @@ static int php_fixup_hook(request_rec *r) php_per_dir_config *conf; TSRMLS_FETCH(); AP(current_hook) = AP_FIXUP; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_http_error(&conf->fixup_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, @@ -1369,7 +1369,7 @@ static int php_logger_hook(request_rec *r) php_per_dir_config *conf; TSRMLS_FETCH(); AP(current_hook) = AP_LOGGING; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_http_error(&conf->logger_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, @@ -1382,11 +1382,11 @@ static int php_post_read_hook(request_rec *r) php_per_server_config *svr; TSRMLS_FETCH(); AP(current_hook) = AP_POST_READ; - svr = get_module_config(r->server->module_config, &php5_module); + svr = get_module_config(r->server->module_config, &php7_module); if(ap_is_initial_req(r)) { sapi_stack_apply_with_argument_all(&svr->requires, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); } - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_http_error(&conf->post_read_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); @@ -1397,7 +1397,7 @@ static int php_response_handler(request_rec *r) php_per_dir_config *conf; TSRMLS_FETCH(); AP(current_hook) = AP_RESPONSE; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); + conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_all(&conf->response_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); } @@ -1449,9 +1449,9 @@ command_rec php_commands[] = }; /* }}} */ -/* {{{ module MODULE_VAR_EXPORT php5_module +/* {{{ module MODULE_VAR_EXPORT php7_module */ -module MODULE_VAR_EXPORT php5_module = +module MODULE_VAR_EXPORT php7_module = { STANDARD_MODULE_STUFF, php_init_handler, /* initializer */ diff --git a/sapi/apache_hooks/mod_php7.exp b/sapi/apache_hooks/mod_php7.exp new file mode 100644 index 0000000000..1469b0314d --- /dev/null +++ b/sapi/apache_hooks/mod_php7.exp @@ -0,0 +1 @@ +php7_module diff --git a/sapi/apache_hooks/mod_php5.h b/sapi/apache_hooks/mod_php7.h index 3db828ec83..325ae1f721 100644 --- a/sapi/apache_hooks/mod_php5.h +++ b/sapi/apache_hooks/mod_php7.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -17,8 +17,8 @@ */ /* $Id$ */ -#ifndef MOD_PHP5_H -#define MOD_PHP5_H +#ifndef MOD_PHP7_H +#define MOD_PHP7_H #if !defined(WIN32) && !defined(WINNT) #ifndef MODULE_VAR_EXPORT @@ -78,7 +78,7 @@ extern php_apache_info_struct php_apache_info; # define MODULE_VAR_EXPORT PHPAPI #endif -#endif /* MOD_PHP5_H */ +#endif /* MOD_PHP7_H */ /* * Local variables: diff --git a/sapi/apache_hooks/php.sym b/sapi/apache_hooks/php.sym index 9ad0f0a0ad..1469b0314d 100644 --- a/sapi/apache_hooks/php.sym +++ b/sapi/apache_hooks/php.sym @@ -1 +1 @@ -php5_module +php7_module diff --git a/sapi/apache_hooks/php5apache_hooks.dsp b/sapi/apache_hooks/php5apache_hooks.dsp deleted file mode 100755 index cc60f4b3b1..0000000000 --- a/sapi/apache_hooks/php5apache_hooks.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache_hooks" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5apache_hooks - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5apache_hooks.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5apache_hooks.mak" CFG="php5apache_hooks - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5apache_hooks - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5apache_hooks - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5apache_hooks - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5apache_hooks - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\apache\src\corer" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5apache_hooks - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts_debug.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php5apache_hooks.dll" /pdbtype:sept /libpath:"..\..\..\php_build\apache\src\cored" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS"
-
-!ELSEIF "$(CFG)" == "php5apache_hooks - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS_inline"
-# PROP BASE Intermediate_Dir "Release_TS_inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"\apache\src\corer" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5apache_hooks - Win32 Release_TS"
-# Name "php5apache_hooks - Win32 Debug_TS"
-# Name "php5apache_hooks - Win32 Release_TS_inline"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mod_php5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_apache.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\sapi_apache.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\mod_php5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_apache_http.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c index 8045bbce32..e5bd3f5d61 100644 --- a/sapi/apache_hooks/php_apache.c +++ b/sapi/apache_hooks/php_apache.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/apache_hooks/php_apache_http.h b/sapi/apache_hooks/php_apache_http.h index 23cf7fea69..e6610741c7 100644 --- a/sapi/apache_hooks/php_apache_http.h +++ b/sapi/apache_hooks/php_apache_http.h @@ -36,7 +36,7 @@ #include "php_ini.h" #include "ext/standard/php_standard.h" -#include "mod_php5.h" +#include "mod_php7.h" zval *php_apache_request_new(request_rec *r); diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c index 9ed93aea6d..daaad4e39d 100644 --- a/sapi/apache_hooks/sapi_apache.c +++ b/sapi/apache_hooks/sapi_apache.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c index 946f7a039e..b1ffddb460 100644 --- a/sapi/caudium/caudium.c +++ b/sapi/caudium/caudium.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -38,7 +38,7 @@ */ #define NO_PIKE_SHORTHAND -/* Ok, we are now using Pike level threads to handle PHP5 since +/* Ok, we are now using Pike level threads to handle PHP7 since * the nice th_farm threads aren't working on Linux with glibc 2.2 * (why this is I don't know). */ @@ -79,7 +79,7 @@ #endif #ifndef PIKE_THREADS -#error The PHP5 module requires that your Pike has thread support. +#error The PHP7 module requires that your Pike has thread support. #endif #undef HIDE_GLOBAL_VARIABLES @@ -625,7 +625,7 @@ static void php_caudium_module_main(php_caudium_request *ureq) SG(request_info).headers_only = 0; } - /* Let PHP5 handle the deconding of the AUTH */ + /* Let PHP7 handle the deconding of the AUTH */ php_handle_auth_data(lookup_string_header("HTTP_AUTHORIZATION", NULL), TSRMLS_C); /* Swap out this thread and release the interpreter lock to allow * Pike threads to run. We wait since the above would otherwise require diff --git a/sapi/caudium/config.m4 b/sapi/caudium/config.m4 index 5ce55f3f01..13a6b2943e 100644 --- a/sapi/caudium/config.m4 +++ b/sapi/caudium/config.m4 @@ -79,12 +79,12 @@ if test "$PHP_CAUDIUM" != "no"; then AC_MSG_RESULT(not found) fi else - AC_MSG_ERROR([Caudium PHP5 requires Pike 7.0 or newer]) + AC_MSG_ERROR([Caudium PHP7 requires Pike 7.0 or newer]) fi PIKE_VERSION=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'` AC_DEFINE(HAVE_CAUDIUM,1,[Whether to compile with Caudium support]) PHP_SELECT_SAPI(caudium, shared, caudium.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_CAUDIUM/lib/$PIKE_VERSION/PHP5.so" + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_CAUDIUM/lib/$PIKE_VERSION/PHP7.so" RESULT=" *** Pike binary used: $PIKE *** Pike include dir(s) used: $PIKE_INCLUDE_DIR *** Pike version: $PIKE_VERSION" diff --git a/sapi/cgi/CHANGES b/sapi/cgi/CHANGES index de029474e5..b7cf41cf5e 100755 --- a/sapi/cgi/CHANGES +++ b/sapi/cgi/CHANGES @@ -31,4 +31,3 @@ In PHP5.3 all additional configure options (except --enable-cgi) are removed: Now it is disabled by default, but can be enabled with ini directive "cgi.discard_path=1". - diff --git a/sapi/cgi/README.FastCGI b/sapi/cgi/README.FastCGI index 3dda295d84..f0f11e102d 100644 --- a/sapi/cgi/README.FastCGI +++ b/sapi/cgi/README.FastCGI @@ -69,7 +69,7 @@ a line in your config like: Don't load mod_php, by the way. Make sure it is commented out! - #LoadModule php5_module /usr/lib/apache/2.0/libphp5.so + #LoadModule php7_module /usr/lib/apache/2.0/libphp7.so Now, we'll create a fcgi-bin directory, just like you would do with normal CGI scripts. You'll need to create a directory somewhere to store your diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index d73c4a3e71..dead1c3213 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -159,6 +159,8 @@ static const opt_struct OPTIONS[] = { }; typedef struct _php_cgi_globals_struct { + HashTable user_config_cache; + char *redirect_status_env; zend_bool rfc2616_headers; zend_bool nph; zend_bool check_shebang_line; @@ -166,11 +168,9 @@ typedef struct _php_cgi_globals_struct { zend_bool force_redirect; zend_bool discard_path; zend_bool fcgi_logging; - char *redirect_status_env; #ifdef PHP_WIN32 zend_bool impersonate; #endif - HashTable user_config_cache; } php_cgi_globals_struct; /* {{{ user_config_cache @@ -2405,8 +2405,8 @@ consult the installation file that came with this distribution, or visit \n\ /* handle situations where line is terminated by \r\n */ if (c == '\r') { if (fgetc(file_handle.handle.fp) != '\n') { - long pos = ftell(file_handle.handle.fp); - fseek(file_handle.handle.fp, pos - 1, SEEK_SET); + zend_long pos = zend_ftell(file_handle.handle.fp); + zend_fseek(file_handle.handle.fp, pos - 1, SEEK_SET); } } CG(start_lineno) = 2; diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c index 115c4289c0..0cd3096e4d 100644 --- a/sapi/cgi/fastcgi.c +++ b/sapi/cgi/fastcgi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1111,7 +1111,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy) shutdown(req->fd, 1); /* read the last FCGI_STDIN header (it may be omitted) */ - recv(req->fd, (char *)&buf, sizeof(buf), 0); + recv(req->fd, (char *)(&buf), sizeof(buf), 0); } closesocket(req->fd); } @@ -1121,7 +1121,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy) shutdown(req->fd, 1); /* read the last FCGI_STDIN header (it may be omitted) */ - recv(req->fd, &buf, sizeof(buf), 0); + recv(req->fd, (char *)(&buf), sizeof(buf), 0); } close(req->fd); #endif diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h index d5f141cd1b..4a30a207b1 100644 --- a/sapi/cgi/fastcgi.h +++ b/sapi/cgi/fastcgi.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h index b04f6c91f0..e49a203821 100644 --- a/sapi/cli/cli.h +++ b/sapi/cli/cli.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 index 9a1b98da46..090574a007 100644 --- a/sapi/cli/config.m4 +++ b/sapi/cli/config.m4 @@ -45,7 +45,7 @@ if test "$PHP_CLI" != "no"; then BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" ;; *netware*) - BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_BINARY_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -Lnetware -lphp5lib -o \$(SAPI_CLI_PATH)" + BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_BINARY_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -Lnetware -lphp7lib -o \$(SAPI_CLI_PATH)" ;; *) BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" diff --git a/sapi/cli/generate_mime_type_map.php b/sapi/cli/generate_mime_type_map.php index 4475004985..772569a426 100644 --- a/sapi/cli/generate_mime_type_map.php +++ b/sapi/cli/generate_mime_type_map.php @@ -30,7 +30,7 @@ array_walk($types, function ($line) use (&$extensions) { ?> /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/mime_type_map.h b/sapi/cli/mime_type_map.h index 72c05d4149..16f9b7f3ff 100644 --- a/sapi/cli/mime_type_map.h +++ b/sapi/cli/mime_type_map.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 2e714c4a90..04cbdeb8f1 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -627,8 +627,8 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, /* handle situations where line is terminated by \r\n */ if (c == '\r') { if (fgetc(file_handle->handle.fp) != '\n') { - long pos = ftell(file_handle->handle.fp); - fseek(file_handle->handle.fp, pos - 1, SEEK_SET); + zend_long pos = zend_ftell(file_handle->handle.fp); + zend_fseek(file_handle->handle.fp, pos - 1, SEEK_SET); } } *lineno = 2; diff --git a/sapi/cli/php_cli_process_title.c b/sapi/cli/php_cli_process_title.c index 24f26f383c..28fbdfb518 100644 --- a/sapi/cli/php_cli_process_title.c +++ b/sapi/cli/php_cli_process_title.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/php_cli_process_title.h b/sapi/cli/php_cli_process_title.h index bd44d99111..b93947a81f 100644 --- a/sapi/cli/php_cli_process_title.h +++ b/sapi/cli/php_cli_process_title.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 88a1010db1..909e91e3fa 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -96,7 +96,7 @@ #endif #include "ext/standard/file.h" /* for php_set_sock_blocking() :-( */ -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "ext/standard/html.h" #include "ext/standard/url.h" /* for php_url_decode() */ #include "ext/standard/php_string.h" /* for php_dirname() */ @@ -380,11 +380,11 @@ static void append_http_status_line(smart_str *buffer, int protocol_version, int } smart_str_appendl_ex(buffer, "HTTP", 4, persistent); smart_str_appendc_ex(buffer, '/', persistent); - smart_str_append_generic_ex(buffer, protocol_version / 100, persistent, int, _unsigned); + smart_str_append_long_ex(buffer, protocol_version / 100, persistent); smart_str_appendc_ex(buffer, '.', persistent); - smart_str_append_generic_ex(buffer, protocol_version % 100, persistent, int, _unsigned); + smart_str_append_long_ex(buffer, protocol_version % 100, persistent); smart_str_appendc_ex(buffer, ' ', persistent); - smart_str_append_generic_ex(buffer, response_code, persistent, int, _unsigned); + smart_str_append_long_ex(buffer, response_code, persistent); smart_str_appendc_ex(buffer, ' ', persistent); smart_str_appends_ex(buffer, get_status_string(response_code), persistent); smart_str_appendl_ex(buffer, "\r\n", 2, persistent); @@ -1902,13 +1902,13 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server append_essential_headers(&buffer, client, 1); smart_str_appends_ex(&buffer, "Content-Type: text/html; charset=UTF-8\r\n", 1); smart_str_appends_ex(&buffer, "Content-Length: ", 1); - smart_str_append_generic_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1, size_t, _unsigned); + smart_str_append_unsigned_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); chunk = php_cli_server_chunk_heap_new(buffer.s, buffer.s->val, buffer.s->len); if (!chunk) { - smart_str_free_ex(&buffer, 1); + smart_str_free(&buffer); goto fail; } php_cli_server_buffer_prepend(&client->content_sender.buffer, chunk); @@ -1993,12 +1993,12 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv } smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appends_ex(&buffer, "Content-Length: ", 1); - smart_str_append_generic_ex(&buffer, client->request.sb.st_size, 1, size_t, _unsigned); + smart_str_append_unsigned_ex(&buffer, client->request.sb.st_size, 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); chunk = php_cli_server_chunk_heap_new(buffer.s, buffer.s->val, buffer.s->len); if (!chunk) { - smart_str_free_ex(&buffer, 1); + smart_str_free(&buffer); php_cli_server_log_response(client, 500, NULL TSRMLS_CC); return FAILURE; } diff --git a/sapi/cli/php_cli_server.h b/sapi/cli/php_cli_server.h index a8d7f46e7c..476ee2919c 100644 --- a/sapi/cli/php_cli_server.h +++ b/sapi/cli/php_cli_server.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/ps_title.c b/sapi/cli/ps_title.c index 53cd5fc9a0..0be94e3eb0 100644 --- a/sapi/cli/ps_title.c +++ b/sapi/cli/ps_title.c @@ -311,7 +311,7 @@ const char* ps_title_errno(int rc) #ifdef PS_USE_WIN32 case PS_TITLE_WINDOWS_ERROR: - sprintf(windows_error_details, "Windows error code: %d", GetLastError()); + sprintf(windows_error_details, "Windows error code: %u", GetLastError()); return windows_error_details; #endif } diff --git a/sapi/cli/ps_title.h b/sapi/cli/ps_title.h index 09650fed08..30a16b5a0c 100644 --- a/sapi/cli/ps_title.h +++ b/sapi/cli/ps_title.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt index 31c1a40e4a..9c28d15a30 100644 --- a/sapi/cli/tests/016.phpt +++ b/sapi/cli/tests/016.phpt @@ -59,8 +59,6 @@ foreach ($codes as $key => $code) { echo "\nDone\n"; ?> ---XFAIL-- -https://bugs.php.net/bug.php?id=55496 --EXPECTF-- -------------- Snippet no. 1: diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c index 30d10ed0a0..aebfb9f671 100644 --- a/sapi/continuity/capi.c +++ b/sapi/continuity/capi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/embed/php5embed.dsp b/sapi/embed/php5embed.dsp deleted file mode 100644 index 8564b11797..0000000000 --- a/sapi/embed/php5embed.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5embed" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=php5embed - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5embed.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5embed.mak" CFG="php5embed - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5embed - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
-!MESSAGE "php5embed - Win32 Release_TS" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5embed - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c
-# ADD BASE RSC /l 0x406 /d "_DEBUG"
-# ADD RSC /l 0x406 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\Debug_TS\php5embed.lib"
-
-!ELSEIF "$(CFG)" == "php5embed - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\Release_TS\php5embed.lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5embed - Win32 Debug_TS"
-# Name "php5embed - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=php_embed.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=php_embed.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index 230b3a649d..e0df666108 100644 --- a/sapi/embed/php_embed.c +++ b/sapi/embed/php_embed.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h index 84c0e36336..b62fd9fe24 100644 --- a/sapi/embed/php_embed.h +++ b/sapi/embed/php_embed.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/devpoll.c b/sapi/fpm/fpm/events/devpoll.c index 3fa7cd4545..c843940638 100644 --- a/sapi/fpm/fpm/events/devpoll.c +++ b/sapi/fpm/fpm/events/devpoll.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/devpoll.h b/sapi/fpm/fpm/events/devpoll.h index 2753cb5abe..3cb744c023 100644 --- a/sapi/fpm/fpm/events/devpoll.h +++ b/sapi/fpm/fpm/events/devpoll.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/epoll.c b/sapi/fpm/fpm/events/epoll.c index b55cb44b15..aa4881649b 100644 --- a/sapi/fpm/fpm/events/epoll.c +++ b/sapi/fpm/fpm/events/epoll.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/epoll.h b/sapi/fpm/fpm/events/epoll.h index f89e59a5f5..965fe4dc4e 100644 --- a/sapi/fpm/fpm/events/epoll.h +++ b/sapi/fpm/fpm/events/epoll.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/kqueue.c b/sapi/fpm/fpm/events/kqueue.c index 9fde33842b..df0724c3d4 100644 --- a/sapi/fpm/fpm/events/kqueue.c +++ b/sapi/fpm/fpm/events/kqueue.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/kqueue.h b/sapi/fpm/fpm/events/kqueue.h index 16f8046529..4b52faba21 100644 --- a/sapi/fpm/fpm/events/kqueue.h +++ b/sapi/fpm/fpm/events/kqueue.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/poll.c b/sapi/fpm/fpm/events/poll.c index d49661413c..a97c64c2d0 100644 --- a/sapi/fpm/fpm/events/poll.c +++ b/sapi/fpm/fpm/events/poll.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/poll.h b/sapi/fpm/fpm/events/poll.h index 4a05755d07..6378074a14 100644 --- a/sapi/fpm/fpm/events/poll.h +++ b/sapi/fpm/fpm/events/poll.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/port.c b/sapi/fpm/fpm/events/port.c index 0e6a880554..faf67343c7 100644 --- a/sapi/fpm/fpm/events/port.c +++ b/sapi/fpm/fpm/events/port.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/port.h b/sapi/fpm/fpm/events/port.h index f127b8cdad..1e57feb194 100644 --- a/sapi/fpm/fpm/events/port.h +++ b/sapi/fpm/fpm/events/port.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/select.c b/sapi/fpm/fpm/events/select.c index cf3331c04b..1be074c43c 100644 --- a/sapi/fpm/fpm/events/select.c +++ b/sapi/fpm/fpm/events/select.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/select.h b/sapi/fpm/fpm/events/select.h index 74f7be2bc1..cd3652e4bd 100644 --- a/sapi/fpm/fpm/events/select.h +++ b/sapi/fpm/fpm/events/select.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index 39621b839c..4f7f5eab9c 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1064,7 +1064,7 @@ char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val) void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len) { zval zvalue; - ZVAL_STR(&zvalue, zend_string_init(value, value_len, 1)); + ZVAL_NEW_STR(&zvalue, zend_string_init(value, value_len, 1)); zend_hash_str_add(&fcgi_mgmt_vars, name, name_len, &zvalue); } diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h index 5a8aa0e70e..6d1bb38dba 100644 --- a/sapi/fpm/fpm/fastcgi.h +++ b/sapi/fpm/fpm/fastcgi.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index ff30369697..2552f9afe0 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1226,6 +1226,17 @@ static void init_request_info(TSRMLS_D) SG(request_info).request_uri = orig_script_name; } path_info[0] = old; + } else if (apache_was_here && env_script_name) { + /* Using mod_proxy_fcgi and ProxyPass, apache cannot set PATH_INFO + * As we can extract PATH_INFO from PATH_TRANSLATED + * it is probably also in SCRIPT_NAME and need to be removed + */ + int snlen = strlen(env_script_name); + if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) { + _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); + env_script_name[snlen-slen] = 0; + SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); + } } env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC); } diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c index e056565ea4..da14d63d8c 100644 --- a/sapi/fpm/fpm/fpm_sockets.c +++ b/sapi/fpm/fpm/fpm_sockets.c @@ -39,29 +39,6 @@ struct listening_socket_s { static struct fpm_array_s sockets_list; -static int fpm_sockets_resolve_af_inet(char *node, char *service, struct sockaddr_in *addr) /* {{{ */ -{ - struct addrinfo *res; - struct addrinfo hints; - int ret; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_INET; - ret = getaddrinfo(node, service, &hints, &res); - - if (ret != 0) { - zlog(ZLOG_ERROR, "can't resolve hostname '%s%s%s': getaddrinfo said: %s%s%s\n", - node, service ? ":" : "", service ? service : "", - gai_strerror(ret), ret == EAI_SYSTEM ? ", system error: " : "", ret == EAI_SYSTEM ? strerror(errno) : ""); - return -1; - } - - *addr = *(struct sockaddr_in *) res->ai_addr; - freeaddrinfo(res); - return 0; -} -/* }}} */ - enum { FPM_GET_USE_SOCKET = 1, FPM_STORE_SOCKET = 2, FPM_STORE_USE_SOCKET = 3 }; static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */ @@ -98,14 +75,23 @@ static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */ } /* }}} */ +static void *fpm_get_in_addr(struct sockaddr *sa) /* {{{ */ +{ + if (sa->sa_family == AF_INET) { + return &(((struct sockaddr_in*)sa)->sin_addr); + } + + return &(((struct sockaddr_in6*)sa)->sin6_addr); +} +/* }}} */ + static int fpm_sockets_hash_op(int sock, struct sockaddr *sa, char *key, int type, int op) /* {{{ */ { if (key == NULL) { switch (type) { case FPM_AF_INET : { - struct sockaddr_in *sa_in = (struct sockaddr_in *) sa; - key = alloca(sizeof("xxx.xxx.xxx.xxx:ppppp")); - sprintf(key, "%u.%u.%u.%u:%u", IPQUAD(&sa_in->sin_addr), (unsigned int) ntohs(sa_in->sin_port)); + key = alloca(INET6_ADDRSTRLEN); + inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, sizeof key); break; } @@ -254,11 +240,14 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *address) /* {{{ */ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* {{{ */ { - struct sockaddr_in sa_in; + struct addrinfo hints, *servinfo, *p; char *dup_address = strdup(wp->config->listen_address); - char *port_str = strchr(dup_address, ':'); + char *port_str = strrchr(dup_address, ':'); char *addr = NULL; + int addr_len; int port = 0; + int sock; + int status; if (port_str) { /* this is host:port pair */ *port_str++ = '\0'; @@ -274,23 +263,35 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* return -1; } - memset(&sa_in, 0, sizeof(sa_in)); - - if (addr) { - sa_in.sin_addr.s_addr = inet_addr(addr); - if (sa_in.sin_addr.s_addr == INADDR_NONE) { /* do resolve */ - if (0 > fpm_sockets_resolve_af_inet(addr, NULL, &sa_in)) { - return -1; - } - zlog(ZLOG_NOTICE, "address '%s' resolved as %u.%u.%u.%u", addr, IPQUAD(&sa_in.sin_addr)); + // strip brackets from address for getaddrinfo + if (addr != NULL) { + addr_len = strlen(addr); + if (addr[0] == '[' && addr[addr_len - 1] == ']') { + addr[addr_len - 1] = '\0'; + addr++; } - } else { - sa_in.sin_addr.s_addr = htonl(INADDR_ANY); } - sa_in.sin_family = AF_INET; - sa_in.sin_port = htons(port); + + memset(&hints, 0, sizeof hints); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + + if ((status = getaddrinfo(addr, port_str, &hints, &servinfo)) != 0) { + zlog(ZLOG_ERROR, "getaddrinfo: %s\n", gai_strerror(status)); + return -1; + } + free(dup_address); - return fpm_sockets_get_listening_socket(wp, (struct sockaddr *) &sa_in, sizeof(struct sockaddr_in)); + + for (p = servinfo; p != NULL; p = p->ai_next) { + if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) { + break; + } + } + + freeaddrinfo(servinfo); + + return sock; } /* }}} */ diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h index 121c016a7b..446c78e410 100644 --- a/sapi/fpm/fpm/fpm_sockets.h +++ b/sapi/fpm/fpm/fpm_sockets.h @@ -45,10 +45,4 @@ static inline int fd_set_blocked(int fd, int blocked) /* {{{ */ } /* }}} */ -#define IPQUAD(sin_addr) \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[0], \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[1], \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[2], \ - (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[3] - #endif diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in index c5f4abc59c..106689f0a7 100644 --- a/sapi/fpm/php-fpm.conf.in +++ b/sapi/fpm/php-fpm.conf.in @@ -152,6 +152,8 @@ group = @php_fpm_group@ ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on ; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; ; 'port' - to listen on a TCP socket to all addresses on a ; specific port; ; '/path/to/unix/socket' - to listen on a unix socket. @@ -490,7 +492,7 @@ pm.max_spare_servers = 3 ; exectute php code. ; Note: set an empty value to allow all extensions. ; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 +;security.limit_extensions = .php .php3 .php4 .php5 .php7 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from ; the current environment. diff --git a/sapi/fpm/tests/003.phpt b/sapi/fpm/tests/003.phpt new file mode 100644 index 0000000000..389cb2401e --- /dev/null +++ b/sapi/fpm/tests/003.phpt @@ -0,0 +1,53 @@ +--TEST-- +FPM: Test IPv6 support +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = [::1]:9000 +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + var_dump(fgets($tail)); + var_dump(fgets($tail)); + $i = 0; + while (($i++ < 30) && !($fp = fsockopen('[::1]', 9000))) { + usleep(10000); + } + if ($fp) { + echo "Done\n"; + fclose($fp); + } + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +" +string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +" +Done +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/isapi/config.m4 b/sapi/isapi/config.m4 index 6014bab09f..4073173eaf 100644 --- a/sapi/isapi/config.m4 +++ b/sapi/isapi/config.m4 @@ -15,7 +15,7 @@ if test "$PHP_ISAPI" != "no"; then PHP_BUILD_THREAD_SAFE AC_DEFINE(WITH_ZEUS, 1, [ ]) PHP_ADD_INCLUDE($ZEUSPATH/web/include) - PHP_SELECT_SAPI(isapi, shared, php5isapi.c) + PHP_SELECT_SAPI(isapi, shared, php7isapi.c) INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/" fi diff --git a/sapi/isapi/config.w32 b/sapi/isapi/config.w32 index 8012352744..5a359f11b2 100644 --- a/sapi/isapi/config.w32 +++ b/sapi/isapi/config.w32 @@ -7,7 +7,7 @@ if (PHP_ISAPI == "yes") { if (PHP_ZTS == "no") { WARNING("ISAPI module requires an --enable-zts build of PHP"); } else { - SAPI('isapi', 'php5isapi.c', 'php' + PHP_VERSION + 'isapi.dll', '/D PHP5ISAPI_EXPORTS'); - ADD_FLAG('LDFLAGS_ISAPI', '/DEF:sapi\\isapi\\php5isapi.def'); + SAPI('isapi', 'php7isapi.c', 'php' + PHP_VERSION + 'isapi.dll', '/D PHP7ISAPI_EXPORTS'); + ADD_FLAG('LDFLAGS_ISAPI', '/DEF:sapi\\isapi\\php7isapi.def'); } } diff --git a/sapi/isapi/php5isapi.dsp b/sapi/isapi/php5isapi.dsp deleted file mode 100644 index 3dbab11eff..0000000000 --- a/sapi/isapi/php5isapi.dsp +++ /dev/null @@ -1,165 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5isapi" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5isapi - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5isapi.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5isapi.mak" CFG="php5isapi - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5isapi - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5isapi - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5isapi - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5isapi - Win32 Release_TSDbg" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5isapi - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D "COMPILE_LIBZEND" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5isapi___Win32_Release_TS_inline"
-# PROP BASE Intermediate_Dir "php5isapi___Win32_Release_TS_inline"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /libpath:"..\..\Release_TS"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TSDbg"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5isapi___Win32_Release_TSDbg"
-# PROP BASE Intermediate_Dir "php5isapi___Win32_Release_TSDbg"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TSDbg"
-# PROP Intermediate_Dir "Release_TSDbg"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /debug /machine:I386 /libpath:"..\..\Release_TSDbg"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5isapi - Win32 Debug_TS"
-# Name "php5isapi - Win32 Release_TS"
-# Name "php5isapi - Win32 Release_TS_inline"
-# Name "php5isapi - Win32 Release_TSDbg"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php5isapi.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php5isapi.def
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# End Target
-# End Project
diff --git a/sapi/isapi/php5isapi.c b/sapi/isapi/php7isapi.c index d83c81ad9e..27eb1c9353 100644 --- a/sapi/isapi/php5isapi.c +++ b/sapi/isapi/php7isapi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/isapi/php5isapi.def b/sapi/isapi/php7isapi.def index 596023ef55..596023ef55 100644 --- a/sapi/isapi/php5isapi.def +++ b/sapi/isapi/php7isapi.def diff --git a/sapi/isapi/stresstest/notes.txt b/sapi/isapi/stresstest/notes.txt index f58ab3c0e9..e6d10dd486 100644 --- a/sapi/isapi/stresstest/notes.txt +++ b/sapi/isapi/stresstest/notes.txt @@ -44,7 +44,7 @@ Run: stresstest L files.txt supply the path to the parent of the "tests" directory (expect a couple long pauses for a couple of the larger tests) -Run: stresstest T c:\php5-source +Run: stresstest T c:\php7-source diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp index 9a5964a6ba..8ad414fab6 100644 --- a/sapi/isapi/stresstest/stresstest.cpp +++ b/sapi/isapi/stresstest/stresstest.cpp @@ -529,7 +529,7 @@ int main(int argc, char* argv[]) 0, NULL ); - fprintf(stderr,"Error: Dll 'php5isapi.dll' not found -%d\n%s\n", GetLastError(), lpMsgBuf); + fprintf(stderr,"Error: Dll 'php7isapi.dll' not found -%d\n%s\n", GetLastError(), lpMsgBuf); free (module); free(filelist); LocalFree( lpMsgBuf ); diff --git a/sapi/isapi/stresstest/stresstest.dsp b/sapi/isapi/stresstest/stresstest.dsp deleted file mode 100644 index fb82303e3d..0000000000 --- a/sapi/isapi/stresstest/stresstest.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="stresstest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=stresstest - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "stresstest.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "stresstest.mak" CFG="stresstest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "stresstest - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "stresstest - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "stresstest - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 2
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "stresstest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 2
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "c:\php-fcgi"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FD /GZ /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "stresstest - Win32 Release"
-# Name "stresstest - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\getopt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getopt.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\stresstest.cpp
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\notes.txt
-# End Source File
-# End Target
-# End Project
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index ae01893a7a..13439460ae 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lsapidef.h b/sapi/litespeed/lsapidef.h index fb75d01a17..5c604a57c4 100644 --- a/sapi/litespeed/lsapidef.h +++ b/sapi/litespeed/lsapidef.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index aac823fc1c..cf63f6ab1c 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h index cae1863c79..cacf7d97b8 100644 --- a/sapi/litespeed/lsapilib.h +++ b/sapi/litespeed/lsapilib.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c index 57f8190ec4..d82089ca1f 100644 --- a/sapi/milter/php_milter.c +++ b/sapi/milter/php_milter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/nsapi/nsapi-readme.txt b/sapi/nsapi/nsapi-readme.txt index 54980bf0e0..812507957e 100644 --- a/sapi/nsapi/nsapi-readme.txt +++ b/sapi/nsapi/nsapi-readme.txt @@ -1,4 +1,4 @@ -Configuration of your Netscape/iPlanet/Sun Webserver for PHP5 +Configuration of your Netscape/iPlanet/Sun Webserver for PHP7 ----------------------------------------------------------------- These instructions are targetted at Netscape Enterprise Web Server and @@ -28,13 +28,13 @@ Place the following two lines after mime.types init in for iPlanet/Sun Webserver 6.0 and above however at the end of the <path-to-server>/https-servername/config/magnus.conf file: - Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="/path/to/phplibrary" - Init fn=php5_init errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"] + Init fn="load-modules" funcs="php7_init,php7_execute,php7_auth_trans" shlib="/path/to/phplibrary" + Init fn=php7_init errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"] The "shlib" will vary depending on your OS: - Unix: "<path-to-server>/bin/libphp5.so". - Windows: "c:/path/to/php5/php5nsapi.dll" + Unix: "<path-to-server>/bin/libphp7.so". + Windows: "c:/path/to/php7/php7nsapi.dll" In obj.conf (for virtual server classes [Sun 6.0+] in their vserver.obj.conf): @@ -50,7 +50,7 @@ In obj.conf (for virtual server classes [Sun 6.0+] in their vserver.obj.conf): # For boolean ini-keys please use 0/1 as value, NOT "On","Off",... (this will not work # correctly), e.g. zlib.output_compression=1 instead of zlib.output_compression="On" - Service fn="php5_execute" type="magnus-internal/x-httpd-php" [inikey=value ...] + Service fn="php7_execute" type="magnus-internal/x-httpd-php" [inikey=value ...] . . . @@ -61,7 +61,7 @@ PHP scripts (same like a cgi-bin directory): <Object name="x-httpd-php"> ObjectType fn="force-type" type="magnus-internal/x-httpd-php" - Service fn="php5_execute" [inikey=value ...] + Service fn="php7_execute" [inikey=value ...] </Object> After that you can configure a directory in the Administration server and assign it @@ -81,7 +81,7 @@ AUTHENTICATION IS PASSED TO YOUR PHP SCRIPT. To configure PHP Authentication for the entire server, add the following line: <Object name="default"> - AuthTrans fn=php5_auth_trans + AuthTrans fn=php7_auth_trans . . . @@ -92,7 +92,7 @@ Authentication for the entire server, add the following line: To use PHP Authentication on a single directory, add the following: <Object ppath="d:\path\to\authenticated\dir\*"> - AuthTrans fn=php5_auth_trans + AuthTrans fn=php7_auth_trans </Object> @@ -103,7 +103,7 @@ You can use PHP to generate the error pages for "404 Not Found" or similar. Add the following line to the object in obj.conf for every error page you want to overwrite: - Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...] + Error fn="php7_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...] where XXX ist the HTTP error code. Please delete any other Error directives which could interfere with yours. @@ -116,7 +116,7 @@ Just generate a PHP script which displays a directory listing and replace the corresponding default Service line for type="magnus-internal/directory" in obj.conf with the following: - Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...] + Service fn="php7_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...] For both error and directory listing pages the original URI and translated URI are in the variables $_SERVER['PATH_INFO'] and @@ -141,9 +141,9 @@ till version 6.1. If a newer version of the Sun server is used, the detection fails and nsapi_virtual() is disabled. If this is the case, try the following: -Add the following parameter to php5_init in magnus.conf: +Add the following parameter to php7_init in magnus.conf: - Init fn=php5_init ... server_lib="ns-httpdXX.dll" + Init fn=php7_init ... server_lib="ns-httpdXX.dll" where XX is the correct DLL version number. To get it, look in the server-root for the correct DLL name. The DLL with the biggest filesize is the right one. diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 496596d773..bb99c31652 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -251,7 +251,7 @@ static void php_nsapi_init_dynamic_symbols(void) /* try user specified server_lib */ module = GetModuleHandle(nsapi_dll); if (!module) { - log_error(LOG_WARN, "php5_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll); + log_error(LOG_WARN, "php7_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll); } } else { /* find a LOADED dll module from nsapi_dlls */ @@ -781,7 +781,7 @@ static void nsapi_log_message(char *message TSRMLS_DC) if (rc) { log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message); } else { - log_error(LOG_INFORM, "php5", NULL, NULL, "%s", message); + log_error(LOG_INFORM, "php7", NULL, NULL, "%s", message); } } @@ -868,7 +868,7 @@ static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC) } } -void NSAPI_PUBLIC php5_close(void *vparam) +void NSAPI_PUBLIC php7_close(void *vparam) { if (nsapi_sapi_module.shutdown) { nsapi_sapi_module.shutdown(&nsapi_sapi_module); @@ -888,13 +888,13 @@ void NSAPI_PUBLIC php5_close(void *vparam) sapi_shutdown(); tsrm_shutdown(); - log_error(LOG_INFORM, "php5_close", NULL, NULL, "Shutdown PHP Module"); + log_error(LOG_INFORM, "php7_close", NULL, NULL, "Shutdown PHP Module"); } /********************************************************* / init SAF / -/ Init fn="php5_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"] +/ Init fn="php7_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"] / Initialize the NSAPI module in magnus.conf / / php_ini: gives path to php.ini file @@ -902,7 +902,7 @@ void NSAPI_PUBLIC php5_close(void *vparam) / servact_* functions / /*********************************************************/ -int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) +int NSAPI_PUBLIC php7_init(pblock *pb, Session *sn, Request *rq) { php_core_globals *core_globals; char *strval; @@ -917,13 +917,13 @@ int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) core_globals = ts_resource(core_globals_id); - /* look if php_ini parameter is given to php5_init */ + /* look if php_ini parameter is given to php7_init */ if (strval = pblock_findval("php_ini", pb)) { nsapi_sapi_module.php_ini_path_override = strdup(strval); } #ifdef PHP_WIN32 - /* look if server_lib parameter is given to php5_init + /* look if server_lib parameter is given to php7_init * (this disables the automatic search for the newest ns-httpdXX.dll) */ if (strval = pblock_findval("server_lib", pb)) { nsapi_dll = strdup(strval); @@ -934,7 +934,7 @@ int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) sapi_startup(&nsapi_sapi_module); nsapi_sapi_module.startup(&nsapi_sapi_module); - daemon_atrestart(&php5_close, NULL); + daemon_atrestart(&php7_close, NULL); log_error(LOG_INFORM, pblock_findval("fn", pb), sn, rq, "Initialized PHP Module (%d threads expected)", threads); return REQ_PROCEED; @@ -943,19 +943,19 @@ int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) /********************************************************* / normal use in Service directive: / -/ Service fn="php5_execute" type=... method=... [inikey=inivalue inikey=inivalue...] +/ Service fn="php7_execute" type=... method=... [inikey=inivalue inikey=inivalue...] / / use in Service for a directory to supply a php-made directory listing instead of server default: / -/ Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] +/ Service fn="php7_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] / / use in Error SAF to display php script as error page: / -/ Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ Error fn="php5_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] +/ Error fn="php7_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] +/ Error fn="php7_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] / /*********************************************************/ -int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq) +int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq) { int retval; nsapi_request_context *request_context; @@ -1076,15 +1076,15 @@ int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq) / will pass authentication through to php, and allow us to / check authentication with our scripts. / -/ php5_auth_trans +/ php7_auth_trans / main function called from netscape server to authenticate / a line in obj.conf: -/ funcs=php5_auth_trans shlib="path/to/this/phpnsapi.dll" +/ funcs=php7_auth_trans shlib="path/to/this/phpnsapi.dll" / and: / <Object ppath="path/to/be/authenticated/by/php/*"> -/ AuthTrans fn="php5_auth_trans" +/ AuthTrans fn="php7_auth_trans" /*********************************************************/ -int NSAPI_PUBLIC php5_auth_trans(pblock * pb, Session * sn, Request * rq) +int NSAPI_PUBLIC php7_auth_trans(pblock * pb, Session * sn, Request * rq) { /* This is a DO NOTHING function that allows authentication * information diff --git a/sapi/nsapi/php5nsapi.dsp b/sapi/nsapi/php5nsapi.dsp deleted file mode 100644 index 6cd0079b43..0000000000 --- a/sapi/nsapi/php5nsapi.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5nsapi" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5nsapi - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5nsapi.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5nsapi.mak" CFG="php5nsapi - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5nsapi - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5nsapi - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5nsapi - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5nsapi - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5nsapi___Win32_Release_TS"
-# PROP BASE Intermediate_Dir "php5nsapi___Win32_Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "NDEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ns-httpd30.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5nsapi - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5nsapi___Win32_Release_TS_inline"
-# PROP BASE Intermediate_Dir "php5nsapi___Win32_Release_TS_inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ns-httpd30.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5nsapi - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "php5nsapi___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "php5nsapi___Win32_Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D "_Debug_TS" /D ZEND_DEBUG=1 /D "_DEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ns-httpd30.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5nsapi - Win32 Release_TS"
-# Name "php5nsapi - Win32 Release_TS_inline"
-# Name "php5nsapi - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\nsapi.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/sapi/phpdbg/.travis.yml b/sapi/phpdbg/.travis.yml index d5b492e7cf..2e777fbe13 100644 --- a/sapi/phpdbg/.travis.yml +++ b/sapi/phpdbg/.travis.yml @@ -4,7 +4,6 @@ env: - PHP="PHP-5.4" - PHP="PHP-5.5" - PHP="PHP-5.6" -- PHP="master" before_script: ./travis/ci.sh diff --git a/sapi/phpdbg/README.md b/sapi/phpdbg/README.md index e7e5c731a8..a2a84deb7b 100644 --- a/sapi/phpdbg/README.md +++ b/sapi/phpdbg/README.md @@ -1,7 +1,7 @@ The interactive PHP debugger ============================ -Implemented as a SAPI module, phpdbg can excert complete control over the environment without impacting the functionality or performance of your code. +Implemented as a SAPI module, phpdbg can exert complete control over the environment without impacting the functionality or performance of your code. phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP 5.4+ diff --git a/sapi/phpdbg/phpdbg.1 b/sapi/phpdbg/phpdbg.1 index 5e4d144c83..b6c26df565 100644 --- a/sapi/phpdbg/phpdbg.1 +++ b/sapi/phpdbg/phpdbg.1 @@ -7,7 +7,7 @@ phpdbg \- The interactive PHP debugger [\fB\-e\fIFILE\fR] .SH DESCRIPTION .B phpdbg -a lightweight, powerful, easy to use debugging platform for PHP5. +a lightweight, powerful, easy to use debugging platform for PHP7. .SH OPTIONS The following switches are implemented (just like cli SAPI): .TP diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 6fe06a9f65..4388b4f86d 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1296,14 +1296,14 @@ phpdbg_main: /* do not install sigint handlers for remote consoles */ /* sending SIGINT then provides a decent way of shutting down the server */ -#if defined(ZEND_SIGNALS) && !defined(_WIN32) - if (listen[0] < 0) { - zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try(); - } -#elif !defined(_WIN32) +#ifndef _WIN32 if (listen[0] < 0) { #endif +#if defined(ZEND_SIGNALS) && !defined(_WIN32) + zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try(); +#else signal(SIGINT, phpdbg_sigint_handler); +#endif #ifndef _WIN32 } #endif diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index 7d720f157b..364ef7d176 100644 --- a/sapi/phpdbg/phpdbg.h +++ b/sapi/phpdbg/phpdbg.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index 09bdc1931f..e30b87c313 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h index 97980e7ed7..9c3f097d78 100644 --- a/sapi/phpdbg/phpdbg_bp.h +++ b/sapi/phpdbg/phpdbg_bp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c index be76b22b05..d04f2f8bb4 100644 --- a/sapi/phpdbg/phpdbg_break.c +++ b/sapi/phpdbg/phpdbg_break.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_break.h b/sapi/phpdbg/phpdbg_break.h index dc06da62b7..de1eff1b56 100644 --- a/sapi/phpdbg/phpdbg_break.h +++ b/sapi/phpdbg/phpdbg_break.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_btree.c b/sapi/phpdbg/phpdbg_btree.c index 491445399b..a155efbf9a 100644 --- a/sapi/phpdbg/phpdbg_btree.c +++ b/sapi/phpdbg/phpdbg_btree.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_btree.h b/sapi/phpdbg/phpdbg_btree.h index af2a6ac314..c714d8dc4c 100644 --- a/sapi/phpdbg/phpdbg_btree.h +++ b/sapi/phpdbg/phpdbg_btree.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c index 72dc484098..0437455054 100644 --- a/sapi/phpdbg/phpdbg_cmd.c +++ b/sapi/phpdbg/phpdbg_cmd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h index 571d065f59..08b50de39e 100644 --- a/sapi/phpdbg/phpdbg_cmd.h +++ b/sapi/phpdbg/phpdbg_cmd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c index 5a6a37d5f9..5678534005 100644 --- a/sapi/phpdbg/phpdbg_frame.c +++ b/sapi/phpdbg/phpdbg_frame.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h index 7c4574ed28..757f98fd71 100644 --- a/sapi/phpdbg/phpdbg_frame.h +++ b/sapi/phpdbg/phpdbg_frame.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index c552529930..3421f7ebeb 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_help.h b/sapi/phpdbg/phpdbg_help.h index 16a1e771e3..c7af5c894b 100644 --- a/sapi/phpdbg/phpdbg_help.h +++ b/sapi/phpdbg/phpdbg_help.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index 97f88bfa1e..5911185300 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_info.h b/sapi/phpdbg/phpdbg_info.h index c36e6bebd6..fcdc131fd5 100644 --- a/sapi/phpdbg/phpdbg_info.h +++ b/sapi/phpdbg/phpdbg_info.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h index ab51e7daa8..d0e259f453 100644 --- a/sapi/phpdbg/phpdbg_lexer.h +++ b/sapi/phpdbg/phpdbg_lexer.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index e8db4e605c..eac17ba6a7 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h index 14905f6567..84f6b63195 100644 --- a/sapi/phpdbg/phpdbg_list.h +++ b/sapi/phpdbg/phpdbg_list.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c index 4e693c4414..125a85fe72 100644 --- a/sapi/phpdbg/phpdbg_opcode.c +++ b/sapi/phpdbg/phpdbg_opcode.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -104,9 +104,6 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM #ifdef ZEND_JMP_SET case ZEND_JMP_SET: #endif -#ifdef ZEND_JMP_SET_VAR - case ZEND_JMP_SET_VAR: -#endif decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC); asprintf( &decode[2], "J%ld", op->op2.jmp_addr - ops->opcodes); @@ -235,7 +232,6 @@ const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */ CASE(ZEND_JMPZ_EX); CASE(ZEND_JMPNZ_EX); CASE(ZEND_CASE); - CASE(ZEND_SWITCH_FREE); CASE(ZEND_BRK); CASE(ZEND_CONT); CASE(ZEND_BOOL); @@ -333,12 +329,6 @@ const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */ #ifdef ZEND_SEPARATE CASE(ZEND_SEPARATE); #endif -#ifdef ZEND_QM_ASSIGN_VAR - CASE(ZEND_QM_ASSIGN_VAR); -#endif -#ifdef ZEND_JMP_SET_VAR - CASE(ZEND_JMP_SET_VAR); -#endif #ifdef ZEND_DISCARD_EXCEPTION CASE(ZEND_DISCARD_EXCEPTION); #endif diff --git a/sapi/phpdbg/phpdbg_opcode.h b/sapi/phpdbg/phpdbg_opcode.h index 144442981d..647237119c 100644 --- a/sapi/phpdbg/phpdbg_opcode.h +++ b/sapi/phpdbg/phpdbg_opcode.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index 376373e4a1..eba7ed7666 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_print.h b/sapi/phpdbg/phpdbg_print.h index ed85e965c1..7bd096bf4e 100644 --- a/sapi/phpdbg/phpdbg_print.h +++ b/sapi/phpdbg/phpdbg_print.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 7f78b58e53..134ef33f6d 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h index ef648aabeb..0bd03f03bb 100644 --- a/sapi/phpdbg/phpdbg_prompt.h +++ b/sapi/phpdbg/phpdbg_prompt.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c index 54269a8193..3d3eced705 100644 --- a/sapi/phpdbg/phpdbg_set.c +++ b/sapi/phpdbg/phpdbg_set.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_set.h b/sapi/phpdbg/phpdbg_set.h index dea61ed382..18618cd007 100644 --- a/sapi/phpdbg/phpdbg_set.h +++ b/sapi/phpdbg/phpdbg_set.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index 3ce2fade17..b57986b55c 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h index 56bacfc459..0edc40a262 100644 --- a/sapi/phpdbg/phpdbg_utils.h +++ b/sapi/phpdbg/phpdbg_utils.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c index e88622444b..054bea6d00 100644 --- a/sapi/phpdbg/phpdbg_watch.c +++ b/sapi/phpdbg/phpdbg_watch.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h index d00bcff77e..7a4e49ec8f 100644 --- a/sapi/phpdbg/phpdbg_watch.h +++ b/sapi/phpdbg/phpdbg_watch.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c index b0cbdf267a..b55abd9e1b 100644 --- a/sapi/phpdbg/phpdbg_win.c +++ b/sapi/phpdbg/phpdbg_win.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_win.h b/sapi/phpdbg/phpdbg_win.h index 68c3052790..3f87c216f6 100644 --- a/sapi/phpdbg/phpdbg_win.h +++ b/sapi/phpdbg/phpdbg_win.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phttpd/php_phttpd.h b/sapi/phttpd/php_phttpd.h index 92409ac905..73c76cec0b 100644 --- a/sapi/phttpd/php_phttpd.h +++ b/sapi/phttpd/php_phttpd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c index 60fc48ba35..ba8dfe3838 100644 --- a/sapi/phttpd/phttpd.c +++ b/sapi/phttpd/phttpd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/pi3web/README b/sapi/pi3web/README index e3e523e940..e7726edcf4 100644 --- a/sapi/pi3web/README +++ b/sapi/pi3web/README @@ -1,36 +1,36 @@ -PHP5 Module +PHP7 Module ========== -This module requires PHP5 as thread safe shared library. Have a look +This module requires PHP7 as thread safe shared library. Have a look into the INSTALL file which accompanies that distribution. If you distribute this software bundled with the PHP software in source or binary form, then you must adhere to the PHP copyright conditions - the terms are reasonable. -You should have checked out and built the PHP5 source package from the -PHP CVS tree into the Pi3Web source directory called 'PHP5' first. Then -build PHP5 as Pi3Web module and after that build the Pi3Web PHP5 wrapper: +You should have checked out and built the PHP7 source package from the +PHP CVS tree into the Pi3Web source directory called 'PHP7' first. Then +build PHP7 as Pi3Web module and after that build the Pi3Web PHP7 wrapper: -1. Checkout PHP5 +1. Checkout PHP7 ================ cvs -d :pserver:cvsread@cvs.php.net:/repository login The required password is phpfi -cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co php5 +cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co php7 You must also checkout the TSRM and the ZEND module from the ZEND cvs tree -into the PHP5 root directory +into the PHP7 root directory cvs -d :pserver:cvsread@cvs.zend.com:/repository login The required password is zend cvs -z3 -d :pserver:cvsread@cvs.zend.com:/repository co Zend TSRM -2. Build PHP5 +2. Build PHP7 ============= 2.1 POSIX --------- -cd ./php5 +cd ./php7 ./buildconf ./configure --with-pi3web make @@ -41,10 +41,10 @@ other required downloads from the php website - bison 1.25 - bindlib32 - number4.tar.gz -nmake php5dllts.mak +nmake php7dllts.mak -3. Build Pi3Web PHP5 wrapper +3. Build Pi3Web PHP7 wrapper ============================ -Run make in the Pi3Web /Source/PHP5 directory. +Run make in the Pi3Web /Source/PHP7 directory. For further information refer to http://www.php.net/version4/ diff --git a/sapi/pi3web/config.m4 b/sapi/pi3web/config.m4 index 347a74ca06..42ff164394 100644 --- a/sapi/pi3web/config.m4 +++ b/sapi/pi3web/config.m4 @@ -17,7 +17,7 @@ if test "$PHP_PI3WEB" != "no"; then PHP_ADD_INCLUDE($PI3PATH/PiAPI) PHP_ADD_INCLUDE($PI3PATH/Pi2API) PHP_ADD_INCLUDE($PI3PATH/Pi3API) - PHP_ADD_INCLUDE($PI3PATH/PHP5) + PHP_ADD_INCLUDE($PI3PATH/PHP7) PHP_SELECT_SAPI(pi3web, shared, pi3web_sapi.c) INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PI3PATH/bin/" fi diff --git a/sapi/pi3web/config.w32 b/sapi/pi3web/config.w32 index a5393e621b..9441784468 100644 --- a/sapi/pi3web/config.w32 +++ b/sapi/pi3web/config.w32 @@ -8,7 +8,7 @@ if (PHP_PI3WEB != "no") { CHECK_LIB('piapi.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) && CHECK_LIB('pi2api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) && CHECK_LIB('pi3api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB)) { - SAPI('pi3web', 'pi3web_sapi.c', 'php' + PHP_VERSION + 'pi3web.dll', '/D PHP5PI3WEB_EXPORTS'); + SAPI('pi3web', 'pi3web_sapi.c', 'php' + PHP_VERSION + 'pi3web.dll', '/D PHP7PI3WEB_EXPORTS'); AC_DEFINE('WITH_PI3WEB', 1); } else { WARNING('Pi3Web not enabled; headers/libraries not found'); diff --git a/sapi/pi3web/php5pi3web.dsp b/sapi/pi3web/php5pi3web.dsp deleted file mode 100644 index bb5a248802..0000000000 --- a/sapi/pi3web/php5pi3web.dsp +++ /dev/null @@ -1,136 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5pi3web" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5pi3web - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5pi3web.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5pi3web.mak" CFG="php5pi3web - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5pi3web - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5pi3web - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5pi3web - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5pi3web - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5pi3web_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API"
-
-!ELSEIF "$(CFG)" == "php5pi3web - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5pi3web_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API"
-
-!ELSEIF "$(CFG)" == "php5pi3web - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5pi3web___Win32_Release_TS_inline"
-# PROP BASE Intermediate_Dir "php5pi3web___Win32_Release_TS_inline"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\ext\mysql\libmysql" /I "..\..\..\PiAPI" /I "..\..\..\Pi2API" /I "..\..\..\Pi3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS" /libpath:"..\..\..\PiAPI" /libpath:"..\..\..\Pi2API" /libpath:"..\..\..\Pi3API"
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5pi3web - Win32 Debug_TS"
-# Name "php5pi3web - Win32 Release_TS"
-# Name "php5pi3web - Win32 Release_TS_inline"
-# Begin Group "Source Files"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=.\pi3web_sapi.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=.\pi3web_sapi.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index 0e17c0e029..d92526cf5e 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -342,7 +342,7 @@ static sapi_module_struct pi3web_sapi_module = { STANDARD_SAPI_MODULE_PROPERTIES }; -MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB) +MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB) { zend_file_handle file_handle = {0}; int iRet = PIAPI_COMPLETED; @@ -411,7 +411,7 @@ MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB) return iRet; } -MODULE_API BOOL PHP5_startup() { +MODULE_API BOOL PHP7_startup() { tsrm_startup(1, 1, 0, NULL); sapi_startup(&pi3web_sapi_module); if (pi3web_sapi_module.startup) { @@ -421,7 +421,7 @@ MODULE_API BOOL PHP5_startup() { return IWasLoaded; }; -MODULE_API BOOL PHP5_shutdown() { +MODULE_API BOOL PHP7_shutdown() { if (pi3web_sapi_module.shutdown) { pi3web_sapi_module.shutdown(&pi3web_sapi_module); }; diff --git a/sapi/pi3web/pi3web_sapi.h b/sapi/pi3web/pi3web_sapi.h index d229fec53f..83f483d924 100644 --- a/sapi/pi3web/pi3web_sapi.h +++ b/sapi/pi3web/pi3web_sapi.h @@ -3,7 +3,7 @@ #ifdef PHP_WIN32 # include <windows.h> -# ifdef PHP5PI3WEB_EXPORTS +# ifdef PHP7PI3WEB_EXPORTS # define MODULE_API __declspec(dllexport) # else # define MODULE_API __declspec(dllimport) @@ -86,9 +86,9 @@ typedef struct _CONTROL_BLOCK { } CONTROL_BLOCK, *LPCONTROL_BLOCK; -MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB); -MODULE_API BOOL PHP5_startup(); -MODULE_API BOOL PHP5_shutdown(); +MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB); +MODULE_API BOOL PHP7_startup(); +MODULE_API BOOL PHP7_shutdown(); // the following type declaration is for the server side typedef DWORD ( * PFN_WRAPPERFUNC )( CONTROL_BLOCK *pCB ); diff --git a/sapi/roxen/README b/sapi/roxen/README index d834a0000e..59c215cba0 100644 --- a/sapi/roxen/README +++ b/sapi/roxen/README @@ -8,9 +8,9 @@ script is executed at any one time). The second option is using ZTS (Zend Thread Safe mode). Unless --enable-roxen-zts is specified, this won't be used. -This solution now works fine and is recommended. Multiple PHP5 +This solution now works fine and is recommended. Multiple PHP7 requests will be run in parallell. The maximum number of parallell -PHP5-execution is limited to the number of handle threads Roxen is +PHP7-execution is limited to the number of handle threads Roxen is started with. Support for this module is lacking. Please contact Roxen Internet diff --git a/sapi/roxen/TODO b/sapi/roxen/TODO index 248f36f52e..47143f1be1 100644 --- a/sapi/roxen/TODO +++ b/sapi/roxen/TODO @@ -10,18 +10,18 @@ BUGS: And another error (when trying to include a class) Recursive mutex locks! - /Usr/local/pike/7.0.54/lib/modules/PHP5.so.Interpreter: - run("/home/www/www.tx.pl/news/test.php",mapping[3],modules/scripting/php5.pike.PHPScript(),modules/scripting/php5.pike.PHPScript.done) - modules/scripting/php5.pike:169: run() + /Usr/local/pike/7.0.54/lib/modules/PHP7.so.Interpreter: + run("/home/www/www.tx.pl/news/test.php",mapping[3],modules/scripting/php7.pike.PHPScript(),modules/scripting/php7.pike.PHPScript.done) + modules/scripting/php7.pike:169: run() base_server/roxen.pike:569: handler_thread(3). And after this every access to any php script (on other virtual sites also) ends (of course there is no proper output) with this error: Php4.Interpreter->run: Tried to run a PHP-script from a PHP - callback!/usr/local/pike/7.0.54/lib/modules/PHP5.so.Interpreter: - run("/home/www/biall.com.pl/index.php3",mapping[2],modules/scripting/php5.pike.PHPScript(),modules/scripting/php5.pike.PHPScript.done) - modules/scripting/php5.pike:169: run() + callback!/usr/local/pike/7.0.54/lib/modules/PHP7.so.Interpreter: + run("/home/www/biall.com.pl/index.php3",mapping[2],modules/scripting/php7.pike.PHPScript(),modules/scripting/php7.pike.PHPScript.done) + modules/scripting/php7.pike:169: run() base_server/roxen.pike:569: handler_thread(3). diff --git a/sapi/roxen/config.m4 b/sapi/roxen/config.m4 index 7601b0c1ed..d536ac571b 100644 --- a/sapi/roxen/config.m4 +++ b/sapi/roxen/config.m4 @@ -36,7 +36,7 @@ if test "$PHP_ROXEN" != "no"; then PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR) AC_DEFINE(HAVE_ROXEN, 1, [Whether you use Roxen]) PHP_SELECT_SAPI(roxen, shared, roxen.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP5.so" + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP7.so" RESULT="yes Pike binary used: $PIKE Pike include dir: $PIKE_INCLUDE_DIR diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c index 14456477b0..756f7353e9 100644 --- a/sapi/roxen/roxen.c +++ b/sapi/roxen/roxen.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -616,12 +616,12 @@ void f_php_roxen_request_handler(INT32 args) TSRMLS_FETCH(); if(current_thread == th_self()) - php_error(E_WARNING, "PHP5.Interpreter->run: Tried to run a PHP-script from a PHP " + php_error(E_WARNING, "PHP7.Interpreter->run: Tried to run a PHP-script from a PHP " "callback!"); - get_all_args("PHP5.Interpreter->run", args, "%S%m%O%*", &script, + get_all_args("PHP7.Interpreter->run", args, "%S%m%O%*", &script, &request_data, &my_fd_obj, &done_callback); if(done_callback->type != PIKE_T_FUNCTION) - php_error(E_WARNING, "PHP5.Interpreter->run: Bad argument 4, expected function.\n"); + php_error(E_WARNING, "PHP7.Interpreter->run: Bad argument 4, expected function.\n"); PHP_LOCK(THIS); /* Need to lock here or reusing the same object might cause * problems in changing stuff in that object */ #ifndef ROXEN_USE_ZTS @@ -657,7 +657,7 @@ void f_php_roxen_request_handler(INT32 args) { int fd = fd_from_object(raw_fd->u.object); if(fd == -1) - php_error(E_WARNING, "PHP5.Interpreter->run: my_fd object not open or not an FD.\n"); + php_error(E_WARNING, "PHP7.Interpreter->run: my_fd object not open or not an FD.\n"); THIS->my_fd = fd; } else THIS->my_fd = 0; diff --git a/sapi/thttpd/config.m4 b/sapi/thttpd/config.m4 index 371edaee84..fddb709d92 100644 --- a/sapi/thttpd/config.m4 +++ b/sapi/thttpd/config.m4 @@ -25,10 +25,10 @@ if test "$PHP_THTTPD" != "no"; then fi PHP_TARGET_RDYNAMIC INSTALL_IT="\ - echo 'PHP_LIBS = -L. -lphp5 \$(PHP_LIBS) \$(EXTRA_LIBS)' > $THTTPD/php_makefile; \ + echo 'PHP_LIBS = -L. -lphp7 \$(PHP_LIBS) \$(EXTRA_LIBS)' > $THTTPD/php_makefile; \ echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $THTTPD/php_makefile; \ echo 'PHP_CFLAGS = \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(CPPFLAGS) \$(EXTRA_CFLAGS)' >> $THTTPD/php_makefile; \ - rm -f $THTTPD/php_thttpd.c $THTTPD/php_thttpd.h $THTTPD/libphp5.a; \ + rm -f $THTTPD/php_thttpd.c $THTTPD/php_thttpd.h $THTTPD/libphp7.a; \ \$(LN_S) $abs_srcdir/sapi/thttpd/thttpd.c $THTTPD/php_thttpd.c; \ \$(LN_S) $abs_srcdir/sapi/thttpd/php_thttpd.h $abs_builddir/$SAPI_STATIC $THTTPD/;\ $patch" diff --git a/sapi/thttpd/php_thttpd.h b/sapi/thttpd/php_thttpd.h index 75e79b4054..df7fb455e1 100644 --- a/sapi/thttpd/php_thttpd.h +++ b/sapi/thttpd/php_thttpd.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index f6ba8585b9..7c03454f58 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -27,7 +27,7 @@ #include "php_ini.h" #include "zend_highlight.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include <sys/time.h> #include <sys/types.h> @@ -181,7 +181,7 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) if (!SG(sapi_headers).http_status_line) { ADD_VEC_S("HTTP/1.1 "); - p = smart_str_print_long(buf+sizeof(buf)-1, + p = zend_print_long_to_buf(buf+sizeof(buf)-1, SG(sapi_headers).http_response_code); ADD_VEC(p, strlen(p)); ADD_VEC_S(" HTTP\r\n"); @@ -293,7 +293,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC) ADD_STRING_EX("REMOTE_HOST", p); ADD_STRING_EX("SERVER_PORT", - smart_str_print_long(buf + sizeof(buf) - 1, + zend_print_long_to_buf(buf + sizeof(buf) - 1, TG(hc)->hs->port)); buf[0] = '/'; @@ -323,7 +323,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC) if (TG(hc)->contentlength != -1) { ADD_STRING_EX("CONTENT_LENGTH", - smart_str_print_long(buf + sizeof(buf) - 1, + zend_print_long_to_buf(buf + sizeof(buf) - 1, TG(hc)->contentlength)); } @@ -468,7 +468,7 @@ static void thttpd_request_ctor(TSRMLS_D) static void thttpd_request_dtor(TSRMLS_D) { - smart_str_free_ex(&TG(sbuf), 1); + smart_str_free(&TG(sbuf)); if (SG(request_info).query_string) free(SG(request_info).query_string); free(SG(request_info).request_uri); diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch index 33de921489..1a9ed29d60 100644 --- a/sapi/thttpd/thttpd_patch +++ b/sapi/thttpd/thttpd_patch @@ -34,7 +34,7 @@ diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in this: $(ALL) -thttpd: $(OBJ) -+thttpd: $(OBJ) libphp5.a ++thttpd: $(OBJ) libphp7.a @rm -f $@ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(NETLIBS) @@ -240,7 +240,7 @@ diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c + +#define SMART_STR_USE_REALLOC + -+#include "ext/standard/php_smart_str.h" ++#include "zend_smart_str.h" static void -send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod ) diff --git a/sapi/tux/README b/sapi/tux/README index 92c021123f..3c5ebc56ba 100644 --- a/sapi/tux/README +++ b/sapi/tux/README @@ -56,31 +56,31 @@ BUILD INSTRUCTIONS $ ./configure --help - 3. Touch a file in your web-root 'php5.tux'. This will - cause requests to '/php5.tux' to be redirected to the - userspace module php5.tux. + 3. Touch a file in your web-root 'php7.tux'. This will + cause requests to '/php7.tux' to be redirected to the + userspace module php7.tux. 4. Start TUX with something like - # tux -d -t 8 -r /www -m /tux-modules php5.tux + # tux -d -t 8 -r /www -m /tux-modules php7.tux (daemon mode, eight threads, web-root /www, modules in - /tux-modules, load php5.tux) + /tux-modules, load php7.tux) BEFORE running this command, the kernel side of TUX has to be properly setup. 5. Try to access - http://yourserver/php5.tux?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 + http://yourserver/php7.tux?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 It should display the PHP credits page. To access a script /foo/bar.php, use - http://yourserver/php5.tux?/foo/bar.php + http://yourserver/php7.tux?/foo/bar.php Parameters can be appended: - http://yourserver/php5.tux?/foo/bar.php&var=value + http://yourserver/php7.tux?/foo/bar.php&var=value diff --git a/sapi/tux/config.m4 b/sapi/tux/config.m4 index 06788be757..db4be82cf1 100644 --- a/sapi/tux/config.m4 +++ b/sapi/tux/config.m4 @@ -7,7 +7,7 @@ PHP_ARG_WITH(tux,, AC_MSG_CHECKING([for TUX]) if test "$PHP_TUX" != "no"; then - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_TUX/php5.tux.so" + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_TUX/php7.tux.so" AC_CHECK_HEADERS(tuxmodule.h,[:],[AC_MSG_ERROR([Cannot find tuxmodule.h])]) PHP_SELECT_SAPI(tux, shared, php_tux.c) AC_MSG_RESULT([$PHP_TUX]) diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c index 9dba8efbfe..783fe852bc 100644 --- a/sapi/tux/php_tux.c +++ b/sapi/tux/php_tux.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -21,7 +21,7 @@ #include "php_main.h" #include "php_variables.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "tuxmodule.h" diff --git a/sapi/webjames/README b/sapi/webjames/README index 746a7762fb..15a7be3de0 100644 --- a/sapi/webjames/README +++ b/sapi/webjames/README @@ -16,7 +16,7 @@ http://www.webjames.alexwaugh.com/ BUILDING -$ cd php5 +$ cd php7 $ ./configure \ --host=arm-riscos-aof \ --with-webjames=../webjames/src \ diff --git a/sapi/webjames/php_webjames.h b/sapi/webjames/php_webjames.h index dcb6cdb911..08f4a11442 100644 --- a/sapi/webjames/php_webjames.h +++ b/sapi/webjames/php_webjames.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c index 264f910af4..2978131ac1 100644 --- a/sapi/webjames/webjames.c +++ b/sapi/webjames/webjames.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/scripts/dev/check_parameters.php b/scripts/dev/check_parameters.php index c9f5169eec..658471ef2a 100644 --- a/scripts/dev/check_parameters.php +++ b/scripts/dev/check_parameters.php @@ -1,7 +1,7 @@ <?php /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ diff --git a/scripts/dev/credits b/scripts/dev/credits index 801637cd19..5be84fda07 100755 --- a/scripts/dev/credits +++ b/scripts/dev/credits @@ -10,9 +10,9 @@ do /* DO NOT EDIT THIS FILE! - it has been automaticaly created by php5/scripts/credits from - the information found in the various php5/ext/.../CREDITS and - php5/sapi/.../CREDITS files + it has been automaticaly created by php7/scripts/credits from + the information found in the various php7/ext/.../CREDITS and + php7/sapi/.../CREDITS files if you want to change an entry you have to edit the appropriate CREDITS file instead diff --git a/scripts/dev/search_underscores.php b/scripts/dev/search_underscores.php index 445228b8c5..67ed02f160 100755 --- a/scripts/dev/search_underscores.php +++ b/scripts/dev/search_underscores.php @@ -3,7 +3,7 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2006 The PHP Group | +----------------------------------------------------------------------+ diff --git a/server-tests.php b/server-tests.php index 688fee485a..8666895a96 100755 --- a/server-tests.php +++ b/server-tests.php @@ -1,7 +1,7 @@ <?php /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ diff --git a/tests/classes/inheritance_002.phpt b/tests/classes/inheritance_002.phpt index cca528e29c..0b8cf2650e 100644 --- a/tests/classes/inheritance_002.phpt +++ b/tests/classes/inheritance_002.phpt @@ -17,13 +17,13 @@ class Child_php4 extends Base_php4 { } } -class Base_php5 { +class Base_php7 { function __construct() { var_dump('Base constructor'); } } -class Child_php5 extends Base_php5 { +class Child_php7 extends Base_php7 { function __construct() { var_dump('Child constructor'); parent::__construct(); @@ -37,7 +37,7 @@ class Child_mx1 extends Base_php4 { } } -class Child_mx2 extends Base_php5 { +class Child_mx2 extends Base_php7 { function Child_mx2() { var_dump('Child constructor'); parent::__construct(); @@ -47,8 +47,8 @@ class Child_mx2 extends Base_php5 { echo "### PHP 4 style\n"; $c4= new Child_php4(); -echo "### PHP 5 style\n"; -$c5= new Child_php5(); +echo "### PHP 7 style\n"; +$c5= new Child_php7(); echo "### Mixed style 1\n"; $cm= new Child_mx1(); @@ -60,7 +60,7 @@ $cm= new Child_mx2(); ### PHP 4 style string(17) "Child constructor" string(16) "Base constructor" -### PHP 5 style +### PHP 7 style string(17) "Child constructor" string(16) "Base constructor" ### Mixed style 1 diff --git a/tests/lang/bug24396.phpt b/tests/lang/bug24396.phpt index b78e4b8757..80862191de 100644 --- a/tests/lang/bug24396.phpt +++ b/tests/lang/bug24396.phpt @@ -6,7 +6,7 @@ Bug #24396 (global $$variable broken) $arr = array('a' => 1, 'b' => 2, 'c' => 3); foreach($arr as $k=>$v) { - global $$k; // comment this out and it works in PHP 5 too.. + global $$k; // comment this out and it works in PHP 7 too.. echo "($k => $v)\n"; diff --git a/tests/lang/foreachLoop.013.phpt b/tests/lang/foreachLoop.013.phpt index 3dec1194ff..b0c5e8dcf5 100644 --- a/tests/lang/foreachLoop.013.phpt +++ b/tests/lang/foreachLoop.013.phpt @@ -1,5 +1,7 @@ --TEST--
Directly modifying an unreferenced array when foreach'ing over it while using &$value syntax.
+--XFAIL--
+Needs major foreach changes to get sane behavior
--FILE--
<?php
diff --git a/tests/lang/foreachLoop.014.phpt b/tests/lang/foreachLoop.014.phpt index ab3c657715..d32ea635fd 100644 --- a/tests/lang/foreachLoop.014.phpt +++ b/tests/lang/foreachLoop.014.phpt @@ -1,5 +1,7 @@ --TEST--
Directly modifying a REFERENCED array when foreach'ing over it.
+--XFAIL--
+Needs major foreach changes to get sane behavior
--FILE--
<?php
@@ -553,4 +555,4 @@ array(10) { string(3) "v.2"
[9]=>
string(3) "v.3"
-}
\ No newline at end of file +}
diff --git a/tests/lang/foreachLoop.015.phpt b/tests/lang/foreachLoop.015.phpt index dfba159153..5b12a2b0c2 100644 --- a/tests/lang/foreachLoop.015.phpt +++ b/tests/lang/foreachLoop.015.phpt @@ -1,5 +1,7 @@ --TEST--
Directly modifying a REFERENCED array when foreach'ing over it while using &$value syntax.
+--XFAIL--
+Needs major foreach changes to get sane behavior
--FILE--
<?php
diff --git a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt index 24da2d0dc4..d784ed6601 100644 --- a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt @@ -44,25 +44,25 @@ int(9223372036854775807) --- testing: 9223372036854775807 << 1 --- int(-2) --- testing: 9223372036854775807 << -1 --- -int(-9223372036854775808) +bool(false) --- testing: 9223372036854775807 << 7 --- int(-128) --- testing: 9223372036854775807 << 9 --- int(-512) --- testing: 9223372036854775807 << 65 --- -int(-2) +int(0) --- testing: 9223372036854775807 << -44 --- -int(-1048576) +bool(false) --- testing: 9223372036854775807 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 9223372036854775807 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: -9223372036854775808 << 0 --- int(-9223372036854775808) --- testing: -9223372036854775808 << 1 --- int(0) --- testing: -9223372036854775808 << -1 --- -int(0) +bool(false) --- testing: -9223372036854775808 << 7 --- int(0) --- testing: -9223372036854775808 << 9 --- @@ -70,7 +70,7 @@ int(0) --- testing: -9223372036854775808 << 65 --- int(0) --- testing: -9223372036854775808 << -44 --- -int(0) +bool(false) --- testing: -9223372036854775808 << 2147483647 --- int(0) --- testing: -9223372036854775808 << 9223372036854775807 --- @@ -80,33 +80,33 @@ int(2147483647) --- testing: 2147483647 << 1 --- int(4294967294) --- testing: 2147483647 << -1 --- -int(-9223372036854775808) +bool(false) --- testing: 2147483647 << 7 --- int(274877906816) --- testing: 2147483647 << 9 --- int(1099511627264) --- testing: 2147483647 << 65 --- -int(4294967294) +int(0) --- testing: 2147483647 << -44 --- -int(2251799812636672) +bool(false) --- testing: 2147483647 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 2147483647 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: -2147483648 << 0 --- int(-2147483648) --- testing: -2147483648 << 1 --- int(-4294967296) --- testing: -2147483648 << -1 --- -int(0) +bool(false) --- testing: -2147483648 << 7 --- int(-274877906944) --- testing: -2147483648 << 9 --- int(-1099511627776) --- testing: -2147483648 << 65 --- -int(-4294967296) +int(0) --- testing: -2147483648 << -44 --- -int(-2251799813685248) +bool(false) --- testing: -2147483648 << 2147483647 --- int(0) --- testing: -2147483648 << 9223372036854775807 --- @@ -116,15 +116,15 @@ int(9223372034707292160) --- testing: 9223372034707292160 << 1 --- int(-4294967296) --- testing: 9223372034707292160 << -1 --- -int(0) +bool(false) --- testing: 9223372034707292160 << 7 --- int(-274877906944) --- testing: 9223372034707292160 << 9 --- int(-1099511627776) --- testing: 9223372034707292160 << 65 --- -int(-4294967296) +int(0) --- testing: 9223372034707292160 << -44 --- -int(-2251799813685248) +bool(false) --- testing: 9223372034707292160 << 2147483647 --- int(0) --- testing: 9223372034707292160 << 9223372036854775807 --- @@ -134,15 +134,15 @@ int(-9223372034707292160) --- testing: -9223372034707292160 << 1 --- int(4294967296) --- testing: -9223372034707292160 << -1 --- -int(0) +bool(false) --- testing: -9223372034707292160 << 7 --- int(274877906944) --- testing: -9223372034707292160 << 9 --- int(1099511627776) --- testing: -9223372034707292160 << 65 --- -int(4294967296) +int(0) --- testing: -9223372034707292160 << -44 --- -int(2251799813685248) +bool(false) --- testing: -9223372034707292160 << 2147483647 --- int(0) --- testing: -9223372034707292160 << 9223372036854775807 --- @@ -152,15 +152,15 @@ int(2147483648) --- testing: 2147483648 << 1 --- int(4294967296) --- testing: 2147483648 << -1 --- -int(0) +bool(false) --- testing: 2147483648 << 7 --- int(274877906944) --- testing: 2147483648 << 9 --- int(1099511627776) --- testing: 2147483648 << 65 --- -int(4294967296) +int(0) --- testing: 2147483648 << -44 --- -int(2251799813685248) +bool(false) --- testing: 2147483648 << 2147483647 --- int(0) --- testing: 2147483648 << 9223372036854775807 --- @@ -170,33 +170,33 @@ int(-2147483649) --- testing: -2147483649 << 1 --- int(-4294967298) --- testing: -2147483649 << -1 --- -int(-9223372036854775808) +bool(false) --- testing: -2147483649 << 7 --- int(-274877907072) --- testing: -2147483649 << 9 --- int(-1099511628288) --- testing: -2147483649 << 65 --- -int(-4294967298) +int(0) --- testing: -2147483649 << -44 --- -int(-2251799814733824) +bool(false) --- testing: -2147483649 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: -2147483649 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 4294967294 << 0 --- int(4294967294) --- testing: 4294967294 << 1 --- int(8589934588) --- testing: 4294967294 << -1 --- -int(0) +bool(false) --- testing: 4294967294 << 7 --- int(549755813632) --- testing: 4294967294 << 9 --- int(2199023254528) --- testing: 4294967294 << 65 --- -int(8589934588) +int(0) --- testing: 4294967294 << -44 --- -int(4503599625273344) +bool(false) --- testing: 4294967294 << 2147483647 --- int(0) --- testing: 4294967294 << 9223372036854775807 --- @@ -206,51 +206,51 @@ int(4294967295) --- testing: 4294967295 << 1 --- int(8589934590) --- testing: 4294967295 << -1 --- -int(-9223372036854775808) +bool(false) --- testing: 4294967295 << 7 --- int(549755813760) --- testing: 4294967295 << 9 --- int(2199023255040) --- testing: 4294967295 << 65 --- -int(8589934590) +int(0) --- testing: 4294967295 << -44 --- -int(4503599626321920) +bool(false) --- testing: 4294967295 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 4294967295 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 4294967293 << 0 --- int(4294967293) --- testing: 4294967293 << 1 --- int(8589934586) --- testing: 4294967293 << -1 --- -int(-9223372036854775808) +bool(false) --- testing: 4294967293 << 7 --- int(549755813504) --- testing: 4294967293 << 9 --- int(2199023254016) --- testing: 4294967293 << 65 --- -int(8589934586) +int(0) --- testing: 4294967293 << -44 --- -int(4503599624224768) +bool(false) --- testing: 4294967293 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 4294967293 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 9223372036854775806 << 0 --- int(9223372036854775806) --- testing: 9223372036854775806 << 1 --- int(-4) --- testing: 9223372036854775806 << -1 --- -int(0) +bool(false) --- testing: 9223372036854775806 << 7 --- int(-256) --- testing: 9223372036854775806 << 9 --- int(-1024) --- testing: 9223372036854775806 << 65 --- -int(-4) +int(0) --- testing: 9223372036854775806 << -44 --- -int(-2097152) +bool(false) --- testing: 9223372036854775806 << 2147483647 --- int(0) --- testing: 9223372036854775806 << 9223372036854775807 --- @@ -260,7 +260,7 @@ int(-9223372036854775808) --- testing: 9.2233720368548E+18 << 1 --- int(0) --- testing: 9.2233720368548E+18 << -1 --- -int(0) +bool(false) --- testing: 9.2233720368548E+18 << 7 --- int(0) --- testing: 9.2233720368548E+18 << 9 --- @@ -268,7 +268,7 @@ int(0) --- testing: 9.2233720368548E+18 << 65 --- int(0) --- testing: 9.2233720368548E+18 << -44 --- -int(0) +bool(false) --- testing: 9.2233720368548E+18 << 2147483647 --- int(0) --- testing: 9.2233720368548E+18 << 9223372036854775807 --- @@ -278,25 +278,25 @@ int(-9223372036854775807) --- testing: -9223372036854775807 << 1 --- int(2) --- testing: -9223372036854775807 << -1 --- -int(-9223372036854775808) +bool(false) --- testing: -9223372036854775807 << 7 --- int(128) --- testing: -9223372036854775807 << 9 --- int(512) --- testing: -9223372036854775807 << 65 --- -int(2) +int(0) --- testing: -9223372036854775807 << -44 --- -int(1048576) +bool(false) --- testing: -9223372036854775807 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: -9223372036854775807 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: -9.2233720368548E+18 << 0 --- int(-9223372036854775808) --- testing: -9.2233720368548E+18 << 1 --- int(0) --- testing: -9.2233720368548E+18 << -1 --- -int(0) +bool(false) --- testing: -9.2233720368548E+18 << 7 --- int(0) --- testing: -9.2233720368548E+18 << 9 --- @@ -304,7 +304,7 @@ int(0) --- testing: -9.2233720368548E+18 << 65 --- int(0) --- testing: -9.2233720368548E+18 << -44 --- -int(0) +bool(false) --- testing: -9.2233720368548E+18 << 2147483647 --- int(0) --- testing: -9.2233720368548E+18 << 9223372036854775807 --- @@ -312,19 +312,19 @@ int(0) --- testing: 0 << 9223372036854775807 --- int(0) --- testing: 0 << -9223372036854775808 --- -int(0) +bool(false) --- testing: 0 << 2147483647 --- int(0) --- testing: 0 << -2147483648 --- -int(0) +bool(false) --- testing: 0 << 9223372034707292160 --- int(0) --- testing: 0 << -9223372034707292160 --- -int(0) +bool(false) --- testing: 0 << 2147483648 --- int(0) --- testing: 0 << -2147483649 --- -int(0) +bool(false) --- testing: 0 << 4294967294 --- int(0) --- testing: 0 << 4294967295 --- @@ -334,250 +334,249 @@ int(0) --- testing: 0 << 9223372036854775806 --- int(0) --- testing: 0 << 9.2233720368548E+18 --- -int(0) +bool(false) --- testing: 0 << -9223372036854775807 --- -int(0) +bool(false) --- testing: 0 << -9.2233720368548E+18 --- -int(0) +bool(false) --- testing: 1 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 1 << -9223372036854775808 --- -int(1) +bool(false) --- testing: 1 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 1 << -2147483648 --- -int(1) +bool(false) --- testing: 1 << 9223372034707292160 --- -int(1) +int(0) --- testing: 1 << -9223372034707292160 --- -int(1) +bool(false) --- testing: 1 << 2147483648 --- -int(1) +int(0) --- testing: 1 << -2147483649 --- -int(-9223372036854775808) +bool(false) --- testing: 1 << 4294967294 --- -int(4611686018427387904) +int(0) --- testing: 1 << 4294967295 --- -int(-9223372036854775808) +int(0) --- testing: 1 << 4294967293 --- -int(2305843009213693952) +int(0) --- testing: 1 << 9223372036854775806 --- -int(4611686018427387904) +int(0) --- testing: 1 << 9.2233720368548E+18 --- -int(1) +bool(false) --- testing: 1 << -9223372036854775807 --- -int(2) +bool(false) --- testing: 1 << -9.2233720368548E+18 --- -int(1) +bool(false) --- testing: -1 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: -1 << -9223372036854775808 --- -int(-1) +bool(false) --- testing: -1 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: -1 << -2147483648 --- -int(-1) +bool(false) --- testing: -1 << 9223372034707292160 --- -int(-1) +int(0) --- testing: -1 << -9223372034707292160 --- -int(-1) +bool(false) --- testing: -1 << 2147483648 --- -int(-1) +int(0) --- testing: -1 << -2147483649 --- -int(-9223372036854775808) +bool(false) --- testing: -1 << 4294967294 --- -int(-4611686018427387904) +int(0) --- testing: -1 << 4294967295 --- -int(-9223372036854775808) +int(0) --- testing: -1 << 4294967293 --- -int(-2305843009213693952) +int(0) --- testing: -1 << 9223372036854775806 --- -int(-4611686018427387904) +int(0) --- testing: -1 << 9.2233720368548E+18 --- -int(-1) +bool(false) --- testing: -1 << -9223372036854775807 --- -int(-2) +bool(false) --- testing: -1 << -9.2233720368548E+18 --- -int(-1) +bool(false) --- testing: 7 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 7 << -9223372036854775808 --- -int(7) +bool(false) --- testing: 7 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 7 << -2147483648 --- -int(7) +bool(false) --- testing: 7 << 9223372034707292160 --- -int(7) +int(0) --- testing: 7 << -9223372034707292160 --- -int(7) +bool(false) --- testing: 7 << 2147483648 --- -int(7) +int(0) --- testing: 7 << -2147483649 --- -int(-9223372036854775808) +bool(false) --- testing: 7 << 4294967294 --- -int(-4611686018427387904) +int(0) --- testing: 7 << 4294967295 --- -int(-9223372036854775808) +int(0) --- testing: 7 << 4294967293 --- -int(-2305843009213693952) +int(0) --- testing: 7 << 9223372036854775806 --- -int(-4611686018427387904) +int(0) --- testing: 7 << 9.2233720368548E+18 --- -int(7) +bool(false) --- testing: 7 << -9223372036854775807 --- -int(14) +bool(false) --- testing: 7 << -9.2233720368548E+18 --- -int(7) +bool(false) --- testing: 9 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 9 << -9223372036854775808 --- -int(9) +bool(false) --- testing: 9 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 9 << -2147483648 --- -int(9) +bool(false) --- testing: 9 << 9223372034707292160 --- -int(9) +int(0) --- testing: 9 << -9223372034707292160 --- -int(9) +bool(false) --- testing: 9 << 2147483648 --- -int(9) +int(0) --- testing: 9 << -2147483649 --- -int(-9223372036854775808) +bool(false) --- testing: 9 << 4294967294 --- -int(4611686018427387904) +int(0) --- testing: 9 << 4294967295 --- -int(-9223372036854775808) +int(0) --- testing: 9 << 4294967293 --- -int(2305843009213693952) +int(0) --- testing: 9 << 9223372036854775806 --- -int(4611686018427387904) +int(0) --- testing: 9 << 9.2233720368548E+18 --- -int(9) +bool(false) --- testing: 9 << -9223372036854775807 --- -int(18) +bool(false) --- testing: 9 << -9.2233720368548E+18 --- -int(9) +bool(false) --- testing: 65 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 65 << -9223372036854775808 --- -int(65) +bool(false) --- testing: 65 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 65 << -2147483648 --- -int(65) +bool(false) --- testing: 65 << 9223372034707292160 --- -int(65) +int(0) --- testing: 65 << -9223372034707292160 --- -int(65) +bool(false) --- testing: 65 << 2147483648 --- -int(65) +int(0) --- testing: 65 << -2147483649 --- -int(-9223372036854775808) +bool(false) --- testing: 65 << 4294967294 --- -int(4611686018427387904) +int(0) --- testing: 65 << 4294967295 --- -int(-9223372036854775808) +int(0) --- testing: 65 << 4294967293 --- -int(2305843009213693952) +int(0) --- testing: 65 << 9223372036854775806 --- -int(4611686018427387904) +int(0) --- testing: 65 << 9.2233720368548E+18 --- -int(65) +bool(false) --- testing: 65 << -9223372036854775807 --- -int(130) +bool(false) --- testing: 65 << -9.2233720368548E+18 --- -int(65) +bool(false) --- testing: -44 << 9223372036854775807 --- int(0) --- testing: -44 << -9223372036854775808 --- -int(-44) +bool(false) --- testing: -44 << 2147483647 --- int(0) --- testing: -44 << -2147483648 --- -int(-44) +bool(false) --- testing: -44 << 9223372034707292160 --- -int(-44) +int(0) --- testing: -44 << -9223372034707292160 --- -int(-44) +bool(false) --- testing: -44 << 2147483648 --- -int(-44) ---- testing: -44 << -2147483649 --- int(0) +--- testing: -44 << -2147483649 --- +bool(false) --- testing: -44 << 4294967294 --- int(0) --- testing: -44 << 4294967295 --- int(0) --- testing: -44 << 4294967293 --- -int(-9223372036854775808) +int(0) --- testing: -44 << 9223372036854775806 --- int(0) --- testing: -44 << 9.2233720368548E+18 --- -int(-44) +bool(false) --- testing: -44 << -9223372036854775807 --- -int(-88) +bool(false) --- testing: -44 << -9.2233720368548E+18 --- -int(-44) +bool(false) --- testing: 2147483647 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 2147483647 << -9223372036854775808 --- -int(2147483647) +bool(false) --- testing: 2147483647 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 2147483647 << -2147483648 --- -int(2147483647) +bool(false) --- testing: 2147483647 << 9223372034707292160 --- -int(2147483647) +int(0) --- testing: 2147483647 << -9223372034707292160 --- -int(2147483647) +bool(false) --- testing: 2147483647 << 2147483648 --- -int(2147483647) +int(0) --- testing: 2147483647 << -2147483649 --- -int(-9223372036854775808) +bool(false) --- testing: 2147483647 << 4294967294 --- -int(-4611686018427387904) +int(0) --- testing: 2147483647 << 4294967295 --- -int(-9223372036854775808) +int(0) --- testing: 2147483647 << 4294967293 --- -int(-2305843009213693952) +int(0) --- testing: 2147483647 << 9223372036854775806 --- -int(-4611686018427387904) +int(0) --- testing: 2147483647 << 9.2233720368548E+18 --- -int(2147483647) +bool(false) --- testing: 2147483647 << -9223372036854775807 --- -int(4294967294) +bool(false) --- testing: 2147483647 << -9.2233720368548E+18 --- -int(2147483647) +bool(false) --- testing: 9223372036854775807 << 9223372036854775807 --- -int(-9223372036854775808) +int(0) --- testing: 9223372036854775807 << -9223372036854775808 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 << 2147483647 --- -int(-9223372036854775808) +int(0) --- testing: 9223372036854775807 << -2147483648 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 << 9223372034707292160 --- -int(9223372036854775807) +int(0) --- testing: 9223372036854775807 << -9223372034707292160 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 << 2147483648 --- -int(9223372036854775807) +int(0) --- testing: 9223372036854775807 << -2147483649 --- -int(-9223372036854775808) +bool(false) --- testing: 9223372036854775807 << 4294967294 --- -int(-4611686018427387904) +int(0) --- testing: 9223372036854775807 << 4294967295 --- -int(-9223372036854775808) +int(0) --- testing: 9223372036854775807 << 4294967293 --- -int(-2305843009213693952) +int(0) --- testing: 9223372036854775807 << 9223372036854775806 --- -int(-4611686018427387904) +int(0) --- testing: 9223372036854775807 << 9.2233720368548E+18 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 << -9223372036854775807 --- -int(-2) +bool(false) --- testing: 9223372036854775807 << -9.2233720368548E+18 --- -int(9223372036854775807) -===DONE=== -
\ No newline at end of file +bool(false) +===DONE===
\ No newline at end of file diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt index e13fc3bc1b..d507577777 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt @@ -3,7 +3,6 @@ Test << operator : various numbers as strings --SKIPIF-- <?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); -if ((65<<65)==0) die("skip this test is for Intel only"); ?> --FILE-- <?php @@ -18,7 +17,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { echo "--- testing: '$strVal' << '$otherVal' ---\n"; - var_dump(bin2hex($strVal<<$otherVal)); + var_dump(strVal<<$otherVal); } } @@ -26,396 +25,395 @@ foreach ($strVals as $strVal) { ===DONE=== --EXPECT-- --- testing: '0' << '0' --- -string(2) "30" +int(0) --- testing: '0' << '65' --- -string(2) "30" +int(0) --- testing: '0' << '-44' --- -string(2) "30" +bool(false) --- testing: '0' << '1.2' --- -string(2) "30" +int(0) --- testing: '0' << '-7.7' --- -string(2) "30" +bool(false) --- testing: '0' << 'abc' --- -string(2) "30" +int(0) --- testing: '0' << '123abc' --- -string(2) "30" +int(0) --- testing: '0' << '123e5' --- -string(2) "30" +int(0) --- testing: '0' << '123e5xyz' --- -string(2) "30" +int(0) --- testing: '0' << ' 123abc' --- -string(2) "30" +int(0) --- testing: '0' << '123 abc' --- -string(2) "30" +int(0) --- testing: '0' << '123abc ' --- -string(2) "30" +int(0) --- testing: '0' << '3.4a' --- -string(2) "30" +int(0) --- testing: '0' << 'a5.9' --- -string(2) "30" +int(0) --- testing: '65' << '0' --- -string(4) "3635" +int(0) --- testing: '65' << '65' --- -string(6) "313330" +int(0) --- testing: '65' << '-44' --- -string(16) "3638313537343430" +bool(false) --- testing: '65' << '1.2' --- -string(6) "313330" +int(0) --- testing: '65' << '-7.7' --- -string(22) "2d32313133393239323136" +bool(false) --- testing: '65' << 'abc' --- -string(4) "3635" +int(0) --- testing: '65' << '123abc' --- -string(18) "313334323137373238" +int(0) --- testing: '65' << '123e5' --- -string(18) "313334323137373238" +int(0) --- testing: '65' << '123e5xyz' --- -string(18) "313334323137373238" +int(0) --- testing: '65' << ' 123abc' --- -string(18) "313334323137373238" +int(0) --- testing: '65' << '123 abc' --- -string(18) "313334323137373238" +int(0) --- testing: '65' << '123abc ' --- -string(18) "313334323137373238" +int(0) --- testing: '65' << '3.4a' --- -string(6) "353230" +int(0) --- testing: '65' << 'a5.9' --- -string(4) "3635" +int(0) --- testing: '-44' << '0' --- -string(6) "2d3434" +int(0) --- testing: '-44' << '65' --- -string(6) "2d3838" +int(0) --- testing: '-44' << '-44' --- -string(18) "2d3436313337333434" +bool(false) --- testing: '-44' << '1.2' --- -string(6) "2d3838" +int(0) --- testing: '-44' << '-7.7' --- -string(22) "2d31343736333935303038" +bool(false) --- testing: '-44' << 'abc' --- -string(6) "2d3434" +int(0) --- testing: '-44' << '123abc' --- -string(22) "2d31363130363132373336" +int(0) --- testing: '-44' << '123e5' --- -string(22) "2d31363130363132373336" +int(0) --- testing: '-44' << '123e5xyz' --- -string(22) "2d31363130363132373336" +int(0) --- testing: '-44' << ' 123abc' --- -string(22) "2d31363130363132373336" +int(0) --- testing: '-44' << '123 abc' --- -string(22) "2d31363130363132373336" +int(0) --- testing: '-44' << '123abc ' --- -string(22) "2d31363130363132373336" +int(0) --- testing: '-44' << '3.4a' --- -string(8) "2d333532" +int(0) --- testing: '-44' << 'a5.9' --- -string(6) "2d3434" +int(0) --- testing: '1.2' << '0' --- -string(2) "31" +int(0) --- testing: '1.2' << '65' --- -string(2) "32" +int(0) --- testing: '1.2' << '-44' --- -string(14) "31303438353736" +bool(false) --- testing: '1.2' << '1.2' --- -string(2) "32" +int(0) --- testing: '1.2' << '-7.7' --- -string(16) "3333353534343332" +bool(false) --- testing: '1.2' << 'abc' --- -string(2) "31" +int(0) --- testing: '1.2' << '123abc' --- -string(18) "313334323137373238" +int(0) --- testing: '1.2' << '123e5' --- -string(18) "313334323137373238" +int(0) --- testing: '1.2' << '123e5xyz' --- -string(18) "313334323137373238" +int(0) --- testing: '1.2' << ' 123abc' --- -string(18) "313334323137373238" +int(0) --- testing: '1.2' << '123 abc' --- -string(18) "313334323137373238" +int(0) --- testing: '1.2' << '123abc ' --- -string(18) "313334323137373238" +int(0) --- testing: '1.2' << '3.4a' --- -string(2) "38" +int(0) --- testing: '1.2' << 'a5.9' --- -string(2) "31" +int(0) --- testing: '-7.7' << '0' --- -string(4) "2d37" +int(0) --- testing: '-7.7' << '65' --- -string(6) "2d3134" +int(0) --- testing: '-7.7' << '-44' --- -string(16) "2d37333430303332" +bool(false) --- testing: '-7.7' << '1.2' --- -string(6) "2d3134" +int(0) --- testing: '-7.7' << '-7.7' --- -string(20) "2d323334383831303234" +bool(false) --- testing: '-7.7' << 'abc' --- -string(4) "2d37" +int(0) --- testing: '-7.7' << '123abc' --- -string(20) "2d393339353234303936" +int(0) --- testing: '-7.7' << '123e5' --- -string(20) "2d393339353234303936" +int(0) --- testing: '-7.7' << '123e5xyz' --- -string(20) "2d393339353234303936" +int(0) --- testing: '-7.7' << ' 123abc' --- -string(20) "2d393339353234303936" +int(0) --- testing: '-7.7' << '123 abc' --- -string(20) "2d393339353234303936" +int(0) --- testing: '-7.7' << '123abc ' --- -string(20) "2d393339353234303936" +int(0) --- testing: '-7.7' << '3.4a' --- -string(6) "2d3536" +int(0) --- testing: '-7.7' << 'a5.9' --- -string(4) "2d37" +int(0) --- testing: 'abc' << '0' --- -string(2) "30" +int(0) --- testing: 'abc' << '65' --- -string(2) "30" +int(0) --- testing: 'abc' << '-44' --- -string(2) "30" +bool(false) --- testing: 'abc' << '1.2' --- -string(2) "30" +int(0) --- testing: 'abc' << '-7.7' --- -string(2) "30" +bool(false) --- testing: 'abc' << 'abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123e5' --- -string(2) "30" +int(0) --- testing: 'abc' << '123e5xyz' --- -string(2) "30" +int(0) --- testing: 'abc' << ' 123abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123 abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123abc ' --- -string(2) "30" +int(0) --- testing: 'abc' << '3.4a' --- -string(2) "30" +int(0) --- testing: 'abc' << 'a5.9' --- -string(2) "30" +int(0) --- testing: '123abc' << '0' --- -string(6) "313233" +int(0) --- testing: '123abc' << '65' --- -string(6) "323436" +int(0) --- testing: '123abc' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123abc' << '1.2' --- -string(6) "323436" +int(0) --- testing: '123abc' << '-7.7' --- -string(20) "2d313637373732313630" +bool(false) --- testing: '123abc' << 'abc' --- -string(6) "313233" +int(0) --- testing: '123abc' << '123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc' << '123e5' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc' << '123e5xyz' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc' << ' 123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc' << '123 abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc' << '123abc ' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc' << '3.4a' --- -string(6) "393834" +int(0) --- testing: '123abc' << 'a5.9' --- -string(6) "313233" +int(0) --- testing: '123e5' << '0' --- -string(6) "313233" +int(0) --- testing: '123e5' << '65' --- -string(6) "323436" +int(0) --- testing: '123e5' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123e5' << '1.2' --- -string(6) "323436" +int(0) --- testing: '123e5' << '-7.7' --- -string(20) "2d313637373732313630" +bool(false) --- testing: '123e5' << 'abc' --- -string(6) "313233" +int(0) --- testing: '123e5' << '123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5' << '123e5' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5' << '123e5xyz' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5' << ' 123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5' << '123 abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5' << '123abc ' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5' << '3.4a' --- -string(6) "393834" +int(0) --- testing: '123e5' << 'a5.9' --- -string(6) "313233" +int(0) --- testing: '123e5xyz' << '0' --- -string(6) "313233" +int(0) --- testing: '123e5xyz' << '65' --- -string(6) "323436" +int(0) --- testing: '123e5xyz' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123e5xyz' << '1.2' --- -string(6) "323436" +int(0) --- testing: '123e5xyz' << '-7.7' --- -string(20) "2d313637373732313630" +bool(false) --- testing: '123e5xyz' << 'abc' --- -string(6) "313233" +int(0) --- testing: '123e5xyz' << '123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5xyz' << '123e5' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5xyz' << '123e5xyz' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5xyz' << ' 123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5xyz' << '123 abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5xyz' << '123abc ' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123e5xyz' << '3.4a' --- -string(6) "393834" +int(0) --- testing: '123e5xyz' << 'a5.9' --- -string(6) "313233" +int(0) --- testing: ' 123abc' << '0' --- -string(6) "313233" +int(0) --- testing: ' 123abc' << '65' --- -string(6) "323436" +int(0) --- testing: ' 123abc' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: ' 123abc' << '1.2' --- -string(6) "323436" +int(0) --- testing: ' 123abc' << '-7.7' --- -string(20) "2d313637373732313630" +bool(false) --- testing: ' 123abc' << 'abc' --- -string(6) "313233" +int(0) --- testing: ' 123abc' << '123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: ' 123abc' << '123e5' --- -string(20) "2d363731303838363430" +int(0) --- testing: ' 123abc' << '123e5xyz' --- -string(20) "2d363731303838363430" +int(0) --- testing: ' 123abc' << ' 123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: ' 123abc' << '123 abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: ' 123abc' << '123abc ' --- -string(20) "2d363731303838363430" +int(0) --- testing: ' 123abc' << '3.4a' --- -string(6) "393834" +int(0) --- testing: ' 123abc' << 'a5.9' --- -string(6) "313233" +int(0) --- testing: '123 abc' << '0' --- -string(6) "313233" +int(0) --- testing: '123 abc' << '65' --- -string(6) "323436" +int(0) --- testing: '123 abc' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123 abc' << '1.2' --- -string(6) "323436" +int(0) --- testing: '123 abc' << '-7.7' --- -string(20) "2d313637373732313630" +bool(false) --- testing: '123 abc' << 'abc' --- -string(6) "313233" +int(0) --- testing: '123 abc' << '123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123 abc' << '123e5' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123 abc' << '123e5xyz' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123 abc' << ' 123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123 abc' << '123 abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123 abc' << '123abc ' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123 abc' << '3.4a' --- -string(6) "393834" +int(0) --- testing: '123 abc' << 'a5.9' --- -string(6) "313233" +int(0) --- testing: '123abc ' << '0' --- -string(6) "313233" +int(0) --- testing: '123abc ' << '65' --- -string(6) "323436" +int(0) --- testing: '123abc ' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123abc ' << '1.2' --- -string(6) "323436" +int(0) --- testing: '123abc ' << '-7.7' --- -string(20) "2d313637373732313630" +bool(false) --- testing: '123abc ' << 'abc' --- -string(6) "313233" +int(0) --- testing: '123abc ' << '123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc ' << '123e5' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc ' << '123e5xyz' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc ' << ' 123abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc ' << '123 abc' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc ' << '123abc ' --- -string(20) "2d363731303838363430" +int(0) --- testing: '123abc ' << '3.4a' --- -string(6) "393834" +int(0) --- testing: '123abc ' << 'a5.9' --- -string(6) "313233" +int(0) --- testing: '3.4a' << '0' --- -string(2) "33" +int(0) --- testing: '3.4a' << '65' --- -string(2) "36" +int(0) --- testing: '3.4a' << '-44' --- -string(14) "33313435373238" +bool(false) --- testing: '3.4a' << '1.2' --- -string(2) "36" +int(0) --- testing: '3.4a' << '-7.7' --- -string(18) "313030363633323936" +bool(false) --- testing: '3.4a' << 'abc' --- -string(2) "33" +int(0) --- testing: '3.4a' << '123abc' --- -string(18) "343032363533313834" +int(0) --- testing: '3.4a' << '123e5' --- -string(18) "343032363533313834" +int(0) --- testing: '3.4a' << '123e5xyz' --- -string(18) "343032363533313834" +int(0) --- testing: '3.4a' << ' 123abc' --- -string(18) "343032363533313834" +int(0) --- testing: '3.4a' << '123 abc' --- -string(18) "343032363533313834" +int(0) --- testing: '3.4a' << '123abc ' --- -string(18) "343032363533313834" +int(0) --- testing: '3.4a' << '3.4a' --- -string(4) "3234" +int(0) --- testing: '3.4a' << 'a5.9' --- -string(2) "33" +int(0) --- testing: 'a5.9' << '0' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '65' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '-44' --- -string(2) "30" +bool(false) --- testing: 'a5.9' << '1.2' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '-7.7' --- -string(2) "30" +bool(false) --- testing: 'a5.9' << 'abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123e5' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123e5xyz' --- -string(2) "30" +int(0) --- testing: 'a5.9' << ' 123abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123 abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123abc ' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '3.4a' --- -string(2) "30" +int(0) --- testing: 'a5.9' << 'a5.9' --- -string(2) "30" -===DONE=== - +int(0) +===DONE===
\ No newline at end of file diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt index 0b697c8579..655d72545d 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt @@ -17,7 +17,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) {
foreach($strVals as $otherVal) {
echo "--- testing: '$strVal' << '$otherVal' ---\n";
- var_dump(bin2hex($strVal<<$otherVal));
+ var_dump($strVal<<$otherVal);
}
}
@@ -26,395 +26,395 @@ foreach ($strVals as $strVal) { ===DONE===
--EXPECT--
--- testing: '0' << '0' --- -string(2) "30" +int(0) --- testing: '0' << '65' --- -string(2) "30" +int(0) --- testing: '0' << '-44' --- -string(2) "30" +bool(false) --- testing: '0' << '1.2' --- -string(2) "30" +int(0) --- testing: '0' << '-7.7' --- -string(2) "30" +bool(false) --- testing: '0' << 'abc' --- -string(2) "30" +int(0) --- testing: '0' << '123abc' --- -string(2) "30" +int(0) --- testing: '0' << '123e5' --- -string(2) "30" +int(0) --- testing: '0' << '123e5xyz' --- -string(2) "30" +int(0) --- testing: '0' << ' 123abc' --- -string(2) "30" +int(0) --- testing: '0' << '123 abc' --- -string(2) "30" +int(0) --- testing: '0' << '123abc ' --- -string(2) "30" +int(0) --- testing: '0' << '3.4a' --- -string(2) "30" +int(0) --- testing: '0' << 'a5.9' --- -string(2) "30" +int(0) --- testing: '65' << '0' --- -string(4) "3635" +int(65) --- testing: '65' << '65' --- -string(6) "313330" +int(0) --- testing: '65' << '-44' --- -string(16) "3638313537343430" +bool(false) --- testing: '65' << '1.2' --- -string(6) "313330" +int(130) --- testing: '65' << '-7.7' --- -string(40) "2d39303739323536383438373738393139393336" +bool(false) --- testing: '65' << 'abc' --- -string(4) "3635" +int(65) --- testing: '65' << '123abc' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '65' << '123e5' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '65' << '123e5xyz' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '65' << ' 123abc' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '65' << '123 abc' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '65' << '123abc ' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '65' << '3.4a' --- -string(6) "353230" +int(520) --- testing: '65' << 'a5.9' --- -string(4) "3635" +int(65) --- testing: '-44' << '0' --- -string(6) "2d3434" +int(-44) --- testing: '-44' << '65' --- -string(6) "2d3838" +int(0) --- testing: '-44' << '-44' --- -string(18) "2d3436313337333434" +bool(false) --- testing: '-44' << '1.2' --- -string(6) "2d3838" +int(-88) --- testing: '-44' << '-7.7' --- -string(40) "2d36333431303638323735333337363538333638" +bool(false) --- testing: '-44' << 'abc' --- -string(6) "2d3434" +int(-44) --- testing: '-44' << '123abc' --- -string(40) "2d36393137353239303237363431303831383536" +int(0) --- testing: '-44' << '123e5' --- -string(40) "2d36393137353239303237363431303831383536" +int(0) --- testing: '-44' << '123e5xyz' --- -string(40) "2d36393137353239303237363431303831383536" +int(0) --- testing: '-44' << ' 123abc' --- -string(40) "2d36393137353239303237363431303831383536" +int(0) --- testing: '-44' << '123 abc' --- -string(40) "2d36393137353239303237363431303831383536" +int(0) --- testing: '-44' << '123abc ' --- -string(40) "2d36393137353239303237363431303831383536" +int(0) --- testing: '-44' << '3.4a' --- -string(8) "2d333532" +int(-352) --- testing: '-44' << 'a5.9' --- -string(6) "2d3434" +int(-44) --- testing: '1.2' << '0' --- -string(2) "31" +int(1) --- testing: '1.2' << '65' --- -string(2) "32" +int(0) --- testing: '1.2' << '-44' --- -string(14) "31303438353736" +bool(false) --- testing: '1.2' << '1.2' --- -string(2) "32" +int(2) --- testing: '1.2' << '-7.7' --- -string(36) "313434313135313838303735383535383732" +bool(false) --- testing: '1.2' << 'abc' --- -string(2) "31" +int(1) --- testing: '1.2' << '123abc' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '1.2' << '123e5' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '1.2' << '123e5xyz' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '1.2' << ' 123abc' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '1.2' << '123 abc' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '1.2' << '123abc ' --- -string(36) "353736343630373532333033343233343838" +int(0) --- testing: '1.2' << '3.4a' --- -string(2) "38" +int(8) --- testing: '1.2' << 'a5.9' --- -string(2) "31" +int(1) --- testing: '-7.7' << '0' --- -string(4) "2d37" +int(-7) --- testing: '-7.7' << '65' --- -string(6) "2d3134" +int(0) --- testing: '-7.7' << '-44' --- -string(16) "2d37333430303332" +bool(false) --- testing: '-7.7' << '1.2' --- -string(6) "2d3134" +int(-14) --- testing: '-7.7' << '-7.7' --- -string(40) "2d31303038383036333136353330393931313034" +bool(false) --- testing: '-7.7' << 'abc' --- -string(4) "2d37" +int(-7) --- testing: '-7.7' << '123abc' --- -string(40) "2d34303335323235323636313233393634343136" +int(0) --- testing: '-7.7' << '123e5' --- -string(40) "2d34303335323235323636313233393634343136" +int(0) --- testing: '-7.7' << '123e5xyz' --- -string(40) "2d34303335323235323636313233393634343136" +int(0) --- testing: '-7.7' << ' 123abc' --- -string(40) "2d34303335323235323636313233393634343136" +int(0) --- testing: '-7.7' << '123 abc' --- -string(40) "2d34303335323235323636313233393634343136" +int(0) --- testing: '-7.7' << '123abc ' --- -string(40) "2d34303335323235323636313233393634343136" +int(0) --- testing: '-7.7' << '3.4a' --- -string(6) "2d3536" +int(-56) --- testing: '-7.7' << 'a5.9' --- -string(4) "2d37" +int(-7) --- testing: 'abc' << '0' --- -string(2) "30" +int(0) --- testing: 'abc' << '65' --- -string(2) "30" +int(0) --- testing: 'abc' << '-44' --- -string(2) "30" +bool(false) --- testing: 'abc' << '1.2' --- -string(2) "30" +int(0) --- testing: 'abc' << '-7.7' --- -string(2) "30" +bool(false) --- testing: 'abc' << 'abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123e5' --- -string(2) "30" +int(0) --- testing: 'abc' << '123e5xyz' --- -string(2) "30" +int(0) --- testing: 'abc' << ' 123abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123 abc' --- -string(2) "30" +int(0) --- testing: 'abc' << '123abc ' --- -string(2) "30" +int(0) --- testing: 'abc' << '3.4a' --- -string(2) "30" +int(0) --- testing: 'abc' << 'a5.9' --- -string(2) "30" +int(0) --- testing: '123abc' << '0' --- -string(6) "313233" +int(123) --- testing: '123abc' << '65' --- -string(6) "323436" +int(0) --- testing: '123abc' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123abc' << '1.2' --- -string(6) "323436" +int(246) --- testing: '123abc' << '-7.7' --- -string(38) "2d373230353735393430333739323739333630" +bool(false) --- testing: '123abc' << 'abc' --- -string(6) "313233" +int(123) --- testing: '123abc' << '123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc' << '123e5' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc' << '123e5xyz' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc' << ' 123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc' << '123 abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc' << '123abc ' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc' << '3.4a' --- -string(6) "393834" +int(984) --- testing: '123abc' << 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123e5' << '0' --- -string(6) "313233" +int(123) --- testing: '123e5' << '65' --- -string(6) "323436" +int(0) --- testing: '123e5' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123e5' << '1.2' --- -string(6) "323436" +int(246) --- testing: '123e5' << '-7.7' --- -string(38) "2d373230353735393430333739323739333630" +bool(false) --- testing: '123e5' << 'abc' --- -string(6) "313233" +int(123) --- testing: '123e5' << '123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5' << '123e5' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5' << '123e5xyz' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5' << ' 123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5' << '123 abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5' << '123abc ' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5' << '3.4a' --- -string(6) "393834" +int(984) --- testing: '123e5' << 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123e5xyz' << '0' --- -string(6) "313233" +int(123) --- testing: '123e5xyz' << '65' --- -string(6) "323436" +int(0) --- testing: '123e5xyz' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123e5xyz' << '1.2' --- -string(6) "323436" +int(246) --- testing: '123e5xyz' << '-7.7' --- -string(38) "2d373230353735393430333739323739333630" +bool(false) --- testing: '123e5xyz' << 'abc' --- -string(6) "313233" +int(123) --- testing: '123e5xyz' << '123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5xyz' << '123e5' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5xyz' << '123e5xyz' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5xyz' << ' 123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5xyz' << '123 abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5xyz' << '123abc ' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123e5xyz' << '3.4a' --- -string(6) "393834" +int(984) --- testing: '123e5xyz' << 'a5.9' --- -string(6) "313233" +int(123) --- testing: ' 123abc' << '0' --- -string(6) "313233" +int(123) --- testing: ' 123abc' << '65' --- -string(6) "323436" +int(0) --- testing: ' 123abc' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: ' 123abc' << '1.2' --- -string(6) "323436" +int(246) --- testing: ' 123abc' << '-7.7' --- -string(38) "2d373230353735393430333739323739333630" +bool(false) --- testing: ' 123abc' << 'abc' --- -string(6) "313233" +int(123) --- testing: ' 123abc' << '123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: ' 123abc' << '123e5' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: ' 123abc' << '123e5xyz' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: ' 123abc' << ' 123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: ' 123abc' << '123 abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: ' 123abc' << '123abc ' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: ' 123abc' << '3.4a' --- -string(6) "393834" +int(984) --- testing: ' 123abc' << 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123 abc' << '0' --- -string(6) "313233" +int(123) --- testing: '123 abc' << '65' --- -string(6) "323436" +int(0) --- testing: '123 abc' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123 abc' << '1.2' --- -string(6) "323436" +int(246) --- testing: '123 abc' << '-7.7' --- -string(38) "2d373230353735393430333739323739333630" +bool(false) --- testing: '123 abc' << 'abc' --- -string(6) "313233" +int(123) --- testing: '123 abc' << '123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123 abc' << '123e5' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123 abc' << '123e5xyz' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123 abc' << ' 123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123 abc' << '123 abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123 abc' << '123abc ' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123 abc' << '3.4a' --- -string(6) "393834" +int(984) --- testing: '123 abc' << 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123abc ' << '0' --- -string(6) "313233" +int(123) --- testing: '123abc ' << '65' --- -string(6) "323436" +int(0) --- testing: '123abc ' << '-44' --- -string(18) "313238393734383438" +bool(false) --- testing: '123abc ' << '1.2' --- -string(6) "323436" +int(246) --- testing: '123abc ' << '-7.7' --- -string(38) "2d373230353735393430333739323739333630" +bool(false) --- testing: '123abc ' << 'abc' --- -string(6) "313233" +int(123) --- testing: '123abc ' << '123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc ' << '123e5' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc ' << '123e5xyz' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc ' << ' 123abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc ' << '123 abc' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc ' << '123abc ' --- -string(40) "2d32383832333033373631353137313137343430" +int(0) --- testing: '123abc ' << '3.4a' --- -string(6) "393834" +int(984) --- testing: '123abc ' << 'a5.9' --- -string(6) "313233" +int(123) --- testing: '3.4a' << '0' --- -string(2) "33" +int(3) --- testing: '3.4a' << '65' --- -string(2) "36" +int(0) --- testing: '3.4a' << '-44' --- -string(14) "33313435373238" +bool(false) --- testing: '3.4a' << '1.2' --- -string(2) "36" +int(6) --- testing: '3.4a' << '-7.7' --- -string(36) "343332333435353634323237353637363136" +bool(false) --- testing: '3.4a' << 'abc' --- -string(2) "33" +int(3) --- testing: '3.4a' << '123abc' --- -string(38) "31373239333832323536393130323730343634" +int(0) --- testing: '3.4a' << '123e5' --- -string(38) "31373239333832323536393130323730343634" +int(0) --- testing: '3.4a' << '123e5xyz' --- -string(38) "31373239333832323536393130323730343634" +int(0) --- testing: '3.4a' << ' 123abc' --- -string(38) "31373239333832323536393130323730343634" +int(0) --- testing: '3.4a' << '123 abc' --- -string(38) "31373239333832323536393130323730343634" +int(0) --- testing: '3.4a' << '123abc ' --- -string(38) "31373239333832323536393130323730343634" +int(0) --- testing: '3.4a' << '3.4a' --- -string(4) "3234" +int(24) --- testing: '3.4a' << 'a5.9' --- -string(2) "33" +int(3) --- testing: 'a5.9' << '0' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '65' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '-44' --- -string(2) "30" +bool(false) --- testing: 'a5.9' << '1.2' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '-7.7' --- -string(2) "30" +bool(false) --- testing: 'a5.9' << 'abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123e5' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123e5xyz' --- -string(2) "30" +int(0) --- testing: 'a5.9' << ' 123abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123 abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '123abc ' --- -string(2) "30" +int(0) --- testing: 'a5.9' << '3.4a' --- -string(2) "30" +int(0) --- testing: 'a5.9' << 'a5.9' --- -string(2) "30"
-===DONE===
+int(0) +===DONE===
\ No newline at end of file diff --git a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt index 1029d1942a..1747bc66fe 100644 --- a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt @@ -44,15 +44,15 @@ int(9223372036854775807) --- testing: 9223372036854775807 >> 1 --- int(4611686018427387903) --- testing: 9223372036854775807 >> -1 --- -int(0) +bool(false) --- testing: 9223372036854775807 >> 7 --- int(72057594037927935) --- testing: 9223372036854775807 >> 9 --- int(18014398509481983) --- testing: 9223372036854775807 >> 65 --- -int(4611686018427387903) +int(0) --- testing: 9223372036854775807 >> -44 --- -int(8796093022207) +bool(false) --- testing: 9223372036854775807 >> 2147483647 --- int(0) --- testing: 9223372036854775807 >> 9223372036854775807 --- @@ -62,15 +62,15 @@ int(-9223372036854775808) --- testing: -9223372036854775808 >> 1 --- int(-4611686018427387904) --- testing: -9223372036854775808 >> -1 --- -int(-1) +bool(false) --- testing: -9223372036854775808 >> 7 --- int(-72057594037927936) --- testing: -9223372036854775808 >> 9 --- int(-18014398509481984) --- testing: -9223372036854775808 >> 65 --- -int(-4611686018427387904) +int(-1) --- testing: -9223372036854775808 >> -44 --- -int(-8796093022208) +bool(false) --- testing: -9223372036854775808 >> 2147483647 --- int(-1) --- testing: -9223372036854775808 >> 9223372036854775807 --- @@ -80,15 +80,15 @@ int(2147483647) --- testing: 2147483647 >> 1 --- int(1073741823) --- testing: 2147483647 >> -1 --- -int(0) +bool(false) --- testing: 2147483647 >> 7 --- int(16777215) --- testing: 2147483647 >> 9 --- int(4194303) --- testing: 2147483647 >> 65 --- -int(1073741823) +int(0) --- testing: 2147483647 >> -44 --- -int(2047) +bool(false) --- testing: 2147483647 >> 2147483647 --- int(0) --- testing: 2147483647 >> 9223372036854775807 --- @@ -98,15 +98,15 @@ int(-2147483648) --- testing: -2147483648 >> 1 --- int(-1073741824) --- testing: -2147483648 >> -1 --- -int(-1) +bool(false) --- testing: -2147483648 >> 7 --- int(-16777216) --- testing: -2147483648 >> 9 --- int(-4194304) --- testing: -2147483648 >> 65 --- -int(-1073741824) +int(-1) --- testing: -2147483648 >> -44 --- -int(-2048) +bool(false) --- testing: -2147483648 >> 2147483647 --- int(-1) --- testing: -2147483648 >> 9223372036854775807 --- @@ -116,15 +116,15 @@ int(9223372034707292160) --- testing: 9223372034707292160 >> 1 --- int(4611686017353646080) --- testing: 9223372034707292160 >> -1 --- -int(0) +bool(false) --- testing: 9223372034707292160 >> 7 --- int(72057594021150720) --- testing: 9223372034707292160 >> 9 --- int(18014398505287680) --- testing: 9223372034707292160 >> 65 --- -int(4611686017353646080) +int(0) --- testing: 9223372034707292160 >> -44 --- -int(8796093020160) +bool(false) --- testing: 9223372034707292160 >> 2147483647 --- int(0) --- testing: 9223372034707292160 >> 9223372036854775807 --- @@ -134,15 +134,15 @@ int(-9223372034707292160) --- testing: -9223372034707292160 >> 1 --- int(-4611686017353646080) --- testing: -9223372034707292160 >> -1 --- -int(-1) +bool(false) --- testing: -9223372034707292160 >> 7 --- int(-72057594021150720) --- testing: -9223372034707292160 >> 9 --- int(-18014398505287680) --- testing: -9223372034707292160 >> 65 --- -int(-4611686017353646080) +int(-1) --- testing: -9223372034707292160 >> -44 --- -int(-8796093020160) +bool(false) --- testing: -9223372034707292160 >> 2147483647 --- int(-1) --- testing: -9223372034707292160 >> 9223372036854775807 --- @@ -152,15 +152,15 @@ int(2147483648) --- testing: 2147483648 >> 1 --- int(1073741824) --- testing: 2147483648 >> -1 --- -int(0) +bool(false) --- testing: 2147483648 >> 7 --- int(16777216) --- testing: 2147483648 >> 9 --- int(4194304) --- testing: 2147483648 >> 65 --- -int(1073741824) +int(0) --- testing: 2147483648 >> -44 --- -int(2048) +bool(false) --- testing: 2147483648 >> 2147483647 --- int(0) --- testing: 2147483648 >> 9223372036854775807 --- @@ -170,15 +170,15 @@ int(-2147483649) --- testing: -2147483649 >> 1 --- int(-1073741825) --- testing: -2147483649 >> -1 --- -int(-1) +bool(false) --- testing: -2147483649 >> 7 --- int(-16777217) --- testing: -2147483649 >> 9 --- int(-4194305) --- testing: -2147483649 >> 65 --- -int(-1073741825) +int(-1) --- testing: -2147483649 >> -44 --- -int(-2049) +bool(false) --- testing: -2147483649 >> 2147483647 --- int(-1) --- testing: -2147483649 >> 9223372036854775807 --- @@ -188,15 +188,15 @@ int(4294967294) --- testing: 4294967294 >> 1 --- int(2147483647) --- testing: 4294967294 >> -1 --- -int(0) +bool(false) --- testing: 4294967294 >> 7 --- int(33554431) --- testing: 4294967294 >> 9 --- int(8388607) --- testing: 4294967294 >> 65 --- -int(2147483647) +int(0) --- testing: 4294967294 >> -44 --- -int(4095) +bool(false) --- testing: 4294967294 >> 2147483647 --- int(0) --- testing: 4294967294 >> 9223372036854775807 --- @@ -206,15 +206,15 @@ int(4294967295) --- testing: 4294967295 >> 1 --- int(2147483647) --- testing: 4294967295 >> -1 --- -int(0) +bool(false) --- testing: 4294967295 >> 7 --- int(33554431) --- testing: 4294967295 >> 9 --- int(8388607) --- testing: 4294967295 >> 65 --- -int(2147483647) +int(0) --- testing: 4294967295 >> -44 --- -int(4095) +bool(false) --- testing: 4294967295 >> 2147483647 --- int(0) --- testing: 4294967295 >> 9223372036854775807 --- @@ -224,15 +224,15 @@ int(4294967293) --- testing: 4294967293 >> 1 --- int(2147483646) --- testing: 4294967293 >> -1 --- -int(0) +bool(false) --- testing: 4294967293 >> 7 --- int(33554431) --- testing: 4294967293 >> 9 --- int(8388607) --- testing: 4294967293 >> 65 --- -int(2147483646) +int(0) --- testing: 4294967293 >> -44 --- -int(4095) +bool(false) --- testing: 4294967293 >> 2147483647 --- int(0) --- testing: 4294967293 >> 9223372036854775807 --- @@ -242,15 +242,15 @@ int(9223372036854775806) --- testing: 9223372036854775806 >> 1 --- int(4611686018427387903) --- testing: 9223372036854775806 >> -1 --- -int(0) +bool(false) --- testing: 9223372036854775806 >> 7 --- int(72057594037927935) --- testing: 9223372036854775806 >> 9 --- int(18014398509481983) --- testing: 9223372036854775806 >> 65 --- -int(4611686018427387903) +int(0) --- testing: 9223372036854775806 >> -44 --- -int(8796093022207) +bool(false) --- testing: 9223372036854775806 >> 2147483647 --- int(0) --- testing: 9223372036854775806 >> 9223372036854775807 --- @@ -260,15 +260,15 @@ int(-9223372036854775808) --- testing: 9.2233720368548E+18 >> 1 --- int(-4611686018427387904) --- testing: 9.2233720368548E+18 >> -1 --- -int(-1) +bool(false) --- testing: 9.2233720368548E+18 >> 7 --- int(-72057594037927936) --- testing: 9.2233720368548E+18 >> 9 --- int(-18014398509481984) --- testing: 9.2233720368548E+18 >> 65 --- -int(-4611686018427387904) +int(-1) --- testing: 9.2233720368548E+18 >> -44 --- -int(-8796093022208) +bool(false) --- testing: 9.2233720368548E+18 >> 2147483647 --- int(-1) --- testing: 9.2233720368548E+18 >> 9223372036854775807 --- @@ -278,15 +278,15 @@ int(-9223372036854775807) --- testing: -9223372036854775807 >> 1 --- int(-4611686018427387904) --- testing: -9223372036854775807 >> -1 --- -int(-1) +bool(false) --- testing: -9223372036854775807 >> 7 --- int(-72057594037927936) --- testing: -9223372036854775807 >> 9 --- int(-18014398509481984) --- testing: -9223372036854775807 >> 65 --- -int(-4611686018427387904) +int(-1) --- testing: -9223372036854775807 >> -44 --- -int(-8796093022208) +bool(false) --- testing: -9223372036854775807 >> 2147483647 --- int(-1) --- testing: -9223372036854775807 >> 9223372036854775807 --- @@ -296,15 +296,15 @@ int(-9223372036854775808) --- testing: -9.2233720368548E+18 >> 1 --- int(-4611686018427387904) --- testing: -9.2233720368548E+18 >> -1 --- -int(-1) +bool(false) --- testing: -9.2233720368548E+18 >> 7 --- int(-72057594037927936) --- testing: -9.2233720368548E+18 >> 9 --- int(-18014398509481984) --- testing: -9.2233720368548E+18 >> 65 --- -int(-4611686018427387904) +int(-1) --- testing: -9.2233720368548E+18 >> -44 --- -int(-8796093022208) +bool(false) --- testing: -9.2233720368548E+18 >> 2147483647 --- int(-1) --- testing: -9.2233720368548E+18 >> 9223372036854775807 --- @@ -312,19 +312,19 @@ int(-1) --- testing: 0 >> 9223372036854775807 --- int(0) --- testing: 0 >> -9223372036854775808 --- -int(0) +bool(false) --- testing: 0 >> 2147483647 --- int(0) --- testing: 0 >> -2147483648 --- -int(0) +bool(false) --- testing: 0 >> 9223372034707292160 --- int(0) --- testing: 0 >> -9223372034707292160 --- -int(0) +bool(false) --- testing: 0 >> 2147483648 --- int(0) --- testing: 0 >> -2147483649 --- -int(0) +bool(false) --- testing: 0 >> 4294967294 --- int(0) --- testing: 0 >> 4294967295 --- @@ -334,27 +334,27 @@ int(0) --- testing: 0 >> 9223372036854775806 --- int(0) --- testing: 0 >> 9.2233720368548E+18 --- -int(0) +bool(false) --- testing: 0 >> -9223372036854775807 --- -int(0) +bool(false) --- testing: 0 >> -9.2233720368548E+18 --- -int(0) +bool(false) --- testing: 1 >> 9223372036854775807 --- int(0) --- testing: 1 >> -9223372036854775808 --- -int(1) +bool(false) --- testing: 1 >> 2147483647 --- int(0) --- testing: 1 >> -2147483648 --- -int(1) +bool(false) --- testing: 1 >> 9223372034707292160 --- -int(1) +int(0) --- testing: 1 >> -9223372034707292160 --- -int(1) +bool(false) --- testing: 1 >> 2147483648 --- -int(1) ---- testing: 1 >> -2147483649 --- int(0) +--- testing: 1 >> -2147483649 --- +bool(false) --- testing: 1 >> 4294967294 --- int(0) --- testing: 1 >> 4294967295 --- @@ -364,27 +364,27 @@ int(0) --- testing: 1 >> 9223372036854775806 --- int(0) --- testing: 1 >> 9.2233720368548E+18 --- -int(1) +bool(false) --- testing: 1 >> -9223372036854775807 --- -int(0) +bool(false) --- testing: 1 >> -9.2233720368548E+18 --- -int(1) +bool(false) --- testing: -1 >> 9223372036854775807 --- int(-1) --- testing: -1 >> -9223372036854775808 --- -int(-1) +bool(false) --- testing: -1 >> 2147483647 --- int(-1) --- testing: -1 >> -2147483648 --- -int(-1) +bool(false) --- testing: -1 >> 9223372034707292160 --- int(-1) --- testing: -1 >> -9223372034707292160 --- -int(-1) +bool(false) --- testing: -1 >> 2147483648 --- int(-1) --- testing: -1 >> -2147483649 --- -int(-1) +bool(false) --- testing: -1 >> 4294967294 --- int(-1) --- testing: -1 >> 4294967295 --- @@ -394,27 +394,27 @@ int(-1) --- testing: -1 >> 9223372036854775806 --- int(-1) --- testing: -1 >> 9.2233720368548E+18 --- -int(-1) +bool(false) --- testing: -1 >> -9223372036854775807 --- -int(-1) +bool(false) --- testing: -1 >> -9.2233720368548E+18 --- -int(-1) +bool(false) --- testing: 7 >> 9223372036854775807 --- int(0) --- testing: 7 >> -9223372036854775808 --- -int(7) +bool(false) --- testing: 7 >> 2147483647 --- int(0) --- testing: 7 >> -2147483648 --- -int(7) +bool(false) --- testing: 7 >> 9223372034707292160 --- -int(7) +int(0) --- testing: 7 >> -9223372034707292160 --- -int(7) +bool(false) --- testing: 7 >> 2147483648 --- -int(7) ---- testing: 7 >> -2147483649 --- int(0) +--- testing: 7 >> -2147483649 --- +bool(false) --- testing: 7 >> 4294967294 --- int(0) --- testing: 7 >> 4294967295 --- @@ -424,27 +424,27 @@ int(0) --- testing: 7 >> 9223372036854775806 --- int(0) --- testing: 7 >> 9.2233720368548E+18 --- -int(7) +bool(false) --- testing: 7 >> -9223372036854775807 --- -int(3) +bool(false) --- testing: 7 >> -9.2233720368548E+18 --- -int(7) +bool(false) --- testing: 9 >> 9223372036854775807 --- int(0) --- testing: 9 >> -9223372036854775808 --- -int(9) +bool(false) --- testing: 9 >> 2147483647 --- int(0) --- testing: 9 >> -2147483648 --- -int(9) +bool(false) --- testing: 9 >> 9223372034707292160 --- -int(9) +int(0) --- testing: 9 >> -9223372034707292160 --- -int(9) +bool(false) --- testing: 9 >> 2147483648 --- -int(9) ---- testing: 9 >> -2147483649 --- int(0) +--- testing: 9 >> -2147483649 --- +bool(false) --- testing: 9 >> 4294967294 --- int(0) --- testing: 9 >> 4294967295 --- @@ -454,27 +454,27 @@ int(0) --- testing: 9 >> 9223372036854775806 --- int(0) --- testing: 9 >> 9.2233720368548E+18 --- -int(9) +bool(false) --- testing: 9 >> -9223372036854775807 --- -int(4) +bool(false) --- testing: 9 >> -9.2233720368548E+18 --- -int(9) +bool(false) --- testing: 65 >> 9223372036854775807 --- int(0) --- testing: 65 >> -9223372036854775808 --- -int(65) +bool(false) --- testing: 65 >> 2147483647 --- int(0) --- testing: 65 >> -2147483648 --- -int(65) +bool(false) --- testing: 65 >> 9223372034707292160 --- -int(65) +int(0) --- testing: 65 >> -9223372034707292160 --- -int(65) +bool(false) --- testing: 65 >> 2147483648 --- -int(65) ---- testing: 65 >> -2147483649 --- int(0) +--- testing: 65 >> -2147483649 --- +bool(false) --- testing: 65 >> 4294967294 --- int(0) --- testing: 65 >> 4294967295 --- @@ -484,27 +484,27 @@ int(0) --- testing: 65 >> 9223372036854775806 --- int(0) --- testing: 65 >> 9.2233720368548E+18 --- -int(65) +bool(false) --- testing: 65 >> -9223372036854775807 --- -int(32) +bool(false) --- testing: 65 >> -9.2233720368548E+18 --- -int(65) +bool(false) --- testing: -44 >> 9223372036854775807 --- int(-1) --- testing: -44 >> -9223372036854775808 --- -int(-44) +bool(false) --- testing: -44 >> 2147483647 --- int(-1) --- testing: -44 >> -2147483648 --- -int(-44) +bool(false) --- testing: -44 >> 9223372034707292160 --- -int(-44) +int(-1) --- testing: -44 >> -9223372034707292160 --- -int(-44) +bool(false) --- testing: -44 >> 2147483648 --- -int(-44) ---- testing: -44 >> -2147483649 --- int(-1) +--- testing: -44 >> -2147483649 --- +bool(false) --- testing: -44 >> 4294967294 --- int(-1) --- testing: -44 >> 4294967295 --- @@ -514,27 +514,27 @@ int(-1) --- testing: -44 >> 9223372036854775806 --- int(-1) --- testing: -44 >> 9.2233720368548E+18 --- -int(-44) +bool(false) --- testing: -44 >> -9223372036854775807 --- -int(-22) +bool(false) --- testing: -44 >> -9.2233720368548E+18 --- -int(-44) +bool(false) --- testing: 2147483647 >> 9223372036854775807 --- int(0) --- testing: 2147483647 >> -9223372036854775808 --- -int(2147483647) +bool(false) --- testing: 2147483647 >> 2147483647 --- int(0) --- testing: 2147483647 >> -2147483648 --- -int(2147483647) +bool(false) --- testing: 2147483647 >> 9223372034707292160 --- -int(2147483647) +int(0) --- testing: 2147483647 >> -9223372034707292160 --- -int(2147483647) +bool(false) --- testing: 2147483647 >> 2147483648 --- -int(2147483647) ---- testing: 2147483647 >> -2147483649 --- int(0) +--- testing: 2147483647 >> -2147483649 --- +bool(false) --- testing: 2147483647 >> 4294967294 --- int(0) --- testing: 2147483647 >> 4294967295 --- @@ -544,40 +544,39 @@ int(0) --- testing: 2147483647 >> 9223372036854775806 --- int(0) --- testing: 2147483647 >> 9.2233720368548E+18 --- -int(2147483647) +bool(false) --- testing: 2147483647 >> -9223372036854775807 --- -int(1073741823) +bool(false) --- testing: 2147483647 >> -9.2233720368548E+18 --- -int(2147483647) +bool(false) --- testing: 9223372036854775807 >> 9223372036854775807 --- int(0) --- testing: 9223372036854775807 >> -9223372036854775808 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 >> 2147483647 --- int(0) --- testing: 9223372036854775807 >> -2147483648 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 >> 9223372034707292160 --- -int(9223372036854775807) +int(0) --- testing: 9223372036854775807 >> -9223372034707292160 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 >> 2147483648 --- -int(9223372036854775807) ---- testing: 9223372036854775807 >> -2147483649 --- int(0) +--- testing: 9223372036854775807 >> -2147483649 --- +bool(false) --- testing: 9223372036854775807 >> 4294967294 --- -int(1) +int(0) --- testing: 9223372036854775807 >> 4294967295 --- int(0) --- testing: 9223372036854775807 >> 4294967293 --- -int(3) +int(0) --- testing: 9223372036854775807 >> 9223372036854775806 --- -int(1) +int(0) --- testing: 9223372036854775807 >> 9.2233720368548E+18 --- -int(9223372036854775807) +bool(false) --- testing: 9223372036854775807 >> -9223372036854775807 --- -int(4611686018427387903) +bool(false) --- testing: 9223372036854775807 >> -9.2233720368548E+18 --- -int(9223372036854775807) -===DONE=== -
\ No newline at end of file +bool(false) +===DONE===
\ No newline at end of file diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt index ad53fea9d1..35ca0a618d 100644 --- a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt @@ -1,9 +1,5 @@ --TEST-- Test >> operator : various numbers as strings ---SKIPIF-- -<?php -if ((65<<65)==0) die("skip this test is for Intel only"); -?> --FILE-- <?php @@ -17,7 +13,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { echo "--- testing: '$strVal' >> '$otherVal' ---\n"; - var_dump(bin2hex($strVal>>$otherVal)); + var_dump($strVal>>$otherVal); } } @@ -26,395 +22,395 @@ foreach ($strVals as $strVal) { ===DONE=== --EXPECT-- --- testing: '0' >> '0' --- -string(2) "30" +int(0) --- testing: '0' >> '65' --- -string(2) "30" +int(0) --- testing: '0' >> '-44' --- -string(2) "30" +bool(false) --- testing: '0' >> '1.2' --- -string(2) "30" +int(0) --- testing: '0' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '0' >> 'abc' --- -string(2) "30" +int(0) --- testing: '0' >> '123abc' --- -string(2) "30" +int(0) --- testing: '0' >> '123e5' --- -string(2) "30" +int(0) --- testing: '0' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '0' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '0' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '0' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '0' >> '3.4a' --- -string(2) "30" +int(0) --- testing: '0' >> 'a5.9' --- -string(2) "30" +int(0) --- testing: '65' >> '0' --- -string(4) "3635" +int(65) --- testing: '65' >> '65' --- -string(4) "3332" +int(0) --- testing: '65' >> '-44' --- -string(2) "30" +bool(false) --- testing: '65' >> '1.2' --- -string(4) "3332" +int(32) --- testing: '65' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '65' >> 'abc' --- -string(4) "3635" +int(65) --- testing: '65' >> '123abc' --- -string(2) "30" +int(0) --- testing: '65' >> '123e5' --- -string(2) "30" +int(0) --- testing: '65' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '65' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '65' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '65' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '65' >> '3.4a' --- -string(2) "38" +int(8) --- testing: '65' >> 'a5.9' --- -string(4) "3635" +int(65) --- testing: '-44' >> '0' --- -string(6) "2d3434" +int(-44) --- testing: '-44' >> '65' --- -string(6) "2d3232" +int(-1) --- testing: '-44' >> '-44' --- -string(4) "2d31" +bool(false) --- testing: '-44' >> '1.2' --- -string(6) "2d3232" +int(-22) --- testing: '-44' >> '-7.7' --- -string(4) "2d31" +bool(false) --- testing: '-44' >> 'abc' --- -string(6) "2d3434" +int(-44) --- testing: '-44' >> '123abc' --- -string(4) "2d31" +int(-1) --- testing: '-44' >> '123e5' --- -string(4) "2d31" +int(-1) --- testing: '-44' >> '123e5xyz' --- -string(4) "2d31" +int(-1) --- testing: '-44' >> ' 123abc' --- -string(4) "2d31" +int(-1) --- testing: '-44' >> '123 abc' --- -string(4) "2d31" +int(-1) --- testing: '-44' >> '123abc ' --- -string(4) "2d31" +int(-1) --- testing: '-44' >> '3.4a' --- -string(4) "2d36" +int(-6) --- testing: '-44' >> 'a5.9' --- -string(6) "2d3434" +int(-44) --- testing: '1.2' >> '0' --- -string(2) "31" +int(1) --- testing: '1.2' >> '65' --- -string(2) "30" +int(0) --- testing: '1.2' >> '-44' --- -string(2) "30" +bool(false) --- testing: '1.2' >> '1.2' --- -string(2) "30" +int(0) --- testing: '1.2' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '1.2' >> 'abc' --- -string(2) "31" +int(1) --- testing: '1.2' >> '123abc' --- -string(2) "30" +int(0) --- testing: '1.2' >> '123e5' --- -string(2) "30" +int(0) --- testing: '1.2' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '1.2' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '1.2' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '1.2' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '1.2' >> '3.4a' --- -string(2) "30" +int(0) --- testing: '1.2' >> 'a5.9' --- -string(2) "31" +int(1) --- testing: '-7.7' >> '0' --- -string(4) "2d37" +int(-7) --- testing: '-7.7' >> '65' --- -string(4) "2d34" +int(-1) --- testing: '-7.7' >> '-44' --- -string(4) "2d31" +bool(false) --- testing: '-7.7' >> '1.2' --- -string(4) "2d34" +int(-4) --- testing: '-7.7' >> '-7.7' --- -string(4) "2d31" +bool(false) --- testing: '-7.7' >> 'abc' --- -string(4) "2d37" +int(-7) --- testing: '-7.7' >> '123abc' --- -string(4) "2d31" +int(-1) --- testing: '-7.7' >> '123e5' --- -string(4) "2d31" +int(-1) --- testing: '-7.7' >> '123e5xyz' --- -string(4) "2d31" +int(-1) --- testing: '-7.7' >> ' 123abc' --- -string(4) "2d31" +int(-1) --- testing: '-7.7' >> '123 abc' --- -string(4) "2d31" +int(-1) --- testing: '-7.7' >> '123abc ' --- -string(4) "2d31" +int(-1) --- testing: '-7.7' >> '3.4a' --- -string(4) "2d31" +int(-1) --- testing: '-7.7' >> 'a5.9' --- -string(4) "2d37" +int(-7) --- testing: 'abc' >> '0' --- -string(2) "30" +int(0) --- testing: 'abc' >> '65' --- -string(2) "30" +int(0) --- testing: 'abc' >> '-44' --- -string(2) "30" +bool(false) --- testing: 'abc' >> '1.2' --- -string(2) "30" +int(0) --- testing: 'abc' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: 'abc' >> 'abc' --- -string(2) "30" +int(0) --- testing: 'abc' >> '123abc' --- -string(2) "30" +int(0) --- testing: 'abc' >> '123e5' --- -string(2) "30" +int(0) --- testing: 'abc' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: 'abc' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: 'abc' >> '123 abc' --- -string(2) "30" +int(0) --- testing: 'abc' >> '123abc ' --- -string(2) "30" +int(0) --- testing: 'abc' >> '3.4a' --- -string(2) "30" +int(0) --- testing: 'abc' >> 'a5.9' --- -string(2) "30" +int(0) --- testing: '123abc' >> '0' --- -string(6) "313233" +int(123) --- testing: '123abc' >> '65' --- -string(4) "3631" +int(0) --- testing: '123abc' >> '-44' --- -string(2) "30" +bool(false) --- testing: '123abc' >> '1.2' --- -string(4) "3631" +int(61) --- testing: '123abc' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '123abc' >> 'abc' --- -string(6) "313233" +int(123) --- testing: '123abc' >> '123abc' --- -string(2) "30" +int(0) --- testing: '123abc' >> '123e5' --- -string(2) "30" +int(0) --- testing: '123abc' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '123abc' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '123abc' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '123abc' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '123abc' >> '3.4a' --- -string(4) "3135" +int(15) --- testing: '123abc' >> 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123e5' >> '0' --- -string(6) "313233" +int(123) --- testing: '123e5' >> '65' --- -string(4) "3631" +int(0) --- testing: '123e5' >> '-44' --- -string(2) "30" +bool(false) --- testing: '123e5' >> '1.2' --- -string(4) "3631" +int(61) --- testing: '123e5' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '123e5' >> 'abc' --- -string(6) "313233" +int(123) --- testing: '123e5' >> '123abc' --- -string(2) "30" +int(0) --- testing: '123e5' >> '123e5' --- -string(2) "30" +int(0) --- testing: '123e5' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '123e5' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '123e5' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '123e5' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '123e5' >> '3.4a' --- -string(4) "3135" +int(15) --- testing: '123e5' >> 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123e5xyz' >> '0' --- -string(6) "313233" +int(123) --- testing: '123e5xyz' >> '65' --- -string(4) "3631" +int(0) --- testing: '123e5xyz' >> '-44' --- -string(2) "30" +bool(false) --- testing: '123e5xyz' >> '1.2' --- -string(4) "3631" +int(61) --- testing: '123e5xyz' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '123e5xyz' >> 'abc' --- -string(6) "313233" +int(123) --- testing: '123e5xyz' >> '123abc' --- -string(2) "30" +int(0) --- testing: '123e5xyz' >> '123e5' --- -string(2) "30" +int(0) --- testing: '123e5xyz' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '123e5xyz' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '123e5xyz' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '123e5xyz' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '123e5xyz' >> '3.4a' --- -string(4) "3135" +int(15) --- testing: '123e5xyz' >> 'a5.9' --- -string(6) "313233" +int(123) --- testing: ' 123abc' >> '0' --- -string(6) "313233" +int(123) --- testing: ' 123abc' >> '65' --- -string(4) "3631" +int(0) --- testing: ' 123abc' >> '-44' --- -string(2) "30" +bool(false) --- testing: ' 123abc' >> '1.2' --- -string(4) "3631" +int(61) --- testing: ' 123abc' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: ' 123abc' >> 'abc' --- -string(6) "313233" +int(123) --- testing: ' 123abc' >> '123abc' --- -string(2) "30" +int(0) --- testing: ' 123abc' >> '123e5' --- -string(2) "30" +int(0) --- testing: ' 123abc' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: ' 123abc' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: ' 123abc' >> '123 abc' --- -string(2) "30" +int(0) --- testing: ' 123abc' >> '123abc ' --- -string(2) "30" +int(0) --- testing: ' 123abc' >> '3.4a' --- -string(4) "3135" +int(15) --- testing: ' 123abc' >> 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123 abc' >> '0' --- -string(6) "313233" +int(123) --- testing: '123 abc' >> '65' --- -string(4) "3631" +int(0) --- testing: '123 abc' >> '-44' --- -string(2) "30" +bool(false) --- testing: '123 abc' >> '1.2' --- -string(4) "3631" +int(61) --- testing: '123 abc' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '123 abc' >> 'abc' --- -string(6) "313233" +int(123) --- testing: '123 abc' >> '123abc' --- -string(2) "30" +int(0) --- testing: '123 abc' >> '123e5' --- -string(2) "30" +int(0) --- testing: '123 abc' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '123 abc' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '123 abc' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '123 abc' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '123 abc' >> '3.4a' --- -string(4) "3135" +int(15) --- testing: '123 abc' >> 'a5.9' --- -string(6) "313233" +int(123) --- testing: '123abc ' >> '0' --- -string(6) "313233" +int(123) --- testing: '123abc ' >> '65' --- -string(4) "3631" +int(0) --- testing: '123abc ' >> '-44' --- -string(2) "30" +bool(false) --- testing: '123abc ' >> '1.2' --- -string(4) "3631" +int(61) --- testing: '123abc ' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '123abc ' >> 'abc' --- -string(6) "313233" +int(123) --- testing: '123abc ' >> '123abc' --- -string(2) "30" +int(0) --- testing: '123abc ' >> '123e5' --- -string(2) "30" +int(0) --- testing: '123abc ' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '123abc ' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '123abc ' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '123abc ' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '123abc ' >> '3.4a' --- -string(4) "3135" +int(15) --- testing: '123abc ' >> 'a5.9' --- -string(6) "313233" +int(123) --- testing: '3.4a' >> '0' --- -string(2) "33" +int(3) --- testing: '3.4a' >> '65' --- -string(2) "31" +int(0) --- testing: '3.4a' >> '-44' --- -string(2) "30" +bool(false) --- testing: '3.4a' >> '1.2' --- -string(2) "31" +int(1) --- testing: '3.4a' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: '3.4a' >> 'abc' --- -string(2) "33" +int(3) --- testing: '3.4a' >> '123abc' --- -string(2) "30" +int(0) --- testing: '3.4a' >> '123e5' --- -string(2) "30" +int(0) --- testing: '3.4a' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: '3.4a' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: '3.4a' >> '123 abc' --- -string(2) "30" +int(0) --- testing: '3.4a' >> '123abc ' --- -string(2) "30" +int(0) --- testing: '3.4a' >> '3.4a' --- -string(2) "30" +int(0) --- testing: '3.4a' >> 'a5.9' --- -string(2) "33" +int(3) --- testing: 'a5.9' >> '0' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '65' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '-44' --- -string(2) "30" +bool(false) --- testing: 'a5.9' >> '1.2' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '-7.7' --- -string(2) "30" +bool(false) --- testing: 'a5.9' >> 'abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '123abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '123e5' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '123e5xyz' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> ' 123abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '123 abc' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '123abc ' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> '3.4a' --- -string(2) "30" +int(0) --- testing: 'a5.9' >> 'a5.9' --- -string(2) "30" -===DONE=== +int(0) +===DONE===
\ No newline at end of file diff --git a/tests/lang/operators/coalesce.phpt b/tests/lang/operators/coalesce.phpt new file mode 100644 index 0000000000..2ee54c5276 --- /dev/null +++ b/tests/lang/operators/coalesce.phpt @@ -0,0 +1,79 @@ +--TEST-- +Test ?? operator +--FILE-- +<?php + +$var = 7; +$var2 = NULL; + +$obj = new StdClass; +$obj->boo = 7; + +$arr = [ + 2 => 7, + "foo" => "bar", + "foobar" => NULL, + "qux" => $obj, + "bing" => [ + "bang" + ] +]; + +function foobar() { + echo "called\n"; + return ['a']; +} + +var_dump($nonexistant_variable ?? 3); +echo PHP_EOL; +var_dump($var ?? 3); +var_dump($var2 ?? 3); +echo PHP_EOL; +var_dump($obj->boo ?? 3); +var_dump($obj->bing ?? 3); +var_dump($arr["qux"]->boo ?? 3); +var_dump($arr["qux"]->bing ?? 3); +echo PHP_EOL; +var_dump($arr[2] ?? 3); +var_dump($arr["foo"] ?? 3); +var_dump($arr["foobar"] ?? 3); +var_dump($arr["qux"] ?? 3); +var_dump($arr["bing"][0] ?? 3); +var_dump($arr["bing"][1] ?? 3); +echo PHP_EOL; +var_dump(foobar()[0] ?? false); +echo PHP_EOL; +function f($x) +{ + printf("%s(%d)\n", __FUNCTION__, $x); + return $x; +} + +$a = f(null) ?? f(1) ?? f(2); +?> +--EXPECTF-- +int(3) + +int(7) +int(3) + +int(7) +int(3) +int(7) +int(3) + +int(7) +string(3) "bar" +int(3) +object(stdClass)#%d (%d) { + ["boo"]=> + int(7) +} +string(4) "bang" +int(3) + +called +string(1) "a" + +f(0) +f(1)
\ No newline at end of file diff --git a/win32/EngineSelect.dsp b/win32/EngineSelect.dsp deleted file mode 100644 index 4aee213c29..0000000000 --- a/win32/EngineSelect.dsp +++ /dev/null @@ -1,85 +0,0 @@ -# Microsoft Developer Studio Project File - Name="EngineSelect" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) External Target" 0x0106
-
-CFG=EngineSelect - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "EngineSelect.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "EngineSelect.mak" CFG="EngineSelect - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "EngineSelect - Win32 Release" (based on "Win32 (x86) External Target")
-!MESSAGE "EngineSelect - Win32 Debug" (based on "Win32 (x86) External Target")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-
-!IF "$(CFG)" == "EngineSelect - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak"
-# PROP BASE Rebuild_Opt "/a"
-# PROP BASE Target_File "EngineSelect.exe"
-# PROP BASE Bsc_Name "EngineSelect.bsc"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Cmd_Line "EngineSelect.bat"
-# PROP Rebuild_Opt "/a"
-# PROP Target_File "EngineSelect.exe"
-# PROP Bsc_Name ""
-# PROP Target_Dir ""
-
-!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak"
-# PROP BASE Rebuild_Opt "/a"
-# PROP BASE Target_File "EngineSelect.exe"
-# PROP BASE Bsc_Name "EngineSelect.bsc"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Cmd_Line "EngineSelect.bat"
-# PROP Rebuild_Opt "/a"
-# PROP Target_File "EngineSelect.exe"
-# PROP Bsc_Name ""
-# PROP Target_Dir ""
-
-!ENDIF
-
-# Begin Target
-
-# Name "EngineSelect - Win32 Release"
-# Name "EngineSelect - Win32 Debug"
-
-!IF "$(CFG)" == "EngineSelect - Win32 Release"
-
-!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug"
-
-!ENDIF
-
-# End Target
-# End Project
diff --git a/win32/build/DSP.README b/win32/build/DSP.README deleted file mode 100644 index c6736578cf..0000000000 --- a/win32/build/DSP.README +++ /dev/null @@ -1,37 +0,0 @@ -MSVC++ project file generation -============================== - -These files are only intended for use in debugging and profiling, -but can be used to create working binaries. However, they are very -unlikely to match the official PHP distributed binaries. - -With this in mind, the script will only generate basic .dsp files -for the modules that are currently configured. - -The switch for project file generation is a buildconf switch and -not a configure switch: - -> buildconf --add-project-files -> configure ... - -The resulting workspace files should appear at /win32/phpdll[ts].dsw -and (if any shared modules are configured) at /win32/php_modules.dsw, -after configure is run. - -If the .dsw files haven't generated in a sane way, the most likely reason -will be that the template files have become corrupted. They need DOS -line endings (CR/LF) in order to function. The affected files are: - -/win32/build/block.template.dsw -/win32/build/template.dsp -/win32/build/template.dsw - -Simply save them with DOS line endings, and bug it to me if basic -project file generation still fails (as in, you ran the command and -configure again after saving, and you have a working copy of MSVS -installed, but clicking on the workspace(s) doesn't give you anything). - -- Steph -sfox@php.net - -July 2008 diff --git a/win32/build/Makefile b/win32/build/Makefile index 7a3be93e87..b2918b7117 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -1,5 +1,5 @@ # +----------------------------------------------------------------------+ -# | PHP Version 5 | +# | PHP Version 7 | # +----------------------------------------------------------------------+ # | Copyright (c) 1997-2008 The PHP Group | # +----------------------------------------------------------------------+ @@ -62,9 +62,9 @@ Zend\zend_language_scanner.c: Zend\zend_language_scanner.l !endif !if $(PGOMGR) != "" -PHP5_PGD_OPTION=/PGD:$(PGOPGD_DIR)\php5.pgd +PHP7_PGD_OPTION=/PGD:$(PGOPGD_DIR)\php7.pgd !else -PHP5_PGD_OPTION= +PHP7_PGD_OPTION= !endif PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res @@ -89,7 +89,7 @@ $(PHPDLL_RES): win32\build\template.rc win32\build\template.rc $(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE) - @$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP5_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) + @$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) -@$(_VC_MANIFEST_EMBED_DLL) $(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL) diff --git a/win32/build/block.template.dsw b/win32/build/block.template.dsw deleted file mode 100644 index 2f2682dc71..0000000000 --- a/win32/build/block.template.dsw +++ /dev/null @@ -1,15 +0,0 @@ - -Project: "EXTNAME"=..\ADDRESS - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5ts - End Project Dependency -}}} - -############################################################################### diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js index b4194ad203..a3a4f1e9aa 100644 --- a/win32/build/buildconf.js +++ b/win32/build/buildconf.js @@ -1,6 +1,6 @@ /*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
@@ -23,7 +23,6 @@ WScript.StdOut.WriteLine("Rebuilding configure.js"); var FSO = WScript.CreateObject("Scripting.FileSystemObject");
var C = FSO.CreateTextFile("configure.js", true);
var B = FSO.CreateTextFile("configure.bat", true);
-var DSP = false;
var modules = "";
var MODULES = WScript.CreateObject("Scripting.Dictionary");
@@ -197,11 +196,6 @@ function buildconf_process_args() WScript.StdOut.WriteLine("Adding " + argval + " to the module search path");
module_dirs[module_dirs.length] = argval;
}
-
- if (argname == '--add-project-files') {
- WScript.StdOut.WriteLine("Adding dsp templates into the mix");
- DSP = true;
- }
}
}
@@ -212,16 +206,6 @@ C.WriteLine("/* This file automatically generated from win32/build/confutils.js C.WriteLine("MODE_PHPIZE=false;");
C.Write(file_get_contents("win32/build/confutils.js"));
-// If project files were requested, pull in the code to generate them
-if (DSP == true) {
- C.WriteLine('PHP_DSP="yes"');
- C.WriteBlankLines(1);
- C.Write(file_get_contents("win32/build/projectgen.js"));
-} else {
- C.WriteLine('PHP_DSP="no"');
- C.WriteBlankLines(1);
-}
-
// Pull in code from sapi and extensions
modules = file_get_contents("win32/build/config.w32");
diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 564cea2dcc..6cde15a9bd 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -131,7 +131,7 @@ DEFINE('PHP_PREFIX', PHP_PREFIX); DEFINE("BASE_INCLUDES", "/I . /I main /I Zend /I TSRM /I ext "); // CFLAGS for building the PHP dll -DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \ +DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP7DLLTS_EXPORTS /D PHP_EXPORTS \ /D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x500"); DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)'); @@ -353,7 +353,7 @@ STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PH ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ zend_ini_parser.c zend_ini_scanner.c zend_alloc.c zend_compile.c \ - zend_constants.c zend_dynamic_array.c zend_exceptions.c \ + zend_constants.c zend_exceptions.c \ zend_execute_API.c zend_highlight.c \ zend_llist.c zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c \ zend_stack.c zend_variables.c zend.c zend_API.c zend_extensions.c \ @@ -362,7 +362,8 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ zend_object_handlers.c zend_objects_API.c \ zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \ - zend_float.c zend_string.c zend_generators.c zend_virtual_cwd.c zend_ast.c"); + zend_float.c zend_string.c zend_generators.c zend_virtual_cwd.c zend_ast.c \ + zend_inheritance.c"); if (VCVERS == 1200) { AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1); @@ -430,13 +431,6 @@ if (PHP_SNAPSHOT_TEMPLATE == "no") { DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE); -if (PHP_DSP != "no") { - if (FSO.FolderExists("tmp")) { - FSO.DeleteFolder("tmp"); - } - FSO.CreateFolder("tmp"); -} - ARG_ENABLE("security-flags", "Disable the compiler security flags", "yes"); if (PHP_SECURITY_FLAGS == "yes") { ADD_FLAG("LDFLAGS", "/NXCOMPAT /DYNAMICBASE "); diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index 9efdfdea3e..e74108ce96 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -174,3 +174,8 @@ # define _USE_32BIT_TIME_T 1 #endif #define HAVE_STDLIB_H 1 + +#define _REENTRANT 1 +#define HAVE_MBRLEN 1 +#define HAVE_MBSTATE_T 1 + diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in index cfec2a28f1..878e48d02b 100644 --- a/win32/build/config.w32.phpize.in +++ b/win32/build/config.w32.phpize.in @@ -115,7 +115,7 @@ DEFINE('PHP_PREFIX', PHP_PREFIX); DEFINE("BASE_INCLUDES", "/I " + PHP_DIR + "/include /I " + PHP_DIR + "/include/main /I " + PHP_DIR + "/include/Zend /I " + PHP_DIR + "/include/TSRM /I " + PHP_DIR + "/include/ext ");
// CFLAGS for building the PHP dll
-DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \
+DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP7DLLTS_EXPORTS /D PHP_EXPORTS \
/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x500");
DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
@@ -352,12 +352,5 @@ if (PHP_SNAPSHOT_TEMPLATE == "no") { DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);
-if (PHP_DSP != "no") {
- if (FSO.FolderExists("tmp")) {
- FSO.DeleteFolder("tmp");
- }
- FSO.CreateFolder("tmp");
-}
-
AC_DEFINE("PHP_DIR", PHP_DIR);
DEFINE("PHP_DIR", PHP_DIR);
diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 3e1a99fe4e..ae668fee26 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1,7 +1,7 @@ // Utils for configure script
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
@@ -28,7 +28,6 @@ var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive"); var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles");
var PROGRAM_FILESx86 = WshShell.Environment("Process").Item("ProgramFiles(x86)");
var VCINSTALLDIR = WshShell.Environment("Process").Item("VCINSTALLDIR");
-var DSP_FLAGS = new Array();
var PHP_SRC_DIR=FSO.GetParentFolderName(WScript.ScriptFullName);
/* Store the enabled extensions (summary + QA check) */
@@ -1130,10 +1129,6 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) ADD_FLAG("SAPI_TARGETS", makefiletarget);
}
- if (PHP_DSP != "no") {
- generate_dsp_file(sapiname, configure_module_dirname, file_list, false);
- }
-
MFO.WriteBlankLines(1);
sapi_enabled[sapi_enabled.length] = [sapiname];
}
@@ -1366,10 +1361,6 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) }
ADD_FLAG("CFLAGS_" + EXT, cflags);
- if (PHP_DSP != "no") {
- generate_dsp_file(extname, configure_module_dirname, file_list, shared);
- }
-
extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static'];
}
@@ -1665,15 +1656,6 @@ function generate_files() }
}
- if (PHP_DSP != "no") {
- generate_dsp_file("TSRM", "TSRM", null, false);
- generate_dsp_file("Zend", "Zend", null, false);
- generate_dsp_file("win32", "win32", null, false);
- generate_dsp_file("main", "main", null, false);
- generate_dsp_file("streams", "main\\streams", null, false);
- copy_dsp_files();
- }
-
STDOUT.WriteLine("Generating files...");
generate_makefile();
if (!MODE_PHPIZE) {
@@ -2043,12 +2025,6 @@ function ADD_FLAG(name, flags, target) configure_subst.Remove(name);
}
configure_subst.Add(name, flags);
-
- if (PHP_DSP != "no") {
- if (flags && (name.substr(name.length-3) != "PHP") && (name.substr(0, 7) == "CFLAGS_")) {
- DSP_FLAGS[DSP_FLAGS.length] = new Array(name, flags);
- }
- }
}
function get_define(name)
diff --git a/win32/build/deplister.c b/win32/build/deplister.c index 31f1f07e67..bae6d031f6 100644 --- a/win32/build/deplister.c +++ b/win32/build/deplister.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/build/phpize.js.in b/win32/build/phpize.js.in index c99dece618..b0ba0bbb82 100644 --- a/win32/build/phpize.js.in +++ b/win32/build/phpize.js.in @@ -1,6 +1,6 @@ /*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
@@ -24,7 +24,6 @@ var STDOUT = WScript.StdOut; var FSO = WScript.CreateObject("Scripting.FileSystemObject");
var C = FSO.CreateTextFile("configure.js", true);
var B = FSO.CreateTextFile("configure.bat", true);
-var DSP = false;
re = /\\script/i;
var PHP_DIR=FSO.GetParentFolderName(WScript.ScriptFullName).replace(re,"");
@@ -222,16 +221,6 @@ if (FSO.FileExists(PHP_DIR + "/script/ext_pickle.js")) { C.Write(file_get_contents(PHP_DIR + "/script/confutils.js"));
C.Write(file_get_contents(PHP_DIR + "/script/config.phpize.js"));
-// If project files were requested, pull in the code to generate them
-if (DSP == true) {
- C.WriteLine('PHP_DSP="yes"');
- C.WriteBlankLines(1);
- C.Write(file_get_contents(PHP_DIR + "win32/build/projectgen.js"));
-} else {
- C.WriteLine('PHP_DSP="no"');
- C.WriteBlankLines(1);
-}
-
// Pull in code for the base detection
modules = file_get_contents(PHP_DIR + "/script/config.w32.phpize.in");
diff --git a/win32/build/projectgen.js b/win32/build/projectgen.js deleted file mode 100644 index 390a303fb4..0000000000 --- a/win32/build/projectgen.js +++ /dev/null @@ -1,625 +0,0 @@ -/* check for duplicate entries */ -function check_duplicates(local, core) -{ - if (!local) { - return core; - } - - arr = local.split(" "); - - for(i = 0; i < arr.length; i++) { - if (core.match(arr[i])) { - continue; - } - core += " " + arr[i]; - } - - return core; -} - -/* read .dsp source blocks */ -function read_src_files(ext, tmpl, path) -{ - sources = file_get_contents("tmp\\src\\" + ext + ".sources.tmp"); - sources = (path ? sources.replace(/\.\//g, path) : sources); - tmpl = tmpl.replace("SOURCEFILES", sources); - FSO.DeleteFile("tmp\\src\\" + ext + ".sources.tmp"); - - headers = file_get_contents("tmp\\src\\" + ext + ".headers.tmp"); - headers = (path ? headers.replace(/\.\//g, path) : headers); - tmpl = tmpl.replace("HEADERFILES", headers); - FSO.DeleteFile("tmp\\src\\" + ext + ".headers.tmp"); - - return tmpl; -} - -/* write a .dsp source block */ -function write_src_file(fname, path, intpath, arr) -{ - FSO.FolderExists("tmp\\src") ? "" : FSO.CreateFolder("tmp\\src"); - var src = FSO.CreateTextFile("tmp\\src\\" + fname, true); - var out = get_define("BUILD_DIR"); - var libpath = ""; - - for (i = 0; i < arr.length; i++) { - if (arr[i].length > 1) { - if (arr[i].match('alloca.c') || - arr[i].match(/internal_functions_(nw|win32)\.c/) || - arr[i].match(/flock\.(c|h)/) || - arr[i].match(/zend_static_allocator\.(c|h)/) || - arr[i].match(/zend_(ini|language)_scanner_defs\.h/)) { - continue; - } - - libpath = arr[i].substr(2, arr[i].lastIndexOf("\\") - 2); - if (libpath) { - libpath = "\\" + libpath; - } - - src.WriteLine("# Begin Source File"); - src.WriteLine("SOURCE=" + arr[i]); - src.WriteLine('# PROP Intermediate_Dir "' + intpath + out + '\\' + path + libpath + '"'); - src.WriteLine("# End Source File"); - src.WriteBlankLines(1); - } - } - - src.Close(); - return; -} - -/* generate list of text files */ -function generate_text_filelist(ext, ext_dir) -{ - var txtdir = FSO.GetFolder(ext_dir); - - block = '# Begin Group "Text Files"\r\n\# PROP Default_Filter ""\r\n\r\n'; - txt = new Enumerator(txtdir.Files); - - for (; !txt.atEnd(); txt.moveNext()) { - fname = FSO.GetFileName(txt.item()); - munged = fname.replace(ext, ""); /* TSRM...! */ - - if (munged.match(/[A-Z]{4}/)){ - block += "# Begin Source File\r\n"; - block += "SOURCE=./" + fname + "\r\n"; - block += "# End Source File\r\n\r\n"; - } - } - - block += "# End Group\r\n"; - return block; -} - -/* generate list of resource files */ -function generate_resource_filelist(ext, ext_dir) -{ - var resdir = FSO.GetFolder(ext_dir); - res = new Enumerator(resdir.Files); - block = ""; - - for (; !res.atEnd(); res.moveNext()) { - fname = FSO.GetFileName(res.item()); - - if (fname.match(/\.(ico|rc)/)) { - block += "# Begin Source File\r\n"; - block += "SOURCE=./" + fname + "\r\n"; - block += "# End Source File\r\n\r\n"; - } - } - - return block; -} - -/* generate parser and scanner files for Zend */ -function generate_parsers_or_scanners(arr, type) -{ - var filter = (type.match("Parsers") ? "y" : "l"); - - ret = '# Begin Group "' + type + '"\r\n# PROP Default_Filter "' + filter + '"\r\n\r\n'; - - for (i = 0; i < arr.length; i++) { - - fl = "zend_" + arr[i] + "_" + type.toLowerCase().substr(0, type.length - 1); - ret += "# Begin Source File\r\n"; - ret += "SOURCE=.\\" + fl + "." + filter + "\r\n\r\n"; - ret += '# Begin Custom Build\r\n\r\n'; - - if (type.match("Parsers")) { - pre = (arr[i].match(/ini/) ? "ini_ " : "zend "); - ret += fl + ".c " + fl + ".h: " + fl + ".y\r\n"; - ret += "\tbison --output=" + fl + ".c -v -d -p " + pre + fl + ".y\r\n\r\n"; - } else { - ret += fl + ".c: " + fl + ".l\r\n"; - ret += "\tre2c --case-inverted -cbdFt " + fl + "_defs.h -o" + fl + ".c " + fl + ".l\r\n\r\n"; - } - - ret += "# End Custom Build\r\n"; - ret += "# End Source File\r\n"; - } - - ret += "# End Group\r\n\r\n"; - return ret; -} - -/* generate .defs file for php5[ts].dll */ -function generate_php_defs() -{ - var defs = get_define("PHP_DLL_DEF_SOURCES").split(" "); - var bdir = get_define("BUILD_DIR") + "\\"; - var file = get_define("PHPLIB").replace("lib", "def"); - var path = "..\\" + bdir + file; - var deps = "USERDEP__PHP5TS="; - var cmds = "BuildCmds= \\\r\n"; - var cmd = '$(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r\n\t$(BuildCmds)\r\n'; - - for (i = 0; i < defs.length; i++) { - deps += '"..\\' + defs[i] + '" '; - cmds += "\ttype ..\\" + defs[i] + (i == 0 ? " > " : " >> ") + path + " \\\r\n"; - } - - ret = '# Begin Group "Defs Files"\r\n\r\n'; - ret += "# Begin Source File\r\nSOURCE=" + path + "\r\n\r\n"; - ret += deps.substr(0, deps.length-1) + "\r\n# Begin Custom Build - "; - ret += "Generating $(InputPath)\r\nInputPath=" + path + "\r\n\r\n"; - ret += cmds + '\r\n\"' + path + '" : ' + cmd + "\r\n"; - ret += "# End Custom Build\r\n# End Source File\r\n\r\n"; - ret += "# End Group\r\n"; - return ret; -} - -/* generate win32\wsyslog.h for php5[ts].dll */ -function generate_wsyslog() -{ - var path = ".\\build\\wsyslog.mc\r\n\r\n"; - var intdir = "..\\" + get_define("BUILD_DIR"); - - ret = "# Begin Source File\r\nSOURCE=" + path; - ret += "# Begin Custom Build\r\nInputDir=.\\build\r\n"; - ret += "IntDir=" + intdir + "\r\nInputPath=" + path; - ret += '"wsyslog.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r\n'; - ret += "\tmc -h $(InputDir)/.. -r $(InputDir) -x $(IntDir) $(InputPath)\r\n\r\n"; - ret += "# End Custom Build\r\n# End Source File\r\n"; - return ret; -} - -/* generate ext\date\lib\timelib_config.h for php5[ts].dll */ -function generate_timelib_conf(headers) -{ - var file = "timelib_config.h"; - var path = "..\\ext\\date\\lib\\timelib_config.h"; - var pos = headers.search(file); - var entry = headers.slice(pos, pos + 64); - - replace = entry.replace(file, file + ".win32"); - replace += "\r\n\r\n# Begin Custom Build\r\nInputDir=..\\ext\\date\\lib\r\n"; - replace += "InputPath=" + path + ".win32\r\n\r\n"; - replace += '"' + path + '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r\n'; - replace += "\tcopy $(InputPath) $(InputDir)\\" + file + "\r\n\r\n"; - replace += "# End Custom Build"; - - headers = headers.replace(entry, replace); - return headers; -} - -/* generate php5[ts].dsp */ -function generate_core_dsp(core_headers, core_sources, headers, sources, cflags, ldflags, libs) -{ - var ts = (PHP_ZTS != "no" ? "ts" : ""); - var extname = "php5" + ts; - var tmpl = generate_dsp_file(extname, ".", false, false); - - cflags += get_define("CFLAGS_PHP").replace("/D _USRDLL", ""); - cflags = cflags.replace(/\/(I|D)(\S)/g, "/$1 $2"); - ldflags += get_define("LDFLAGS_PHP"); - libs += get_define("LIBS_PHP"); - - tmpl = tmpl.replace(/LOCALCPP/, cflags.replace(/\"ext/g, '"../ext') + " /c"); - tmpl = tmpl.replace(/LOCALLIBS/, libs); - tmpl = tmpl.replace(/LOCALLDFLAGS/, ldflags); - tmpl = tmpl.replace(extname + ".dll", get_define("PHPDLL")); - - wsyslog = (core_headers.match("wsyslog.h") ? "" : generate_wsyslog(core_headers)); - core_sources = '# Begin Group "CORE"\r\n' + core_sources + "# End Group\r\n"; - tmpl = tmpl.replace(/CORESOURCES/, core_sources); - core_headers = '# Begin Group "CORE "\r\n' + core_headers + "# End Group\r\n"; - tmpl = tmpl.replace(/COREHEADERS/, core_headers + wsyslog); - - headers = generate_timelib_conf(headers); - tmpl = tmpl.replace(/SOURCEFILES/, sources); - tmpl = tmpl.replace(/HEADERFILES/, headers); - - defs = generate_php_defs(); - tmpl = tmpl.replace(/DEFS/, defs); - - dsp = FSO.CreateTextFile("win32\\php5" + ts + ".dsp", true); - STDOUT.WriteLine("\tGenerating win32\\php5" + ts + ".dsp"); - dsp.Write(tmpl); - dsp.Close(); - - return; -} - -/* generate .dsw files */ -function generate_dsw_files(sblocks, mblocks) -{ - var stmpl = file_get_contents("win32\\build\\template.dsw"); - var mtmpl = file_get_contents("win32\\build\\template.dsw"); - var ts = (PHP_ZTS != "no" ? "ts" : ""); - - /* push all the sapi blocks to the same tag */ - stmpl = stmpl.replace("INSERT", sblocks); - stmpl = (PHP_ZTS != "no" ? stmpl : stmpl.replace(/dllts/g, "dll")); - sdsw = FSO.CreateTextFile("win32\\php5" + ts + ".dsw", true); - STDOUT.WriteLine("\tGenerating win32\\php5" + ts + ".dsw"); - sdsw.Write(stmpl); - sdsw.Close(); - - /* same for shared modules - except that nothing else goes in here */ - garbage = mtmpl.slice(200, mtmpl.search("INSERT")); - mtmpl = mtmpl.replace(garbage, "\r\n"); - mtmpl = mtmpl.replace("INSERT", mblocks); - mtmpl = (PHP_ZTS != "no" ? mtmpl : mtmpl.replace(/dllts/g, "dll")); - mdsw = FSO.CreateTextFile("win32\\php_modules.dsw", true); - STDOUT.WriteLine("\tGenerating win32\\php_modules.dsw"); - mdsw.Write(mtmpl); - mdsw.Close(); - - return; -} - -/* finalize .dsp files and copy to final destination */ -function copy_dsp_files() -{ - var tmp = FSO.GetFolder("tmp"); - var CORE_HEADERS = ""; - var CORE_SOURCES = ""; - var EXT_HEADERS = ""; - var EXT_SOURCES = ""; - var EXT_CFLAGS = ""; - var EXT_LDFLAGS = ""; - var EXT_LIBS = ""; - var sblocks = ""; /* for sapis */ - var mblocks = ""; /* for modules */ - - f = new Enumerator(tmp.Files); - - for (; !f.atEnd(); f.moveNext()) { - /* retrieve the path */ - contents = file_get_contents(f.item()); - address = contents.slice(0, contents.indexOf("#")); - contents = contents.slice(contents.indexOf("#")+1); - shared = contents.slice(0, contents.indexOf("#")); - contents = contents.slice(contents.indexOf("#")); - - /* pick up module name and path */ - path = address.slice(0, address.lastIndexOf("\\")+1); - ext = address.slice(address.lastIndexOf("\\")+1, address.length-4); - EXT = ext.toUpperCase(); - - if (path.match(/(sapi|ext)/)) { - rel = "..\\..\\"; - } else { - rel = "..\\"; - } - - /* pick up local flags and libs */ - cflags = get_define("CFLAGS_" + EXT); - cflags += (ext.match(/(TSRM|Zend)/) ? "/D TSRM_EXPORTS " : ""); - cflags += (ext.match(/Zend/) ? "/D LIBZEND_EXPORTS " : ""); - libs = get_define("LIBS_" + EXT); - ldflags = get_define("LDFLAGS_" + EXT); - ldflags = ldflags.replace(/(\.\.\\)/g, rel + "$1"); - contents = contents.replace(/LOCALCPP/, cflags + " /c"); - contents = contents.replace(/LOCALLIBS/, libs); - contents = contents.replace(/LOCALLDFLAGS/, ldflags); - - if (ext.match("Zend")) { - arr = new Array("ini", "language"); - parsers = generate_parsers_or_scanners(arr, "Parsers"); - scanners = generate_parsers_or_scanners(arr, "Scanners"); - contents = contents.replace(/DEFS/, parsers + scanners); - } - - /* none of these are core... */ - contents = contents.replace(/\r\n(CORESOURCES|COREHEADERS|EXTSOURCES|EXTHEADERS|DEFS)\r\n/g, ""); - - if (address.match("sapi")) { - /* most sapis are .dlls, just not cgi, cli, embed */ - - if (ext == "cli") { - - /* change of address: php.dsp */ - newext = "cli"; - address = "win32\\php.dsp"; - srcpath = "..\\" + path; - contents = contents.replace(/cli\.exe/g, "php.exe"); - - } else if (ext == "cgi") { - - /* change of address: php-cgi.dsp */ - newext = "cgi"; - address = "win32\\php-cgi.dsp"; - srcpath = "..\\" + path; - contents = contents.replace(/cgi\.exe/g, "php-cgi.exe"); - - } else { - - /* there's always one... most sapis just get a 'php5' prefix */ - newext = (ext.match(/apache2handler/) ? "php5apache2" : "php5" + ext); - address = address.replace(ext + ".dsp", newext + ".dsp"); - srcpath = ".\\"; - oldext = new RegExp(('[^=\\\\]'+ext), "g"); - contents = contents.replace(oldext, newext); - contents = contents.replace(ext + ".dll", newext + ".dll"); - contents = contents.replace("CFG=" + ext, "CFG=" + newext); - } - - contents = read_src_files(ext, contents, (srcpath ? srcpath : false)); - dsp = FSO.CreateTextFile(address, true); - STDOUT.WriteLine("\tGenerating " + address); - dsp.Write(contents); - dsp.Close(); - - /* add all configured sapis to the list in php5ts.dsw */ - sblocks += file_get_contents("win32\\build\\block.template.dsw"); - sblocks = sblocks.replace("ADDRESS", address); - sblocks = sblocks.replace("EXTNAME", newext); - - } else if (address.match("ext") && shared == "true") { - - /* independent modules with their own .dsp */ - contents = read_src_files(ext, contents, false); - dsp = FSO.CreateTextFile(address, true); - STDOUT.WriteLine("\tGenerating " + address); - dsp.Write(contents); - dsp.Close(); - - mblocks += file_get_contents("win32\\build\\block.template.dsw"); - mblocks = mblocks.replace("ADDRESS", address); - mblocks = mblocks.replace("EXTNAME", ext); - - } else if (ext.match(/(TSRM|Zend)/)) { - - contents = read_src_files(ext, contents, false); - dsp = FSO.CreateTextFile(address, true); - STDOUT.WriteLine("\tGenerating " + address); - dsp.Write(contents); - dsp.Close(); - - } else { - - /* bound for php5[ts].dsp */ - cflags = get_define("CFLAGS_" + EXT); - cflags = cflags ? cflags.replace(/-(I|D)/g, " /$1") : ""; - cflags = cflags? cflags.replace(/\/(I|D)\s+/g, "/$1") : ""; - cflags = cflags ? cflags.replace(/\/I(?!\")(\S+)/g, '/I"$1"') : ""; - - EXT_CFLAGS = check_duplicates(cflags, EXT_CFLAGS); - EXT_LDFLAGS = check_duplicates(ldflags, EXT_LDFLAGS); - EXT_LIBS = check_duplicates(libs, EXT_LIBS); - - beginh = '# Begin Group "' + ext + ' "\r\n'; - begins = '# Begin Group "' + ext + '"\r\n'; - - hdr = file_get_contents("tmp\\src\\" + ext + ".headers.tmp"); - hdr = hdr.replace(/\.\//g, "..\\" + path); - hdr = hdr.replace(/\.\.\\\.\.\\/g, "..\\"); - - src = file_get_contents("tmp\\src\\" + ext + ".sources.tmp"); - src = src.replace(/\.\//g, "..\\" + path); - src = src.replace(/\.\.\\\.\.\\/g, "..\\"); - - if (ext.match(/(main|standard|streams|win32)/)) { - CORE_HEADERS += beginh + hdr + "# End Group\r\n"; - CORE_SOURCES += begins + src + "# End Group\r\n"; - } else { - EXT_HEADERS += beginh + hdr + "# End Group\r\n"; - EXT_SOURCES += begins + src + "# End Group\r\n"; - } - - FSO.DeleteFile("tmp\\src\\" + ext + ".headers.tmp"); - FSO.DeleteFile("tmp\\src\\" + ext + ".sources.tmp"); - } - - FSO.DeleteFile(f.item()); - } - - generate_core_dsp(CORE_HEADERS, CORE_SOURCES, EXT_HEADERS, EXT_SOURCES, EXT_CFLAGS, EXT_LDFLAGS, EXT_LIBS); - generate_dsw_files(sblocks, mblocks); - - /* goodnight vienna */ - FSO.DeleteFolder("tmp\\src"); - FSO.DeleteFolder("tmp"); -} - -/* generate source and header entries for .dsp files */ -function generate_dsp_filelist(ext, ext_dir, files, intpath) -{ - var EXT = ext.toUpperCase(); - var tabs = new RegExp("[\t\r\n\'\"]", "gm"); - var ws = new RegExp("\\s+", "g"); - var dir = FSO.GetFolder(ext_dir); - var configfile = FSO.BuildPath(ext_dir, "config.w32"); - var headers = ""; - var path = ""; - - if (!files) { - /* module either lacks a config.w32 or is core - * either way, we know nothing about its sources - */ - files = ""; - f = new Enumerator(dir.Files); - - for (; !f.atEnd(); f.moveNext()) { - name = FSO.GetFileName(f.item()); - - if (name.substr(name.length-2) == ".c") { - files += " ./" + name; - } - } - } else { - files = files.replace(tabs, ""); - files = "./" + files.replace(/ /g, " ./"); - } - - DSP_SOURCES = files.split(" "); - - /* pick up headers (all modules) */ - f = new Enumerator(dir.Files); - - for (; !f.atEnd(); f.moveNext()) { - name = FSO.GetFileName(f.item()); - - if (name.substr(name.length-2) == ".h") { - headers += " ./" + name; - } - } - - DSP_HEADERS = headers.split(" "); - - /* check for bundled library paths and sourcefiles */ - if (FSO.FileExists(configfile)) { - config = file_get_contents(configfile); - - if (config.match("ADD_SOURCES")) { - sources = new RegExp("ADD_SOURCES\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\)", "gm"); - arr = config.match(sources); - line = arr[0].replace(tabs, ""); - line = line.replace(/ADD_SOURCES\((.+)\)/, "$1"); - newarr = line.split(','); - orig_path = newarr[0].replace(/\//g, "\\"); - orig_path = orig_path.replace(/configure_module_dirname(\s?\+\s?)?/, ext_dir); - path = orig_path.replace(ext_dir + '\\', ""); - - if (path.length > 0 && path != ext_dir) { - subdir = FSO.GetFolder(orig_path); - lib = new Enumerator(subdir.Files); - libheaders = ""; - - for (; !lib.atEnd(); lib.moveNext()) { - name = FSO.GetFileName(lib.item()); - - if (name.substr(name.length-2) == ".h") { - libheaders += " ./" + path + "\\" + name; - } - } - - DSP_HEADERS = DSP_HEADERS.concat(libheaders.split(" ")); - - } else { - path = ""; - } - - sources = newarr[1].replace(/\\/g, ""); /* continuation lines */ - sources = sources.replace(ws, " "); - sources = sources.replace(/\s/g, (path ? " ./" + path + "\\" : " ./")); - sources = check_duplicates(DSP_SOURCES.join(" "), sources); - DSP_SOURCES = sources.split(" "); - } - } - - /* store the array contents in temp files for now */ - write_src_file(ext + ".headers.tmp", ext_dir, intpath, DSP_HEADERS); - write_src_file(ext + ".sources.tmp", ext_dir, intpath, DSP_SOURCES); - - return; -} - -/* entry point. Called from EXTENSION(), SAPI() and generate_files() (confutils.js) */ -function generate_dsp_file(ext, ext_dir, files, shared) -{ - var dsp = FSO.CreateTextFile("tmp\\" + ext + ".dsp", true); - var tmpl = file_get_contents("win32\\build\\template.dsp"); - var ts = (PHP_ZTS != "no" ? "ts" : ""); - var debug = (PHP_DEBUG != "no" ? " /debug" : ""); - var ld = (debug ? "/LDd" : "/LD"); - var status = (PHP_DEBUG == "no" ? 'Release' : 'Debug'); - var statusts = status + (ts ? "_" + ts.toUpperCase() : ""); - var baseflags = ""; - - /* store the final path and value of shared in the tmp file */ - if (!ext.match("php5")) { - tmpl = ext_dir + "\\" + ext + ".dsp#" + shared + tmpl; - } - - tmpl = tmpl.replace(/extname/g, ext); - tmpl = tmpl.replace(/Status_TS/g, statusts); - - if (debug) { - tmpl = tmpl.replace(/Use_Debug_Libraries 0/g, "Use_Debug_Libraries 1"); - tmpl = tmpl.replace(/NDEBUG/g, "_DEBUG"); - } - - if (ext == "cli" || ext == "cgi") { - tmpl = tmpl.replace(/Dynamic-Link Library/g, "Console Application"); - tmpl = tmpl.replace(/0x0102/, "0x0103"); - path = "..\\"; - type = ".exe"; - } else if (ext == "embed" || ext == "TSRM" || ext == "Zend") { - tmpl = tmpl.replace(/Dynamic-Link/g, "Static"); - tmpl = tmpl.replace(/0x0102/, "0x0104"); - tmpl = tmpl.replace(/LINK32/g, "LIB32"); - tmpl = tmpl.replace("link.exe", "link.exe -lib"); - tmpl = tmpl.replace(/BASELIBS/g, "/nologo"); - tmpl = tmpl.replace(/\s(LOCALLIBS|BASELDFLAGS|LOCALLDFLAGS|OUTPATH)/g, ""); - path = "..\\"; - if (ext == "embed") { - path += "..\\"; - } - type = ".lib"; - } else if (ext.match("php5")) { - path = "..\\"; - type = ".dll"; - } else { - path = "..\\..\\"; - type = ".dll"; - } - - outpath = path + get_define("BUILD_DIR"); - tmpl = tmpl.replace(/OUTPUTDIR/g, outpath); - - /* populate the baseline CFLAGS and libs */ - cflags = get_define("CFLAGS").replace(/\s+/g, " "); - cflags = cflags.replace('/I "..\\bindlib_w32" ', ""); - bcflags = (cflags.replace(/\/([A-Z])\s/g, "/$1")).split(" "); - - for (i= 0; i < bcflags.length; i++) { - baseflags += (bcflags[i].match(/(PHP|ZEND|ZTS|BASE|FD|WINDOWS)/) ? "" : bcflags[i]); - } - - baseflags = baseflags.replace(/\//g, " /"); - baseflags = baseflags.substr(1).replace(/(\/D)/g, "$1 ") + " /c"; - tmpl = tmpl.replace(/BASECPP/, (type == ".dll" ? baseflags : baseflags.replace(ld + " ", ""))); - - tmpl = tmpl.replace(/BASELIBS/, "/nologo " + get_define("LIBS").replace(/\sresolv.lib/, "")); - - /* now populate the bases in the 'local' lines */ - incs = get_define("BASE_INCLUDES").replace(/\/I (\S+)/g, '/I "' + path + '$1"'); - incs = incs.replace('"' + path + '."', '".."'); - lcflags = cflags.replace(/\$\(BASE_INCLUDES\)/, incs + (type == ".exe" ? '/I "..\\sapi" ' : "") + '/I "' + path + '..\\bindlib_w32"'); - tmpl = tmpl.replace(/BASECPP/, (type == ".dll" ? lcflags : lcflags.replace(ld + " ", ""))); - tmpl = tmpl.replace(/BASELIBS/, "/nologo " + get_define("LIBS") + " " + (ext.match("php5") ? "" : get_define("PHPLIB"))); - ldflags = get_define("LDFLAGS").replace(/\s?(\/nologo|\/libpath:\S+)\s?/g, ""); - tmpl = tmpl.replace(/BASELDFLAGS/, ldflags + (type == ".dll" ? " " + get_define("DLL_LDFLAGS") : "") + (debug ? ' /nodefaultlib:"msvcrt"' : "")); - out = '/out:"' + outpath + "\\" + ext + type + '"' + ' /libpath:"' + outpath + '"' + ' /libpath:"..\\' + path + 'bindlib_w32\\' + status + '"'; - tmpl = tmpl.replace(/OUTPATH/, out); - - txt = generate_text_filelist(ext, ext_dir); - res = generate_resource_filelist(ext, ext_dir); - - tmpl = tmpl.replace(/TEXTFILES/, txt); - tmpl = tmpl.replace(/RESOURCEFILES/, res); - - if (ext.match("php5")) { - return tmpl; - } - - /* generate source and header blocks for .dsp */ - generate_dsp_filelist(ext, ext_dir, files, path); - - dsp.Write(tmpl); - dsp.Close(); - - return; -} diff --git a/win32/build/template.dsp b/win32/build/template.dsp deleted file mode 100644 index ce1b070d5a..0000000000 --- a/win32/build/template.dsp +++ /dev/null @@ -1,81 +0,0 @@ -# Microsoft Developer Studio Project File - Name="extname" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=extname - Win32 Status_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak" CFG="extname - Win32 Status_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "extname - Win32 Status_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-RE2C=re2c.exe
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "OUTPUTDIR"
-# PROP BASE Intermediate_Dir "OUTPUTDIR"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUTDIR"
-# PROP Intermediate_Dir "OUTPUTDIR"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP BASECPP
-# ADD CPP BASECPP LOCALCPP
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 BASELIBS
-# ADD LINK32 BASELIBS LOCALLIBS BASELDFLAGS LOCALLDFLAGS OUTPATH
-
-# Begin Target
-# Name "extname - Win32 Status_TS"
-
-# Begin Group "Source Files"
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-
-CORESOURCES
-SOURCEFILES
-# End Group
-
-# Begin Group "Header Files"
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-
-COREHEADERS
-HEADERFILES
-# End Group
-
-DEFS
-
-TEXTFILES
-
-# Begin Group "Resource Files"
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-
-RESOURCEFILES
-# End Group
-# End Target
-# End Project
diff --git a/win32/build/template.dsw b/win32/build/template.dsw deleted file mode 100644 index ac781664ff..0000000000 --- a/win32/build/template.dsw +++ /dev/null @@ -1,63 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "Zend"=..\Zend\Zend.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Project: "php5ts"=..\win32\php5ts.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency -}}} - -############################################################################### -INSERT - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/build/template.rc b/win32/build/template.rc index f36f2c041c..b28645822f 100644 --- a/win32/build/template.rc +++ b/win32/build/template.rc @@ -23,7 +23,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US # ifdef FILE_DESCRIPTION #define INTERNAL_NAME FILE_DESCRIPTION /* e.g. 'PHP Script Interpreter', 'GD imaging' */ # else -#define INTERNAL_NAME FILE_NAME /* e.g. 'php5ts.dll', 'php_bz2.dll' */ +#define INTERNAL_NAME FILE_NAME /* e.g. 'php7ts.dll', 'php_bz2.dll' */ # endif #endif diff --git a/win32/globals.c b/win32/globals.c index 0f88e4cc63..ec4180db38 100644 --- a/win32/globals.c +++ b/win32/globals.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/grp.h b/win32/grp.h index 899d3ac0cd..71454fc3b6 100644 --- a/win32/grp.h +++ b/win32/grp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/install.txt b/win32/install.txt index b240ad2723..3c91aeafd7 100644 --- a/win32/install.txt +++ b/win32/install.txt @@ -283,7 +283,7 @@ Manual Installation Steps Extract the distribution file into a directory of your choice. If you are installing PHP 4, extract to C:\, as the zip file expands to a - foldername like php-4.3.7-Win32. If you are installing PHP 5, extract + foldername like php-4.3.7-Win32. If you are installing PHP 7, extract to C:\php as the zip file doesn't expand as in PHP 4. You may choose a different location but do not have spaces in the path (like C:\Program Files\PHP) as some web servers will crash if you do. @@ -291,12 +291,12 @@ Manual Installation Steps The directory structure extracted from the zip is different for PHP versions 4 and 5 and look like as follows: - Example 2-2. PHP 5 package structure + Example 2-2. PHP 7 package structure c:\php | +--dev | | - | |-php5ts.lib + | |-php7ts.lib | +--ext -- extension DLLs for PHP | | @@ -385,7 +385,7 @@ c:\php other server modules failing, such as ASP. The CGI and CLI binaries, and the web server modules all require the - php5ts.dll file to be available to them. You have to make + php7ts.dll file to be available to them. You have to make sure that this file can be found by your PHP installation. The search order for this DLL is as follows: @@ -394,7 +394,7 @@ c:\php Files\Apache Group\Apache2\bin). * Any directory in your Windows PATH environment variable. - To make php5ts.dll available you have three options: copy + To make php7ts.dll available you have three options: copy the file to the Windows system directory, copy the file to the web server's directory, or add your PHP directory, C:\php to the PATH. For better maintenance, we advise you to follow the last option, add C:\php @@ -463,13 +463,13 @@ ActiveScript Note: You should read the manual installation steps first! After installing PHP, you should download the ActiveScript DLL - (php5activescript.dll) and place it in the main PHP folder (e.g. + (php7activescript.dll) and place it in the main PHP folder (e.g. C:\php). After having all the files needed, you must register the DLL on your system. To achieve this, open a Command Prompt window (located in the Start Menu). Then go to your PHP directory by typing something like cd - C:\php. To register the DLL just type regsvr32 php5activescript.dll. + C:\php. To register the DLL just type regsvr32 php7activescript.dll. To test if ActiveScript is working, create a new file, named test.wsf (the extension is very important) and type: @@ -516,8 +516,8 @@ General considerations for all installations of PHP with IIS Also, CGI users may want to set the cgi.redirect_status_env directive. When using directives, be sure these directives aren't commented out inside php.ini. - * The PHP 4 CGI is named php.exe while in PHP 5 it's php-cgi.exe. In - PHP 5, php.exe is the CLI, and not the CGI. + * The PHP 4 CGI is named php.exe while in PHP 7 it's php-cgi.exe. In + PHP 7, php.exe is the CLI, and not the CGI. * Modify the Windows PATH environment variable to include the PHP directory. This way the PHP DLL files and PHP executables can all remain in the PHP directory without cluttering up the Windows @@ -529,12 +529,12 @@ General considerations for all installations of PHP with IIS * Be sure the extension_dir and doc_root PHP directives are appropriately set in php.ini. These directives depend on the system that PHP is being installed on. In PHP 4, the extension_dir is - extensions while with PHP 5 it's ext. So, an example PHP 5 + extensions while with PHP 7 it's ext. So, an example PHP 7 extensions_dir value is "c:\php\ext" and an example IIS doc_root value is "c:\Inetpub\wwwroot". * PHP extension DLL files, such as php_mysql.dll and php_curl.dll, are found in the zip package of the PHP download (not the PHP - installer). In PHP 5, many extensions are part of PECL and can be + installer). In PHP 7, many extensions are part of PECL and can be downloaded in the "Collection of PECL modules" package. Files such as php_zip.dll and php_ssh2.dll. Download PHP files here. * When defining the executable, the 'check that file exists' box may @@ -561,7 +561,7 @@ Windows NT/200x/XP and IIS 4 or newer * Change the Execute Permissions to 'Scripts only' * Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the - appropriate CGI file. An example PHP 5 value is: C:\php\php-cgi.exe + appropriate CGI file. An example PHP 7 value is: C:\php\php-cgi.exe Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times. * Set up the appropriate security. (This is done in Internet Service @@ -574,14 +574,14 @@ Windows NT/200x/XP and IIS 4 or newer * If you don't want to perform HTTP Authentication using PHP, you can (and should) skip this step. Under ISAPI Filters, add a new ISAPI filter. Use PHP as the filter name, and supply a path to the - php5isapi.dll. + php7isapi.dll. * Under 'Home Directory', 'Virtual Directory', or 'Directory', do the following: * Change the Execute Permissions to 'Scripts only' * Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the - appropriate ISAPI DLL. An example PHP 5 value is: - C:\php\php5isapi.dll Supply .php as the extension. Leave 'Method + appropriate ISAPI DLL. An example PHP 7 value is: + C:\php\php7isapi.dll Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times. * Stop IIS completely (NET STOP iisadmin) @@ -590,7 +590,7 @@ Windows NT/200x/XP and IIS 4 or newer With IIS 6 (2003 Server), open up the IIS Manager, go to Web Service Extensions, choose "Add a new Web service extension", enter in a name such as PHP, choose the Add button and for the value browse to either - the ISAPI file (php5isapi.dll) or CGI (php.exe or + the ISAPI file (php7isapi.dll) or CGI (php.exe or php-cgi.exe) then check "Set extension status to Allowed" and click OK. In order to use index.php as a default content page, do the following: @@ -653,12 +653,12 @@ Installing as an Apache module This assumes PHP is installed to c:\php. Adjust the path if this is not the case. - For PHP 5: + For PHP 7: # Add to the end of the LoadModule section -LoadModule php5_module "C:/php/php5apache.dll" +LoadModule php7_module "C:/php/php7apache.dll" # Add to the end of the AddModule section -AddModule mod_php5.c +AddModule mod_php7.c For both: # Add this line inside the <IfModule mod_mime.c> conditional brace @@ -681,7 +681,7 @@ AddType application/x-httpd-php .php # For PHP 4 Action application/x-httpd-php "/php/php.exe" -# For PHP 5 +# For PHP 7 Action application/x-httpd-php "/php/php-cgi.exe" # specify the directory where php.ini is @@ -715,7 +715,7 @@ Apache 2.0.x on Microsoft Windows Apache 2.2.x Support: Users of Apache 2.2.x may use the documentation below except the appropriate DLL file is named - php5apache2_2.dll and it only exists as of PHP 5.2.0. See also + php7apache2_2.dll and it only exists as of PHP 7.2.0. See also http://snaps.php.net/ Warning @@ -734,8 +734,8 @@ Apache 2.0.x on Microsoft Windows * PHP 4.3.0 or later available at http://www.php.net/downloads.php. * the latest stable development version. Get the source code - http://snaps.php.net/php5-latest.tar.gz or download binaries for - Windows http://snaps.php.net/win32/php5-win32-latest.zip. + http://snaps.php.net/php7-latest.tar.gz or download binaries for + Windows http://snaps.php.net/win32/php7-win32-latest.zip. * a prerelease version downloadable from http://qa.php.net/. * you have always the option to obtain PHP through SVN. @@ -782,7 +782,7 @@ AddType application/x-httpd-php .php # For PHP 4 Action application/x-httpd-php "/php/php.exe" -# For PHP 5 +# For PHP 7 Action application/x-httpd-php "/php/php-cgi.exe" Warning @@ -799,8 +799,8 @@ Installing as an Apache module Example 2-6. PHP and Apache 2.0 as Module -# For PHP 5 do something like this: -LoadModule php5_module "c:/php/php5apache2.dll" +# For PHP 7 do something like this: +LoadModule php7_module "c:/php/php7apache2.dll" AddType application/x-httpd-php .php # configure the path to php.ini @@ -836,7 +836,7 @@ CGI setup on Sun, iPlanet and Netscape servers To install PHP as a CGI handler, do the following: - * Copy php5ts.dll to your systemroot (the directory where you + * Copy php7ts.dll to your systemroot (the directory where you installed Windows) * Make a file association from the command line. Type the following two lines: @@ -861,7 +861,7 @@ NSAPI setup on Sun, iPlanet and Netscape servers To install PHP with NSAPI, do the following: - * Copy php5ts.dll to your systemroot (the directory where you + * Copy php7ts.dll to your systemroot (the directory where you installed Windows) * Make a file association from the command line. Type the following two lines: @@ -876,9 +876,9 @@ ftype PHPScript=c:\php\php.exe %1 %* and add the following: You should place the lines after mime types init. -Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="c:/ -php/sapi/php5nsapi.dll" -Init fn="php5_init" LateInit="yes" errorString="Failed to initialise PHP!" [php_ +Init fn="load-modules" funcs="php7_init,php7_execute,php7_auth_trans" shlib="c:/ +php/sapi/php7nsapi.dll" +Init fn="php7_init" LateInit="yes" errorString="Failed to initialise PHP!" [php_ ini="c:/path/to/php.ini"] The php_ini parameter is optional but with it you @@ -888,12 +888,12 @@ ini="c:/path/to/php.ini"] <Object name="default"> section, place this line necessarily after all 'ObjectType' and before all 'AddLog' lines: -Service fn="php5_execute" type="magnus-internal/x-httpd-php" [inikey=value inike +Service fn="php7_execute" type="magnus-internal/x-httpd-php" [inikey=value inike y=value ...] As additional parameters you can add some special php.ini-values, for example you can set a - docroot="/path/to/docroot" specific to the context php5_execute is + docroot="/path/to/docroot" specific to the context php7_execute is called. For boolean ini-keys please use 0/1 as value, not "On","Off",... (this will not work correctly), e.g. zlib.output_compression=1 instead of zlib.output_compression="On" @@ -902,7 +902,7 @@ y=value ...] <Object name="x-httpd-php"> ObjectType fn="force-type" type="magnus-internal/x-httpd-php" -Service fn=php5_execute [inikey=value inikey=value ...] +Service fn=php7_execute [inikey=value inikey=value ...] </Object> After that you can configure a directory in the Administration @@ -949,7 +949,7 @@ Special use for error pages or self-made directory listings (PHP >= 4.3.3) You can use PHP to generate the error pages for "404 Not Found" or similar. Add the following line to the object in obj.conf for every error page you want to overwrite: -Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=value inik +Error fn="php7_execute" code=XXX script="/path/to/script.php" [inikey=value inik ey=value...] where XXX is the HTTP error code. Please delete any other Error @@ -961,7 +961,7 @@ ey=value...] create a PHP script which displays a directory listing and replace the corresponding default Service line for type="magnus-internal/directory" in obj.conf with the following: -Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/scri +Service fn="php7_execute" type="magnus-internal/directory" script="/path/to/scri pt.php" [inikey=value inikey=value...] For both error and directory listing pages the original URI and @@ -986,8 +986,8 @@ Note about nsapi_virtual() and subrequests (PHP >= 4.3.3) server is used, the detection fails and nsapi_virtual() is disabled. If this is the case, try the following: Add the following parameter to - php5_init in magnus.conf/obj.conf: - Init fn=php5_init ... server_lib="ns-httpdXX.dll" + php7_init in magnus.conf/obj.conf: + Init fn=php7_init ... server_lib="ns-httpdXX.dll" where XX is the correct DLL version number. To get it, look in the server-root for the correct DLL name. The DLL with the biggest filesize @@ -1023,7 +1023,7 @@ OmniHTTPd Server select Properties 3. Click on Web Server Global Settings 4. On the 'External' tab, enter: virtual = .php | actual = - c:\php\php.exe (use php-cgi.exe if installing PHP 5), and use the + c:\php\php.exe (use php-cgi.exe if installing PHP 7), and use the Add button. 5. On the Mime tab, enter: virtual = wwwserver/stdcgi | actual = .php, and use the Add button. @@ -1080,11 +1080,11 @@ Installation of extensions on Windows that require, or used to require, additional PHP DLL files. Here's a list of built in extensions: - In PHP 5 (updated PHP 5.0.4), the following changes exist. Built in: + In PHP 7 (updated PHP 5.0.4), the following changes exist. Built in: DOM, LibXML, Iconv, SimpleXML, SPL and SQLite. And the following are no longer built in: MySQL and Overload. - The default location PHP searches for extensions is C:\php5 in PHP 5. + The default location PHP searches for extensions is C:\php7 in PHP 7. To change this setting to reflect your setup of PHP edit your php.ini file: @@ -1446,7 +1446,7 @@ Running PHP as an Apache module (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride Options" or "AllowOverride All" privileges to do so. - With PHP 4 and PHP 5, there are several Apache directives that allow + With PHP 4 and PHP 7, there are several Apache directives that allow you to change the PHP configuration from within the Apache configuration files. For a listing of which directives are PHP_INI_ALL, PHP_INI_PERDIR, or PHP_INI_SYSTEM, have a look at the List of php.ini @@ -1481,7 +1481,7 @@ Running PHP as an Apache module directives. Example 5-2. Apache configuration example -<IfModule mod_php5.c> +<IfModule mod_php7.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag engine on </IfModule> @@ -1558,7 +1558,7 @@ Chapter 6. Installation FAQ 9. Some operating systems: I have installed PHP without errors, but when I try to start apache I get undefined symbol errors: -[mybox:user /src/php5] root# apachectl configtest +[mybox:user /src/php7] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress @@ -1769,7 +1769,7 @@ rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm 9. Some operating systems: I have installed PHP without errors, but when I try to start apache I get undefined symbol errors: -[mybox:user /src/php5] root# apachectl configtest +[mybox:user /src/php7] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress @@ -1797,7 +1797,7 @@ cgi error: the browser again. If it still fails then it could be one of the following: - * File permissions on your PHP script, php.exe, php5ts.dll, php.ini + * File permissions on your PHP script, php.exe, php7ts.dll, php.ini or any PHP extensions you are trying to load are such that the anonymous internet user ISUR_<machinename> cannot access them. * The script file does not exist (or possibly isn't where you think @@ -1917,8 +1917,8 @@ cgi error: AddHandler php-script php AddType text/html php -# PHP 5 -AddHandler php5-script php +# PHP 7 +AddHandler php7-script php AddType text/html php This solution doesn't work for Apache 1 as PHP module doesn't catch diff --git a/win32/php5.dsp b/win32/php5.dsp deleted file mode 100644 index 0b5b9a6d6b..0000000000 --- a/win32/php5.dsp +++ /dev/null @@ -1,134 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=php5 - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5.mak" CFG="php5 - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5 - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5 - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5 - Win32 Release_inline" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release"
-# PROP Intermediate_Dir "..\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release"
-
-!ELSEIF "$(CFG)" == "php5 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "c:\php-fcgi"
-# PROP Intermediate_Dir "..\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D "_CONSOLE" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"c:\php-fcgi\php.exe" /pdbtype:sept /libpath:"..\Debug"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "php5 - Win32 Release_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5___Win32_Release_inline"
-# PROP BASE Intermediate_Dir "php5___Win32_Release_inline"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_inline"
-# PROP Intermediate_Dir "..\Release_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex\\" /I "..\bindlib_w32" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c
-# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release\php.exe" /libpath:"Release"
-# ADD LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release_inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5 - Win32 Release"
-# Name "php5 - Win32 Debug"
-# Name "php5 - Win32 Release_inline"
-# Begin Group "Source Files"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\sapi\cgi\cgi_main.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\sapi\cgi\getopt.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ".h"
-# End Group
-# End Target
-# End Project
diff --git a/win32/php5.dsw b/win32/php5.dsw deleted file mode 100644 index d6efc98ee2..0000000000 --- a/win32/php5.dsw +++ /dev/null @@ -1,107 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "Zend"=..\Zend\Zend.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Project: "fastcgi"=..\sapi\fastcgi\fastcgi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dll - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency -}}} - -############################################################################### - -Project: "php5"=.\php5.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dll - End Project Dependency - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Project: "php5dll"=.\php5dll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency - Begin Project Dependency - Project_Dep_Name libmysql - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/php5dll.dsp b/win32/php5dll.dsp deleted file mode 100644 index cc56f538af..0000000000 --- a/win32/php5dll.dsp +++ /dev/null @@ -1,1643 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5dll" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5dll - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5dll.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5dll.mak" CFG="php5dll - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5dll - Win32 Release_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "c:\php-fcgi\"
-# PROP Intermediate_Dir "..\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib TSRM.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"c:\php-fcgi\php5nts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug" /libpath:"..\Zend\Debug" /libpath:"..\..\bindlib_w32\Debug"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release"
-# PROP Intermediate_Dir "..\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLL_EXPORTS" /D "PHP_EXPORTS" /D "SAPI_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib tsrm.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release" /libpath:"..\TSRM\Release_TS" /libpath:"..\..\bindlib_w32\Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5dll___Win32_Release_inline"
-# PROP BASE Intermediate_Dir "php5dll___Win32_Release_inline"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_inline"
-# PROP Intermediate_Dir "..\Release_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex" /I "..\bindlib_w32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D ZEND_DEBUG=0 /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php5nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib tsrm.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release_inline" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\..\bindlib_w32\Release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5dll - Win32 Debug"
-# Name "php5dll - Win32 Release"
-# Name "php5dll - Win32 Release_inline"
-# Begin Group "Core"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\standard\css.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\cyr_convert.c
-# End Source File
-# Begin Source File
-
-SOURCE="..\main\fopen_wrappers.c"
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\internal_functions_win32.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\main.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\mergesort.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\network.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\output.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_content_types.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_ini.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_open_temporary_file.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_ticks.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_variables.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\proc_open.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\quot_print.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\reentrancy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\rfc1867.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\safe_mode.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\SAPI.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\snprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\spprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\memory_streams.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\user_streams.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\filters.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\user_filters.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\strlcat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\strlcpy.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\standard\config.w32.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\css.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\cyr_convert.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\getopt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\logos.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\main.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\output.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_content_types.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_globals.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_ini.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_open_temporary_file.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_realpath.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_ticks.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_variables.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\quot_print.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\rfc1867.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\safe_mode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\SAPI.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\snprintf.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\spprintf.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\win95nt.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Function Modules"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\standard\array.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\assert.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\base64.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\basic_functions.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\bcmath.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\browscap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\crc32.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\credits.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\datetime.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dir.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dl.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dns.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\exec.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\file.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\filestat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\flock_compat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\formatted_print.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\fsock.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\ftp_fopen_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\head.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\html.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\http_fopen_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\image.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\incomplete_class.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\info.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\iptc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\lcg.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\levenshtein.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\link.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\mail.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\math.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\md5.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\metaphone.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\microtime.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\mod_files.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\mod_user.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\pack.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\pageinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_fopen_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\odbc\php_odbc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\php_pcre.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# ADD CPP /D "STATIC"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\rand.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\reg.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\scanf.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\session.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\soundex.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\string.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\strnatcmp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\syslog.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\type.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\uniqid.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url_scanner_ex.c
-# ADD CPP /W2
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\var.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\var_unserializer.c
-# ADD CPP /W2
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\versioning.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\standard\base64.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\basic_functions.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\datetime.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dl.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dns.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\exec.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\file.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\flock_compat.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\fsock.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\functions\global.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\head.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\html.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\md5.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\mime.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\mod_user.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\pageinfo.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\php_bcmath.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_dir.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_filestat.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_fopen_wrappers.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\ldap\php_ldap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_mail.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_metaphone.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\odbc\php_odbc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\php_pcre.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_string.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_syslog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\functions\phpdir.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\functions\phpmath.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\reg.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\scanf.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\type.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\uniqid.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url_scanner_ex.h
-# End Source File
-# End Group
-# Begin Group "Regular Expressions"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\regex\regcomp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\regex\regerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\regex\regexec.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\regex\regfree.c
-# End Source File
-# End Group
-# Begin Group "PCRE"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 3"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\chartables.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# ADD CPP /D "STATIC"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\get.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# ADD CPP /D "STATIC"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\maketables.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# ADD CPP /D "STATIC"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# ADD CPP /D "STATIC"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\study.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# ADD CPP /D "STATIC"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files No. 3"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\internal.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "XML"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 4"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\ctype\ctype.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\overload\overload.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\tokenizer\tokenizer.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\wddx\wddx.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\xml\compat.c
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\xml\xml.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 4"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\xml\php_xml.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "FTP"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 6"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\ftp\ftp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\ftp\php_ftp.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 6"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\ftp\ftp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\ftp\php_ftp.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Calendar"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 7"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\calendar\cal_unix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\calendar.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\dow.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\easter.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\french.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\gregor.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\jewish.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\julian.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 7"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\calendar\php_calendar.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\sdncal.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "bcmath"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 8"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\add.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\compare.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\debug.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\div.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\divmod.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\init.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\int2num.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\neg.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\num2long.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\num2str.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\output.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\raise.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\recmul.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\rt.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\str2num.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\sub.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\zero.c
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files No. 8"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\config.h
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\private.h
-
-!IF "$(CFG)" == "php5dll - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
-
-!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
-
-# PROP Intermediate_Dir "..\Release_inline_bcmath"
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Group
-# End Group
-# Begin Group "Win32"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\com\COM.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com\conversion.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\readdir.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\registry.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\sendmail.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\time.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com\VARIANT.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\winutil.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\wsyslog.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\com\com.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com\conversion.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\grp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\param.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com\php_COM.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\php_registry.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com\php_VARIANT.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com\php_versioning.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\readdir.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\sendmail.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\syslog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\time.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\unistd.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com\variant.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\wfile.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Text Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ChangeLog
-# End Source File
-# Begin Source File
-
-SOURCE=..\LICENSE
-# End Source File
-# End Group
-# Begin Group "Support"
-
-# PROP Default_Filter ""
-# End Target
-# End Project
diff --git a/win32/php5dllts.dsp b/win32/php5dllts.dsp deleted file mode 100644 index 3755ea79f9..0000000000 --- a/win32/php5dllts.dsp +++ /dev/null @@ -1,2719 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5dllts" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php5dllts - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5dllts.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5dllts.mak" CFG="php5dllts - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5dllts - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5dllts - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5dllts - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php5dllts - Win32 Release_TSDbg" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"msvcrt" /out:"..\Debug_TS\php5ts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" /libpath:"..\..\bindlib_w32\Debug" /libpath:"Debug_TS" /libpath:"..\..\zlib\Debug" /libpath:"..\..\libxml\lib\Debug" /libpath:"..\ext\sqlite\Debug_TS" /libpath:"..\..\libiconv\lib"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_STATIC" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"Release_TS" /libpath:"..\ext\sqlite\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5dllts___Win32_Release_TS_inline"
-# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TS_inline"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"Release_TS/php5ts.dll" /libpath:"TSRM\Release_TS" /libpath:"Zend\Release_TS" /libpath:"..\bindlib_w32\Release"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS_inline\php5ts.dll" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\Zend\Release_TS_inline" /libpath:"Release_TS_Inline" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" /libpath:"..\ext\sqlite\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5dllts___Win32_Release_TSDbg"
-# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TSDbg"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TSDbg"
-# PROP Intermediate_Dir "Release_TSDbg"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"Release_TS"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TSDbg\php5ts.dll" /libpath:"..\TSRM\Release_TSDbg" /libpath:"..\Zend\Release_TSDbg" /libpath:"Release_TSDbg" /libpath:"..\ext\sqlite\Release_TSDbg" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5dllts - Win32 Debug_TS"
-# Name "php5dllts - Win32 Release_TS"
-# Name "php5dllts - Win32 Release_TS_inline"
-# Name "php5dllts - Win32 Release_TSDbg"
-# Begin Group "Core"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\standard\css.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\cyr_convert.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\filters.c
-# End Source File
-# Begin Source File
-
-SOURCE="..\main\fopen_wrappers.c"
-# End Source File
-# Begin Source File
-
-SOURCE=.\globals.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\internal_functions_win32.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\main.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\mergesort.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\network.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\output.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_content_types.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_ini.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_open_temporary_file.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_scandir.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_sprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_ticks.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_variables.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\proc_open.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\quot_print.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\reentrancy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\rfc1867.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\safe_mode.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\SAPI.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\snprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\spprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\strlcat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\strlcpy.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\main\config.w32.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\css.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\cyr_convert.h
-# End Source File
-# Begin Source File
-
-SOURCE="..\main\fopen_wrappers.h"
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\getopt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\logos.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\output.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_compat.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_content_types.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_globals.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_ini.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_main.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_open_temporary_file.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_output.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_regex.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_scandir.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_streams.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\php_variables.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\quot_print.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\rfc1867.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\safe_mode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\SAPI.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\snprintf.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\spprintf.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\win95nt.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Function Modules"
-
-# PROP Default_Filter ""
-# Begin Group "PCRE"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 3"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_chartables.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_compile.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_exec.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_fullinfo.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_get.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_globals.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_info.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_maketables.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_ord2utf8.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_study.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_tables.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_try_flipped.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_ucp_searchfuncs.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_valid_utf8.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_version.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre_xclass.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
-# End Source File
-# End Group
-# Begin Group "Header Files No. 3"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\internal.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\pcrelib\pcre.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "DOM"
-
-# PROP Default_Filter ""
-# Begin Group "DOM Source Files"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\dom\attr.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\cdatasection.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\characterdata.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\comment.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\document.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\documentfragment.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\documenttype.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\dom_iterators.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domconfiguration.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domerrorhandler.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domexception.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domimplementation.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domimplementationlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domimplementationsource.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domlocator.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\domstringlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\element.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\entity.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\entityreference.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\namednodemap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\namelist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\node.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\nodelist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\notation.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\php_dom.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\processinginstruction.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\string_extend.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\text.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\typeinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\userdatahandler.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\xpath.c
-# End Source File
-# End Group
-# Begin Group "DOM Header Files"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\dom\dom_ce.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\dom_fe.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\dom_properties.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\php_dom.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\dom\xml_common.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Group
-# Begin Group "SimpleXML"
-
-# PROP Default_Filter ""
-# Begin Group "SimpleXML Source Files"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\simplexml\simplexml.c
-# End Source File
-# End Group
-# Begin Group "SimpleXML Header Files"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\simplexml\php_simplexml.h
-# End Source File
-# End Group
-# Begin Group "Resource Files No. 1"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Group
-# Begin Group "Regular Expressions"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\regex\regcomp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\regex\regerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\regex\regexec.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\regex\regfree.c
-# End Source File
-# End Group
-# Begin Group "XML"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 4"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\xml\compat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\ctype\ctype.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\tokenizer\tokenizer.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\wddx\wddx.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\xml\xml.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 4"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\wddx\php_wddx.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\wddx\php_wddx_api.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\xml\php_xml.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "FTP"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 6"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\ftp\ftp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\ftp\php_ftp.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 6"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\ftp\ftp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\ftp\php_ftp.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Calendar"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 7"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\calendar\cal_unix.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\calendar.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\dow.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\easter.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\french.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\gregor.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\jewish.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\julian.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# End Group
-# Begin Group "Header Files No. 7"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\calendar\php_calendar.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\sdncal.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "SPL"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 11"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\spl\php_spl.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_array.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_directory.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_engine.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_exceptions.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_functions.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_iterators.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_observer.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_sxe.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 12"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\spl\php_spl.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_array.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_directory.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_engine.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_exceptions.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_functions.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_iterators.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_observer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_sxe.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Reflection"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 12"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\reflection\php_reflection.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 13"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\reflection\php_reflection.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "XMLReader"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 13"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\xmlreader\php_xmlreader.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 14"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\xmlreader\php_xmlreader.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "XMLwriter"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 14"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\xmlwriter\php_xmlwriter.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 15"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\xmlwriter\php_xmlwriter.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "IConv"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 15"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\iconv\iconv.c
-# ADD CPP /D "PHP_ICONV_EXPORTS"
-# End Source File
-# End Group
-# Begin Group "Header Files No. 16"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\iconv\php_iconv.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "bcmath"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 8"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\add.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\compare.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\debug.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\div.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\divmod.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\init.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\int2num.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\neg.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\num2long.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\num2str.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\output.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\raise.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\recmul.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\rt.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\str2num.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\sub.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\zero.c
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
-# ADD CPP /I "..\ext\bcmath\libbcmath\src"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files No. 8"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\config.h
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\libbcmath\src\private.h
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Group
-# Begin Group "zlib"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 10 Nr. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\zlib\zlib.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\zlib\zlib_filter.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\zlib\zlib_fopen_wrapper.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 10 Nr. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\zlib\php_zlib.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Standard"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\standard\array.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\assert.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\base64.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\basic_functions.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\bcmath.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\browscap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\crc32.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\credits.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\crypt.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\datetime.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dir.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dl.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dns.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\exec.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\file.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\filestat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\flock_compat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\formatted_print.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\fsock.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\ftp_fopen_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\head.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\html.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\http.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\http_fopen_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\image.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\incomplete_class.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\info.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\iptc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\lcg.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\levenshtein.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\link.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\mail.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\math.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\md5.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\metaphone.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\microtime.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\mod_files.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\mod_user.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\pack.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\pageinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_fopen_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\odbc\php_odbc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\php_pcre.c
-# ADD CPP /D "STATIC"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\rand.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\reg.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\scanf.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\session.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\sha1.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\soundex.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\streamsfuncs.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\string.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\strnatcmp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\syslog.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\type.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\uniqid.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url_scanner_ex.c
-# ADD CPP /W2
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\uuencode.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\var.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\var_unserializer.c
-# ADD CPP /W2
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\versioning.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\standard\base64.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\basic_functions.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\datetime.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dl.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\dns.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\exec.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\file.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\flock_compat.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\fsock.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\functions\global.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\head.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\html.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\info.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\md5.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\mod_user.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\pageinfo.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_array.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\bcmath\php_bcmath.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_crypt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_dir.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_filestat.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_fopen_wrappers.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_http.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_lcg.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\ldap\php_ldap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_mail.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\odbc\php_odbc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\odbc\php_odbc_includes.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\pcre\php_pcre.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_rand.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\session\php_session.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_string.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_sunfuncs.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\php_syslog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\functions\phpdir.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\functions\phpmath.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\reg.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\scanf.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\sha1.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\type.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\uniqid.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\url_scanner_ex.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "SQLite"
-
-# PROP Default_Filter ""
-# Begin Group "Header Files No. 5"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\sqlite\php_sqlite.h
-# End Source File
-# End Group
-# Begin Group "Source Files No. 5"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\sqlite\sess_sqlite.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\sqlite\sqlite.c
-# End Source File
-# End Group
-# End Group
-# Begin Group "LIBXML"
-
-# PROP Default_Filter ""
-# Begin Group "Header Files No. 10"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\libxml\php_libxml.h
-# End Source File
-# End Group
-# Begin Group "Source Files No. 9"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\libxml\libxml.c
-# End Source File
-# End Group
-# End Group
-# Begin Group "Date"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 10"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\date\lib\astro.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\dow.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\parse_date.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\parse_tz.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\php_date.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timelib.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timelib_config.h.win32
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-# Begin Custom Build
-InputDir=\Projects\php-5.2\ext\date\lib
-InputPath=..\ext\date\lib\timelib_config.h.win32
-
-"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputPath) $(InputDir)\timelib_config.h
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-# Begin Custom Build
-InputDir=\Projects\php-5.2\ext\date\lib
-InputPath=..\ext\date\lib\timelib_config.h.win32
-
-"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputPath) $(InputDir)\timelib_config.h
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-# Begin Custom Build
-InputDir=\Projects\php-5.2\ext\date\lib
-InputPath=..\ext\date\lib\timelib_config.h.win32
-
-"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputPath) $(InputDir)\timelib_config.h
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# Begin Custom Build
-InputDir=\Projects\php-5.2\ext\date\lib
-InputPath=..\ext\date\lib\timelib_config.h.win32
-
-"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputPath) $(InputDir)\timelib_config.h
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\tm2unixtime.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\unixtime2tm.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 11"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\date\lib\astro.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\fallbackmap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\php_date.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timelib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timezonedb.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timezonemap.h
-# End Source File
-# End Group
-# End Group
-# End Group
-# Begin Group "Win32"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\crypt_win32.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\glob.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\md5crypt.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\readdir.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\registry.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\select.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\sendmail.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\time.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\winutil.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\wsyslog.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\build\wsyslog.mc
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-# Begin Custom Build
-InputDir=.\build
-IntDir=.\Release_TSDbg
-InputPath=.\build\wsyslog.mc
-
-"wsyslog.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- mc -h $(InputDir)/.. -r $(InputDir) -x $(IntDir) $(InputPath)
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\crypt_win32.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\glob.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\grp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\param.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\php_registry.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\readdir.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\select.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\sendmail.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\syslog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\time.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\unistd.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\win32\wfile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\winutil.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Text Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ChangeLog
-# End Source File
-# Begin Source File
-
-SOURCE=..\LICENSE
-# End Source File
-# Begin Source File
-
-SOURCE=..\NEWS
-# End Source File
-# Begin Source File
-
-SOURCE="..\php.ini-dist"
-# End Source File
-# Begin Source File
-
-SOURCE="..\php.ini-recommended"
-# End Source File
-# Begin Source File
-
-SOURCE="..\README.CVS-RULES"
-# End Source File
-# Begin Source File
-
-SOURCE=..\TODO
-# End Source File
-# End Group
-# Begin Group "Support"
-
-# PROP Default_Filter ""
-# End Group
-# Begin Group "Streams"
-
-# PROP Default_Filter ""
-# Begin Group "streams headers"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\main\streams\php_stream_context.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\php_stream_filter_api.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\php_stream_mmap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\php_stream_plain_wrapper.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\php_stream_transport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\php_stream_userspace.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\php_streams_int.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=..\main\streams\cast.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\filter.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\memory.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\mmap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\plain_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\streams.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\transports.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\standard\user_filters.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\userspace.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\main\streams\xp_socket.c
-# End Source File
-# End Group
-# Begin Group "COM and DotNet"
-
-# PROP Default_Filter ""
-# Begin Group "Header Files No. 9"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_saproxy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_wrapper.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\php_com_dotnet.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\php_com_dotnet_internal.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_com.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_dotnet.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_extension.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_handlers.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_iterator.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_misc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_olechar.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_persist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_typeinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\com_dotnet\com_variant.c
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\php5dllts.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\php5dllts.rc2
-# End Source File
-# Begin Source File
-
-SOURCE=.\phpts.def
-
-!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
-# Begin Custom Build - Generating $(InputPath)
-InputPath=.\phpts.def
-
-"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- builddef.bat > phpts.def
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
-# Begin Custom Build - Generating $(InputPath)
-InputPath=.\phpts.def
-
-"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- builddef.bat > phpts.def
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
-# Begin Custom Build - Generating $(InputPath)
-InputPath=.\phpts.def
-
-"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- builddef.bat > phpts.def
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
-# Begin Custom Build - Generating $(InputPath)
-InputPath=.\phpts.def
-
-"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- builddef.bat > phpts.def
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Target
-# End Project
diff --git a/win32/php5ts.dsp b/win32/php5ts.dsp deleted file mode 100644 index 3736815127..0000000000 --- a/win32/php5ts.dsp +++ /dev/null @@ -1,191 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5ts" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=php5ts - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5ts.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5ts.mak" CFG="php5ts - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5ts - Win32 Release_TS" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5ts - Win32 Debug_TS" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5ts - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5ts - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5ts - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 php5ts.lib winmm.lib ws2_32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5ts - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 winmm.lib netapi32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS/php.exe" /pdbtype:sept /libpath:"..\Debug_TS"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline"
-# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c
-# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS"
-# ADD LINK32 php5ts.lib winmm.lib ws2_32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\php.exe" /libpath:"..\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TSDbg"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg"
-# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TSDbg"
-# PROP Intermediate_Dir "Release_TSDbg"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS"
-# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5ts - Win32 Release_TS"
-# Name "php5ts - Win32 Debug_TS"
-# Name "php5ts - Win32 Release_TS_inline"
-# Name "php5ts - Win32 Release_TSDbg"
-# Begin Group "Source Files"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\sapi\cgi\cgi_main.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\sapi\cgi\fastcgi.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\sapi\cgi\getopt.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\sapi\cgi\php_getopt.h
-# End Source File
-# End Group
-# Begin Group "libfcgi"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\sapi\cgi\libfcgi\fcgiapp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\sapi\cgi\libfcgi\os_win32.c
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\php5ts.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\php5ts.rc2
-# End Source File
-# End Target
-# End Project
diff --git a/win32/php5ts.dsw b/win32/php5ts.dsw deleted file mode 100644 index 61ccd1c24b..0000000000 --- a/win32/php5ts.dsw +++ /dev/null @@ -1,227 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "EngineSelect"=.\EngineSelect.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ZendTS"=..\Zend\ZendTS.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name TSRM
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name EngineSelect
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "libsqlite"=..\ext\sqlite\libsqlite\src\libsqlite.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "php5aolserver"=..\sapi\aolserver\php5aolserver.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5apache"=..\sapi\apache\php5apache.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5apache2"=..\SAPI\APACHE2HANDLER\php5apache2.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5dllts"=.\php5dllts.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name ZendTS
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name TSRM
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name libsqlite
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5isapi"=..\sapi\isapi\php5isapi.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5nsapi"=..\sapi\nsapi\php5nsapi.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5pi3web"=..\sapi\pi3web\php5pi3web.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5ts"=.\php5ts.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "php5ts_cli"=.\php5ts_cli.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5dllts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "testsuite"=.\testsuite.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name php5ts
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/win32/php5ts_cli.dsp b/win32/php5ts_cli.dsp deleted file mode 100644 index 37a4113ad4..0000000000 --- a/win32/php5ts_cli.dsp +++ /dev/null @@ -1,175 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5ts_cli" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=php5ts_cli - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php5ts_cli.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php5ts_cli.mak" CFG="php5ts_cli - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php5ts_cli - Win32 Release_TS" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5ts_cli - Win32 Debug_TS" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5ts_cli - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application")
-!MESSAGE "php5ts_cli - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php5ts_cli - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\cli\php.exe" /libpath:"..\Release_TS"
-
-!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 winmm.lib netapi32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS\cli\php.exe" /pdbtype:sept /libpath:"..\Debug_TS"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TS_inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline"
-# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TS_inline"
-# PROP Intermediate_Dir "Release_TS_inline"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c
-# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS"
-# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\cli\php.exe" /libpath:"..\Release_TS_inline"
-
-!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TSDbg"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg"
-# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\Release_TSDbg"
-# PROP Intermediate_Dir "Release_TSDbg"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS"
-# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg"
-
-!ENDIF
-
-# Begin Target
-
-# Name "php5ts_cli - Win32 Release_TS"
-# Name "php5ts_cli - Win32 Debug_TS"
-# Name "php5ts_cli - Win32 Release_TS_inline"
-# Name "php5ts_cli - Win32 Release_TSDbg"
-# Begin Group "Source Files"
-
-# PROP Default_Filter ".c"
-# Begin Source File
-
-SOURCE=..\sapi\cli\getopt.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\sapi\cli\php_cli.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\sapi\cli\php_getopt.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\php5ts_cli.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\php5ts_cli.rc2
-# End Source File
-# End Target
-# End Project
diff --git a/win32/php5dllts.rc b/win32/php7dllts.rc index 2e01037eee..27ec635e25 100644 --- a/win32/php5dllts.rc +++ b/win32/php7dllts.rc @@ -70,7 +70,7 @@ END BEGIN - "#include ""php5dllts.rc2""\r\n" + "#include ""php7dllts.rc2""\r\n" "\0" @@ -114,7 +114,7 @@ END // -#include "php5dllts.rc2" +#include "php7dllts.rc2" diff --git a/win32/php5dllts.rc2 b/win32/php7dllts.rc2 index b05f0af0dc..6bcc652a72 100644 --- a/win32/php5dllts.rc2 +++ b/win32/php7dllts.rc2 @@ -1,5 +1,5 @@ // -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly +// php7dllts.RC2 - resources Microsoft Visual C++ does not edit directly // #ifdef APSTUDIO_INVOKED @@ -42,7 +42,7 @@ BEGIN VALUE "InternalName", "php\0" VALUE "LegalCopyright", "Copyright © 1997-2007 The PHP Group\0" VALUE "LegalTrademarks", "php\0" - VALUE "OriginalFilename", "php5ts.dll\0" + VALUE "OriginalFilename", "php7ts.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "PHP Thread Safe\0" VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) diff --git a/win32/php5ts.rc b/win32/php7ts.rc index d9a4aa541b..b725155809 100644 --- a/win32/php5ts.rc +++ b/win32/php7ts.rc @@ -70,7 +70,7 @@ END BEGIN - "#include ""php5ts.rc2""\r\n" + "#include ""php7ts.rc2""\r\n" "\0" @@ -114,7 +114,7 @@ END // -#include "php5ts.rc2" +#include "php7ts.rc2" diff --git a/win32/php5ts.rc2 b/win32/php7ts.rc2 index 3a53a900ec..6c813de23c 100644 --- a/win32/php5ts.rc2 +++ b/win32/php7ts.rc2 @@ -1,5 +1,5 @@ // -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly +// php7dllts.RC2 - resources Microsoft Visual C++ does not edit directly // #ifdef APSTUDIO_INVOKED diff --git a/win32/php5ts_cli.rc b/win32/php7ts_cli.rc index 0053e0c7f2..3478b94bd7 100644 --- a/win32/php5ts_cli.rc +++ b/win32/php7ts_cli.rc @@ -70,7 +70,7 @@ END BEGIN - "#include ""php5ts_cli.rc2""\r\n" + "#include ""php7ts_cli.rc2""\r\n" "\0" @@ -114,7 +114,7 @@ END // -#include "php5ts_cli.rc2" +#include "php7ts_cli.rc2" diff --git a/win32/php5ts_cli.rc2 b/win32/php7ts_cli.rc2 index 517bd4ab34..004808c16b 100644 --- a/win32/php5ts_cli.rc2 +++ b/win32/php7ts_cli.rc2 @@ -1,5 +1,5 @@ // -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly +// php7dllts.RC2 - resources Microsoft Visual C++ does not edit directly // #ifdef APSTUDIO_INVOKED diff --git a/win32/php_modules.dsw b/win32/php_modules.dsw deleted file mode 100644 index 81f22fa44f..0000000000 --- a/win32/php_modules.dsw +++ /dev/null @@ -1,473 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "bz2"=..\ext\bz2\bz2.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ctype"=..\ext\ctype\ctype.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "curl"=..\ext\curl\curl.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "dba"=..\ext\dba\dba.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "dbase"=..\ext\dbase\dbase.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "dbx"=..\ext\dbx\dbx.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "exif"=..\ext\exif\exif.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "fbsql"=..\ext\fbsql\fbsql.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "fdf"=..\ext\fdf\fdf.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "filepro"=..\ext\filepro\filepro.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "gd"=..\ext\gd\gd.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "gettext"=..\ext\gettext\gettext.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "iconv"=..\ext\iconv\iconv.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ifx"=..\ext\informix\ifx.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "imap"=..\ext\imap\imap.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ingres"=..\ext\ingres_ii\ingres.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "interbase"=..\ext\interbase\interbase.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ldap"=..\ext\ldap\ldap.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "mbstring"=..\ext\mbstring\mbstring.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "mcrypt"=..\ext\mcrypt\mcrypt.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "mcve"=..\ext\mcve\mcve.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "mhash"=..\ext\mhash\mhash.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "mime_magic"=..\ext\mime_magic\mime_magic.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "ming"=..\ext\ming\ming.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "msql"=..\ext\msql\msql.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "mssql"=..\ext\mssql\mssql.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "mysql"=..\ext\mysql\mysql.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "oci8"=..\ext\oci8\oci8.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "openssl"=..\ext\openssl\openssl.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "oracle"=..\ext\oracle\oracle.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "pgsql"=..\ext\pgsql\pgsql.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "shmop"=..\ext\shmop\shmop.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "snmp"=..\ext\snmp\snmp.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "sockets"=..\ext\sockets\sockets.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "sybase_ct"=..\ext\sybase_ct\sybase_ct.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "tokenizer"=..\ext\tokenizer\tokenizer.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "xmlrpc"=..\ext\xmlrpc\xmlrpc.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "xsl"=..\ext\xsl\xsl.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h index 6bf9ba5b71..42f5ec9411 100644 --- a/win32/php_win32_globals.h +++ b/win32/php_win32_globals.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/resource.h b/win32/resource.h index 3e7e4c0ed1..13760d4962 100644 --- a/win32/resource.h +++ b/win32/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. -// Used by php5dllts.rc +// Used by php7dllts.rc // // Next default values for new objects diff --git a/win32/select.c b/win32/select.c index 8e44636945..636c84364a 100644 --- a/win32/select.c +++ b/win32/select.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/select.h b/win32/select.h index a8d8496295..dafe76c1bc 100644 --- a/win32/select.h +++ b/win32/select.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/sendmail.c b/win32/sendmail.c index 5fe33331cd..3e81ecd4bc 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -87,9 +87,9 @@ char LocalHost[HOST_NAME_LEN]; #endif char seps[] = " ,\t\n"; #ifndef NETWARE -char *php_mailer = "PHP 5 WIN32"; +char *php_mailer = "PHP 7 WIN32"; #else -char *php_mailer = "PHP 5 NetWare"; +char *php_mailer = "PHP 7 NetWare"; #endif /* NETWARE */ /* Error messages */ diff --git a/win32/sockets.c b/win32/sockets.c index 8b3898bb3c..1fceabb90a 100644 --- a/win32/sockets.c +++ b/win32/sockets.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/sockets.h b/win32/sockets.h index 78a0d3a967..c5cd4d19ed 100644 --- a/win32/sockets.h +++ b/win32/sockets.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/syslog.h b/win32/syslog.h index 06397d0f90..5274f64c44 100644 --- a/win32/syslog.h +++ b/win32/syslog.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/syslog.reg b/win32/syslog.reg index cb12d6e6b9..2974bfbd48 100644 --- a/win32/syslog.reg +++ b/win32/syslog.reg @@ -2,4 +2,4 @@ REGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.3.99-dev]
"TypesSupported"=dword:00000007
-"EventMessageFile"="g:\\test\\srctrunkinstall\\php5ts.dll"
+"EventMessageFile"="g:\\test\\srctrunkinstall\\php7ts.dll"
diff --git a/win32/testsuite.dsp b/win32/testsuite.dsp deleted file mode 100644 index 5cd65622f5..0000000000 --- a/win32/testsuite.dsp +++ /dev/null @@ -1,150 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testsuite" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Generic Project" 0x010a
-
-CFG=testsuite - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "testsuite.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "testsuite.mak" CFG="testsuite - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "testsuite - Win32 Release_TS_Inline" (based on "Win32 (x86) Generic Project")
-!MESSAGE "testsuite - Win32 Release_TS" (based on "Win32 (x86) Generic Project")
-!MESSAGE "testsuite - Win32 Release_TSDbg" (based on "Win32 (x86) Generic Project")
-!MESSAGE "testsuite - Win32 Debug_TS" (based on "Win32 (x86) Generic Project")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-MTL=midl.exe
-
-!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS_Inline"
-# PROP BASE Intermediate_Dir "Release_TS_Inline"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS_Inline"
-# PROP Intermediate_Dir "..\..\"
-# PROP Target_Dir ""
-
-!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TS"
-# PROP Intermediate_Dir "..\..\"
-# PROP Target_Dir ""
-
-!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TSDbg"
-# PROP BASE Intermediate_Dir "Release_TSDbg"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\Release_TSDbg"
-# PROP Intermediate_Dir "..\..\"
-# PROP Target_Dir ""
-
-!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\Debug_TS"
-# PROP Intermediate_Dir "..\..\"
-# PROP Target_Dir ""
-
-!ENDIF
-
-# Begin Target
-
-# Name "testsuite - Win32 Release_TS_Inline"
-# Name "testsuite - Win32 Release_TS"
-# Name "testsuite - Win32 Release_TSDbg"
-# Name "testsuite - Win32 Debug_TS"
-# Begin Source File
-
-SOURCE=..\results.txt
-
-!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline"
-
-# PROP Intermediate_Dir "..\Release_TS_Inline"
-# PROP Ignore_Default_Tool 1
-# Begin Custom Build - Running Testsuite, please wait...
-IntDir=.\..\Release_TS_Inline
-InputPath=..\results.txt
-
-"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- set TOP_BUILDDIR=Release_TS_inline
- set TEST_DIR=tests
- $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS"
-
-# PROP Intermediate_Dir "..\Release_TS"
-# PROP Ignore_Default_Tool 1
-# Begin Custom Build - Running Testsuite, please wait...
-IntDir=.\..\Release_TS
-InputPath=..\results.txt
-
-"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- set TOP_BUILDDIR=Release_TS
- set TEST_DIR=tests
- $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg"
-
-# PROP Intermediate_Dir "..\Release_TSDbg"
-# PROP Ignore_Default_Tool 1
-# Begin Custom Build - Running Testsuite, please wait...
-IntDir=.\..\Release_TSDbg
-InputPath=..\results.txt
-
-"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- set TOP_BUILDDIR=Release_TSDbg
- set TEST_DIR=tests
- $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS"
-
-# PROP Intermediate_Dir "..\Debug_TS"
-# PROP Exclude_From_Build 1
-
-!ENDIF
-
-# End Source File
-# End Target
-# End Project
diff --git a/win32/winutil.c b/win32/winutil.c index 9984d3addc..5203fb4e66 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/win32/winutil.h b/win32/winutil.h index e0193d33f3..74d72062c4 100644 --- a/win32/winutil.h +++ b/win32/winutil.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ |