summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2014-11-29 01:45:54 +0000
committerAndrea Faulds <ajf@ajf.me>2014-11-29 01:45:54 +0000
commit01554bf3e417f13baf7af874e449c265c0309279 (patch)
tree8aca46ab27a54cea34c14001af774942f0502e39
parent65c8edd525108f6598a8bb25fb3c5d6c80233322 (diff)
parent719083bd943e6c287c2dcb47918cf51f89a4ac08 (diff)
downloadphp-git-01554bf3e417f13baf7af874e449c265c0309279.tar.gz
Merge branch 'master' into zppFailOnOverflow
-rw-r--r--CODING_STANDARDS2
-rw-r--r--INSTALL2
-rw-r--r--NEWS52
-rw-r--r--README.TESTING2
-rw-r--r--README.TESTING26
-rw-r--r--TSRM/tsrm_win32.c69
-rw-r--r--TSRM/tsrm_win32.h3
-rw-r--r--UPGRADING8
-rw-r--r--UPGRADING.INTERNALS31
-rw-r--r--Zend/ZEND_CHANGES2
-rw-r--r--Zend/tests/bug21478.phpt2
-rw-r--r--Zend/tests/bug33512.phpt2
-rw-r--r--Zend/tests/bug38779_1.phpt8
-rw-r--r--Zend/tests/bug40809.phpt2
-rw-r--r--Zend/tests/bug43200.phpt2
-rw-r--r--Zend/tests/bug43200_2.phpt2
-rw-r--r--Zend/tests/bug65419.phpt23
-rw-r--r--Zend/tests/bug68370.phpt18
-rw-r--r--Zend/tests/bug68446.phpt36
-rw-r--r--Zend/tests/class_properties_const.phpt25
-rw-r--r--Zend/tests/debug_backtrace_with_include_and_this.phpt8
-rw-r--r--Zend/tests/traits/bug54441.phpt2
-rw-r--r--Zend/tests/try_finally_010.phpt2
-rw-r--r--Zend/tests/varSyntax/tempDimFetchByRefError.phpt2
-rw-r--r--Zend/zend_API.c12
-rw-r--r--Zend/zend_API.h6
-rw-r--r--Zend/zend_alloc.c21
-rw-r--r--Zend/zend_builtin_functions.c26
-rw-r--r--Zend/zend_compile.c99
-rw-r--r--Zend/zend_compile.h67
-rw-r--r--Zend/zend_constants.h12
-rw-r--r--Zend/zend_execute.c323
-rw-r--r--Zend/zend_execute.h92
-rw-r--r--Zend/zend_execute_API.c23
-rw-r--r--Zend/zend_float.h6
-rw-r--r--Zend/zend_gc.c10
-rw-r--r--Zend/zend_generators.c12
-rw-r--r--Zend/zend_hash.c111
-rw-r--r--Zend/zend_hash.h2
-rw-r--r--Zend/zend_indent.c2
-rw-r--r--Zend/zend_inheritance.c6
-rw-r--r--Zend/zend_object_handlers.c50
-rw-r--r--Zend/zend_objects.c9
-rw-r--r--Zend/zend_opcode.c19
-rw-r--r--Zend/zend_portability.h7
-rw-r--r--Zend/zend_types.h5
-rw-r--r--Zend/zend_variables.c15
-rw-r--r--Zend/zend_variables.h13
-rw-r--r--Zend/zend_virtual_cwd.c53
-rw-r--r--Zend/zend_vm.h4
-rw-r--r--Zend/zend_vm_def.h341
-rw-r--r--Zend/zend_vm_execute.h4683
-rw-r--r--Zend/zend_vm_execute.skl2
-rw-r--r--Zend/zend_vm_gen.php90
-rw-r--r--Zend/zend_vm_opcodes.h4
-rw-r--r--ext/calendar/julian.c2
-rw-r--r--ext/calendar/tests/unixtojd.phpt4
-rw-r--r--ext/com_dotnet/com_com.c3
-rw-r--r--ext/com_dotnet/com_extension.c2
-rw-r--r--ext/com_dotnet/com_typeinfo.c8
-rw-r--r--ext/com_dotnet/com_variant.c11
-rw-r--r--ext/ctype/ctype.xml2
-rw-r--r--ext/curl/tests/curl_multi_init_param.phpt27
-rw-r--r--ext/date/lib/parse_tz.c6
-rw-r--r--ext/date/lib/timezonedb.h1356
-rw-r--r--ext/date/tests/002.phpt2
-rw-r--r--ext/date/tests/bug13142.phpt2
-rw-r--r--ext/date/tests/bug26317.phpt2
-rw-r--r--ext/date/tests/bug26320.phpt2
-rw-r--r--ext/date/tests/date_interval_create_from_date_string.phpt34
-rw-r--r--ext/date/tests/date_interval_create_from_date_string_nullparam.phpt42
-rw-r--r--ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt11
-rw-r--r--ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt9
-rw-r--r--ext/date/tests/date_timestamp_set.phpt19
-rw-r--r--ext/date/tests/date_timestamp_set_nullparam.phpt17
-rw-r--r--ext/date/tests/date_timestamp_set_nullparam2.phpt24
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_001.phpt17
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_002.phpt15
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_003.phpt19
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_004.phpt17
-rw-r--r--ext/date/tests/timezone_version_get.phpt13
-rw-r--r--ext/date/tests/timezone_version_get_basic1.phpt12
-rwxr-xr-xext/dba/README2
-rw-r--r--ext/ereg/regex/regcomp.c2
-rw-r--r--ext/exif/tests/bug68113.phpt6
-rw-r--r--ext/fileinfo/fileinfo.php2
-rw-r--r--ext/fileinfo/libmagic/patchlevel.h2
-rw-r--r--ext/fileinfo/tests/magic14
-rw-r--r--ext/filter/filter.c6
-rw-r--r--ext/filter/filter_private.h5
-rw-r--r--ext/filter/logical_filters.c87
-rw-r--r--ext/filter/php_filter.h1
-rw-r--r--ext/filter/tests/008.phpt34
-rw-r--r--ext/filter/tests/015.phpt32
-rw-r--r--ext/filter/tests/033.phpt3
-rw-r--r--ext/filter/tests/056.phpt68
-rw-r--r--ext/ftp/ftp.h4
-rw-r--r--ext/gd/libgd/gd.h2
-rw-r--r--ext/gd/libgd/gd_arc_f_buggy.c2
-rw-r--r--ext/gd/libgd/gdft.c2
-rw-r--r--ext/gd/libgd/webpimg.c4
-rw-r--r--ext/gd/libgd/webpimg.h2
-rw-r--r--ext/gd/tests/imagealphablending_error1.phpt19
-rw-r--r--ext/gd/tests/imagecolorresolvealpha_error3.phpt19
-rw-r--r--ext/gd/tests/imagesavealpha_error2.phpt19
-rw-r--r--ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mobin0 -> 458 bytes
-rw-r--r--ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po17
-rw-r--r--ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mobin0 -> 445 bytes
-rw-r--r--ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po17
-rw-r--r--ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mobin0 -> 458 bytes
-rw-r--r--ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po17
-rw-r--r--ext/gettext/tests/bug66267.phpt55
-rw-r--r--ext/iconv/tests/iconv_basic_001-win32.phpt19
-rw-r--r--ext/iconv/tests/iconv_basic_001.phpt19
-rw-r--r--ext/interbase/tests/002.phpt2
-rw-r--r--ext/interbase/tests/003.phpt2
-rw-r--r--ext/interbase/tests/004.phpt2
-rw-r--r--ext/interbase/tests/005.phpt4
-rw-r--r--ext/interbase/tests/006.phpt2
-rw-r--r--ext/interbase/tests/007.phpt2
-rw-r--r--ext/interbase/tests/008.phpt2
-rw-r--r--ext/intl/collator/collator_convert.c2
-rw-r--r--ext/intl/collator/collator_sort.c2
-rw-r--r--ext/intl/doc/datefmt_api.php4
-rw-r--r--ext/intl/intl_convert.c2
-rw-r--r--ext/intl/tests/bug60192-compare.phpt2
-rw-r--r--ext/intl/tests/bug60192-getlocale.phpt2
-rw-r--r--ext/intl/tests/bug60192-getsortkey.phpt2
-rw-r--r--ext/intl/tests/bug60192-sort.phpt2
-rw-r--r--ext/intl/tests/bug60192-sortwithsortkeys.phpt2
-rw-r--r--ext/intl/tests/bug67052-win32.phpt30
-rw-r--r--ext/intl/tests/bug67052.phpt5
-rw-r--r--ext/intl/tests/collator_create3.phpt3
-rw-r--r--ext/intl/tests/collator_create4.phpt79
-rw-r--r--ext/intl/tests/collator_get_error_code.phpt2
-rw-r--r--ext/intl/tests/collator_get_error_message.phpt2
-rw-r--r--ext/intl/tests/collator_get_sort_key_variant3.phpt3
-rw-r--r--ext/intl/tests/collator_get_sort_key_variant4.phpt98
-rw-r--r--ext/intl/tests/dateformat_calendars_variant2.phpt1
-rw-r--r--ext/intl/tests/dateformat_calendars_variant3.phpt45
-rw-r--r--ext/intl/tests/dateformat_create_cal_arg_variant3.phpt1
-rw-r--r--ext/intl/tests/dateformat_create_cal_arg_variant4.phpt53
-rw-r--r--ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt1
-rw-r--r--ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt40
-rw-r--r--ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt1
-rw-r--r--ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt33
-rw-r--r--ext/intl/tests/dateformat_get_set_calendar_variant3.phpt1
-rw-r--r--ext/intl/tests/dateformat_get_set_calendar_variant4.phpt55
-rw-r--r--ext/intl/tests/dateformat_get_set_timezone_variant3.phpt1
-rw-r--r--ext/intl/tests/dateformat_get_set_timezone_variant4.phpt62
-rw-r--r--ext/intl/tests/dateformat_timezone_arg_variations3.phpt1
-rw-r--r--ext/intl/tests/dateformat_timezone_arg_variations4.phpt46
-rw-r--r--ext/intl/tests/formatter_format4.phpt3
-rw-r--r--ext/intl/tests/formatter_format5.phpt130
-rw-r--r--ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt1
-rw-r--r--ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt30
-rw-r--r--ext/libxml/libxml.c2
-rw-r--r--ext/mbstring/README_PHP3-i18n-ja4
-rw-r--r--ext/mbstring/config.w3299
-rw-r--r--ext/mbstring/libmbfl/filters/unicode_prop.h2
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_consts.h2
-rw-r--r--ext/mbstring/tests/mb_strtolower_variation3.phpt2
-rw-r--r--ext/mbstring/tests/mb_strtoupper_variation3.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt4
-rw-r--r--ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt2
-rw-r--r--ext/mysql/tests/mysql_deprecated_api.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_ps_select_union.phpt4
-rw-r--r--ext/mysqli/tests/mysqli_result_references.phpt6
-rw-r--r--ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt4
-rw-r--r--ext/mysqlnd/mysqlnd.c4
-rw-r--r--ext/mysqlnd/mysqlnd.h2
-rw-r--r--ext/oci8/oci8.c2
-rw-r--r--ext/oci8/tests/bug36010.phpt2
-rw-r--r--ext/odbc/php_odbc.c6
-rw-r--r--ext/odbc/tests/bug60616.phpt2
-rw-r--r--ext/opcache/Optimizer/block_pass.c6
-rw-r--r--ext/opcache/Optimizer/optimize_func_calls.c2
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c12
-rw-r--r--ext/opcache/Optimizer/zend_optimizer_internal.h2
-rw-r--r--ext/opcache/ZendAccelerator.c2
-rw-r--r--ext/opcache/zend_accelerator_module.c4
-rw-r--r--ext/openssl/tests/bug64802.phpt2
-rw-r--r--ext/openssl/tests/stream_server_reneg_limit.phpt4
-rw-r--r--ext/pcntl/README2
-rw-r--r--ext/pcre/pcrelib/ChangeLog4
-rw-r--r--ext/pcre/pcrelib/HACKING2
-rw-r--r--ext/pcre/pcrelib/README2
-rw-r--r--ext/pcre/pcrelib/doc/pcre.txt2
-rw-r--r--ext/pcre/pcrelib/pcre_exec.c2
-rw-r--r--ext/pcre/pcrelib/pcre_printint.c2
-rw-r--r--ext/pcre/pcrelib/pcre_study.c2
-rw-r--r--ext/pcre/pcrelib/pcredemo.c4
-rw-r--r--ext/pcre/pcrelib/sljit/sljitLir.c2
-rw-r--r--ext/pcre/pcrelib/sljit/sljitLir.h4
-rw-r--r--ext/pcre/pcrelib/sljit/sljitNativeARM_32.c4
-rw-r--r--ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c2
-rw-r--r--ext/pdo/pdo_dbh.c2
-rw-r--r--ext/pdo/pdo_stmt.c25
-rw-r--r--ext/pdo/tests/bug_39656.phpt2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt4
-rw-r--r--ext/pdo_oci/oci_driver.c2
-rw-r--r--ext/pgsql/README2
-rw-r--r--ext/pgsql/pgsql.c6
-rw-r--r--ext/pgsql/tests/80_bug36625.phpt8
-rw-r--r--ext/phar/Makefile.frag2
-rw-r--r--ext/phar/func_interceptors.c2
-rw-r--r--ext/readline/tests/readline_read_history_error_001.phpt14
-rw-r--r--ext/reflection/php_reflection.c10
-rw-r--r--ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt16
-rw-r--r--ext/shmop/README2
-rw-r--r--ext/snmp/snmp.c8
-rw-r--r--ext/soap/TODO.old2
-rw-r--r--ext/soap/interop/client_round2_interop.php18
-rw-r--r--ext/soap/package.xml2
-rw-r--r--ext/soap/php_sdl.h2
-rw-r--r--ext/soap/php_soap.h2
-rw-r--r--ext/soap/soap.c19
-rw-r--r--ext/soap/tests/bug68361.phpt114
-rw-r--r--ext/soap/tests/bugs/bug27742.wsdl4
-rw-r--r--ext/soap/tests/bugs/bug50698_2.phpt2
-rw-r--r--ext/sockets/php_sockets.h2
-rw-r--r--ext/sockets/sockets.c4
-rw-r--r--ext/sockets/tests/mcast_ipv4_send.phpt131
-rw-r--r--ext/spl/internal/recursivecachingiterator.inc2
-rwxr-xr-xext/spl/spl.php2
-rw-r--r--ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt2
-rw-r--r--ext/spl/tests/bug53071.phpt2
-rw-r--r--ext/sqlite3/libsqlite/sqlite3.c126
-rw-r--r--ext/standard/array.c6
-rw-r--r--ext/standard/basic_functions.c27
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/exec.c6
-rw-r--r--ext/standard/file.c2
-rw-r--r--ext/standard/filestat.c2
-rw-r--r--ext/standard/flock_compat.h2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c9
-rw-r--r--ext/standard/html_tables/ents_html401.txt2
-rw-r--r--ext/standard/image.c4
-rw-r--r--ext/standard/incomplete_class.c2
-rw-r--r--ext/standard/metaphone.c2
-rw-r--r--ext/standard/pack.c4
-rw-r--r--ext/standard/password.c24
-rw-r--r--ext/standard/php_fopen_wrapper.c2
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/standard/php_incomplete_class.h2
-rw-r--r--ext/standard/php_var.h1
-rw-r--r--ext/standard/rand.c2
-rw-r--r--ext/standard/scanf.h2
-rw-r--r--ext/standard/string.c6
-rw-r--r--ext/standard/tests/array/array_search_variation4.phpt2
-rw-r--r--ext/standard/tests/array/in_array_variation4.phpt2
-rw-r--r--ext/standard/tests/file/fgetc_variation1.phpt2
-rw-r--r--ext/standard/tests/file/fgets_variation6-win32.phpt2
-rw-r--r--ext/standard/tests/file/fgets_variation6.phpt2
-rw-r--r--ext/standard/tests/file/file.inc4
-rw-r--r--ext/standard/tests/file/fscanf_variation18.phpt4
-rw-r--r--ext/standard/tests/file/fscanf_variation2.phpt4
-rw-r--r--ext/standard/tests/file/fscanf_variation20.phpt4
-rw-r--r--ext/standard/tests/file/fscanf_variation27.phpt4
-rw-r--r--ext/standard/tests/file/fscanf_variation33.phpt4
-rw-r--r--ext/standard/tests/file/fscanf_variation39.phpt4
-rw-r--r--ext/standard/tests/file/fscanf_variation45.phpt4
-rw-r--r--ext/standard/tests/file/fscanf_variation9.phpt4
-rw-r--r--ext/standard/tests/general_functions/bug39322.phpt2
-rw-r--r--ext/standard/tests/general_functions/getrusage_basic.phpt2
-rw-r--r--ext/standard/tests/general_functions/intval.phpt4
-rw-r--r--ext/standard/tests/general_functions/is_int.phpt4
-rw-r--r--ext/standard/tests/general_functions/is_int_64bit.phpt4
-rw-r--r--ext/standard/tests/general_functions/php_uname_error.phpt2
-rw-r--r--ext/standard/tests/general_functions/strval.phpt4
-rw-r--r--ext/standard/tests/general_functions/var_export-locale.phpt4
-rw-r--r--ext/standard/tests/general_functions/var_export_basic1.phpt4
-rw-r--r--ext/standard/tests/image/test1bpix.bmpbin690138 -> 690138 bytes
-rw-r--r--ext/standard/tests/serialize/precision.phpt4
-rw-r--r--ext/standard/tests/serialize/serialization_error_001.phpt6
-rw-r--r--ext/standard/tests/serialize/unserialize_classes.phpt88
-rw-r--r--ext/standard/tests/strings/addcslashes_005.phpt12
-rw-r--r--ext/standard/tests/strings/bin2hex_001.phpt11
-rw-r--r--ext/standard/tests/strings/sprintf_variation10.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation19.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation21.phptbin5046 -> 5048 bytes
-rw-r--r--ext/standard/tests/strings/sprintf_variation28.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation28_64bit.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation3.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation34.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation34_64bit.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation40.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation40_64bit.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation46.phpt4
-rw-r--r--ext/standard/tests/strings/str_pad.phptbin9818 -> 9818 bytes
-rw-r--r--ext/standard/tests/strings/str_repeat.phptbin16786 -> 16786 bytes
-rw-r--r--ext/standard/tests/strings/strncasecmp_variation6.phpt4
-rw-r--r--ext/standard/tests/strings/strncmp_variation6.phpt4
-rw-r--r--ext/standard/tests/strings/unpack_bug68225.phpt39
-rw-r--r--ext/standard/var.c36
-rw-r--r--ext/standard/var_unserializer.c113
-rw-r--r--ext/standard/var_unserializer.re46
-rw-r--r--ext/tokenizer/tests/token_get_all_variation17.phpt4
-rw-r--r--ext/wddx/php_wddx_api.h2
-rw-r--r--ext/wddx/wddx.c5
-rw-r--r--ext/xmlrpc/libxmlrpc/xml_to_soap.c2
-rw-r--r--ext/xmlwriter/tests/011.phpt35
-rw-r--r--ext/xmlwriter/tests/012.phpt38
-rw-r--r--ext/xmlwriter/tests/OO_010.phpt36
-rw-r--r--ext/xmlwriter/tests/OO_011.phpt39
-rw-r--r--ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt13
-rw-r--r--ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt13
-rw-r--r--ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt13
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc.phpt51
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI.phpt53
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt57
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt57
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt57
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML.phpt61
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt55
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt55
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt55
-rw-r--r--ext/zip/php_zip.c2
-rw-r--r--ext/zlib/tests/bug_52944-darwin.phpt24
-rw-r--r--ext/zlib/tests/bug_52944.phpt4
-rw-r--r--ext/zlib/tests/gzfile_variation4.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation4.phpt2
-rw-r--r--ext/zlib/zlib.c12
-rw-r--r--ext/zlib/zlib_filter.c2
-rw-r--r--ext/zlib/zlib_win32_howto.txt2
-rw-r--r--main/main.c4
-rw-r--r--main/network.c8
-rw-r--r--main/snprintf.c4
-rw-r--r--main/snprintf.h2
-rw-r--r--main/streams/plain_wrapper.c2
-rw-r--r--main/streams/streams.c2
-rw-r--r--main/streams/xp_socket.c3
-rw-r--r--php.ini-development29
-rw-r--r--php.ini-production29
-rwxr-xr-xrun-tests.php2
-rw-r--r--sapi/apache2handler/php_functions.c8
-rw-r--r--sapi/cgi/cgi_main.c2
-rw-r--r--sapi/cgi/fastcgi.c10
-rw-r--r--sapi/cli/php_cli_server.c11
-rw-r--r--sapi/cli/php_http_parser.c2
-rw-r--r--sapi/cli/ps_title.c4
-rw-r--r--sapi/cli/tests/bug64529.phpt10
-rw-r--r--sapi/embed/php_embed.c2
-rw-r--r--sapi/fpm/fpm/fastcgi.c100
-rw-r--r--sapi/fpm/fpm/fastcgi.h2
-rw-r--r--sapi/fpm/fpm/fpm_conf.c11
-rw-r--r--sapi/fpm/fpm/fpm_env.c2
-rw-r--r--sapi/fpm/fpm/fpm_log.c4
-rw-r--r--sapi/fpm/fpm/fpm_sockets.c44
-rw-r--r--sapi/fpm/fpm/fpm_stdio.c40
-rw-r--r--sapi/fpm/fpm/fpm_unix.c1
-rw-r--r--sapi/fpm/php-fpm.8.in21
-rw-r--r--sapi/fpm/php-fpm.conf.in9
-rw-r--r--sapi/fpm/tests/002.phpt14
-rw-r--r--sapi/fpm/tests/003.phpt14
-rw-r--r--sapi/fpm/tests/004.phpt59
-rw-r--r--sapi/fpm/tests/005.phpt57
-rw-r--r--sapi/fpm/tests/006.phpt57
-rw-r--r--sapi/fpm/tests/007.phpt68
-rw-r--r--sapi/fpm/tests/008.phpt84
-rw-r--r--sapi/fpm/tests/009.phpt53
-rw-r--r--sapi/fpm/tests/010.phpt84
-rw-r--r--sapi/fpm/tests/011.phpt53
-rw-r--r--sapi/fpm/tests/012.phpt79
-rw-r--r--sapi/fpm/tests/013.phpt54
-rw-r--r--sapi/fpm/tests/014.phpt54
-rw-r--r--sapi/fpm/tests/015.phpt87
-rw-r--r--sapi/fpm/tests/016.phpt87
-rw-r--r--sapi/fpm/tests/017.phpt67
-rw-r--r--sapi/fpm/tests/019.phpt80
-rw-r--r--sapi/fpm/tests/020.phpt76
-rw-r--r--sapi/fpm/tests/fcgi.inc592
-rw-r--r--sapi/fpm/tests/include.inc34
-rw-r--r--sapi/litespeed/lsapi_main.c116
-rw-r--r--sapi/litespeed/lsapilib.c2
-rw-r--r--sapi/nsapi/nsapi-readme.txt2
-rw-r--r--sapi/phpdbg/phpdbg.c2
-rw-r--r--sapi/phpdbg/phpdbg_frame.c4
-rw-r--r--sapi/phpdbg/xml.md6
-rw-r--r--sapi/thttpd/thttpd_patch2
-rwxr-xr-xscripts/apache/apconf-conv.sh24
-rwxr-xr-xscripts/apache/aphtaccess-conv.sh24
-rw-r--r--scripts/apache/conffix.awk23
-rw-r--r--scripts/apache/htaccessfix.awk23
-rw-r--r--scripts/dev/generate-phpt.pharbin52356 -> 52356 bytes
-rwxr-xr-xserver-tests-config.php4
-rwxr-xr-xserver-tests.php2
-rw-r--r--tests/classes/constants_error_004.phpt2
-rw-r--r--tests/lang/bug20175.phpt2
-rw-r--r--tests/lang/operators/coalesce.phpt2
-rw-r--r--win32/build/Makefile9
-rw-r--r--win32/build/config.w32158
-rw-r--r--win32/build/config.w32.phpize.in156
-rw-r--r--win32/build/confutils.js243
-rw-r--r--win32/build/libs_version.txt6
-rw-r--r--win32/glob.h3
-rw-r--r--win32/sendmail.c4
-rw-r--r--win32/winutil.c3
-rw-r--r--win32/winutil.h2
412 files changed, 10002 insertions, 4908 deletions
diff --git a/CODING_STANDARDS b/CODING_STANDARDS
index 27fff07f60..2664d12bd5 100644
--- a/CODING_STANDARDS
+++ b/CODING_STANDARDS
@@ -42,7 +42,7 @@ Exceptions:
4. When writing functions that deal with strings, be sure to remember
that PHP holds the length property of each string, and that it
- shouldn't be calculated with strlen(). Write your functions in a such
+ shouldn't be calculated with strlen(). Write your functions in such
a way so that they'll take advantage of the length property, both
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
diff --git a/INSTALL b/INSTALL
index 3071f267ae..935877b9f9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -155,7 +155,7 @@ Table of Contents
a list of all available options along with short explanations running
./configure --help. Our manual documents the different options
separately. You will find the core options in the appendix, while the
- different extension specific options are descibed on the reference
+ different extension specific options are described on the reference
pages.
When PHP is configured, you are ready to build the module and/or
diff --git a/NEWS b/NEWS
index fba96937fb..dd8e990d5b 100644
--- a/NEWS
+++ b/NEWS
@@ -2,9 +2,6 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 20??, PHP 7.0.0
--Fileinfo:
- . Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
-
- CLI server:
. Refactor MIME type handling to use a hash table instead of linear search.
(Adam)
@@ -20,37 +17,54 @@ PHP NEWS
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
. Fixed #67959 (Segfault when calling phpversion('spl')). (Florian)
. Implemented the RFC `Catchable "Call to a member function bar() on a
- non-object"` (Timm)
-
-- Reflection
- . Fixed inheritance chain of Reflector interface (Tjerk)
+ non-object"`. (Timm)
+ . Added options parameter for unserialize allowing to specify acceptable
+ classes (https://wiki.php.net/rfc/secure_unserialize). (Stas)
+ . Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly triggered). (Julien)
+ . Fixed bug #65419 (Inside trait, self::class != __CLASS__). (Julien)
- DBA:
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
+- DOM:
+ . Made DOMNode::textContent writeable. (Tjerk)
+
+- GD:
+ . Made fontFetch's path parser thread-safe. (Sara)
+
+- Fileinfo:
+ . Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
+
+- Filter:
+ . New FILTER_VALIDATE_DOMAIN and better RFC conformance for FILTER_VALIDATE_URL. (Kevin Dunglas)
+
- FPM:
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
-- Standard:
- . Removed call_user_method() and call_user_method_array() functions. (Kalle)
- . Fix user session handlers (See rfc:session.user.return-value). (Sara)
- . Added intdiv() function. (Andrea)
- . Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
-
-- XSL:
- . Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
+- LiteSpeed:
+ . Updated LiteSpeed SAPI code from V5.5 to V6.6. (George Wang)
-- GD:
- . Made fontFetch's path parser thread-safe. (Sara)
+- Reflection
+ . Fixed inheritance chain of Reflector interface (Tjerk)
- Session:
. Fixed bug #67694 (Regression in session_regenerate_id()). (Tjerk)
+- SOAP:
+ . Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes).
+ (Laruence)
+
- SPL:
. Implemented #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags
nor curruption state). (Julien)
-- DOM:
- . Made DOMNode::textContent writeable. (Tjerk)
+- Standard:
+ . Removed call_user_method() and call_user_method_array() functions. (Kalle)
+ . Fix user session handlers (See rfc:session.user.return-value). (Sara)
+ . Added intdiv() function. (Andrea)
+ . Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
+
+- XSL:
+ . Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
diff --git a/README.TESTING b/README.TESTING
index 1972f5f6f3..dd09ecbe38 100644
--- a/README.TESTING
+++ b/README.TESTING
@@ -123,7 +123,7 @@ MYMAIL=qa-test@domain.com
TMPDIR=/var/tmp
TODAY=`date +"%Y%m%d"`
-# Make sure compilation enviroment is correct
+# Make sure compilation environment is correct
CONFIGURE_OPTS='--disable-all --enable-cli --with-pcre'
export MAKE=gmake
export CC=gcc
diff --git a/README.TESTING2 b/README.TESTING2
index 3c4f1beb29..34f7e83327 100644
--- a/README.TESTING2
+++ b/README.TESTING2
@@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
'make test'. server-tests was developed to provide support for
testing PHP under it's primary environment, HTTP, and can run the
PHP tests under any of the SAPI modules that are direct executables,
-or are accessable via HTTP.
+or are accessible via HTTP.
[New features]
----------------
@@ -95,7 +95,7 @@ include:
$filename full native path to file, will become PATH_TRANSLATED
$filepath =dirname($filename)
$scriptname this is what will become SCRIPT_NAME unless you override it
- $docroot the equivelant of DOCUMENT_ROOT under Apache
+ $docroot the equivalent of DOCUMENT_ROOT under Apache
$cwd the directory that the test is being initiated from
$this->conf all server-tests configuration vars
$this->env all environment variables that will get passed to the test
@@ -105,7 +105,7 @@ include:
This section is also eval'd, and is similar in nature to --ENV--. However,
this section is used to build the url used in an HTTP request. Valid values
to set in this section would include:
- SCRIPT_NAME The inital part of the request url
+ SCRIPT_NAME The initial part of the request url
PATH_INFO The pathinfo part of a request url
FRAGMENT The fragment section of a url (after #)
QUERY_STRING The query part of a url (after ?)
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 9936320a95..9765874448 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -106,16 +106,18 @@ TSRM_API void tsrm_win32_shutdown(void)
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
{
PSID pSid = TWG(impersonation_token_sid);
- DWORD sid_len = pSid ? GetLengthSid(pSid) : 0;
TCHAR *ptcSid = NULL;
char *bucket_key = NULL;
+ size_t ptc_sid_len, pathname_len;
+
+ pathname_len = strlen(pathname);
if (!pSid) {
- bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
+ bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + 1);
if (!bucket_key) {
return NULL;
}
- memcpy(bucket_key, pathname, strlen(pathname));
+ memcpy(bucket_key, pathname, pathname_len);
return bucket_key;
}
@@ -123,14 +125,16 @@ char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
return NULL;
}
- bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);
+
+ ptc_sid_len = strlen(ptcSid);
+ bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + ptc_sid_len + 1);
if (!bucket_key) {
LocalFree(ptcSid);
return NULL;
}
- memcpy(bucket_key, ptcSid, strlen(ptcSid));
- memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
+ memcpy(bucket_key, ptcSid, ptc_sid_len);
+ memcpy(bucket_key + ptc_sid_len, pathname, pathname_len + 1);
LocalFree(ptcSid);
return bucket_key;
@@ -139,11 +143,8 @@ char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
PSID tsrm_win32_get_token_sid(HANDLE hToken)
{
- BOOL bSuccess = FALSE;
DWORD dwLength = 0;
PTOKEN_USER pTokenUser = NULL;
- PSID sid;
- PSID *ppsid = &sid;
DWORD sid_len;
PSID pResultSid = NULL;
@@ -204,7 +205,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
BYTE * psec_desc = NULL;
BOOL fAccess = FALSE;
- BOOL bucket_key_alloc = FALSE;
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
@@ -242,7 +242,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
was impersonating already, this function uses that impersonation context.
*/
if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
- DWORD err = GetLastError();
if (GetLastError() == ERROR_NO_TOKEN) {
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &thread_token)) {
TWG(impersonation_token) = NULL;
@@ -722,4 +721,52 @@ TSRM_API char *realpath(char *orig_path, char *buffer)
return buffer;
}
+#if HAVE_UTIME
+static zend_always_inline void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
+{
+ // Note that LONGLONG is a 64-bit value
+ LONGLONG ll;
+
+ ll = Int32x32To64(t, 10000000) + 116444736000000000;
+ pft->dwLowDateTime = (DWORD)ll;
+ pft->dwHighDateTime = ll >> 32;
+}
+/* }}} */
+
+TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
+{
+ FILETIME mtime, atime;
+ HANDLE hFile;
+
+ hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
+ OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+
+ /* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
+ the CreateFile operation succeeds */
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ SetLastError(0);
+ }
+
+ if ( hFile == INVALID_HANDLE_VALUE ) {
+ return -1;
+ }
+
+ if (!buf) {
+ SYSTEMTIME st;
+ GetSystemTime(&st);
+ SystemTimeToFileTime(&st, &mtime);
+ atime = mtime;
+ } else {
+ UnixTimeToFileTime(buf->modtime, &mtime);
+ UnixTimeToFileTime(buf->actime, &atime);
+ }
+ if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
+ CloseHandle(hFile);
+ return -1;
+ }
+ CloseHandle(hFile);
+ return 1;
+}
+/* }}} */
+#endif
#endif
diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h
index 5933b54ddf..beff1e88cf 100644
--- a/TSRM/tsrm_win32.h
+++ b/TSRM/tsrm_win32.h
@@ -23,6 +23,9 @@
#include "TSRM.h"
#include <windows.h>
+#if HAVE_UTIME
+# include <sys/utime.h>
+#endif
struct ipc_perm {
int key;
diff --git a/UPGRADING b/UPGRADING
index 6cc31732e8..9d5d8e7228 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -63,6 +63,7 @@ PHP X.Y UPGRADE NOTES
- FPM
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes).
+ . Listen = port now listen on all addresses (IPv6 and IPv4-mapped).
========================================
4. Deprecated Functionality
@@ -76,6 +77,11 @@ PHP X.Y UPGRADE NOTES
- parse_ini_file():
- parse_ini_string():
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
+- unserialize():
+ Added second parameter for unserialize function
+ (RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
+ acceptable classes:
+ unserialize($foo, ["allowed_classes" => ["MyClass", "MyClass2"]);
========================================
@@ -126,7 +132,7 @@ PHP X.Y UPGRADE NOTES
========================================
- Core
- . Instead of being undefined and platform-dependant, NaN and Infinity will
+ . Instead of being undefined and platform-dependent, NaN and Infinity will
always be zero when casted to integer.
. Calling a method on a non-object no longer raises a fatal error; see
also: https://wiki.php.net/rfc/catchable-call-to-member-of-non-object
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 92cebc8db3..1cdf0be522 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -9,6 +9,9 @@ PHP 7.0 INTERNALS UPGRADE NOTES
h. HashTable API
i. New portable macros for large file support
j. New portable macros for integers
+ k. get_class_entry object handler info
+ l. get_class_name object handler info
+ m. Other portable macros info
2. Build system changes
a. Unix build system changes
@@ -110,8 +113,34 @@ PHP 7.0 INTERNALS UPGRADE NOTES
The handler is now obligatory, no longer accepts a `parent` argument and
must return a non-NULL zend_string*, which will be released by the caller.
+ m. Other portable macros info
+
+ ZEND_SECURE_ZERO - zeroes chunk of memory
+ ZEND_VALID_SOCKET - validates a php_socket_t variable
+
+ ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
+ ZEND_NORETURN is defined as __declspec(noreturn) on VS
+
========================
2. Build system changes
========================
-
+ a. Unix build system changes
+
+ b. Windows build system changes
+
+ - Besides Visual Studio, building with Clang or Intel Composer is now
+ possible. To enable an alternative toolset, add the option
+ --with-toolset=[vs,clang,icc] to the configure line. The default
+ toolset is vs. Still clang or icc need the correct environment
+ which involves many tools from the vs toolset.
+
+ The toolset option is supported by phpize as well.
+
+ AWARENESS The only recommended and supported toolset to produce production
+ ready binaries is Visual Studio. Still other compilers can be used now for
+ testing and analyzing purposes.
+
+ - configure.js now produces response files which are passed to the linker
+ and library manager. This solves the issues with the long command lines
+ which can exceed the OS limit.
diff --git a/Zend/ZEND_CHANGES b/Zend/ZEND_CHANGES
index afb3595595..94e164c290 100644
--- a/Zend/ZEND_CHANGES
+++ b/Zend/ZEND_CHANGES
@@ -1103,7 +1103,7 @@ Changes in the Zend Engine 1.0
Use ob_start() to begin output buffering, ob_end_flush() to end
buffering and send out the buffered contents, ob_end_clean() to
end buffering without sending the buffered contents, and
- ob_get_contents() to retreive the current contents of the output
+ ob_get_contents() to retrieve the current contents of the output
buffer. Header information (header(), content type, cookies) are
not buffered. By turning on output buffering, you can
effectively send header information all throughout your file,
diff --git a/Zend/tests/bug21478.phpt b/Zend/tests/bug21478.phpt
index 8b38f24d6e..5955c4c1dc 100644
--- a/Zend/tests/bug21478.phpt
+++ b/Zend/tests/bug21478.phpt
@@ -27,7 +27,7 @@ stream_filter_append($fp, "myfilter");
fwrite($fp, "This is a test.\n");
print "Done.\n";
fclose($fp);
-// Uncommenting the following 'print' line causes the segfault to stop occuring
+// Uncommenting the following 'print' line causes the segfault to stop occurring
// print "2\n";
readfile(dirname(__FILE__)."/test.txt");
unlink(dirname(__FILE__)."/test.txt");
diff --git a/Zend/tests/bug33512.phpt b/Zend/tests/bug33512.phpt
index 9dd4e4e5f9..dcb8f0417e 100644
--- a/Zend/tests/bug33512.phpt
+++ b/Zend/tests/bug33512.phpt
@@ -53,7 +53,7 @@ class TheObj {
unset($SomeObj->Virtual1);
unset($SomeObj->{'Virtual'.(3)});
- //but, these variables are still available??? eventhough they're "unset"-ed
+ //but, these variables are still available??? even though they're "unset"-ed
print $SomeObj->Virtual1."\n";
print $SomeObj->{'Virtual'.(3)}."\n";
?>
diff --git a/Zend/tests/bug38779_1.phpt b/Zend/tests/bug38779_1.phpt
index eefa952e36..e2a5b208c6 100644
--- a/Zend/tests/bug38779_1.phpt
+++ b/Zend/tests/bug38779_1.phpt
@@ -39,6 +39,14 @@ include $filename;
echo "Done\n";
?>
+--CLEAN--
+<?php
+
+$filename = dirname(__FILE__)."/bug38779.txt";
+if (file_exists($filename)) {
+ @unlink(dirname(__FILE__)."/bug38779.txt");
+}
+?>
--EXPECTF--
Parse error: %s error%sin %s on line %d
string(6) "flush!"
diff --git a/Zend/tests/bug40809.phpt b/Zend/tests/bug40809.phpt
index 08fc89f553..9ff4e6f1b6 100644
--- a/Zend/tests/bug40809.phpt
+++ b/Zend/tests/bug40809.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #40809 (Poor perfomance of ".=")
+Bug #40809 (Poor performance of ".=")
--FILE--
<?php
error_reporting(E_ALL|E_STRICT);
diff --git a/Zend/tests/bug43200.phpt b/Zend/tests/bug43200.phpt
index 24a8bbb1d7..7a995aab3e 100644
--- a/Zend/tests/bug43200.phpt
+++ b/Zend/tests/bug43200.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #43200 (Interface implementation / inheritence not possible in abstract classes)
+Bug #43200 (Interface implementation / inheritance not possible in abstract classes)
--FILE--
<?php
diff --git a/Zend/tests/bug43200_2.phpt b/Zend/tests/bug43200_2.phpt
index 5efc5facff..3c8a98bddc 100644
--- a/Zend/tests/bug43200_2.phpt
+++ b/Zend/tests/bug43200_2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #43200.2 (Interface implementation / inheritence not possible in abstract classes)
+Bug #43200.2 (Interface implementation / inheritance not possible in abstract classes)
--FILE--
<?php
diff --git a/Zend/tests/bug65419.phpt b/Zend/tests/bug65419.phpt
new file mode 100644
index 0000000000..677b2750f2
--- /dev/null
+++ b/Zend/tests/bug65419.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #65419 (Inside trait, self::class != __CLASS__)
+--FILE--
+<?php
+trait abc
+{
+ static function def()
+ {
+ echo self::class, "\n";
+ echo __CLASS__, "\n";
+ }
+}
+
+class ghi
+{
+ use abc;
+}
+
+ghi::def();
+?>
+--EXPECTF--
+ghi
+ghi \ No newline at end of file
diff --git a/Zend/tests/bug68370.phpt b/Zend/tests/bug68370.phpt
new file mode 100644
index 0000000000..25589bf455
--- /dev/null
+++ b/Zend/tests/bug68370.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #68370 "unset($this)" can make the program crash
+--FILE--
+<?php
+class C {
+ public function test() {
+ unset($this);
+ return get_defined_vars();
+ }
+}
+$c = new C();
+$x = $c->test();
+print_r($x);
+unset($c, $x);
+--EXPECTF--
+Array
+(
+)
diff --git a/Zend/tests/bug68446.phpt b/Zend/tests/bug68446.phpt
new file mode 100644
index 0000000000..48e6f52f1c
--- /dev/null
+++ b/Zend/tests/bug68446.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #68446 (Array constant not accepted for array parameter default)
+--FILE--
+<?php
+const FOO = [1];
+const BAR = null;
+
+function a(array $a = FOO) {
+ var_dump($a);
+}
+
+function b(array $b = BAR) {
+ var_dump($b);
+}
+
+b(null);
+b([]);
+b();
+a([]);
+a();
+a(null);
+?>
+--EXPECTF--
+NULL
+array(0) {
+}
+NULL
+array(0) {
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+
+Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
+
diff --git a/Zend/tests/class_properties_const.phpt b/Zend/tests/class_properties_const.phpt
new file mode 100644
index 0000000000..ac871b5c2b
--- /dev/null
+++ b/Zend/tests/class_properties_const.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Const class properties(runtime cache)
+--FILE--
+<?php
+class A {
+}
+
+$a = new A;
+
+echo "runtime\n";
+var_dump($a->{array()});
+var_dump($a->{1});
+var_dump($a->{function(){}});
+?>
+--EXPECTF--
+Notice: Array to string conversion in %sclass_properties_const.php on line %d
+runtime
+
+Notice: Undefined property: A::$Array in %sclass_properties_const.php on line %d
+NULL
+
+Notice: Undefined property: A::$1 in %sclass_properties_const.php on line %d
+NULL
+
+Catchable fatal error: Object of class Closure could not be converted to string in %sclass_properties_const.php 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
index 171ad9f451..2827ab1b74 100644
--- a/Zend/tests/debug_backtrace_with_include_and_this.phpt
+++ b/Zend/tests/debug_backtrace_with_include_and_this.phpt
@@ -23,15 +23,15 @@ set_error_handler(function($code, $msg, $file, $line) {
});
try {
- (new CL())->load('class://non.existant.Class');
+ (new CL())->load('class://non.existent.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
+ERR#2: include(class://non.existent.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include
+ERR#2: include(): Failed opening 'class://non.existent.Class' for inclusion (include_path='%s') @ include
-Fatal error: Uncaught exception 'Exception' with message 'Failed loading class://non.existant.Class' in %s
+Fatal error: Uncaught exception 'Exception' with message 'Failed loading class://non.existent.Class' in %s
Stack trace:
#0 %s(%d): CL->load('class://non.exi...')
#1 {main}
diff --git a/Zend/tests/traits/bug54441.phpt b/Zend/tests/traits/bug54441.phpt
index 84139f326b..3fe688b3b1 100644
--- a/Zend/tests/traits/bug54441.phpt
+++ b/Zend/tests/traits/bug54441.phpt
@@ -16,4 +16,4 @@ class Boo {
?>
--EXPECTF--
-Fatal error: The modifiers for the trait alias dontKnow() need to be changed in the same statment in which the alias is defined. Error in %s on line %d
+Fatal error: The modifiers for the trait alias dontKnow() need to be changed in the same statement in which the alias is defined. Error in %s on line %d
diff --git a/Zend/tests/try_finally_010.phpt b/Zend/tests/try_finally_010.phpt
index bbac8dd1e5..91eb7821ee 100644
--- a/Zend/tests/try_finally_010.phpt
+++ b/Zend/tests/try_finally_010.phpt
@@ -1,5 +1,5 @@
--TEST--
-Try finally (function call in the finaly block after exception)
+Try finally (function call in the finally block after exception)
--FILE--
<?php
function foo() {
diff --git a/Zend/tests/varSyntax/tempDimFetchByRefError.phpt b/Zend/tests/varSyntax/tempDimFetchByRefError.phpt
index dbcac75ea9..492627302f 100644
--- a/Zend/tests/varSyntax/tempDimFetchByRefError.phpt
+++ b/Zend/tests/varSyntax/tempDimFetchByRefError.phpt
@@ -1,5 +1,5 @@
--TEST--
-Passing a dimention fetch on a temporary by reference is not allowed
+Passing a dimension fetch on a temporary by reference is not allowed
--FILE--
<?php
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index b74fb65c14..04d7f8a23f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -51,7 +51,7 @@ ZEND_API int zend_get_parameters(int ht, int param_count, ...) /* {{{ */
TSRMLS_FETCH();
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
- arg_count = EG(current_execute_data)->num_args;
+ arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
if (param_count>arg_count) {
return FAILURE;
@@ -87,7 +87,7 @@ ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */
TSRMLS_FETCH();
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
- arg_count = EG(current_execute_data)->num_args;
+ arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
if (param_count>arg_count) {
return FAILURE;
@@ -111,7 +111,7 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array
int arg_count;
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
- arg_count = EG(current_execute_data)->num_args;
+ arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
if (param_count>arg_count) {
return FAILURE;
@@ -133,7 +133,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
int arg_count;
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
- arg_count = EG(current_execute_data)->num_args;
+ arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
if (param_count>arg_count) {
return FAILURE;
@@ -924,7 +924,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
return FAILURE;
}
- arg_count = EG(current_execute_data)->num_args;
+ arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
if (num_args > arg_count) {
zend_error(E_WARNING, "%s(): could not obtain parameters for parsing",
@@ -4131,7 +4131,7 @@ ZEND_API void zend_ctor_make_null(zend_execute_data *execute_data) /* {{{ */
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);
+ zval *this_var = ZEND_CALL_VAR(ex, ex->func->op_array.this_var);
if (this_var != EX(return_value)) {
zval_ptr_dtor(this_var);
ZVAL_NULL(this_var);
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 371d1d8ae8..6a8faf8c89 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -346,8 +346,8 @@ ZEND_API char *zend_get_type_by_const(int type);
#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) EX(num_args)
-#define ZEND_NUM_ARGS() EX(num_args)
+#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; }
@@ -712,7 +712,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 = EX(num_args); \
+ int _num_args = EX_NUM_ARGS(); \
int _i; \
zval *_real_arg, *_arg = NULL; \
zend_expected_type _expected_type = IS_UNDEF; \
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index cd8cc50000..1e031f48f5 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -30,7 +30,7 @@
* performed using mmap(). The result is aligned on 2M boundary.
*
* Large - a number of 4096K pages inside a CHUNK. Large blocks
- * are always alligned on page boundary.
+ * are always aligned on page boundary.
*
* Small - less than 3/4 of page size. Small sizes are rounded up to nearest
* greater predefined small size (there are 30 predefined sizes:
@@ -272,7 +272,7 @@ struct _zend_mm_page {
};
/*
- * bin - is one or few continuous pages (up to 8) used for alocation of
+ * bin - is one or few continuous pages (up to 8) used for allocation of
* a particular "small size".
*/
struct _zend_mm_bin {
@@ -395,10 +395,10 @@ stderr_last_error(char *msg)
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&buf,
0, NULL)) {
- fprintf(stderr, "\n%s: [0x%08x]\n", msg, err);
+ fprintf(stderr, "\n%s: [0x%08lx]\n", msg, err);
}
else {
- fprintf(stderr, "\n%s: [0x%08x] %s\n", msg, err, buf);
+ fprintf(stderr, "\n%s: [0x%08lx] %s\n", msg, err, buf);
}
}
#endif
@@ -2130,6 +2130,7 @@ ZEND_API void* ZEND_FASTCALL _emalloc_huge(size_t size)
return zend_mm_alloc_huge(AG(mm_heap), size);
}
+#if ZEND_DEBUG
# define _ZEND_BIN_FREE(_num, _size, _elements, _pages, x, y) \
ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *ptr) { \
TSRMLS_FETCH(); \
@@ -2144,6 +2145,18 @@ ZEND_API void* ZEND_FASTCALL _emalloc_huge(size_t size)
zend_mm_free_small(AG(mm_heap), ptr, _num); \
} \
}
+#else
+# define _ZEND_BIN_FREE(_num, _size, _elements, _pages, x, y) \
+ ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *ptr) { \
+ TSRMLS_FETCH(); \
+ ZEND_MM_CUSTOM_DEALLOCATOR(ptr); \
+ { \
+ zend_mm_chunk *chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE); \
+ ZEND_MM_CHECK(chunk->heap == AG(mm_heap), "zend_mm_heap corrupted"); \
+ zend_mm_free_small(AG(mm_heap), ptr, _num); \
+ } \
+ }
+#endif
ZEND_MM_BINS_INFO(_ZEND_BIN_FREE, x, y)
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index ecb8f4e0d1..fcf2420ac6 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -402,8 +402,8 @@ ZEND_FUNCTION(func_num_args)
{
zend_execute_data *ex = EX(prev_execute_data);
- if (VM_FRAME_KIND(ex->frame_info) == VM_FRAME_NESTED_FUNCTION || VM_FRAME_KIND(ex->frame_info) == VM_FRAME_TOP_FUNCTION) {
- RETURN_LONG(ex->num_args);
+ if (!(ZEND_CALL_INFO(ex) & ZEND_CALL_CODE)) {
+ RETURN_LONG(ZEND_CALL_NUM_ARGS(ex));
} else {
zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context");
RETURN_LONG(-1);
@@ -430,12 +430,12 @@ ZEND_FUNCTION(func_get_arg)
}
ex = EX(prev_execute_data);
- if (VM_FRAME_KIND(ex->frame_info) != VM_FRAME_NESTED_FUNCTION && VM_FRAME_KIND(ex->frame_info) != VM_FRAME_TOP_FUNCTION) {
+ if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
zend_error(E_WARNING, "func_get_arg(): Called from the global scope - no function context");
RETURN_FALSE;
}
- arg_count = ex->num_args;
+ arg_count = ZEND_CALL_NUM_ARGS(ex);
if (requested_offset >= arg_count) {
zend_error(E_WARNING, "func_get_arg(): Argument " ZEND_LONG_FMT " not passed to function", requested_offset);
@@ -446,8 +446,8 @@ ZEND_FUNCTION(func_get_arg)
if (ex->func->op_array.fn_flags & ZEND_ACC_VARIADIC) {
first_extra_arg--;
}
- if (requested_offset >= first_extra_arg && (ex->num_args > first_extra_arg)) {
- arg = EX_VAR_NUM_2(ex, ex->func->op_array.last_var + ex->func->op_array.T) + (requested_offset - first_extra_arg);
+ if (requested_offset >= first_extra_arg && (ZEND_CALL_NUM_ARGS(ex) > first_extra_arg)) {
+ arg = ZEND_CALL_VAR_NUM(ex, ex->func->op_array.last_var + ex->func->op_array.T) + (requested_offset - first_extra_arg);
} else {
arg = ZEND_CALL_ARG(ex, requested_offset + 1);
}
@@ -464,12 +464,12 @@ ZEND_FUNCTION(func_get_args)
uint32_t i;
zend_execute_data *ex = EX(prev_execute_data);
- if (VM_FRAME_KIND(ex->frame_info) != VM_FRAME_NESTED_FUNCTION && VM_FRAME_KIND(ex->frame_info) != VM_FRAME_TOP_FUNCTION) {
+ if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
zend_error(E_WARNING, "func_get_args(): Called from the global scope - no function context");
RETURN_FALSE;
}
- arg_count = ex->num_args;
+ arg_count = ZEND_CALL_NUM_ARGS(ex);
array_init_size(return_value, arg_count);
if (arg_count) {
@@ -483,7 +483,7 @@ ZEND_FUNCTION(func_get_args)
i = 0;
q = Z_ARRVAL_P(return_value)->arData;
p = ZEND_CALL_ARG(ex, 1);
- if (ex->num_args > first_extra_arg) {
+ if (ZEND_CALL_NUM_ARGS(ex) > first_extra_arg) {
while (i < first_extra_arg) {
q->h = i;
q->key = NULL;
@@ -496,7 +496,7 @@ ZEND_FUNCTION(func_get_args)
q++;
i++;
}
- p = EX_VAR_NUM_2(ex, ex->func->op_array.last_var + ex->func->op_array.T);
+ p = ZEND_CALL_VAR_NUM(ex, ex->func->op_array.last_var + ex->func->op_array.T);
}
while (i < arg_count) {
q->h = i;
@@ -2050,7 +2050,7 @@ ZEND_FUNCTION(get_defined_constants)
static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TSRMLS_DC) /* {{{ */
{
- uint32_t num_args = call->num_args;
+ uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
array_init_size(arg_array, num_args);
if (num_args) {
@@ -2063,14 +2063,14 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TS
if (call->func->op_array.fn_flags & ZEND_ACC_VARIADIC) {
first_extra_arg--;
}
- if (call->num_args > first_extra_arg) {
+ if (ZEND_CALL_NUM_ARGS(call) > first_extra_arg) {
while (i < first_extra_arg) {
if (Z_REFCOUNTED_P(p)) Z_ADDREF_P(p);
zend_hash_next_index_insert_new(Z_ARRVAL_P(arg_array), p);
p++;
i++;
}
- p = EX_VAR_NUM_2(call, call->func->op_array.last_var + call->func->op_array.T);
+ p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
}
}
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index babf39ff40..5dbb41f94d 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -159,6 +159,7 @@ void zend_init_compiler_context(TSRMLS_D) /* {{{ */
CG(context).current_brk_cont = -1;
CG(context).backpatch_count = 0;
CG(context).in_finally = 0;
+ CG(context).fast_call_var = -1;
CG(context).labels = NULL;
}
/* }}} */
@@ -272,7 +273,7 @@ static int lookup_cv(zend_op_array *op_array, zend_string* name TSRMLS_DC) /* {{
op_array->vars[i]->len == name->len &&
memcmp(op_array->vars[i]->val, name->val, name->len) == 0)) {
zend_string_release(name);
- return (int)(zend_intptr_t)EX_VAR_NUM_2(NULL, i);
+ return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
}
i++;
}
@@ -284,7 +285,7 @@ static int lookup_cv(zend_op_array *op_array, zend_string* name TSRMLS_DC) /* {{
}
op_array->vars[i] = zend_new_interned_string(name TSRMLS_CC);
- return (int)(zend_intptr_t)EX_VAR_NUM_2(NULL, i);
+ return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
}
/* }}} */
@@ -1810,7 +1811,7 @@ static inline uint32_t zend_delayed_compile_begin(TSRMLS_D) /* {{{ */
static zend_op *zend_delayed_compile_end(uint32_t offset TSRMLS_DC) /* {{{ */
{
- zend_op *opline, *oplines = zend_stack_base(&CG(delayed_oplines_stack));
+ zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack));
uint32_t i, count = zend_stack_count(&CG(delayed_oplines_stack));
ZEND_ASSERT(count > offset);
@@ -2109,7 +2110,8 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
zend_compile_expr(&prop_node, prop_ast TSRMLS_CC);
opline = zend_delayed_emit_op(result, ZEND_FETCH_OBJ_R, &obj_node, &prop_node TSRMLS_CC);
- if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) {
+ if (opline->op2_type == IS_CONST) {
+ convert_to_string(&CONSTANT(opline->op2.constant));
zend_alloc_polymorphic_cache_slot(opline->op2.constant TSRMLS_CC);
}
@@ -2477,7 +2479,12 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
if (fbc) {
flags |= ZEND_ARG_COMPILE_TIME_BOUND;
}
- opline->extended_value = flags;
+ if ((flags & ZEND_ARG_COMPILE_TIME_BOUND) && !(flags & ZEND_ARG_SEND_BY_REF)) {
+ opline->opcode = ZEND_SEND_VAR;
+ opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND;
+ } else {
+ opline->extended_value = flags;
+ }
} else if (fbc) {
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND;
}
@@ -2984,9 +2991,7 @@ void zend_compile_global_var(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_compile_expr(&name_node, name_ast TSRMLS_CC);
if (name_node.op_type == IS_CONST) {
- if (Z_TYPE(name_node.u.constant) != IS_STRING) {
- convert_to_string(&name_node.u.constant);
- }
+ convert_to_string(&name_node.u.constant);
}
if (zend_try_compile_cv(&result, var_ast TSRMLS_CC) == SUCCESS) {
@@ -3122,7 +3127,9 @@ void zend_compile_return(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_free_foreach_and_switch_variables(TSRMLS_C);
if (CG(context).in_finally) {
- zend_emit_op(NULL, ZEND_DISCARD_EXCEPTION, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_DISCARD_EXCEPTION, NULL, NULL TSRMLS_CC);
+ opline->op1_type = IS_TMP_VAR;
+ opline->op1.var = CG(context).fast_call_var;
}
opline = zend_emit_op(NULL, by_ref ? ZEND_RETURN_BY_REF : ZEND_RETURN,
@@ -3427,7 +3434,7 @@ void zend_compile_if(zend_ast *ast TSRMLS_DC) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
- uint32_t *jmp_opnums;
+ uint32_t *jmp_opnums = NULL;
if (list->children > 1) {
jmp_opnums = safe_emalloc(sizeof(uint32_t), list->children - 1, 0);
@@ -3617,8 +3624,15 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
if (finally_ast) {
uint32_t opnum_jmp = get_next_op_number(CG(active_op_array)) + 1;
+ if (!(CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)) {
+ CG(active_op_array)->fn_flags |= ZEND_ACC_HAS_FINALLY_BLOCK;
+ CG(context).fast_call_var = get_temporary_variable(CG(active_op_array));
+ }
+
opline = zend_emit_op(NULL, ZEND_FAST_CALL, NULL, NULL TSRMLS_CC);
opline->op1.opline_num = opnum_jmp + 1;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = CG(context).fast_call_var;
zend_emit_op(NULL, ZEND_JMP, NULL, NULL TSRMLS_CC);
@@ -3629,9 +3643,10 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = opnum_jmp + 1;
CG(active_op_array)->try_catch_array[try_catch_offset].finally_end
= get_next_op_number(CG(active_op_array));
- CG(active_op_array)->fn_flags |= ZEND_ACC_HAS_FINALLY_BLOCK;
- zend_emit_op(NULL, ZEND_FAST_RET, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_FAST_RET, NULL, NULL TSRMLS_CC);
+ opline->op1_type = IS_TMP_VAR;
+ opline->op1.var = CG(context).fast_call_var;
zend_update_jump_target_to_next(opnum_jmp TSRMLS_CC);
}
@@ -3830,8 +3845,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_bool has_null_default = default_ast
&& (Z_TYPE(default_node.u.constant) == IS_NULL
|| (Z_TYPE(default_node.u.constant) == IS_CONSTANT
- && strcasecmp(Z_STRVAL(default_node.u.constant), "NULL") == 0)
- || Z_TYPE(default_node.u.constant) == IS_CONSTANT_AST); // ???
+ && strcasecmp(Z_STRVAL(default_node.u.constant), "NULL") == 0));
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
arg_info->allow_null = has_null_default;
@@ -3841,12 +3855,13 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
if (arg_info->type_hint == IS_ARRAY) {
if (default_ast && !has_null_default
&& Z_TYPE(default_node.u.constant) != IS_ARRAY
+ && !Z_CONSTANT(default_node.u.constant)
) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with array type hint can only be an array or NULL");
}
} else if (arg_info->type_hint == IS_CALLABLE && default_ast) {
- if (!has_null_default) {
+ if (!has_null_default && !Z_CONSTANT(default_node.u.constant)) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with callable type hint can only be NULL");
}
@@ -3866,7 +3881,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_string_release(class_name);
- if (default_ast && !has_null_default) {
+ if (default_ast && !has_null_default && !Z_CONSTANT(default_node.u.constant)) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with a class type hint can only be NULL");
}
@@ -5469,7 +5484,7 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast TSRMLS_DC) /* {{{
zend_ast *var_ast = ast->child[0];
znode var_node;
- zend_op *opline;
+ zend_op *opline = NULL;
ZEND_ASSERT(ast->kind == ZEND_AST_ISSET || ast->kind == ZEND_AST_EMPTY);
@@ -5520,13 +5535,11 @@ void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode silence_node;
- uint32_t opline_num;
- zend_op *begin_silence, *end_silence;
+ uint32_t begin_opline_num, end_opline_num;
+ zend_brk_cont_element *brk_cont_element;
- opline_num = get_next_op_number(CG(active_op_array));
- begin_silence = zend_emit_op_tmp(&silence_node, ZEND_BEGIN_SILENCE, NULL, NULL TSRMLS_CC);
- /* pair BEGIN_SILENCE and END_SILENCE opcodes */
- begin_silence->op2.num = opline_num;
+ begin_opline_num = get_next_op_number(CG(active_op_array));
+ zend_emit_op_tmp(&silence_node, ZEND_BEGIN_SILENCE, NULL, NULL TSRMLS_CC);
if (expr_ast->kind == ZEND_AST_VAR) {
/* For @$var we need to force a FETCH instruction, otherwise the CV access will
@@ -5536,9 +5549,15 @@ void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_compile_expr(result, expr_ast TSRMLS_CC);
}
- end_silence = zend_emit_op(NULL, ZEND_END_SILENCE, &silence_node, NULL TSRMLS_CC);
- /* pair BEGIN_SILENCE and END_SILENCE opcodes */
- end_silence->op2.num = opline_num;
+ end_opline_num = get_next_op_number(CG(active_op_array));
+ zend_emit_op(NULL, ZEND_END_SILENCE, &silence_node, NULL TSRMLS_CC);
+
+ /* Store BEGIN_SILENCE/END_SILENCE pair to restore previous
+ * EG(error_reporting) value on exception */
+ brk_cont_element = get_next_brk_cont_element(CG(active_op_array));
+ brk_cont_element->start = begin_opline_num;
+ brk_cont_element->cont = brk_cont_element->brk = end_opline_num;
+ brk_cont_element->parent = -1;
}
/* }}} */
@@ -5701,8 +5720,21 @@ void zend_compile_resolve_class_name(znode *result, zend_ast *ast TSRMLS_DC) /*
zend_error_noreturn(E_COMPILE_ERROR,
"Cannot access self::class when no class scope is active");
}
- result->op_type = IS_CONST;
- ZVAL_STR_COPY(&result->u.constant, CG(active_class_entry)->name);
+ if (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) {
+ zval class_str_zv;
+ zend_ast *class_str_ast, *class_const_ast;
+
+ ZVAL_STRING(&class_str_zv, "class");
+ class_str_ast = zend_ast_create_zval(&class_str_zv);
+ class_const_ast = zend_ast_create(ZEND_AST_CLASS_CONST, name_ast, class_str_ast);
+
+ zend_compile_expr(result, class_const_ast TSRMLS_CC);
+
+ zval_ptr_dtor(&class_str_zv);
+ } else {
+ result->op_type = IS_CONST;
+ ZVAL_STR_COPY(&result->u.constant, CG(active_class_entry)->name);
+ }
break;
case ZEND_FETCH_CLASS_STATIC:
case ZEND_FETCH_CLASS_PARENT:
@@ -5788,14 +5820,14 @@ void zend_compile_encaps_list(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
void zend_compile_magic_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
{
- zend_class_entry *ce = CG(active_class_entry);
-
if (zend_try_ct_eval_magic_const(&result->u.constant, ast TSRMLS_CC)) {
result->op_type = IS_CONST;
return;
}
- ZEND_ASSERT(ast->attr == T_CLASS_C && ce && ZEND_CE_IS_TRAIT(ce));
+ ZEND_ASSERT(ast->attr == T_CLASS_C &&
+ CG(active_class_entry) &&
+ ZEND_CE_IS_TRAIT(CG(active_class_entry)));
{
zend_ast *const_ast = zend_ast_create(ZEND_AST_CONST,
@@ -5926,10 +5958,11 @@ void zend_compile_const_expr_resolve_class_name(zend_ast **ast_ptr TSRMLS_DC) /*
void zend_compile_const_expr_magic_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
{
zend_ast *ast = *ast_ptr;
- zend_class_entry *ce = CG(active_class_entry);
/* Other cases already resolved by constant folding */
- ZEND_ASSERT(ast->attr == T_CLASS_C && ce && ZEND_CE_IS_TRAIT(ce));
+ ZEND_ASSERT(ast->attr == T_CLASS_C &&
+ CG(active_class_entry) &&
+ ZEND_CE_IS_TRAIT(CG(active_class_entry)));
{
zval const_zv;
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index f9a66a37d8..a885518caf 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -52,6 +52,7 @@ typedef struct _zend_compiler_context {
int current_brk_cont;
int backpatch_count;
int in_finally;
+ uint32_t fast_call_var;
HashTable *labels;
} zend_compiler_context;
@@ -356,12 +357,12 @@ union _zend_function {
zend_internal_function internal_function;
};
-typedef enum _vm_frame_kind {
- VM_FRAME_NESTED_FUNCTION, /* stackless VM call to function */
- VM_FRAME_NESTED_CODE, /* stackless VM call to include/require/eval */
- VM_FRAME_TOP_FUNCTION, /* direct VM call to function from external C code */
- VM_FRAME_TOP_CODE /* direct VM call to "main" code from external C code */
-} vm_frame_kind;
+typedef enum _zend_call_kind {
+ ZEND_CALL_NESTED_FUNCTION, /* stackless VM call to function */
+ ZEND_CALL_NESTED_CODE, /* stackless VM call to include/require/eval */
+ ZEND_CALL_TOP_FUNCTION, /* direct VM call to function from external C code */
+ ZEND_CALL_TOP_CODE /* direct VM call to "main" code from external C code */
+} zend_call_kind;
struct _zend_execute_data {
const zend_op *opline; /* executed opline */
@@ -371,42 +372,56 @@ struct _zend_execute_data {
zval This;
zend_class_entry *called_scope;
zend_execute_data *prev_execute_data;
- uint32_t frame_info;
- uint32_t num_args;
zval *return_value;
- zend_class_entry *scope; /* function scope (self) */
zend_array *symbol_table;
- const zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */
- zend_object *delayed_exception;
- uint32_t silence_op_num;
- uint32_t old_error_reporting;
};
-#define VM_FRAME_KIND_MASK 0x000000ff
-#define VM_FRAME_FLAGS_MASK 0xffffff00
+#define ZEND_CALL_FUNCTION (0 << 0)
+#define ZEND_CALL_CODE (1 << 0)
+#define ZEND_CALL_NESTED (0 << 1)
+#define ZEND_CALL_TOP (1 << 1)
+#define ZEND_CALL_CTOR (1 << 2)
+#define ZEND_CALL_CTOR_RESULT_UNUSED (1 << 3)
-#define ZEND_CALL_CTOR (1 << 8)
-#define ZEND_CALL_CTOR_RESULT_UNUSED (1 << 9)
+#define ZEND_CALL_INFO(call) \
+ (Z_TYPE_INFO((call)->This) >> 24)
-#define VM_FRAME_INFO(kind, flags) ((kind) | (flags))
-#define VM_FRAME_KIND(info) ((info) & VM_FRAME_KIND_MASK)
-#define VM_FRAME_FLAGS(info) ((info) & VM_FRAME_FLAGS_MASK)
+#define ZEND_CALL_KIND(call) \
+ (ZEND_CALL_INFO(call) & (ZEND_CALL_CODE | ZEND_CALL_TOP))
+
+#define ZEND_SET_CALL_INFO(call, info) do { \
+ Z_TYPE_INFO((call)->This) = IS_OBJECT_EX | ((info) << 24); \
+ } while (0)
+
+#define ZEND_ADD_CALL_FLAG(call, info) do { \
+ Z_TYPE_INFO((call)->This) |= ((info) << 24); \
+ } while (0)
+
+#define ZEND_CALL_NUM_ARGS(call) \
+ (call)->This.u2.num_args
#define ZEND_CALL_FRAME_SLOT \
((ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / ZEND_MM_ALIGNED_SIZE(sizeof(zval)))
+#define ZEND_CALL_VAR(call, n) \
+ ((zval*)(((char*)(call)) + ((int)(n))))
+
+#define ZEND_CALL_VAR_NUM(call, n) \
+ (((zval*)(call)) + (ZEND_CALL_FRAME_SLOT + ((int)(n))))
+
#define ZEND_CALL_ARG(call, n) \
- (((zval*)(call)) + ((n) + (ZEND_CALL_FRAME_SLOT - 1)))
+ ZEND_CALL_VAR_NUM(call, ((int)(n)) - 1)
#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))))
+#define EX_CALL_INFO() ZEND_CALL_INFO(execute_data)
+#define EX_CALL_KIND() ZEND_CALL_KIND(execute_data)
+#define EX_NUM_ARGS() ZEND_CALL_NUM_ARGS(execute_data)
-#define EX_VAR(n) EX_VAR_2(execute_data, n)
-#define EX_VAR_NUM(n) EX_VAR_NUM_2(execute_data, n)
+#define EX_VAR(n) ZEND_CALL_VAR(execute_data, n)
+#define EX_VAR_NUM(n) ZEND_CALL_VAR_NUM(execute_data, n)
-#define EX_VAR_TO_NUM(n) (EX_VAR_2(NULL, n) - EX_VAR_NUM_2(NULL, 0))
+#define EX_VAR_TO_NUM(n) (ZEND_CALL_VAR(NULL, n) - ZEND_CALL_VAR_NUM(NULL, 0))
#define IS_CONST (1<<0)
#define IS_TMP_VAR (1<<1)
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index 6d5542e1ec..058e0135c7 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -44,12 +44,12 @@ typedef struct _zend_constant {
#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number TSRMLS_CC)
#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (bval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (bval), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (lval), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (dval), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), 0 TSRMLS_CC)
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 1551789c48..e848e59dec 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -99,13 +99,13 @@ static const zend_internal_function zend_pass_function = {
} while (0)
#define FREE_OP(should_free) \
- if (should_free.var) { \
- zval_ptr_dtor_nogc(should_free.var); \
+ if (should_free) { \
+ zval_ptr_dtor_nogc(should_free); \
}
#define FREE_OP_VAR_PTR(should_free) \
- if (should_free.var) { \
- zval_ptr_dtor_nogc(should_free.var); \
+ if (should_free) { \
+ zval_ptr_dtor_nogc(should_free); \
}
/* End of zend_execute_locks.h */
@@ -183,29 +183,29 @@ ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute
return EX_VAR(var);
}
-static zend_always_inline zval *_get_zval_ptr_tmp(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_tmp(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free)
{
zval *ret = EX_VAR(var);
- should_free->var = ret;
+ *should_free = ret;
ZEND_ASSERT(Z_TYPE_P(ret) != IS_REFERENCE);
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free)
{
zval *ret = EX_VAR(var);
- should_free->var = ret;
+ *should_free = ret;
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free)
{
zval *ret = EX_VAR(var);
- should_free->var = ret;
+ *should_free = ret;
ZVAL_DEREF(ret);
return ret;
}
@@ -392,93 +392,71 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(const zend_execu
static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
{
- zval *ret;
-
switch (op_type) {
case IS_CONST:
- should_free->var = NULL;
+ *should_free = NULL;
return node->zv;
- break;
case IS_TMP_VAR:
- ret = EX_VAR(node->var);
- should_free->var = ret;
- return ret;
- break;
+ return _get_zval_ptr_tmp(node->var, execute_data, should_free);
case IS_VAR:
- return _get_zval_ptr_var(node->var, execute_data, should_free TSRMLS_CC);
- break;
- case IS_UNUSED:
- should_free->var = NULL;
- return NULL;
- break;
+ return _get_zval_ptr_var(node->var, execute_data, should_free);
case IS_CV:
- default:
- should_free->var = NULL;
+ *should_free = NULL;
return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
- break;
+ default:
+ *should_free = NULL;
+ return NULL;
}
- return NULL;
}
static inline zval *_get_zval_ptr_deref(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
{
- zval *ret;
-
switch (op_type) {
case IS_CONST:
- should_free->var = NULL;
+ *should_free = NULL;
return node->zv;
- break;
case IS_TMP_VAR:
- ret = EX_VAR(node->var);
- should_free->var = ret;
- return ret;
- break;
+ return _get_zval_ptr_tmp(node->var, execute_data, should_free);
case IS_VAR:
- return _get_zval_ptr_var_deref(node->var, execute_data, should_free TSRMLS_CC);
- break;
- case IS_UNUSED:
- should_free->var = NULL;
- return NULL;
- break;
+ return _get_zval_ptr_var_deref(node->var, execute_data, should_free);
case IS_CV:
- default:
- should_free->var = NULL;
+ *should_free = NULL;
return _get_zval_ptr_cv_deref(execute_data, node->var, type TSRMLS_CC);
- break;
+ default:
+ *should_free = NULL;
+ return NULL;
}
- return NULL;
}
-static zend_always_inline zval *_get_zval_ptr_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free)
{
zval *ret = EX_VAR(var);
if (EXPECTED(Z_TYPE_P(ret) == IS_INDIRECT)) {
- should_free->var = NULL;
- return Z_INDIRECT_P(ret);
- } else if (!Z_REFCOUNTED_P(ret) || Z_REFCOUNT_P(ret) == 1) {
- should_free->var = ret;
- return ret;
+ *should_free = NULL;
+ ret = Z_INDIRECT_P(ret);
} else {
- Z_DELREF_P(ret);
- should_free->var = NULL;
- return ret;
+ *should_free = ret;
+ if (Z_REFCOUNTED_P(ret) && Z_REFCOUNT_P(ret) > 1) {
+ *should_free = NULL;
+ Z_DELREF_P(ret);
+ }
}
+ return ret;
}
static inline zval *_get_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)
{
if (op_type == IS_CV) {
- should_free->var = NULL;
+ *should_free = NULL;
return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
} else /* if (op_type == IS_VAR) */ {
ZEND_ASSERT(op_type == IS_VAR);
- return _get_zval_ptr_ptr_var(node->var, execute_data, should_free TSRMLS_CC);
+ return _get_zval_ptr_ptr_var(node->var, execute_data, should_free);
}
}
-static zend_always_inline zval *_get_obj_zval_ptr_unused(zend_execute_data *execute_data TSRMLS_DC)
+static zend_always_inline zval *_get_obj_zval_ptr_unused(zend_execute_data *execute_data)
{
if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
return &EX(This);
@@ -492,7 +470,7 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, zend_execute_da
{
if (op_type == IS_UNUSED) {
if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
- should_free->var = NULL;
+ *should_free = NULL;
return &EX(This);
} else {
zend_error_noreturn(E_ERROR, "Using $this when not in object context");
@@ -505,7 +483,7 @@ static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, zen
{
if (op_type == IS_UNUSED) {
if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
- should_free->var = NULL;
+ *should_free = NULL;
return &EX(This);
} else {
zend_error_noreturn(E_ERROR, "Using $this when not in object context");
@@ -580,23 +558,42 @@ ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uin
fclass = "";
}
- if (arg && zf->common.type == ZEND_USER_FUNCTION) {
- ZVAL_COPY_VALUE(&old_arg, arg);
- ZVAL_UNDEF(arg);
- }
+ if (zf->common.type == ZEND_USER_FUNCTION) {
+ if (arg) {
+ ZVAL_COPY_VALUE(&old_arg, arg);
+ ZVAL_UNDEF(arg);
+ }
- if (zf->common.type == ZEND_USER_FUNCTION && ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
- zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->func->op_array.filename->val, ptr->opline->lineno);
+ if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
+ zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->func->op_array.filename->val, ptr->opline->lineno);
+ } else {
+ zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
+ }
+
+ if (arg) {
+ ZVAL_COPY_VALUE(arg, &old_arg);
+ }
} else {
zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
}
+}
+
+static int is_null_constant(zval *default_value TSRMLS_DC)
+{
+ if (Z_CONSTANT_P(default_value)) {
+ zval constant;
- if (arg && zf->common.type == ZEND_USER_FUNCTION) {
- ZVAL_COPY_VALUE(arg, &old_arg);
+ ZVAL_COPY_VALUE(&constant, default_value);
+ zval_update_constant(&constant, 0 TSRMLS_CC);
+ if (Z_TYPE(constant) == IS_NULL) {
+ return 1;
+ }
+ zval_dtor(&constant);
}
+ return 0;
}
-static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg TSRMLS_DC)
+static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
char *need_msg;
@@ -623,18 +620,18 @@ static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg TSRMLS_CC);
}
- } else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
+ } else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
} else if (cur_arg_info->type_hint) {
if (cur_arg_info->type_hint == IS_ARRAY) {
ZVAL_DEREF(arg);
- if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
- if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
#if ZEND_DEBUG
@@ -704,7 +701,7 @@ static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t ar
static zend_always_inline void zend_assign_to_object(zval *retval, zval *object, uint32_t object_op_type, zval *property_name, int value_type, const znode_op *value_op, const zend_execute_data *execute_data, int opcode, void **cache_slot TSRMLS_DC)
{
zend_free_op free_value;
- zval *value = get_zval_ptr(value_type, value_op, execute_data, &free_value, BP_VAR_R);
+ zval *value = get_zval_ptr_deref(value_type, value_op, execute_data, &free_value, BP_VAR_R);
zval tmp;
if (object_op_type != IS_UNUSED) {
@@ -748,38 +745,101 @@ static zend_always_inline void zend_assign_to_object(zval *retval, zval *object,
}
}
- /* separate our value if necessary */
- if (value_type == IS_TMP_VAR) {
- ZVAL_COPY_VALUE(&tmp, value);
- value = &tmp;
- } else if (value_type == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- ZVAL_COPY_VALUE(&tmp, value);
- zval_copy_ctor_func(&tmp);
- value = &tmp;
- }
- } else if (Z_REFCOUNTED_P(value)) {
- Z_ADDREF_P(value);
- }
-
if (opcode == ZEND_ASSIGN_OBJ) {
if (!Z_OBJ_HT_P(object)->write_property) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (retval) {
ZVAL_NULL(retval);
}
- if (value_type == IS_CONST) {
- zval_ptr_dtor(value);
- }
FREE_OP(free_value);
return;
}
+
+ if (cache_slot &&
+ EXPECTED(Z_OBJCE_P(object) == CACHED_PTR_EX(cache_slot))) {
+ zend_property_info *prop_info = CACHED_PTR_EX(cache_slot + 1);
+ zend_object *zobj = Z_OBJ_P(object);
+ zval *property;
+
+ if (EXPECTED(prop_info)) {
+ property = OBJ_PROP(zobj, prop_info->offset);
+ if (Z_TYPE_P(property) != IS_UNDEF) {
+fast_assign:
+ value = zend_assign_to_variable(property, value, value_type TSRMLS_CC);
+ if (retval && !EG(exception)) {
+ ZVAL_COPY(retval, value);
+ }
+ if (value_type == IS_VAR) {
+ FREE_OP(free_value);
+ }
+ return;
+ }
+ } else {
+ if (EXPECTED(zobj->properties != NULL)) {
+ property = zend_hash_find(zobj->properties, Z_STR_P(property_name));
+ if (property) {
+ goto fast_assign;
+ }
+ }
+
+ if (!zobj->ce->__set) {
+ if (EXPECTED(zobj->properties == NULL)) {
+ rebuild_object_properties(zobj);
+ }
+ /* separate our value if necessary */
+ if (value_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
+ ZVAL_COPY_VALUE(&tmp, value);
+ zval_copy_ctor_func(&tmp);
+ value = &tmp;
+ }
+ } else if (value_type != IS_TMP_VAR &&
+ Z_REFCOUNTED_P(value)) {
+ Z_ADDREF_P(value);
+ }
+ zend_hash_add_new(zobj->properties, Z_STR_P(property_name), value);
+ if (retval && !EG(exception)) {
+ ZVAL_COPY(retval, value);
+ }
+ if (value_type == IS_VAR) {
+ FREE_OP(free_value);
+ }
+ return;
+ }
+ }
+ }
+
+ /* separate our value if necessary */
+ if (value_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
+ ZVAL_COPY_VALUE(&tmp, value);
+ zval_copy_ctor_func(&tmp);
+ value = &tmp;
+ }
+ } else if (value_type != IS_TMP_VAR &&
+ Z_REFCOUNTED_P(value)) {
+ Z_ADDREF_P(value);
+ }
+
Z_OBJ_HT_P(object)->write_property(object, property_name, value, cache_slot TSRMLS_CC);
} else {
/* Note: property_name in this case is really the array index! */
if (!Z_OBJ_HT_P(object)->write_dimension) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
+
+ /* separate our value if necessary */
+ if (value_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
+ ZVAL_COPY_VALUE(&tmp, value);
+ zval_copy_ctor_func(&tmp);
+ value = &tmp;
+ }
+ } else if (value_type != IS_TMP_VAR &&
+ Z_REFCOUNTED_P(value)) {
+ Z_ADDREF_P(value);
+ }
+
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
@@ -842,65 +902,6 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu
}
}
-static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC)
-{
- do {
- if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
- zend_refcounted *garbage;
-
- if (Z_ISREF_P(variable_ptr)) {
- variable_ptr = Z_REFVAL_P(variable_ptr);
- if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
- break;
- }
- }
- 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;
- }
- if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
- return variable_ptr;
- }
- garbage = Z_COUNTED_P(variable_ptr);
- 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);
- }
- } else if (value_type != IS_TMP_VAR) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
- Z_ADDREF_P(variable_ptr);
- }
- }
- _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);
- }
- }
- }
- } 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;
-}
-
/* Utility Functions for Extensions */
static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
{
@@ -1429,12 +1430,12 @@ ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_val
ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{{ */
{
if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
- zend_hash_destroy(&symbol_table->ht);
+ zend_array_destroy(&symbol_table->ht TSRMLS_CC);
efree_size(symbol_table, sizeof(zend_array));
} else {
/* clean before putting into the cache, since clean
could call dtors, which could use cached hash */
- zend_hash_clean(&symbol_table->ht);
+ zend_symtable_clean(&symbol_table->ht TSRMLS_CC);
*(++EG(symtable_cache_ptr)) = symbol_table;
}
}
@@ -1483,20 +1484,17 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
{
uint32_t first_extra_arg, num_args;
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
- ZEND_ASSERT(EX(scope) == EG(scope));
EX(opline) = op_array->opcodes;
EX(call) = NULL;
EX(return_value) = return_value;
- EX(delayed_exception) = NULL;
- EX(silence_op_num) = -1;
/* Handle arguments */
first_extra_arg = op_array->num_args;
if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
first_extra_arg--;
}
- num_args = EX(num_args);
+ num_args = EX_NUM_ARGS();
if (UNEXPECTED(num_args > first_extra_arg)) {
zval *end, *src, *dst;
@@ -1554,9 +1552,6 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
EX(opline) = op_array->opcodes;
EX(call) = NULL;
EX(return_value) = return_value;
- EX(scope) = EG(scope);
- EX(delayed_exception) = NULL;
- EX(silence_op_num) = -1;
zend_attach_symbol_table(execute_data);
@@ -1581,9 +1576,6 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
EX(opline) = op_array->opcodes;
EX(call) = NULL;
EX(return_value) = return_value;
- EX(scope) = EG(scope);
- EX(delayed_exception) = NULL;
- EX(silence_op_num) = -1;
if (UNEXPECTED(EX(symbol_table) != NULL)) {
zend_attach_symbol_table(execute_data);
@@ -1595,7 +1587,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
first_extra_arg--;
}
- num_args = EX(num_args);
+ num_args = EX_NUM_ARGS();
if (UNEXPECTED(num_args > first_extra_arg)) {
zval *end, *src, *dst;
@@ -1663,7 +1655,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
* restore it simply by replacing a pointer.
*/
zend_execute_data *execute_data;
- uint32_t num_args = call->num_args;
+ uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
size_t stack_size = (ZEND_CALL_FRAME_SLOT + MAX(op_array->last_var + op_array->T, num_args)) * sizeof(zval);
EG(vm_stack) = zend_vm_stack_new_page(
@@ -1675,13 +1667,13 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
EG(vm_stack_end) = EG(vm_stack)->end;
execute_data = zend_vm_stack_push_call_frame(
- VM_FRAME_TOP_FUNCTION,
+ ZEND_CALL_TOP_FUNCTION,
(zend_function*)op_array,
num_args,
call->called_scope,
Z_OBJ(call->This),
NULL TSRMLS_CC);
- EX(num_args) = num_args;
+ EX_NUM_ARGS() = num_args;
/* copy arguments */
if (num_args > 0) {
@@ -1695,7 +1687,6 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
}
EX(symbol_table) = NULL;
- EX(scope) = EG(scope);
i_init_func_execute_data(execute_data, op_array, return_value TSRMLS_CC);
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 982413e032..ddd736c07e 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -51,18 +51,6 @@ ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, c
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC);
ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC);
-static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_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_RELAY_CC);
- } else {
- GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr);
- }
- }
-}
-
static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC)
{
int result;
@@ -129,6 +117,65 @@ again:
return result;
}
+static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC)
+{
+ do {
+ if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
+ zend_refcounted *garbage;
+
+ if (Z_ISREF_P(variable_ptr)) {
+ variable_ptr = Z_REFVAL_P(variable_ptr);
+ if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
+ break;
+ }
+ }
+ 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;
+ }
+ if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
+ return variable_ptr;
+ }
+ garbage = Z_COUNTED_P(variable_ptr);
+ 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);
+ }
+ } else if (value_type != IS_TMP_VAR) {
+ if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
+ Z_ADDREF_P(variable_ptr);
+ }
+ }
+ _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);
+ }
+ }
+ }
+ } 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;
+}
+
ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC);
ZEND_API int zval_update_constant_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
@@ -162,7 +209,7 @@ static zend_always_inline zval* zend_vm_stack_alloc(size_t size TSRMLS_DC)
return (zval*)top;
}
-static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint32_t frame_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
+static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
{
uint32_t used_stack = ZEND_CALL_FRAME_SLOT + num_args;
zend_execute_data *call;
@@ -172,11 +219,11 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint3
}
call = (zend_execute_data*)zend_vm_stack_alloc(used_stack * sizeof(zval) TSRMLS_CC);
call->func = func;
- ZVAL_OBJ(&call->This, object);
+ Z_OBJ(call->This) = object;
+ ZEND_SET_CALL_INFO(call, call_info);
+ ZEND_CALL_NUM_ARGS(call) = 0;
call->called_scope = called_scope;
call->prev_execute_data = prev;
- call->frame_info = frame_info;
- call->num_args = 0;
return call;
}
@@ -184,9 +231,9 @@ static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *
{
uint32_t first_extra_arg = call->func->op_array.num_args - ((call->func->common.fn_flags & ZEND_ACC_VARIADIC) != 0);
- if (UNEXPECTED(call->num_args > first_extra_arg)) {
- zval *end = EX_VAR_NUM_2(call, call->func->op_array.last_var + call->func->op_array.T);
- zval *p = end + (call->num_args - first_extra_arg);
+ if (UNEXPECTED(ZEND_CALL_NUM_ARGS(call) > first_extra_arg)) {
+ zval *end = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
+ zval *p = end + (ZEND_CALL_NUM_ARGS(call) - first_extra_arg);
do {
p--;
zval_ptr_dtor_nogc(p);
@@ -196,7 +243,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *
static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call TSRMLS_DC)
{
- uint32_t num_args = call->num_args;
+ uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
if (num_args > 0) {
zval *end = ZEND_CALL_ARG(call, 1);
@@ -261,10 +308,7 @@ ZEND_API int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler
ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode);
/* former zend_execute_locks.h */
-typedef struct _zend_free_op {
- zval *var;
-/* int is_var; */
-} zend_free_op;
+typedef zval* zend_free_op;
ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC);
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 5edc65e93e..7d5af4e9aa 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -51,8 +51,8 @@ static WNDCLASS wc;
static HWND timeout_window;
static HANDLE timeout_thread_event;
static HANDLE timeout_thread_handle;
-static DWORD timeout_thread_id;
-static int timeout_thread_initialized=0;
+static unsigned timeout_thread_id;
+static volatile long timeout_thread_initialized=0;
#endif
#if 0&&ZEND_DEBUG
@@ -736,7 +736,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
func = fci_cache->function_handler;
- call = zend_vm_stack_push_call_frame(VM_FRAME_TOP_FUNCTION,
+ call = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_FUNCTION,
func, fci->param_count, fci_cache->called_scope, fci_cache->object, NULL TSRMLS_CC);
calling_scope = fci_cache->calling_scope;
fci->object = fci_cache->object;
@@ -787,7 +787,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
if (i) {
/* hack to clean up the stack */
- call->num_args = i;
+ ZEND_CALL_NUM_ARGS(call) = i;
zend_vm_stack_free_args(call TSRMLS_CC);
}
zend_vm_stack_free_call_frame(call TSRMLS_CC);
@@ -827,7 +827,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
ZVAL_COPY(param, &fci->params[i]);
}
}
- call->num_args = fci->param_count;
+ ZEND_CALL_NUM_ARGS(call) = fci->param_count;
EG(scope) = calling_scope;
if (func->common.fn_flags & ZEND_ACC_STATIC) {
@@ -835,9 +835,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
if (!fci->object) {
Z_OBJ(call->This) = NULL;
- Z_TYPE_INFO(call->This) = IS_UNDEF;
} else {
- ZVAL_OBJ(&call->This, fci->object);
+ Z_OBJ(call->This) = fci->object;
GC_REFCOUNT(fci->object)++;
}
@@ -1166,6 +1165,10 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */
#ifdef ZEND_WIN32
static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* {{{ */
{
+#ifdef ZTS
+ THREAD_T thread_id = (THREAD_T)wParam;
+#endif
+
switch (message) {
case WM_DESTROY:
PostQuitMessage(0);
@@ -1180,7 +1183,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
#endif
SetTimer(timeout_window, wParam, lParam*1000, NULL);
#ifdef ZTS
- tsrm_ls = ts_resource_ex(0, &wParam);
+ tsrm_ls = ts_resource_ex(0, &thread_id);
if (!tsrm_ls) {
/* shouldn't normally happen */
break;
@@ -1197,7 +1200,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
#ifdef ZTS
void ***tsrm_ls;
- tsrm_ls = ts_resource_ex(0, &wParam);
+ tsrm_ls = ts_resource_ex(0, &thread_id);
if (!tsrm_ls) {
/* Thread died before receiving its timeout? */
break;
@@ -1529,7 +1532,7 @@ ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
for (i = 0; i < ex->func->op_array.last_var; i++) {
zval zv;
- ZVAL_INDIRECT(&zv, EX_VAR_NUM_2(ex, i));
+ ZVAL_INDIRECT(&zv, ZEND_CALL_VAR_NUM(ex, i));
zend_hash_add_new(&symbol_table->ht,
ex->func->op_array.vars[i], &zv);
}
diff --git a/Zend/zend_float.h b/Zend/zend_float.h
index 33f8e93fbf..008bf07854 100644
--- a/Zend/zend_float.h
+++ b/Zend/zend_float.h
@@ -21,6 +21,8 @@
#ifndef ZEND_FLOAT_H
#define ZEND_FLOAT_H
+BEGIN_EXTERN_C()
+
/*
Define functions for FP initialization and de-initialization.
*/
@@ -28,6 +30,8 @@ extern ZEND_API void zend_init_fpu(TSRMLS_D);
extern ZEND_API void zend_shutdown_fpu(TSRMLS_D);
extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
+END_EXTERN_C()
+
/* Copy of the contents of xpfpa.h (which is under public domain)
See http://wiki.php.net/rfc/rounding for details.
@@ -53,7 +57,7 @@ extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
Implementation notes:
x86_64:
- - Since all x86_64 compilers use SSE by default, it is probably unecessary
+ - Since all x86_64 compilers use SSE by default, it is probably unnecessary
to use these macros there. We define them anyway since we are too lazy
to differentiate the architecture. Also, the compiler option -mfpmath=i387
justifies this decision.
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index b331f979fd..f6aad866a7 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -469,7 +469,7 @@ tail_call:
ht = NULL;
GC_SET_BLACK(GC_INFO(ref));
- /* don't count references for compatibilty ??? */
+ /* don't count references for compatibility ??? */
if (GC_TYPE(ref) != IS_REFERENCE) {
count++;
}
@@ -515,7 +515,7 @@ tail_call:
ZVAL_OBJ(&tmp, obj);
props = get_gc(&tmp, &table, &n TSRMLS_CC);
while (n > 0 && !Z_REFCOUNTED(table[n-1])) {
- /* count non-refcounted for compatibilty ??? */
+ /* count non-refcounted for compatibility ??? */
if (Z_TYPE(table[n-1]) != IS_UNDEF) {
count++;
}
@@ -532,7 +532,7 @@ tail_call:
} else {
count += gc_collect_white(ref TSRMLS_CC);
}
- /* count non-refcounted for compatibilty ??? */
+ /* count non-refcounted for compatibility ??? */
} else if (Z_TYPE(table[i]) != IS_UNDEF) {
count++;
}
@@ -563,7 +563,7 @@ tail_call:
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (!Z_REFCOUNTED(p->val)) {
- /* count non-refcounted for compatibilty ??? */
+ /* count non-refcounted for compatibility ??? */
if (Z_TYPE(p->val) != IS_UNDEF && Z_TYPE(p->val) != IS_INDIRECT) {
count++;
}
@@ -641,7 +641,7 @@ static int gc_collect_roots(TSRMLS_D)
static void gc_remove_nested_data_from_buffer(zend_refcounted *ref TSRMLS_DC)
{
- HashTable *ht;
+ HashTable *ht = NULL;
uint idx;
Bucket *p;
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index b38657f7b7..3d95cde44d 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -58,7 +58,7 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
zend_op *brk_opline = op_array->opcodes + brk_cont->brk;
if (brk_opline->opcode == ZEND_FREE) {
- zval *var = EX_VAR_2(execute_data, brk_opline->op1.var);
+ zval *var = EX_VAR(brk_opline->op1.var);
zval_ptr_dtor_nogc(var);
}
}
@@ -133,7 +133,7 @@ static void zend_generator_dtor_storage(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator*) object;
zend_execute_data *ex = generator->execute_data;
- uint32_t op_num, finally_op_num;
+ uint32_t op_num, finally_op_num, finally_op_end;
int i;
if (!ex || !(ex->func->op_array.fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)) {
@@ -146,6 +146,7 @@ static void zend_generator_dtor_storage(zend_object *object TSRMLS_DC) /* {{{ */
/* Find next finally block */
finally_op_num = 0;
+ finally_op_end = 0;
for (i = 0; i < ex->func->op_array.last_try_catch; i++) {
zend_try_catch_element *try_catch = &ex->func->op_array.try_catch_array[i];
@@ -155,14 +156,17 @@ static void zend_generator_dtor_storage(zend_object *object TSRMLS_DC) /* {{{ */
if (op_num < try_catch->finally_op) {
finally_op_num = try_catch->finally_op;
+ finally_op_end = try_catch->finally_end;
}
}
/* If a finally block was found we jump directly to it and
* resume the generator. */
if (finally_op_num) {
+ zval *fast_call = ZEND_CALL_VAR(ex, ex->func->op_array.opcodes[finally_op_end].op1.var);
+
+ fast_call->u2.lineno = (uint32_t)-1;
ex->opline = &ex->func->op_array.opcodes[finally_op_num];
- ex->fast_ret = NULL;
generator->flags |= ZEND_GENERATOR_FORCED_CLOSE;
zend_generator_resume(generator TSRMLS_CC);
}
@@ -302,7 +306,7 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
original_stack->top = EG(vm_stack_top);
/* Set executor globals */
EG(current_execute_data) = generator->execute_data;
- EG(scope) = generator->execute_data->scope;
+ EG(scope) = generator->execute_data->func->common.scope;
EG(vm_stack_top) = generator->stack->top;
EG(vm_stack_end) = generator->stack->end;
EG(vm_stack) = generator->stack;
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 5577194b0c..0f77ca6048 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -21,6 +21,7 @@
#include "zend.h"
#include "zend_globals.h"
+#include "zend_variables.h"
#if ZEND_DEBUG
/*
@@ -944,24 +945,115 @@ ZEND_API void zend_hash_destroy(HashTable *ht)
pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT);
}
+ZEND_API void zend_array_destroy(HashTable *ht TSRMLS_DC)
+{
+ Bucket *p, *end;
+
+ IS_CONSISTENT(ht);
+
+ if (ht->nNumUsed) {
+
+ /* In some rare cases destructors of regular arrays may be changed */
+ if (UNEXPECTED(ht->pDestructor != ZVAL_PTR_DTOR)) {
+ zend_hash_destroy(ht);
+ return;
+ }
+
+ p = ht->arData;
+ end = p + ht->nNumUsed;
+ SET_INCONSISTENT(HT_IS_DESTROYING);
+
+ if (ht->u.flags & HASH_FLAG_PACKED) {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ }
+ } while (++p != end);
+ } else {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
+
+ SET_INCONSISTENT(HT_DESTROYED);
+ } else if (EXPECTED(!ht->nTableMask)) {
+ return;
+ }
+ pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT);
+}
ZEND_API void zend_hash_clean(HashTable *ht)
{
- uint32_t idx;
- Bucket *p;
+ Bucket *p, *end;
IS_CONSISTENT(ht);
- for (idx = 0; idx < ht->nNumUsed; idx++) {
- p = ht->arData + idx;
- if (Z_TYPE(p->val) == IS_UNDEF) continue;
+ if (ht->nNumUsed) {
+ p = ht->arData;
+ end = p + ht->nNumUsed;
if (ht->pDestructor) {
- ht->pDestructor(&p->val);
+ if (ht->u.flags & HASH_FLAG_PACKED) {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ ht->pDestructor(&p->val);
+ }
+ } while (++p != end);
+ } else {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ ht->pDestructor(&p->val);
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
+ } else {
+ if (!(ht->u.flags & HASH_FLAG_PACKED)) {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
}
- if (p->key) {
- zend_string_release(p->key);
+ }
+ ht->nNumUsed = 0;
+ ht->nNumOfElements = 0;
+ ht->nNextFreeElement = 0;
+ ht->nInternalPointer = INVALID_IDX;
+ if (ht->nTableMask) {
+ if (!(ht->u.flags & HASH_FLAG_PACKED)) {
+ memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(uint32_t));
}
}
+}
+
+ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC)
+{
+ Bucket *p, *end;
+
+ IS_CONSISTENT(ht);
+
+ if (ht->nNumUsed) {
+ p = ht->arData;
+ end = p + ht->nNumUsed;
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
ht->nNumUsed = 0;
ht->nNumOfElements = 0;
ht->nNextFreeElement = 0;
@@ -1697,8 +1789,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
p->key = NULL;
}
}
- }
- if (renumber) {
+
ht->nNextFreeElement = i;
}
if (ht->u.flags & HASH_FLAG_PACKED) {
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 0ed47b424d..8f12b0e66e 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -216,6 +216,8 @@ ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint
ZEND_API int zend_hash_rehash(HashTable *ht);
ZEND_API void zend_array_dup(HashTable *target, HashTable *source);
+ZEND_API void zend_array_destroy(HashTable *ht TSRMLS_DC);
+ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC);
#if ZEND_DEBUG
/* debug */
diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c
index 93c10108f8..b5884c72c0 100644
--- a/Zend/zend_indent.c
+++ b/Zend/zend_indent.c
@@ -31,7 +31,7 @@
#define zendleng LANG_SCNG(yy_leng)
-static void handle_whitespace(int *emit_whitespace)
+static void handle_whitespace(unsigned int *emit_whitespace)
{
unsigned char c;
int i;
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 7d9d1aade8..43ef22074f 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -1206,7 +1206,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
}
zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC);
- /** Ensure that the prefered method is actually available. */
+ /** Ensure that the preferred 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,
@@ -1238,7 +1238,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
/* 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) {
+ if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[j].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",
@@ -1507,7 +1507,7 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce
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",
+ "The modifiers for the trait alias %s() need to be changed in the same statement in which the alias is defined. Error",
cur_alias->trait_method->method_name->val);
} else {
zend_string_free(lc_method_name);
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index ad5a55510b..c474fa8662 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -184,7 +184,7 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval TSRMLS
/* __get handler is called with one argument:
property name
- it should return whether the call was successfull or not
+ it should return whether the call was successful or not
*/
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
@@ -207,7 +207,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
property name
value to be set
- it should return whether the call was successfull or not
+ it should return whether the call was successful or not
*/
zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value);
@@ -545,51 +545,7 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, v
} else if (EXPECTED(zobj->properties != NULL)) {
if ((variable_ptr = zend_hash_find(zobj->properties, Z_STR_P(member))) != NULL) {
found:
- /* if we already have this value there, we don't actually need to do anything */
- if (EXPECTED(variable_ptr != value)) {
- /* if we are assigning reference, we shouldn't move it, but instead assign variable
- to the same pointer */
- if (Z_ISREF_P(variable_ptr)) {
- zval garbage;
-
- ZVAL_COPY_VALUE(&garbage, Z_REFVAL_P(variable_ptr)); /* old value should be destroyed */
-
- /* To check: can't *variable_ptr be some system variable like error_zval here? */
- 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)) {
- if (UNEXPECTED(Z_REFVAL_P(variable_ptr) == value)) {
- goto exit;
- }
- Z_ADDREF_P(value);
- }
- }
- }
- ZVAL_COPY_VALUE(Z_REFVAL_P(variable_ptr), value);
- zval_ptr_dtor(&garbage);
- } else {
- zval garbage;
-
- ZVAL_COPY_VALUE(&garbage, variable_ptr);
-
- /* if we assign referenced variable, we should separate it */
- ZVAL_COPY_VALUE(variable_ptr, value);
- if (Z_REFCOUNTED_P(variable_ptr)) {
- Z_ADDREF_P(variable_ptr);
- if (Z_ISREF_P(variable_ptr)) {
- SEPARATE_ZVAL(variable_ptr);
- }
- }
- zval_ptr_dtor(&garbage);
- }
- }
+ zend_assign_to_variable(variable_ptr, value, (IS_VAR|IS_TMP_VAR) TSRMLS_CC);
goto exit;
}
}
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 58c034163e..2778b168ee 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -47,18 +47,19 @@ ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSR
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
{
- int i;
+ int i, count;
if (object->guards) {
zend_hash_destroy(object->guards);
FREE_HASHTABLE(object->guards);
}
if (object->properties) {
- zend_hash_destroy(object->properties);
+ zend_array_destroy(object->properties TSRMLS_CC);
FREE_HASHTABLE(object->properties);
}
- for (i = 0; i < object->ce->default_properties_count; i++) {
- zval_ptr_dtor(&object->properties_table[i]);
+ count = object->ce->default_properties_count;
+ for (i = 0; i < count; i++) {
+ i_zval_ptr_dtor(&object->properties_table[i] ZEND_FILE_LINE_CC TSRMLS_CC);
}
}
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 5902abd4c5..59e62149f2 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -532,12 +532,19 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
(dst_num < op_array->try_catch_array[i].try_op ||
dst_num > op_array->try_catch_array[i].finally_end)) {
/* we have a jump out of try block that needs executing finally */
+ uint32_t fast_call_var;
+
+ /* Must be ZEND_FAST_RET */
+ ZEND_ASSERT(op_array->opcodes[op_array->try_catch_array[i].finally_end].opcode == ZEND_FAST_RET);
+ fast_call_var = op_array->opcodes[op_array->try_catch_array[i].finally_end].op1.var;
/* generate a FAST_CALL to finally block */
start_op = get_next_op_number(op_array);
opline = get_next_op(op_array TSRMLS_CC);
opline->opcode = ZEND_FAST_CALL;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = fast_call_var;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
zend_adjust_fast_call(op_array, start_op,
@@ -550,6 +557,8 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
/* generate a FAST_CALL to hole CALL_FROM_FINALLY */
opline = get_next_op(op_array TSRMLS_CC);
opline->opcode = ZEND_FAST_CALL;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = fast_call_var;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
zend_resolve_fast_call(op_array, start_op + 1, op_array->try_catch_array[i].finally_op - 2 TSRMLS_CC);
@@ -569,6 +578,8 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
opline = get_next_op(op_array TSRMLS_CC);
opline->opcode = ZEND_FAST_CALL;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = fast_call_var;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
@@ -708,20 +719,20 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
if (opline->op1_type == IS_CONST) {
opline->op1.zv = &op_array->literals[opline->op1.constant];
} else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
- opline->op1.var = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->op1.var);
+ opline->op1.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op1.var);
}
if (opline->op2_type == IS_CONST) {
opline->op2.zv = &op_array->literals[opline->op2.constant];
} else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) {
- opline->op2.var = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->op2.var);
+ opline->op2.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op2.var);
}
if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
- opline->result.var = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->result.var);
+ opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->result.var);
}
switch (opline->opcode) {
case ZEND_DECLARE_INHERITED_CLASS:
case ZEND_DECLARE_INHERITED_CLASS_DELAYED:
- opline->extended_value = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->extended_value);
+ opline->extended_value = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->extended_value);
break;
case ZEND_GOTO:
if (Z_TYPE_P(opline->op2.zv) != IS_LONG) {
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index a6dac42b5a..73a4f3b962 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -394,6 +394,13 @@ char *alloca();
#define ZEND_SECURE_ZERO(var, size) memset((var), 0, (size))
#endif
+/* This check should only be used on network socket, not file descriptors */
+#ifdef ZEND_WIN32
+#define ZEND_VALID_SOCKET(sock) (INVALID_SOCKET != (sock))
+#else
+#define ZEND_VALID_SOCKET(sock) ((sock) >= 0)
+#endif
+
#endif /* ZEND_PORTABILITY_H */
/*
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 383f77caa4..c444bd41fb 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -112,7 +112,7 @@ struct _zval_struct {
zend_uchar type, /* active type */
zend_uchar type_flags,
zend_uchar const_flags,
- zend_uchar reserved) /* various IS_VAR flags */
+ zend_uchar reserved) /* call info for EX(This) */
} v;
uint32_t type_info;
} u1;
@@ -121,6 +121,7 @@ struct _zval_struct {
uint32_t next; /* hash collision chain */
uint32_t cache_slot; /* literal cache slot */
uint32_t lineno; /* line number (for ast nodes) */
+ uint32_t num_args; /* arguments number for EX(This) */
} u2;
};
@@ -145,9 +146,9 @@ struct _zend_string {
};
typedef struct _Bucket {
+ zval val;
zend_ulong h; /* hash value (or numeric index) */
zend_string *key; /* string key or NULL for numerics */
- zval val;
} Bucket;
typedef struct _HashTable {
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index aae8465791..548d191cfd 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -45,7 +45,7 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
/* break possible cycles */
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
- zend_hash_destroy(&arr->ht);
+ zend_array_destroy(&arr->ht TSRMLS_CC);
efree_size(arr, sizeof(zend_array));
}
break;
@@ -77,7 +77,9 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
if (--GC_REFCOUNT(ref) == 0) {
- zval_ptr_dtor(&ref->val);
+ TSRMLS_FETCH();
+
+ i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
efree_size(ref, sizeof(zend_reference));
}
break;
@@ -105,7 +107,7 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
/* break possible cycles */
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
- zend_hash_destroy(&arr->ht);
+ zend_array_destroy(&arr->ht TSRMLS_CC);
efree_size(arr, sizeof(zend_array));
}
break;
@@ -134,8 +136,9 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
+ TSRMLS_FETCH();
- zval_ptr_dtor(&ref->val);
+ i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
efree_size(ref, sizeof(zend_reference));
break;
}
@@ -293,7 +296,9 @@ ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue)
ZEND_API void _zval_ptr_dtor_wrapper(zval *zval_ptr)
{
- zval_ptr_dtor(zval_ptr);
+ TSRMLS_FETCH();
+
+ i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_CC TSRMLS_CC);
}
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index 4f840bdd8a..ea0434dc0b 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -22,6 +22,8 @@
#ifndef ZEND_VARIABLES_H
#define ZEND_VARIABLES_H
+#include "zend_types.h"
+#include "zend_gc.h"
BEGIN_EXTERN_C()
@@ -43,6 +45,17 @@ static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE
}
}
+static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
+{
+ if (Z_REFCOUNTED_P(zval_ptr)) {
+ if (!Z_DELREF_P(zval_ptr)) {
+ _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
+ } else {
+ GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr);
+ }
+ }
+}
+
ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC);
#define zval_copy_ctor_func(zv) _zval_copy_ctor_func(zv ZEND_FILE_LINE_CC)
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 385df393bf..509b33e369 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -347,7 +347,7 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
/* File is a reparse point. Get the target */
HANDLE hLink = NULL;
REPARSE_DATA_BUFFER * pbuffer;
- unsigned int retlength = 0;
+ DWORD retlength = 0;
hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
if(hLink == INVALID_HANDLE_VALUE) {
@@ -898,7 +898,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
/* File is a reparse point. Get the target */
HANDLE hLink = NULL;
REPARSE_DATA_BUFFER * pbuffer;
- unsigned int retlength = 0;
+ DWORD retlength = 0;
int bufindex = 0, isabsolute = 0;
wchar_t * reparsetarget;
BOOL isVolume = FALSE;
@@ -1540,55 +1540,6 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
/* }}} */
#if HAVE_UTIME
-#ifdef TSRM_WIN32
-static void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
-{
- // Note that LONGLONG is a 64-bit value
- LONGLONG ll;
-
- ll = Int32x32To64(t, 10000000) + 116444736000000000;
- pft->dwLowDateTime = (DWORD)ll;
- pft->dwHighDateTime = ll >> 32;
-}
-/* }}} */
-
-TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
-{
- FILETIME mtime, atime;
- HANDLE hFile;
-
- hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
- OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-
- /* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
- the CreateFile operation succeeds */
- if (GetLastError() == ERROR_ALREADY_EXISTS) {
- SetLastError(0);
- }
-
- if ( hFile == INVALID_HANDLE_VALUE ) {
- return -1;
- }
-
- if (!buf) {
- SYSTEMTIME st;
- GetSystemTime(&st);
- SystemTimeToFileTime(&st, &mtime);
- atime = mtime;
- } else {
- UnixTimeToFileTime(buf->modtime, &mtime);
- UnixTimeToFileTime(buf->actime, &atime);
- }
- if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
- CloseHandle(hFile);
- return -1;
- }
- CloseHandle(hFile);
- return 1;
-}
-/* }}} */
-#endif
-
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /* {{{ */
{
cwd_state new_state;
diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h
index 078be15b74..e403e7cc92 100644
--- a/Zend/zend_vm.h
+++ b/Zend/zend_vm.h
@@ -21,9 +21,13 @@
#ifndef ZEND_VM_H
#define ZEND_VM_H
+BEGIN_EXTERN_C()
+
ZEND_API void zend_vm_use_old_executor(void);
ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode);
+END_EXTERN_C()
+
#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline)
#endif
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index b6d2b82cde..b64eb6b3cb 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -385,7 +385,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -711,7 +711,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -798,7 +798,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -1199,7 +1199,7 @@ ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R), OP2_TYPE TSRMLS_CC);
FREE_OP2();
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP1_VAR_PTR();
@@ -1222,7 +1222,7 @@ ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
ZVAL_DEREF(container);
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R), OP2_TYPE TSRMLS_CC);
FREE_OP2();
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP1_VAR_PTR();
@@ -1263,7 +1263,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNU
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R), OP2_TYPE TSRMLS_CC);
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP2();
@@ -1296,7 +1296,7 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV)
ZVAL_DEREF(container);
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R), OP2_TYPE TSRMLS_CC);
FREE_OP2();
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP1_VAR_PTR();
@@ -1326,7 +1326,7 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
/* here we are sure we are dealing with an object */
do {
if (OP2_TYPE == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -1376,7 +1376,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
FREE_OP2();
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP1_VAR_PTR();
@@ -1400,7 +1400,7 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
FREE_OP2();
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP1_VAR_PTR();
@@ -1415,8 +1415,6 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_DEREF(BP_VAR_IS);
@@ -1431,7 +1429,7 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV
/* here we are sure we are dealing with an object */
do {
if (OP2_TYPE == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -1486,7 +1484,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
FREE_OP2();
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP1_VAR_PTR();
@@ -1512,7 +1510,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
FREE_OP2();
- if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
FREE_OP1_VAR_PTR();
@@ -1738,9 +1736,9 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
{
- vm_frame_kind frame_kind = VM_FRAME_KIND(EX(frame_info));
+ zend_call_kind call_kind = EX_CALL_KIND();
- if (frame_kind == VM_FRAME_NESTED_FUNCTION) {
+ if (call_kind == ZEND_CALL_NESTED_FUNCTION) {
zend_object *object;
i_free_compiled_variables(execute_data TSRMLS_CC);
@@ -1768,7 +1766,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
}
OBJ_RELEASE(object);
}
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
if (UNEXPECTED(EG(exception) != NULL)) {
const zend_op *opline = EX(opline);
@@ -1782,7 +1780,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
LOAD_OPLINE();
ZEND_VM_INC_OPCODE();
ZEND_VM_LEAVE();
- } else if (frame_kind == VM_FRAME_NESTED_CODE) {
+ } else if (call_kind == ZEND_CALL_NESTED_CODE) {
zend_detach_symbol_table(execute_data);
destroy_op_array(&EX(func)->op_array TSRMLS_CC);
efree_size(EX(func), sizeof(zend_op_array));
@@ -1800,7 +1798,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
ZEND_VM_INC_OPCODE();
ZEND_VM_LEAVE();
} else {
- if (frame_kind == VM_FRAME_TOP_FUNCTION) {
+ if (call_kind == ZEND_CALL_TOP_FUNCTION) {
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);
@@ -1810,7 +1808,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
if ((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) && EX(func)->op_array.prototype) {
OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
}
- } else /* if (frame_kind == VM_FRAME_TOP_CODE) */ {
+ } else /* if (call_kind == ZEND_CALL_TOP_CODE) */ {
zend_array *symbol_table = EX(symbol_table);
zend_execute_data *old_execute_data;
@@ -2070,7 +2068,9 @@ ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP|UNUSED, TMP|VAR|CV)
}
if (Z_TYPE_P(var) != IS_STRING) {
- ZVAL_DEREF(var);
+ if (OP2_TYPE != IS_TMP_VAR) {
+ ZVAL_DEREF(var);
+ }
if (Z_TYPE_P(var) != IS_STRING) {
use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
@@ -2082,7 +2082,7 @@ ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP|UNUSED, TMP|VAR|CV)
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -2235,7 +2235,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
FREE_OP2();
@@ -2358,7 +2358,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (OP2_TYPE == IS_UNUSED) {
@@ -2387,7 +2387,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
/*CHECK_EXCEPTION();*/
@@ -2397,12 +2397,10 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
zend_free_op free_op2;
zend_class_entry *called_scope;
zend_object *object;
- zval *function_name_ptr;
SAVE_OPLINE();
- function_name_ptr = function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
+ function_name = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R);
- ZVAL_DEREF(function_name);
if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
if (Z_STRVAL_P(function_name)[0] == '\\') {
lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
@@ -2427,10 +2425,9 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
if (object) {
GC_REFCOUNT(object)++;
}
- if (OP2_TYPE == IS_VAR && OP2_FREE && Z_REFCOUNT_P(function_name) == 1 &&
- fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
+ if (OP2_TYPE == IS_VAR && (fbc->common.fn_flags & ZEND_ACC_CLOSURE)) {
/* Delay closure destruction until its invocation */
- fbc->common.prototype = (zend_function*)Z_OBJ_P(function_name_ptr);
+ fbc->common.prototype = (zend_function*)Z_OBJ_P(free_op2);
} else if (OP2_TYPE == IS_CV) {
FREE_OP2();
}
@@ -2507,7 +2504,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
zend_error_noreturn(E_ERROR, "Function name must be a string");
ZEND_VM_CONTINUE(); /* Never reached */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -2561,7 +2558,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMP|VAR|CV)
object = NULL;
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
FREE_OP2();
@@ -2593,7 +2590,7 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2617,7 +2614,7 @@ ZEND_VM_HANDLER(61, ZEND_INIT_FCALL, ANY, CONST)
CACHE_PTR(Z_CACHE_SLOT_P(fname), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
FREE_OP2();
@@ -2676,8 +2673,8 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
uint32_t i;
zval *p = ZEND_CALL_ARG(call, 1);
- for (i = 0; i < call->num_args; ++i) {
- zend_verify_arg_type(fbc, i + 1, p TSRMLS_CC);
+ for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
+ zend_verify_arg_type(fbc, i + 1, p, NULL TSRMLS_CC);
p++;
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -2719,7 +2716,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
ZEND_VM_C_GOTO(fcall_end);
}
} else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
- call->scope = EG(scope) = fbc->common.scope;
+ EG(scope) = fbc->common.scope;
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);
@@ -2745,9 +2742,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
- call->frame_info = VM_FRAME_INFO(
- VM_FRAME_TOP_FUNCTION,
- VM_FRAME_FLAGS(call->frame_info));
+ ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
zend_execute_ex(call TSRMLS_CC);
}
}
@@ -2796,7 +2791,7 @@ ZEND_VM_C_LABEL(fcall_end_change_scope):
}
OBJ_RELEASE(object);
}
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
ZEND_VM_C_LABEL(fcall_end):
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -2982,9 +2977,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
}
exception = EG(exception);
- if (Z_REFCOUNTED_P(EX_VAR(opline->op2.var))) {
- zval_ptr_dtor(EX_VAR(opline->op2.var));
- }
+ zval_ptr_dtor(EX_VAR(opline->op2.var));
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
if (UNEXPECTED(EG(exception) != exception)) {
GC_REFCOUNT(EG(exception))++;
@@ -3004,7 +2997,7 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY)
SAVE_OPLINE();
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
ZVAL_COPY_VALUE(arg, value);
if (OP1_TYPE == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -3026,7 +3019,7 @@ ZEND_VM_HANDLER(116, ZEND_SEND_VAL_EX, CONST|TMP, ANY)
}
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
ZVAL_COPY_VALUE(arg, value);
if (OP1_TYPE == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -3044,7 +3037,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;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
FREE_OP1();
@@ -3064,11 +3057,8 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
zval *varptr, *arg;
SAVE_OPLINE();
- if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
- if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
- ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_VAR);
- }
- } else {
+
+ if (!(opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_VAR);
}
@@ -3083,20 +3073,18 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
if (OP1_TYPE == IS_CV) {
Z_ADDREF_P(varptr);
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
- ZVAL_COPY_VALUE(arg, varptr);
} else {
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
- ZVAL_COPY(arg, varptr);
- FREE_OP1_IF_VAR();
}
+
+ arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ ZVAL_COPY_VALUE(arg, varptr);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -3115,7 +3103,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
}
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
if (OP1_TYPE == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
ZEND_VM_NEXT_OPCODE();
@@ -3126,12 +3114,11 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
ZVAL_COPY_VALUE(arg, varptr);
} else if (OP1_TYPE == IS_VAR &&
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) {
- ZVAL_COPY_VALUE(arg, varptr);
- ZVAL_MAKE_REF(arg);
+ ZVAL_NEW_REF(arg, varptr);
} else {
- ZVAL_MAKE_REF(varptr);
- Z_ADDREF_P(varptr);
- ZVAL_REF(arg, Z_REF_P(varptr));
+ ZVAL_NEW_REF(arg, varptr);
+ Z_ADDREF_P(arg);
+ ZVAL_REF(varptr, Z_REF_P(arg));
}
FREE_OP1_VAR_PTR();
@@ -3149,7 +3136,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;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
FREE_OP1();
@@ -3171,7 +3158,7 @@ ZEND_VM_HANDLER(165, ZEND_SEND_UNPACK, ANY, ANY)
SAVE_OPLINE();
args = GET_OP1_ZVAL_PTR(BP_VAR_R);
- arg_num = EX(call)->num_args + 1;
+ arg_num = ZEND_CALL_NUM_ARGS(EX(call)) + 1;
ZEND_VM_C_LABEL(send_again):
switch (Z_TYPE_P(args)) {
@@ -3222,7 +3209,7 @@ ZEND_VM_C_LABEL(send_again):
ZVAL_COPY(top, arg);
}
- EX(call)->num_args++;
+ ZEND_CALL_NUM_ARGS(EX(call))++;
arg_num++;
} ZEND_HASH_FOREACH_END();
@@ -3277,7 +3264,7 @@ ZEND_VM_C_LABEL(send_again):
if (Z_TYPE(key) == IS_STRING) {
zend_error(E_RECOVERABLE_ERROR,
"Cannot unpack Traversable with string keys");
- zval_dtor(&key);
+ zend_string_release(Z_STR(key));
ZEND_VM_C_GOTO(unpack_iter_dtor);
}
@@ -3303,7 +3290,7 @@ ZEND_VM_C_LABEL(send_again):
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1 TSRMLS_CC);
top = ZEND_CALL_ARG(EX(call), arg_num);
ZVAL_COPY_VALUE(top, arg);
- EX(call)->num_args++;
+ ZEND_CALL_NUM_ARGS(EX(call))++;
iter->funcs->move_forward(iter TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -3435,7 +3422,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
} else {
ZVAL_COPY(param, arg);
}
- EX(call)->num_args++;
+ ZEND_CALL_NUM_ARGS(EX(call))++;
arg_num++;
param++;
} ZEND_HASH_FOREACH_END();
@@ -3517,7 +3504,7 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
ZVAL_COPY(param, arg);
}
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
FREE_OP1();
CHECK_EXCEPTION();
@@ -3530,13 +3517,13 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
uint32_t arg_num = opline->op1.num;
SAVE_OPLINE();
- if (UNEXPECTED(arg_num > EX(num_args))) {
+ if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
zend_verify_missing_arg(execute_data, arg_num TSRMLS_CC);
CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
CHECK_EXCEPTION();
}
@@ -3551,7 +3538,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
SAVE_OPLINE();
param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
- if (arg_num > EX(num_args)) {
+ if (arg_num > EX_NUM_ARGS()) {
ZVAL_COPY_VALUE(param, opline->op2.zv);
if (Z_OPT_CONSTANT_P(param)) {
zval_update_constant(param, 0 TSRMLS_CC);
@@ -3564,7 +3551,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, opline->op2.zv TSRMLS_CC);
}
CHECK_EXCEPTION();
@@ -3575,7 +3562,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
{
USE_OPLINE
uint32_t arg_num = opline->op1.num;
- uint32_t arg_count = EX(num_args);
+ uint32_t arg_count = EX_NUM_ARGS();
zval *params;
SAVE_OPLINE();
@@ -3589,7 +3576,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
do {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
zend_hash_next_index_insert_new(Z_ARRVAL_P(params), param);
if (Z_REFCOUNTED_P(param)) Z_ADDREF_P(param);
param++;
@@ -3720,16 +3707,14 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), &object_zval);
} else {
- zval_ptr_dtor(&object_zval);
+ OBJ_RELEASE(Z_OBJ(object_zval));
}
ZEND_VM_JMP(opline->op2.jmp_addr);
} else {
/* We are not handling overloaded classes right now */
EX(call) = zend_vm_stack_push_call_frame(
- VM_FRAME_INFO(
- VM_FRAME_NESTED_FUNCTION,
- RETURN_VALUE_USED(opline) ?
- ZEND_CALL_CTOR : (ZEND_CALL_CTOR | ZEND_CALL_CTOR_RESULT_UNUSED)),
+ ZEND_CALL_FUNCTION | ZEND_CALL_CTOR |
+ (RETURN_VALUE_USED(opline) ? 0 : ZEND_CALL_CTOR_RESULT_UNUSED),
constructor,
opline->extended_value,
ce,
@@ -3783,14 +3768,14 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- if (UNEXPECTED(ce != EX(scope))) {
- zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(ce != EG(scope))) {
+ zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
- if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EX(scope)))) {
- zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
+ zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
}
}
@@ -3798,7 +3783,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
FREE_OP1_IF_VAR();
@@ -3884,7 +3869,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
zval_update_constant(value, 1 TSRMLS_CC);
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
}
if (OP1_TYPE == IS_CONST) {
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), value);
@@ -4205,7 +4190,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -4218,7 +4203,9 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
return_value = EX_VAR(opline->result.var);
}
- call = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_CODE,
+ new_op_array->scope = EG(scope); /* ??? */
+
+ call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
(zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
if (EX(symbol_table)) {
@@ -4232,7 +4219,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
- call->frame_info = VM_FRAME_TOP_CODE;
+ ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
zend_execute_ex(call TSRMLS_CC);
}
@@ -4296,8 +4283,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) {
- zval_dtor(&tmp);
+ if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
FREE_OP1();
HANDLE_EXCEPTION();
@@ -4316,8 +4303,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) {
- zval_dtor(&tmp);
+ if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
FREE_OP1();
CHECK_EXCEPTION();
@@ -4339,8 +4326,8 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
if (OP1_TYPE != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
+ SEPARATE_ZVAL_NOREF(container);
offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -4423,7 +4410,9 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
- ZVAL_DEREF(container);
+ if (OP1_TYPE != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (OP1_TYPE == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -4900,6 +4889,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
zend_free_op free_op1;
zval tmp, *varname = GET_OP1_ZVAL_PTR(BP_VAR_IS);
+ ZVAL_UNDEF(&tmp);
if (OP1_TYPE != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -4928,8 +4918,8 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (OP1_TYPE != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
FREE_OP1();
@@ -5028,7 +5018,7 @@ ZEND_VM_C_LABEL(num_index_prop):
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) {
+ if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -5122,10 +5112,6 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
SAVE_OPLINE();
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
- if (EX(silence_op_num) == -1) {
- EX(silence_op_num) = opline->op2.num;
- EX(old_error_reporting) = EG(error_reporting);
- }
if (EG(error_reporting)) {
do {
@@ -5163,9 +5149,6 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
}
- if (EX(silence_op_num) == opline->op2.num) {
- EX(silence_op_num) = -1;
- }
ZEND_VM_NEXT_OPCODE();
}
@@ -5485,6 +5468,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
if (op_num < EX(func)->op_array.try_catch_array[i].finally_op) {
finally_op_num = EX(func)->op_array.try_catch_array[i].finally_op;
+ finally_op_end = EX(func)->op_array.try_catch_array[i].finally_end;
}
if (op_num >= EX(func)->op_array.try_catch_array[i].finally_op &&
op_num < EX(func)->op_array.try_catch_array[i].finally_end) {
@@ -5500,8 +5484,8 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
zend_vm_stack_free_args(EX(call) TSRMLS_CC);
if (Z_OBJ(call->This)) {
- if (call->frame_info & ZEND_CALL_CTOR) {
- if (!(call->frame_info & ZEND_CALL_CTOR_RESULT_UNUSED)) {
+ if (ZEND_CALL_INFO(call) & ZEND_CALL_CTOR) {
+ if (!(ZEND_CALL_INFO(call) & ZEND_CALL_CTOR_RESULT_UNUSED)) {
GC_REFCOUNT(Z_OBJ(call->This))--;
}
if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) {
@@ -5531,40 +5515,47 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var));
}
+ } else if (brk_opline->opcode == ZEND_END_SILENCE) {
+ /* restore previous error_reporting value */
+ if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(brk_opline->op1.var)) != 0) {
+ EG(error_reporting) = Z_LVAL_P(EX_VAR(brk_opline->op1.var));
+ }
}
}
}
}
- /* restore previous error_reporting value */
- if (!EG(error_reporting) && EX(silence_op_num) != -1 && EX(old_error_reporting) != 0) {
- EG(error_reporting) = EX(old_error_reporting);
- }
- EX(silence_op_num) = -1;
-
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
- if (EX(delayed_exception)) {
- zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
+
+ if (Z_OBJ_P(fast_call)) {
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
}
- EX(delayed_exception) = EG(exception);
+ Z_OBJ_P(fast_call) = EG(exception);
EG(exception) = NULL;
- EX(fast_ret) = NULL;
+ fast_call->u2.lineno = (uint32_t)-1;
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else if (catch_op_num) {
if (finally_op_end && catch_op_num > finally_op_end) {
/* we are going out of current finally scope */
- if (EX(delayed_exception)) {
- zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
- EX(delayed_exception) = NULL;
+ zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
+
+ if (Z_OBJ_P(fast_call)) {
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ Z_OBJ_P(fast_call) = NULL;
}
}
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[catch_op_num]);
ZEND_VM_CONTINUE();
} else {
- if (EX(delayed_exception)) {
- zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
- EX(delayed_exception) = NULL;
+ if (finally_op_end) {
+ zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
+
+ if (Z_OBJ_P(fast_call)) {
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ Z_OBJ_P(fast_call) = NULL;
+ }
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_GENERATOR_RETURN);
@@ -5665,7 +5656,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(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
+ zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
}
CHECK_EXCEPTION();
@@ -5824,10 +5815,14 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, ANY)
{
- if (EX(delayed_exception) != NULL) {
+ USE_OPLINE
+ zval *fast_call = EX_VAR(opline->op1.var);
+
+ /* check for delayed exception */
+ if (Z_OBJ_P(fast_call) != NULL) {
/* discard the previously thrown exception */
- OBJ_RELEASE(EX(delayed_exception));
- EX(delayed_exception) = NULL;
+ OBJ_RELEASE(Z_OBJ_P(fast_call));
+ Z_OBJ_P(fast_call) = NULL;
}
ZEND_VM_NEXT_OPCODE();
@@ -5836,6 +5831,7 @@ ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, ANY)
ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
{
USE_OPLINE
+ zval *fast_call = EX_VAR(opline->result.var);
if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
UNEXPECTED(EG(prev_exception) != NULL)) {
@@ -5843,18 +5839,24 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
}
- EX(fast_ret) = opline;
- EX(delayed_exception) = NULL;
+ /* set no delayed exception */
+ Z_OBJ_P(fast_call) = NULL;
+ /* set return address */
+ fast_call->u2.lineno = opline - EX(func)->op_array.opcodes;
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
{
- if (EX(fast_ret)) {
- ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
- if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
- EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
+ USE_OPLINE
+ zval *fast_call = EX_VAR(opline->op1.var);
+
+ if (fast_call->u2.lineno != (uint32_t)-1) {
+ const zend_op *fast_ret = EX(func)->op_array.opcodes + fast_call->u2.lineno;
+ ZEND_VM_SET_OPCODE(fast_ret + 1);
+ if (fast_ret->extended_value & ZEND_FAST_CALL_FROM_FINALLY) {
+ fast_call->u2.lineno = fast_ret->op2.opline_num;
}
ZEND_VM_CONTINUE();
} else {
@@ -5865,8 +5867,8 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else {
- EG(exception) = EX(delayed_exception);
- EX(delayed_exception) = NULL;
+ EG(exception) = Z_OBJ_P(fast_call);
+ Z_OBJ_P(fast_call) = NULL;
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
@@ -5906,23 +5908,39 @@ ZEND_VM_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST)
zval *varname;
zval *value;
zval *variable_ptr;
- Bucket *p;
uint32_t idx;
SAVE_OPLINE();
varname = GET_OP2_ZVAL_PTR(BP_VAR_R);
- 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;
+
+ /* We store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname)) - 1;
+ if (EXPECTED(idx < EG(symbol_table).ht.nNumUsed)) {
+ Bucket *p = EG(symbol_table).ht.arData + idx;
+
+ if (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;
+ ZEND_VM_C_GOTO(check_indirect);
+ }
+ }
+
+ 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);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+ } else {
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+ZEND_VM_C_LABEL(check_indirect):
/* GLOBAL variable may be an INDIRECT pointer to CV */
if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
value = Z_INDIRECT_P(value);
@@ -5930,23 +5948,6 @@ ZEND_VM_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST)
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);
- }
- }
- }
}
variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 8257789cd2..f42d1fa69d 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -369,7 +369,7 @@ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC
return;
}
- execute_data = zend_vm_stack_push_call_frame(VM_FRAME_TOP_CODE,
+ execute_data = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_CODE,
(zend_function*)op_array, 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);
@@ -383,9 +383,9 @@ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC
static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
{
- vm_frame_kind frame_kind = VM_FRAME_KIND(EX(frame_info));
+ zend_call_kind call_kind = EX_CALL_KIND();
- if (frame_kind == VM_FRAME_NESTED_FUNCTION) {
+ if (call_kind == ZEND_CALL_NESTED_FUNCTION) {
zend_object *object;
i_free_compiled_variables(execute_data TSRMLS_CC);
@@ -413,7 +413,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
}
OBJ_RELEASE(object);
}
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
if (UNEXPECTED(EG(exception) != NULL)) {
const zend_op *opline = EX(opline);
@@ -427,7 +427,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
LOAD_OPLINE();
ZEND_VM_INC_OPCODE();
ZEND_VM_LEAVE();
- } else if (frame_kind == VM_FRAME_NESTED_CODE) {
+ } else if (call_kind == ZEND_CALL_NESTED_CODE) {
zend_detach_symbol_table(execute_data);
destroy_op_array(&EX(func)->op_array TSRMLS_CC);
efree_size(EX(func), sizeof(zend_op_array));
@@ -445,7 +445,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_INC_OPCODE();
ZEND_VM_LEAVE();
} else {
- if (frame_kind == VM_FRAME_TOP_FUNCTION) {
+ if (call_kind == ZEND_CALL_TOP_FUNCTION) {
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);
@@ -455,7 +455,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
if ((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) && EX(func)->op_array.prototype) {
OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
}
- } else /* if (frame_kind == VM_FRAME_TOP_CODE) */ {
+ } else /* if (call_kind == ZEND_CALL_TOP_CODE) */ {
zend_array *symbol_table = EX(symbol_table);
zend_execute_data *old_execute_data;
@@ -537,8 +537,8 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
uint32_t i;
zval *p = ZEND_CALL_ARG(call, 1);
- for (i = 0; i < call->num_args; ++i) {
- zend_verify_arg_type(fbc, i + 1, p TSRMLS_CC);
+ for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
+ zend_verify_arg_type(fbc, i + 1, p, NULL TSRMLS_CC);
p++;
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -580,7 +580,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
goto fcall_end;
}
} else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
- call->scope = EG(scope) = fbc->common.scope;
+ EG(scope) = fbc->common.scope;
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);
@@ -606,9 +606,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
- call->frame_info = VM_FRAME_INFO(
- VM_FRAME_TOP_FUNCTION,
- VM_FRAME_FLAGS(call->frame_info));
+ ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
zend_execute_ex(call TSRMLS_CC);
}
}
@@ -657,7 +655,7 @@ fcall_end_change_scope:
}
OBJ_RELEASE(object);
}
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
fcall_end:
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -692,7 +690,7 @@ static int ZEND_FASTCALL ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
args = get_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, BP_VAR_R);
- arg_num = EX(call)->num_args + 1;
+ arg_num = ZEND_CALL_NUM_ARGS(EX(call)) + 1;
send_again:
switch (Z_TYPE_P(args)) {
@@ -743,7 +741,7 @@ send_again:
ZVAL_COPY(top, arg);
}
- EX(call)->num_args++;
+ ZEND_CALL_NUM_ARGS(EX(call))++;
arg_num++;
} ZEND_HASH_FOREACH_END();
@@ -798,7 +796,7 @@ send_again:
if (Z_TYPE(key) == IS_STRING) {
zend_error(E_RECOVERABLE_ERROR,
"Cannot unpack Traversable with string keys");
- zval_dtor(&key);
+ zend_string_release(Z_STR(key));
goto unpack_iter_dtor;
}
@@ -824,7 +822,7 @@ send_again:
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1 TSRMLS_CC);
top = ZEND_CALL_ARG(EX(call), arg_num);
ZVAL_COPY_VALUE(top, arg);
- EX(call)->num_args++;
+ ZEND_CALL_NUM_ARGS(EX(call))++;
iter->funcs->move_forward(iter TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -956,7 +954,7 @@ static int ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
ZVAL_COPY(param, arg);
}
- EX(call)->num_args++;
+ ZEND_CALL_NUM_ARGS(EX(call))++;
arg_num++;
param++;
} ZEND_HASH_FOREACH_END();
@@ -972,13 +970,13 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
uint32_t arg_num = opline->op1.num;
SAVE_OPLINE();
- if (UNEXPECTED(arg_num > EX(num_args))) {
+ if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
zend_verify_missing_arg(execute_data, arg_num TSRMLS_CC);
CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
CHECK_EXCEPTION();
}
@@ -989,7 +987,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
{
USE_OPLINE
uint32_t arg_num = opline->op1.num;
- uint32_t arg_count = EX(num_args);
+ uint32_t arg_count = EX_NUM_ARGS();
zval *params;
SAVE_OPLINE();
@@ -1003,7 +1001,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
do {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
zend_hash_next_index_insert_new(Z_ARRVAL_P(params), param);
if (Z_REFCOUNTED_P(param)) Z_ADDREF_P(param);
param++;
@@ -1029,10 +1027,6 @@ static int ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
- if (EX(silence_op_num) == -1) {
- EX(silence_op_num) = opline->op2.num;
- EX(old_error_reporting) = EG(error_reporting);
- }
if (EG(error_reporting)) {
do {
@@ -1218,6 +1212,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
}
if (op_num < EX(func)->op_array.try_catch_array[i].finally_op) {
finally_op_num = EX(func)->op_array.try_catch_array[i].finally_op;
+ finally_op_end = EX(func)->op_array.try_catch_array[i].finally_end;
}
if (op_num >= EX(func)->op_array.try_catch_array[i].finally_op &&
op_num < EX(func)->op_array.try_catch_array[i].finally_end) {
@@ -1233,8 +1228,8 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
zend_vm_stack_free_args(EX(call) TSRMLS_CC);
if (Z_OBJ(call->This)) {
- if (call->frame_info & ZEND_CALL_CTOR) {
- if (!(call->frame_info & ZEND_CALL_CTOR_RESULT_UNUSED)) {
+ if (ZEND_CALL_INFO(call) & ZEND_CALL_CTOR) {
+ if (!(ZEND_CALL_INFO(call) & ZEND_CALL_CTOR_RESULT_UNUSED)) {
GC_REFCOUNT(Z_OBJ(call->This))--;
}
if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) {
@@ -1264,40 +1259,47 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var));
}
+ } else if (brk_opline->opcode == ZEND_END_SILENCE) {
+ /* restore previous error_reporting value */
+ if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(brk_opline->op1.var)) != 0) {
+ EG(error_reporting) = Z_LVAL_P(EX_VAR(brk_opline->op1.var));
+ }
}
}
}
}
- /* restore previous error_reporting value */
- if (!EG(error_reporting) && EX(silence_op_num) != -1 && EX(old_error_reporting) != 0) {
- EG(error_reporting) = EX(old_error_reporting);
- }
- EX(silence_op_num) = -1;
-
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
- if (EX(delayed_exception)) {
- zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
+
+ if (Z_OBJ_P(fast_call)) {
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
}
- EX(delayed_exception) = EG(exception);
+ Z_OBJ_P(fast_call) = EG(exception);
EG(exception) = NULL;
- EX(fast_ret) = NULL;
+ fast_call->u2.lineno = (uint32_t)-1;
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else if (catch_op_num) {
if (finally_op_end && catch_op_num > finally_op_end) {
/* we are going out of current finally scope */
- if (EX(delayed_exception)) {
- zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
- EX(delayed_exception) = NULL;
+ zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
+
+ if (Z_OBJ_P(fast_call)) {
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ Z_OBJ_P(fast_call) = NULL;
}
}
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[catch_op_num]);
ZEND_VM_CONTINUE();
} else {
- if (EX(delayed_exception)) {
- zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
- EX(delayed_exception) = NULL;
+ if (finally_op_end) {
+ zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
+
+ if (Z_OBJ_P(fast_call)) {
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ Z_OBJ_P(fast_call) = NULL;
+ }
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
return ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -1348,10 +1350,14 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS
static int ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- if (EX(delayed_exception) != NULL) {
+ USE_OPLINE
+ zval *fast_call = EX_VAR(opline->op1.var);
+
+ /* check for delayed exception */
+ if (Z_OBJ_P(fast_call) != NULL) {
/* discard the previously thrown exception */
- OBJ_RELEASE(EX(delayed_exception));
- EX(delayed_exception) = NULL;
+ OBJ_RELEASE(Z_OBJ_P(fast_call));
+ Z_OBJ_P(fast_call) = NULL;
}
ZEND_VM_NEXT_OPCODE();
@@ -1360,6 +1366,7 @@ static int ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLE
static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
+ zval *fast_call = EX_VAR(opline->result.var);
if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
UNEXPECTED(EG(prev_exception) != NULL)) {
@@ -1367,18 +1374,24 @@ static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
}
- EX(fast_ret) = opline;
- EX(delayed_exception) = NULL;
+ /* set no delayed exception */
+ Z_OBJ_P(fast_call) = NULL;
+ /* set return address */
+ fast_call->u2.lineno = opline - EX(func)->op_array.opcodes;
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
ZEND_VM_CONTINUE();
}
static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- if (EX(fast_ret)) {
- ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
- if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
- EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
+ USE_OPLINE
+ zval *fast_call = EX_VAR(opline->op1.var);
+
+ if (fast_call->u2.lineno != (uint32_t)-1) {
+ const zend_op *fast_ret = EX(func)->op_array.opcodes + fast_call->u2.lineno;
+ ZEND_VM_SET_OPCODE(fast_ret + 1);
+ if (fast_ret->extended_value & ZEND_FAST_CALL_FROM_FINALLY) {
+ fast_call->u2.lineno = fast_ret->op2.opline_num;
}
ZEND_VM_CONTINUE();
} else {
@@ -1389,8 +1402,8 @@ static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else {
- EG(exception) = EX(delayed_exception);
- EX(delayed_exception) = NULL;
+ EG(exception) = Z_OBJ_P(fast_call);
+ Z_OBJ_P(fast_call) = NULL;
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
@@ -1460,22 +1473,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
} else {
zend_string *lcname;
-
+ zend_free_op free_op2;
zend_class_entry *called_scope;
zend_object *object;
- zval *function_name_ptr;
SAVE_OPLINE();
- function_name_ptr = function_name = opline->op2.zv;
+ function_name = opline->op2.zv;
- ZVAL_DEREF(function_name);
if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
if (Z_STRVAL_P(function_name)[0] == '\\') {
lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
@@ -1499,10 +1510,9 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
if (object) {
GC_REFCOUNT(object)++;
}
- if (IS_CONST == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 &&
- fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
+ if (IS_CONST == IS_VAR && (fbc->common.fn_flags & ZEND_ACC_CLOSURE)) {
/* Delay closure destruction until its invocation */
- fbc->common.prototype = (zend_function*)Z_OBJ_P(function_name_ptr);
+ fbc->common.prototype = (zend_function*)Z_OBJ_P(free_op2);
} else if (IS_CONST == IS_CV) {
}
@@ -1579,7 +1589,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
zend_error_noreturn(E_ERROR, "Function name must be a string");
ZEND_VM_CONTINUE(); /* Never reached */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -1611,7 +1621,7 @@ static int ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPC
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -1635,7 +1645,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER
CACHE_PTR(Z_CACHE_SLOT_P(fname), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -1649,7 +1659,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
- if (arg_num > EX(num_args)) {
+ if (arg_num > EX_NUM_ARGS()) {
ZVAL_COPY_VALUE(param, opline->op2.zv);
if (Z_OPT_CONSTANT_P(param)) {
zval_update_constant(param, 0 TSRMLS_CC);
@@ -1662,7 +1672,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, opline->op2.zv TSRMLS_CC);
}
CHECK_EXCEPTION();
@@ -1752,7 +1762,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op2;
- zval *class_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *class_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR == IS_CONST) {
if (CACHED_PTR(Z_CACHE_SLOT_P(class_name))) {
@@ -1772,7 +1782,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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1796,7 +1806,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
/*CHECK_EXCEPTION();*/
@@ -1806,12 +1816,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
zend_free_op free_op2;
zend_class_entry *called_scope;
zend_object *object;
- zval *function_name_ptr;
SAVE_OPLINE();
- function_name_ptr = function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(function_name);
if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
if (Z_STRVAL_P(function_name)[0] == '\\') {
lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
@@ -1824,7 +1832,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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
fbc = Z_FUNC_P(func);
called_scope = NULL;
@@ -1836,12 +1844,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
if (object) {
GC_REFCOUNT(object)++;
}
- if (IS_TMP_VAR == IS_VAR && 1 && Z_REFCOUNT_P(function_name) == 1 &&
- fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
+ if (IS_TMP_VAR == IS_VAR && (fbc->common.fn_flags & ZEND_ACC_CLOSURE)) {
/* Delay closure destruction until its invocation */
- fbc->common.prototype = (zend_function*)Z_OBJ_P(function_name_ptr);
+ fbc->common.prototype = (zend_function*)Z_OBJ_P(free_op2);
} else if (IS_TMP_VAR == IS_CV) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
@@ -1908,7 +1915,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -1916,7 +1923,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Function name must be a string");
ZEND_VM_CONTINUE(); /* Never reached */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -1938,7 +1945,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op2;
- zval *class_name = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *class_name = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == IS_CONST) {
if (CACHED_PTR(Z_CACHE_SLOT_P(class_name))) {
@@ -1958,7 +1965,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1982,7 +1989,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
/*CHECK_EXCEPTION();*/
@@ -1992,12 +1999,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
zend_free_op free_op2;
zend_class_entry *called_scope;
zend_object *object;
- zval *function_name_ptr;
SAVE_OPLINE();
- function_name_ptr = function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(function_name);
if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
if (Z_STRVAL_P(function_name)[0] == '\\') {
lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
@@ -2010,7 +2015,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(function_name));
}
zend_string_free(lcname);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
fbc = Z_FUNC_P(func);
called_scope = NULL;
@@ -2022,12 +2027,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
if (object) {
GC_REFCOUNT(object)++;
}
- if (IS_VAR == IS_VAR && (free_op2.var != NULL) && Z_REFCOUNT_P(function_name) == 1 &&
- fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
+ if (IS_VAR == IS_VAR && (fbc->common.fn_flags & ZEND_ACC_CLOSURE)) {
/* Delay closure destruction until its invocation */
- fbc->common.prototype = (zend_function*)Z_OBJ_P(function_name_ptr);
+ fbc->common.prototype = (zend_function*)Z_OBJ_P(free_op2);
} else if (IS_VAR == IS_CV) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
@@ -2094,7 +2098,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2102,7 +2106,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Function name must be a string");
ZEND_VM_CONTINUE(); /* Never reached */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -2206,22 +2210,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
} else {
zend_string *lcname;
-
+ zend_free_op free_op2;
zend_class_entry *called_scope;
zend_object *object;
- zval *function_name_ptr;
SAVE_OPLINE();
- function_name_ptr = function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ function_name = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- ZVAL_DEREF(function_name);
if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
if (Z_STRVAL_P(function_name)[0] == '\\') {
lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
@@ -2245,10 +2247,9 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
if (object) {
GC_REFCOUNT(object)++;
}
- if (IS_CV == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 &&
- fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
+ if (IS_CV == IS_VAR && (fbc->common.fn_flags & ZEND_ACC_CLOSURE)) {
/* Delay closure destruction until its invocation */
- fbc->common.prototype = (zend_function*)Z_OBJ_P(function_name_ptr);
+ fbc->common.prototype = (zend_function*)Z_OBJ_P(free_op2);
} else if (IS_CV == IS_CV) {
}
@@ -2325,7 +2326,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
zend_error_noreturn(E_ERROR, "Function name must be a string");
ZEND_VM_CONTINUE(); /* Never reached */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -2673,7 +2674,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
value = opline->op1.zv;
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
ZVAL_COPY_VALUE(arg, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -2695,7 +2696,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
}
value = opline->op1.zv;
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
ZVAL_COPY_VALUE(arg, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -2757,16 +2758,14 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), &object_zval);
} else {
- zval_ptr_dtor(&object_zval);
+ OBJ_RELEASE(Z_OBJ(object_zval));
}
ZEND_VM_JMP(opline->op2.jmp_addr);
} else {
/* We are not handling overloaded classes right now */
EX(call) = zend_vm_stack_push_call_frame(
- VM_FRAME_INFO(
- VM_FRAME_NESTED_FUNCTION,
- RETURN_VALUE_USED(opline) ?
- ZEND_CALL_CTOR : (ZEND_CALL_CTOR | ZEND_CALL_CTOR_RESULT_UNUSED)),
+ ZEND_CALL_FUNCTION | ZEND_CALL_CTOR |
+ (RETURN_VALUE_USED(opline) ? 0 : ZEND_CALL_CTOR_RESULT_UNUSED),
constructor,
opline->extended_value,
ce,
@@ -2820,14 +2819,14 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- if (UNEXPECTED(ce != EX(scope))) {
- zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(ce != EG(scope))) {
+ zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
- if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EX(scope)))) {
- zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
+ zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
}
}
@@ -2835,7 +2834,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -3023,7 +3022,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -3036,7 +3035,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
return_value = EX_VAR(opline->result.var);
}
- call = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_CODE,
+ new_op_array->scope = EG(scope); /* ??? */
+
+ call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
(zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
if (EX(symbol_table)) {
@@ -3050,7 +3051,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
- call->frame_info = VM_FRAME_TOP_CODE;
+ ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
zend_execute_ex(call TSRMLS_CC);
}
@@ -3946,7 +3947,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -3986,7 +3987,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -4025,8 +4026,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = opline->op1.zv;
@@ -4041,7 +4040,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -4095,7 +4094,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -4252,7 +4251,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_CONST == IS_UNUSED) {
@@ -4309,7 +4308,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
object = NULL;
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -4409,7 +4408,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
zval_update_constant(value, 1 TSRMLS_CC);
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
}
if (IS_CONST == IS_CONST) {
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), value);
@@ -4595,8 +4594,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) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -4615,8 +4614,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) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -4647,6 +4646,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
zval tmp, *varname = opline->op1.zv;
+ ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -4675,8 +4675,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -5025,9 +5025,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5040,9 +5040,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5055,9 +5055,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5070,9 +5070,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5085,9 +5085,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5100,9 +5100,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5115,9 +5115,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5130,9 +5130,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5145,9 +5145,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5161,9 +5161,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5177,9 +5177,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5193,9 +5193,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_not_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5209,9 +5209,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_smaller_function(result,
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5225,9 +5225,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_O
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5240,9 +5240,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5255,9 +5255,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5270,9 +5270,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5285,9 +5285,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5300,8 +5300,8 @@ 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_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5315,8 +5315,8 @@ 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_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5339,19 +5339,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMP_HANDLER(ZEND_OP
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (IS_TMP_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
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_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -5368,7 +5368,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -5380,7 +5380,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -5407,7 +5407,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5420,12 +5420,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -5436,7 +5434,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -5463,7 +5461,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5480,7 +5478,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMP_HANDLER(ZEND_OP
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
container = NULL;
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
@@ -5490,8 +5488,8 @@ 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, IS_CONST, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -5541,7 +5539,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
} else if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -5569,7 +5567,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
}
}
if (IS_TMP_VAR != IS_CONST) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
} else {
if (UNEXPECTED(ce->constructor == NULL)) {
@@ -5615,7 +5613,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_TMP_VAR == IS_UNUSED) {
@@ -5630,7 +5628,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE
{
USE_OPLINE
zend_free_op free_op2;
- zval *function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_fcall_info_cache fcc;
char *error = NULL;
zend_function *func;
@@ -5672,10 +5670,10 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE
object = NULL;
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5689,9 +5687,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
fast_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5733,7 +5731,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -5776,7 +5774,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -5826,7 +5824,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMP_HANDLER(ZEND
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -5896,7 +5894,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -5922,7 +5920,7 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -5939,7 +5937,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMP_HANDLER(ZEN
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -5955,7 +5953,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMP_HANDLER(ZEN
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -6045,7 +6043,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_
/* Set the new yielded key */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -6101,9 +6099,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6116,9 +6114,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6131,9 +6129,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6146,9 +6144,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6161,9 +6159,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6176,9 +6174,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6191,9 +6189,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6206,9 +6204,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6221,9 +6219,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6236,9 +6234,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6252,9 +6250,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6268,9 +6266,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6284,9 +6282,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_not_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6300,9 +6298,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_smaller_function(result,
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6316,9 +6314,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_O
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6331,9 +6329,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6346,9 +6344,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6361,9 +6359,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6376,9 +6374,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6539,8 +6537,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_VAR_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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6554,8 +6552,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_VAR_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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6578,19 +6576,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OP
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (IS_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = opline->op1.zv;
- 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);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -6607,7 +6605,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -6619,7 +6617,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HA
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -6646,7 +6644,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HA
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6659,12 +6657,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -6675,7 +6671,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -6702,7 +6698,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6719,7 +6715,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OP
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
container = NULL;
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
@@ -6729,8 +6725,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_VAR_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, IS_CONST, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -6780,7 +6776,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
} else if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -6808,7 +6804,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
}
}
if (IS_VAR != IS_CONST) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
} else {
if (UNEXPECTED(ce->constructor == NULL)) {
@@ -6854,7 +6850,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_VAR == IS_UNUSED) {
@@ -6869,7 +6865,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE
{
USE_OPLINE
zend_free_op free_op2;
- zval *function_name = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *function_name = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
zend_fcall_info_cache fcc;
char *error = NULL;
zend_function *func;
@@ -6911,10 +6907,10 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE
object = NULL;
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6928,9 +6924,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
fast_equal_function(result,
opline->op1.zv,
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6972,7 +6968,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -7015,7 +7011,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -7101,8 +7097,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) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -7121,8 +7117,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) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -7153,6 +7149,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
zval tmp, *varname = opline->op1.zv;
+ ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -7181,8 +7178,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -7210,7 +7207,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_VAR_HANDLER(ZEND
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -7280,7 +7277,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -7306,7 +7303,7 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -7323,7 +7320,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_VAR_HANDLER(ZEN
SAVE_OPLINE();
container = opline->op1.zv;
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -7339,7 +7336,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_VAR_HANDLER(ZEN
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -7429,7 +7426,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
/* Set the new yielded key */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -7438,7 +7435,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
ZVAL_COPY_VALUE(&generator->key, 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);
+ zval_ptr_dtor_nogc(free_op2);
} else {
ZVAL_COPY_VALUE(&generator->key, key);
if (IS_VAR == IS_CV) {
@@ -7485,9 +7482,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
opline->op1.zv,
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -7658,7 +7655,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -7789,7 +7786,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_UNUSED == IS_UNUSED) {
@@ -7966,8 +7963,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) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -7986,8 +7983,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) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -8018,6 +8015,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
zval tmp, *varname = opline->op1.zv;
+ ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -8046,8 +8044,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -8082,7 +8080,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(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
+ zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
}
CHECK_EXCEPTION();
@@ -8543,7 +8541,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(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_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -8583,7 +8581,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -8622,8 +8620,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = opline->op1.zv;
@@ -8638,7 +8634,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -8692,7 +8688,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -8816,7 +8812,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_CV == IS_UNUSED) {
@@ -8873,7 +8869,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_
object = NULL;
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -8920,9 +8916,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
}
exception = EG(exception);
- if (Z_REFCOUNTED_P(EX_VAR(opline->op2.var))) {
- zval_ptr_dtor(EX_VAR(opline->op2.var));
- }
+ zval_ptr_dtor(EX_VAR(opline->op2.var));
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
if (UNEXPECTED(EG(exception) != exception)) {
GC_REFCOUNT(EG(exception))++;
@@ -9148,7 +9142,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -9365,8 +9359,8 @@ 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_ptr_dtor_nogc(free_op1.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -9378,8 +9372,8 @@ 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_ptr_dtor_nogc(free_op1.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -9391,11 +9385,11 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *z;
SAVE_OPLINE();
- z = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ z = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
zend_print_variable(z TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -9415,7 +9409,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -9432,7 +9426,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
opline = opline->op2.jmp_addr;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -9446,7 +9440,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -9463,7 +9457,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
opline++;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -9477,7 +9471,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
if (EXPECTED(Z_TYPE_P(val) == IS_TRUE)) {
@@ -9494,7 +9488,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
opline = opline->op2.jmp_addr;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -9508,7 +9502,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -9523,11 +9517,11 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (i_zend_is_true(val TSRMLS_CC)) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
ZVAL_TRUE(EX_VAR(opline->result.var));
opline++;
} else {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
ZVAL_FALSE(EX_VAR(opline->result.var));
opline = opline->op2.jmp_addr;
}
@@ -9544,7 +9538,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -9564,7 +9558,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_FALSE(EX_VAR(opline->result.var));
opline++;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -9588,10 +9582,10 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
SAVE_OPLINE();
- retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (!EX(return_value)) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} else {
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
@@ -9627,10 +9621,10 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
- retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (!EX(return_value)) {
if (IS_TMP_VAR == IS_TMP_VAR) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
} else {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
@@ -9680,7 +9674,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -9707,9 +9701,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
ZVAL_COPY_VALUE(arg, value);
if (IS_TMP_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -9729,9 +9723,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
ZVAL_COPY_VALUE(arg, value);
if (IS_TMP_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -9749,8 +9743,8 @@ 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_ptr_dtor_nogc(free_op1.var);
+ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1) TSRMLS_CC));
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -9766,7 +9760,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_object_clone_obj_t clone_call;
SAVE_OPLINE();
- obj = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ obj = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_CONST ||
(IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
@@ -9791,14 +9785,14 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- if (UNEXPECTED(ce != EX(scope))) {
- zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(ce != EG(scope))) {
+ zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
- if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EX(scope)))) {
- zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
+ zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
}
}
@@ -9806,7 +9800,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -9822,7 +9816,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *result = EX_VAR(opline->result.var);
SAVE_OPLINE();
- expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
switch (opline->extended_value) {
case IS_NULL:
@@ -9910,7 +9904,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -9925,7 +9919,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
zend_bool failure_retval=0;
SAVE_OPLINE();
- inc_filename = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ inc_filename = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
@@ -9995,9 +9989,9 @@ 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);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
} else if (EXPECTED(new_op_array != NULL)) {
@@ -10008,7 +10002,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
return_value = EX_VAR(opline->result.var);
}
- call = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_CODE,
+ new_op_array->scope = EG(scope); /* ??? */
+
+ call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
(zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
if (EX(symbol_table)) {
@@ -10022,7 +10018,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
- call->frame_info = VM_FRAME_TOP_CODE;
+ ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
zend_execute_ex(call TSRMLS_CC);
}
@@ -10072,7 +10068,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
}
} else {
- array_ptr = array_ref = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ array_ptr = array_ref = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_DEREF(array_ptr);
if (IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&tmp, array_ptr);
@@ -10236,14 +10232,14 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op1;
- zval *ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (Z_TYPE_P(ptr) == IS_LONG) {
EG(exit_status) = Z_LVAL_P(ptr);
} else {
zend_print_variable(ptr TSRMLS_CC);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
#endif
zend_bailout();
@@ -10258,9 +10254,6 @@ static int ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
}
- if (EX(silence_op_num) == opline->op2.num) {
- EX(silence_op_num) = -1;
- }
ZEND_VM_NEXT_OPCODE();
}
@@ -10272,7 +10265,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
int is_ref = 0;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) {
is_ref = 1;
@@ -10288,12 +10281,12 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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);
+ zval_ptr_dtor_nogc(free_op1);
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10306,7 +10299,7 @@ static int ZEND_FASTCALL ZEND_COALESCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
int is_ref = 0;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) {
is_ref = 1;
@@ -10323,12 +10316,12 @@ static int ZEND_FASTCALL ZEND_COALESCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);
+ zval_ptr_dtor_nogc(free_op1);
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10340,11 +10333,11 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_TMP_VAR == IS_CONST) {
@@ -10365,7 +10358,7 @@ static int ZEND_FASTCALL ZEND_STRLEN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value));
} else {
@@ -10393,7 +10386,7 @@ strlen_error:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10405,7 +10398,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op1;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
switch (opline->extended_value) {
case IS_NULL:
case IS_LONG:
@@ -10440,7 +10433,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10452,9 +10445,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10467,9 +10460,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10482,9 +10475,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10497,9 +10490,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10512,9 +10505,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10527,9 +10520,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10542,9 +10535,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10557,9 +10550,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10572,9 +10565,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10588,9 +10581,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10604,9 +10597,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10620,9 +10613,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10636,9 +10629,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10652,9 +10645,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_O
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10667,9 +10660,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10682,9 +10675,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10697,9 +10690,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10712,9 +10705,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10730,7 +10723,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_CONST) {
name = Z_STR_P(varname);
@@ -10753,7 +10746,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10763,7 +10756,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} 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);
@@ -10811,7 +10804,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
}
@@ -10875,10 +10868,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10890,10 +10883,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10916,7 +10909,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -10925,10 +10918,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
if (IS_CONST == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10943,7 +10936,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -10956,7 +10949,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -10983,7 +10976,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10995,11 +10988,9 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -11011,7 +11002,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -11038,7 +11029,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11065,7 +11056,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -11083,7 +11074,7 @@ static int ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -11169,7 +11160,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
@@ -11245,7 +11236,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
@@ -11261,7 +11252,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
CHECK_EXCEPTION();
@@ -11285,7 +11276,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -11417,7 +11408,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -11434,10 +11425,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) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -11454,10 +11445,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) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11484,8 +11475,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -11514,10 +11506,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (opline->extended_value & ZEND_ISSET) {
ZVAL_BOOL(EX_VAR(opline->result.var),
@@ -11543,7 +11535,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP_CONST_HANDLER(ZEND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if (IS_TMP_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -11614,7 +11606,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -11641,7 +11633,7 @@ num_index_prop:
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11655,7 +11647,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_CONST_HANDLER(ZEN
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if (IS_TMP_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -11673,7 +11665,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_CONST_HANDLER(ZEN
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11686,7 +11678,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
zend_bool result;
SAVE_OPLINE();
- expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (Z_TYPE_P(expr) == IS_OBJECT) {
zend_class_entry *ce;
@@ -11698,7 +11690,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11712,7 +11704,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
result = 0;
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11746,7 +11738,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -11775,7 +11767,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
} else {
- zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -11855,9 +11847,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -11870,10 +11862,10 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11885,10 +11877,10 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11900,10 +11892,10 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11915,10 +11907,10 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11930,10 +11922,10 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11945,10 +11937,10 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11960,10 +11952,10 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11975,10 +11967,10 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11990,10 +11982,10 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12006,10 +11998,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12022,10 +12014,10 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12038,10 +12030,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12054,10 +12046,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12070,10 +12062,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPC
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12085,10 +12077,10 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12100,10 +12092,10 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12115,10 +12107,10 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12130,10 +12122,10 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12145,10 +12137,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
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_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12160,10 +12152,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
zval *container;
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_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12185,20 +12177,20 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMP_HANDLER(ZEND_OPCO
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (IS_TMP_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- 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_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -12213,8 +12205,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -12226,7 +12218,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -12253,8 +12245,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12266,12 +12258,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -12282,7 +12272,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -12309,8 +12299,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12326,7 +12316,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMP_HANDLER(ZEND_OPCO
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
container = NULL;
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
@@ -12336,8 +12326,8 @@ 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, IS_TMP_VAR, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -12358,7 +12348,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_
int use_copy = 0;
SAVE_OPLINE();
- var = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ var = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -12366,7 +12356,9 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_
}
if (Z_TYPE_P(var) != IS_STRING) {
- ZVAL_DEREF(var);
+ if (IS_TMP_VAR != IS_TMP_VAR) {
+ ZVAL_DEREF(var);
+ }
if (Z_TYPE_P(var) != IS_STRING) {
use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
@@ -12378,7 +12370,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -12386,7 +12378,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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -12404,7 +12396,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
- function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -12414,18 +12406,18 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -12490,10 +12482,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -12507,10 +12499,10 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
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);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12532,7 +12524,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -12552,7 +12544,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -12595,7 +12587,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -12644,8 +12636,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP_TMP_HANDLER(ZEND_O
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -12741,9 +12733,9 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12757,8 +12749,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_TMP_HANDLER(ZEND_
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -12774,9 +12766,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_TMP_HANDLER(ZEND_
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12810,7 +12802,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -12839,7 +12831,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
}
} else {
- zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -12864,7 +12856,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
/* Set the new yielded key */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -12919,10 +12911,10 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12934,10 +12926,10 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12949,10 +12941,10 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12964,10 +12956,10 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12979,10 +12971,10 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12994,10 +12986,10 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13009,10 +13001,10 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13024,10 +13016,10 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13039,10 +13031,10 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13054,10 +13046,10 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13070,10 +13062,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13086,10 +13078,10 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13102,10 +13094,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13118,10 +13110,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13134,10 +13126,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPC
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13149,10 +13141,10 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13164,10 +13156,10 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13179,10 +13171,10 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13194,10 +13186,10 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13212,7 +13204,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_CONST) {
name = Z_STR_P(varname);
@@ -13235,7 +13227,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13245,7 +13237,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} 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);
@@ -13293,7 +13285,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
}
@@ -13357,10 +13349,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13372,10 +13364,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
zval *container;
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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13397,20 +13389,20 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCO
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (IS_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- 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_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13425,8 +13417,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -13438,7 +13430,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -13465,8 +13457,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13478,12 +13470,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -13494,7 +13484,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -13521,8 +13511,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13538,7 +13528,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCO
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
container = NULL;
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
@@ -13548,8 +13538,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_VAR_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, IS_TMP_VAR, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -13570,7 +13560,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_
int use_copy = 0;
SAVE_OPLINE();
- var = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ var = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -13578,7 +13568,9 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_
}
if (Z_TYPE_P(var) != IS_STRING) {
- ZVAL_DEREF(var);
+ if (IS_VAR != IS_TMP_VAR) {
+ ZVAL_DEREF(var);
+ }
if (Z_TYPE_P(var) != IS_STRING) {
use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
@@ -13590,7 +13582,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -13598,7 +13590,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_
* which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
* string offsets or overloaded objects
*/
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13616,7 +13608,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
- function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -13626,18 +13618,18 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -13702,10 +13694,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13719,10 +13711,10 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
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);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13744,7 +13736,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -13764,7 +13756,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -13807,7 +13799,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -13876,7 +13868,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -13893,10 +13885,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) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -13913,10 +13905,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) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13943,8 +13935,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -13973,10 +13966,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (opline->extended_value & ZEND_ISSET) {
ZVAL_BOOL(EX_VAR(opline->result.var),
@@ -14002,8 +13995,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP_VAR_HANDLER(ZEND_O
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -14073,7 +14066,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -14099,9 +14092,9 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14115,8 +14108,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_VAR_HANDLER(ZEND_
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -14132,9 +14125,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_VAR_HANDLER(ZEND_
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14147,7 +14140,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL
zend_bool result;
SAVE_OPLINE();
- expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (Z_TYPE_P(expr) == IS_OBJECT) {
zend_class_entry *ce;
@@ -14159,7 +14152,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14173,7 +14166,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL
result = 0;
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14207,7 +14200,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -14236,7 +14229,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
} else {
- zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -14261,7 +14254,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
/* Set the new yielded key */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -14270,7 +14263,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_COPY_VALUE(&generator->key, 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);
+ zval_ptr_dtor_nogc(free_op2);
} else {
ZVAL_COPY_VALUE(&generator->key, key);
if (IS_VAR == IS_CV) {
@@ -14316,10 +14309,10 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14334,7 +14327,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_CONST) {
name = Z_STR_P(varname);
@@ -14357,7 +14350,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14367,7 +14360,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} 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);
@@ -14415,7 +14408,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
}
@@ -14490,7 +14483,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_O
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -14499,10 +14492,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_O
if (IS_UNUSED == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14525,7 +14518,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -14657,7 +14650,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -14674,10 +14667,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) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -14694,10 +14687,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) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14724,8 +14717,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -14754,10 +14748,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (opline->extended_value & ZEND_ISSET) {
ZVAL_BOOL(EX_VAR(opline->result.var),
@@ -14802,7 +14796,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -14831,7 +14825,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
}
} else {
- zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -14911,9 +14905,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14926,9 +14920,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14941,9 +14935,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14956,9 +14950,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14971,9 +14965,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14986,9 +14980,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15001,9 +14995,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15016,9 +15010,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15031,9 +15025,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15047,9 +15041,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15063,9 +15057,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15079,9 +15073,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15095,9 +15089,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15111,9 +15105,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCO
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15126,9 +15120,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15141,9 +15135,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15156,9 +15150,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15171,9 +15165,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15186,10 +15180,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15201,10 +15195,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15227,7 +15221,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(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 && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -15236,10 +15230,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
if (IS_CV == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15254,7 +15248,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -15267,7 +15261,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -15294,7 +15288,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15306,11 +15300,9 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -15322,7 +15314,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -15349,7 +15341,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15376,7 +15368,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -15405,7 +15397,9 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (Z_TYPE_P(var) != IS_STRING) {
- ZVAL_DEREF(var);
+ if (IS_CV != IS_TMP_VAR) {
+ ZVAL_DEREF(var);
+ }
if (Z_TYPE_P(var) != IS_STRING) {
use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
@@ -15417,7 +15411,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_A
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -15452,7 +15446,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
@@ -15528,7 +15522,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
@@ -15544,7 +15538,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -15568,7 +15562,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -15680,7 +15674,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP_CV_HANDLER(ZEND_OP
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_TMP_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -15751,7 +15745,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -15778,7 +15772,7 @@ num_index_prop:
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15792,7 +15786,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMP_CV_HANDLER(ZEND_O
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_TMP_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -15810,7 +15804,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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15844,7 +15838,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -15873,7 +15867,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
} else {
- zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -15953,9 +15947,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15968,8 +15962,8 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
bitwise_not_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15981,8 +15975,8 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
boolean_not_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15994,7 +15988,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -16025,7 +16019,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16037,7 +16031,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -16068,7 +16062,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16080,7 +16074,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -16108,7 +16102,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
increment_function(var_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16120,7 +16114,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -16148,7 +16142,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
decrement_function(var_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16160,11 +16154,11 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *z;
SAVE_OPLINE();
- z = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ z = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
zend_print_variable(z TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16184,7 +16178,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -16201,7 +16195,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
opline = opline->op2.jmp_addr;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -16215,7 +16209,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -16232,7 +16226,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
opline++;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -16246,7 +16240,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
if (EXPECTED(Z_TYPE_P(val) == IS_TRUE)) {
@@ -16263,7 +16257,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
opline = opline->op2.jmp_addr;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -16277,7 +16271,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -16292,11 +16286,11 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (i_zend_is_true(val TSRMLS_CC)) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
ZVAL_TRUE(EX_VAR(opline->result.var));
opline++;
} else {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
ZVAL_FALSE(EX_VAR(opline->result.var));
opline = opline->op2.jmp_addr;
}
@@ -16313,7 +16307,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
if (Z_TYPE_P(val) == IS_TRUE) {
@@ -16333,7 +16327,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_FALSE(EX_VAR(opline->result.var));
opline++;
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -16357,10 +16351,10 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
SAVE_OPLINE();
- retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (!EX(return_value)) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} else {
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
@@ -16371,7 +16365,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} 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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
if (IS_VAR == IS_CV) {
@@ -16396,10 +16390,10 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
- retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (!EX(return_value)) {
if (IS_VAR == IS_TMP_VAR) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
} else {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
@@ -16411,7 +16405,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
break;
}
- retval_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
@@ -16439,7 +16433,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
} while (0);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -16450,7 +16444,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
SAVE_OPLINE();
- value = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -16466,7 +16460,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_throw_exception_object(value TSRMLS_CC);
zend_exception_restore(TSRMLS_C);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
@@ -16476,12 +16470,12 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *varptr, *arg;
zend_free_op free_op1;
- varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(arg, varptr);
if (IS_VAR == IS_CV) {
@@ -16498,17 +16492,14 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
zval *varptr, *arg;
SAVE_OPLINE();
- if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
- if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
- return ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
- }
- } else {
+
+ if (!(opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
return ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
}
- varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
(Z_VAR_FLAGS_P(varptr) & IS_VAR_RET_REF)) &&
(Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) {
@@ -16517,20 +16508,18 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if (IS_VAR == IS_CV) {
Z_ADDREF_P(varptr);
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
- ZVAL_COPY_VALUE(arg, varptr);
} else {
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
- ZVAL_COPY(arg, varptr);
- zval_ptr_dtor_nogc(free_op1.var);
}
+
+ arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ ZVAL_COPY_VALUE(arg, varptr);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16542,14 +16531,14 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *varptr, *arg;
SAVE_OPLINE();
- varptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(varptr == NULL)) {
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
if (IS_VAR == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
ZEND_VM_NEXT_OPCODE();
@@ -16560,15 +16549,14 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_COPY_VALUE(arg, varptr);
} else if (IS_VAR == IS_VAR &&
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) {
- ZVAL_COPY_VALUE(arg, varptr);
- ZVAL_MAKE_REF(arg);
+ ZVAL_NEW_REF(arg, varptr);
} else {
- ZVAL_MAKE_REF(varptr);
- Z_ADDREF_P(varptr);
- ZVAL_REF(arg, Z_REF_P(varptr));
+ ZVAL_NEW_REF(arg, varptr);
+ Z_ADDREF_P(arg);
+ ZVAL_REF(varptr, Z_REF_P(arg));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
ZEND_VM_NEXT_OPCODE();
}
@@ -16581,12 +16569,12 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
- varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(arg, varptr);
if (IS_VAR == IS_CV) {
@@ -16602,7 +16590,7 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *arg, *param, tmp;
zend_free_op free_op1;
- arg = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ arg = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
param = ZEND_CALL_ARG(EX(call), opline->op2.num);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
@@ -16642,7 +16630,7 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
EX(call)->called_scope = NULL;
Z_OBJ(EX(call)->This) = NULL;
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16668,9 +16656,9 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_COPY(param, arg);
}
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16683,8 +16671,8 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_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_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC));
- zval_ptr_dtor_nogc(free_op1.var);
+ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1) TSRMLS_CC));
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16728,16 +16716,14 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), &object_zval);
} else {
- zval_ptr_dtor(&object_zval);
+ OBJ_RELEASE(Z_OBJ(object_zval));
}
ZEND_VM_JMP(opline->op2.jmp_addr);
} else {
/* We are not handling overloaded classes right now */
EX(call) = zend_vm_stack_push_call_frame(
- VM_FRAME_INFO(
- VM_FRAME_NESTED_FUNCTION,
- RETURN_VALUE_USED(opline) ?
- ZEND_CALL_CTOR : (ZEND_CALL_CTOR | ZEND_CALL_CTOR_RESULT_UNUSED)),
+ ZEND_CALL_FUNCTION | ZEND_CALL_CTOR |
+ (RETURN_VALUE_USED(opline) ? 0 : ZEND_CALL_CTOR_RESULT_UNUSED),
constructor,
opline->extended_value,
ce,
@@ -16766,7 +16752,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_object_clone_obj_t clone_call;
SAVE_OPLINE();
- obj = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ obj = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST ||
(IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
@@ -16791,14 +16777,14 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- if (UNEXPECTED(ce != EX(scope))) {
- zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(ce != EG(scope))) {
+ zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
- if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EX(scope)))) {
- zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
+ zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
}
}
@@ -16806,10 +16792,10 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16822,7 +16808,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *result = EX_VAR(opline->result.var);
SAVE_OPLINE();
- expr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
switch (opline->extended_value) {
case IS_NULL:
@@ -16866,7 +16852,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16911,7 +16897,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16926,7 +16912,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
zend_bool failure_retval=0;
SAVE_OPLINE();
- inc_filename = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ inc_filename = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
@@ -16996,9 +16982,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
} else if (EXPECTED(new_op_array != NULL)) {
@@ -17009,7 +16995,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
return_value = EX_VAR(opline->result.var);
}
- call = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_CODE,
+ new_op_array->scope = EG(scope); /* ??? */
+
+ call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
(zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
if (EX(symbol_table)) {
@@ -17023,7 +17011,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
- call->frame_info = VM_FRAME_TOP_CODE;
+ ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
zend_execute_ex(call TSRMLS_CC);
}
@@ -17054,7 +17042,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
(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);
+ array_ptr = array_ref = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_DEREF(array_ptr);
if (Z_TYPE_P(array_ptr) == IS_ARRAY) {
SEPARATE_ARRAY(array_ptr);
@@ -17073,7 +17061,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
}
} else {
- array_ptr = array_ref = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ array_ptr = array_ref = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_DEREF(array_ptr);
if (IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&tmp, array_ptr);
@@ -17140,14 +17128,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
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_FETCH_BYREF)) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
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_FETCH_BYREF) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val);
@@ -17166,7 +17154,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
HANDLE_EXCEPTION();
}
@@ -17175,7 +17163,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
HANDLE_EXCEPTION();
}
@@ -17189,7 +17177,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
@@ -17219,7 +17207,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
if (is_empty) {
ZEND_VM_JMP(opline->op2.jmp_addr);
@@ -17487,14 +17475,14 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op1;
- zval *ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (Z_TYPE_P(ptr) == IS_LONG) {
EG(exit_status) = Z_LVAL_P(ptr);
} else {
zend_print_variable(ptr TSRMLS_CC);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
#endif
zend_bailout();
@@ -17509,7 +17497,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
int is_ref = 0;
SAVE_OPLINE();
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) {
is_ref = 1;
@@ -17525,12 +17513,12 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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);
+ zval_ptr_dtor_nogc(free_op1);
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17543,7 +17531,7 @@ static int ZEND_FASTCALL ZEND_COALESCE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
int is_ref = 0;
SAVE_OPLINE();
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) {
is_ref = 1;
@@ -17560,12 +17548,12 @@ static int ZEND_FASTCALL ZEND_COALESCE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);
+ zval_ptr_dtor_nogc(free_op1);
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17577,11 +17565,11 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_VAR == IS_CONST) {
@@ -17602,7 +17590,7 @@ static int ZEND_FASTCALL ZEND_STRLEN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
SAVE_OPLINE();
- value = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value));
} else {
@@ -17630,7 +17618,7 @@ strlen_error:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17642,7 +17630,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op1;
SAVE_OPLINE();
- value = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
switch (opline->extended_value) {
case IS_NULL:
case IS_LONG:
@@ -17677,7 +17665,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17689,9 +17677,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17704,9 +17692,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17719,9 +17707,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17734,9 +17722,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17749,9 +17737,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17764,9 +17752,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17779,9 +17767,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17794,9 +17782,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17809,9 +17797,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17825,9 +17813,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17841,9 +17829,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17857,9 +17845,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17873,9 +17861,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17889,9 +17877,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_O
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17904,9 +17892,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17919,9 +17907,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17934,9 +17922,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17949,9 +17937,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17961,7 +17949,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
- zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
zval *property = opline->op2.zv;
zval *value;
zval *zptr;
@@ -18016,7 +18004,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -18043,7 +18031,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -18058,7 +18046,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
zval *value, *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -18066,7 +18054,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
ZVAL_DEREF(container);
}
if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
+ if (IS_VAR == IS_VAR && !(free_op1 != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -18099,7 +18087,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
}
FREE_OP(free_op_data1);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
ZEND_VM_NEXT_OPCODE();
@@ -18114,7 +18102,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
SAVE_OPLINE();
value = opline->op2.zv;
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -18135,7 +18123,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18293,7 +18281,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
@@ -18311,7 +18299,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18339,7 +18327,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -18358,7 +18346,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18383,7 +18371,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
@@ -18399,7 +18387,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18425,7 +18413,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -18442,7 +18430,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18467,7 +18455,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST) {
name = Z_STR_P(varname);
@@ -18490,7 +18478,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
if (IS_VAR != IS_CONST) {
zend_string_release(name);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18500,7 +18488,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
retval = zend_std_get_static_property(ce, name, 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} 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);
@@ -18548,7 +18536,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
zval_update_constant(retval, 1 TSRMLS_CC);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
}
@@ -18612,10 +18600,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18627,7 +18615,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -18635,10 +18623,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18650,7 +18638,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -18658,10 +18646,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
ZVAL_DEREF(container);
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18673,10 +18661,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18693,25 +18681,25 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
if (IS_CONST == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -18724,7 +18712,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -18732,10 +18720,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
ZVAL_DEREF(container);
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18749,7 +18737,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -18762,7 +18750,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -18789,7 +18777,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18804,17 +18792,17 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
property = opline->op2.zv;
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18828,17 +18816,17 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
property = opline->op2.zv;
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18850,11 +18838,9 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -18866,7 +18852,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -18893,7 +18879,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18910,7 +18896,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
SAVE_OPLINE();
property = opline->op2.zv;
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -18920,10 +18906,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -18938,7 +18924,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
zval *container, *property;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property = opline->op2.zv;
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -18946,10 +18932,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18961,7 +18947,7 @@ static int ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -18995,7 +18981,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
zval *property_name;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property_name = opline->op2.zv;
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -19003,7 +18989,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
}
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -19017,7 +19003,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
zval *object_ptr;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -19065,7 +19051,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
}
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -19081,7 +19067,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
value = opline->op2.zv;
- variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_CONST == IS_TMP_VAR) {
@@ -19095,7 +19081,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
/* zend_assign_to_variable() always takes care of op2, never free it! */
@@ -19126,7 +19112,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
@@ -19138,7 +19124,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -19203,10 +19189,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -19325,7 +19311,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_CONST == IS_UNUSED) {
@@ -19344,7 +19330,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
CHECK_EXCEPTION();
@@ -19429,7 +19415,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
zval_update_constant(value, 1 TSRMLS_CC);
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
}
if (IS_VAR == IS_CONST) {
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), value);
@@ -19458,15 +19444,15 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC
SAVE_OPLINE();
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
- expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -19478,7 +19464,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC
} 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);
+ zval_ptr_dtor_nogc(free_op1);
} else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) {
Z_ADDREF_P(expr_ptr);
}
@@ -19598,7 +19584,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -19615,10 +19601,10 @@ 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) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -19635,10 +19621,10 @@ 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) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19652,14 +19638,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zend_ulong hval;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_VAR != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
+ SEPARATE_ZVAL_NOREF(container);
offset = opline->op2.zv;
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -19723,7 +19709,7 @@ num_index_dim:
} else {
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19736,13 +19722,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = opline->op2.zv;
- ZVAL_DEREF(container);
+ if (IS_VAR != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -19751,7 +19739,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19778,8 +19766,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -19808,10 +19797,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (opline->extended_value & ZEND_ISSET) {
ZVAL_BOOL(EX_VAR(opline->result.var),
@@ -19837,7 +19826,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER(ZEND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -19908,7 +19897,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -19935,7 +19924,7 @@ num_index_prop:
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19949,7 +19938,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER(ZEN
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = opline->op2.zv;
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -19967,7 +19956,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER(ZEN
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19980,7 +19969,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
zend_bool result;
SAVE_OPLINE();
- expr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (Z_TYPE_P(expr) == IS_OBJECT) {
zend_class_entry *ce;
@@ -19992,7 +19981,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20006,7 +19995,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
result = 0;
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20040,7 +20029,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -20049,7 +20038,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -20067,10 +20056,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
ZVAL_COPY(&generator->value, value_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
} else {
- zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -20079,7 +20068,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
ZVAL_COPY_VALUE(&generator->value, 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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_VAR == IS_CV) {
@@ -20150,9 +20139,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
opline->op2.zv TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20170,10 +20159,10 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20185,10 +20174,10 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20200,10 +20189,10 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20215,10 +20204,10 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20230,10 +20219,10 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20245,10 +20234,10 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20260,10 +20249,10 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20275,10 +20264,10 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20290,10 +20279,10 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20306,10 +20295,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20322,10 +20311,10 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_equal_function(result,
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20338,10 +20327,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_not_equal_function(result,
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20354,10 +20343,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_is_smaller_function(result,
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20370,10 +20359,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPC
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20385,10 +20374,10 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20400,10 +20389,10 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20415,10 +20404,10 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20430,10 +20419,10 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20442,8 +20431,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
{
USE_OPLINE
zend_free_op free_op1, free_op2, free_op_data1;
- zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zval *value;
zval *zptr;
@@ -20459,7 +20448,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
@@ -20497,7 +20486,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -20521,11 +20510,11 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -20540,7 +20529,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMP(int (*bin
zval *value, *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -20548,12 +20537,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMP(int (*bin
ZVAL_DEREF(container);
}
if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
+ if (IS_VAR == IS_VAR && !(free_op1 != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
- zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_fetch_dimension_address_RW(&rv, container, dim, IS_TMP_VAR TSRMLS_CC);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
@@ -20580,9 +20569,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMP(int (*bin
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
ZEND_VM_NEXT_OPCODE();
@@ -20596,8 +20585,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -20618,8 +20607,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_
}
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20777,8 +20766,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -20791,11 +20780,11 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20823,7 +20812,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -20842,8 +20831,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
}
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20868,8 +20857,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -20882,9 +20871,9 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20910,7 +20899,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -20927,8 +20916,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
}
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20950,10 +20939,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
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_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20965,18 +20954,18 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(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_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20988,18 +20977,18 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- 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_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21011,10 +21000,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
zval *container;
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_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21031,25 +21020,25 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
if (IS_TMP_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- 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_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -21062,18 +21051,18 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- 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_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21087,8 +21076,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -21100,7 +21089,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -21127,8 +21116,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21141,19 +21130,19 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21166,18 +21155,18 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21189,12 +21178,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -21205,7 +21192,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -21232,8 +21219,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21249,8 +21236,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -21259,11 +21246,11 @@ 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, IS_VAR, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -21278,18 +21265,18 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
zval *container, *property;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == 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, IS_VAR, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21302,15 +21289,15 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
zval *property_name;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == 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, IS_VAR, 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_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -21324,7 +21311,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
zval *object_ptr;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -21332,27 +21319,27 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
ZVAL_DEREF(object_ptr);
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
zend_free_op free_op2;
- zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_VAR, 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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_free_op free_op2, free_op_data1;
zval rv;
zval *value;
- zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zval *variable_ptr;
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
zend_assign_to_string_offset(object_ptr, offset, value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
FREE_OP(free_op_data1);
} else {
zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_TMP_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
variable_ptr = Z_INDIRECT(rv);
@@ -21372,7 +21359,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
}
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -21387,12 +21374,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(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);
+ value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
+ variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_TMP_VAR == IS_TMP_VAR) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -21402,7 +21389,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
/* zend_assign_to_variable() always takes care of op2, never free it! */
@@ -21423,7 +21410,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
- function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -21433,19 +21420,19 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -21510,11 +21497,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -21559,7 +21546,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
} else if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -21587,7 +21574,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
}
}
if (IS_TMP_VAR != IS_CONST) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
} else {
if (UNEXPECTED(ce->constructor == NULL)) {
@@ -21633,7 +21620,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_TMP_VAR == IS_UNUSED) {
@@ -21652,10 +21639,10 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_equal_function(result,
- _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);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21669,15 +21656,15 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
- expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -21689,7 +21676,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD
} 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);
+ zval_ptr_dtor_nogc(free_op1);
} else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) {
Z_ADDREF_P(expr_ptr);
}
@@ -21697,7 +21684,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -21740,7 +21727,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -21788,15 +21775,15 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
zend_ulong hval;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_VAR != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ SEPARATE_ZVAL_NOREF(container);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -21843,7 +21830,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
@@ -21852,14 +21839,14 @@ num_index_dim:
//??? zval_copy_ctor(offset);
//??? }
Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
} else {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21872,13 +21859,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(container);
+ if (IS_VAR != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -21886,8 +21875,8 @@ 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_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21902,8 +21891,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_O
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -21973,7 +21962,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -21999,9 +21988,9 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22015,8 +22004,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -22032,9 +22021,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22068,7 +22057,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -22077,7 +22066,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -22095,10 +22084,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
}
ZVAL_COPY(&generator->value, value_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
} else {
- zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -22107,7 +22096,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_COPY_VALUE(&generator->value, 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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_VAR == IS_CV) {
@@ -22123,7 +22112,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
/* Set the new yielded key */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -22178,10 +22167,10 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
- _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_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22198,10 +22187,10 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22213,10 +22202,10 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22228,10 +22217,10 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22243,10 +22232,10 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22258,10 +22247,10 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22273,10 +22262,10 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22288,10 +22277,10 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22303,10 +22292,10 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22318,10 +22307,10 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22334,10 +22323,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22350,10 +22339,10 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22366,10 +22355,10 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22382,10 +22371,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22398,10 +22387,10 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPC
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
- _get_zval_ptr_var(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22413,10 +22402,10 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22428,10 +22417,10 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22443,10 +22432,10 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22458,10 +22447,10 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22470,8 +22459,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
{
USE_OPLINE
zend_free_op free_op1, free_op2, free_op_data1;
- zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zval *value;
zval *zptr;
@@ -22487,7 +22476,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
@@ -22525,7 +22514,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -22549,11 +22538,11 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -22568,7 +22557,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_VAR(int (*bin
zval *value, *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -22576,12 +22565,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_VAR(int (*bin
ZVAL_DEREF(container);
}
if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
+ if (IS_VAR == IS_VAR && !(free_op1 != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
- zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
zend_fetch_dimension_address_RW(&rv, container, dim, IS_VAR TSRMLS_CC);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
@@ -22608,9 +22597,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_VAR(int (*bin
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
ZEND_VM_NEXT_OPCODE();
@@ -22624,8 +22613,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -22646,8 +22635,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_
}
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22805,8 +22794,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -22819,11 +22808,11 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22851,7 +22840,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -22870,8 +22859,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
}
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22896,8 +22885,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -22910,9 +22899,9 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22938,7 +22927,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -22955,8 +22944,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
}
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22981,7 +22970,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST) {
name = Z_STR_P(varname);
@@ -23004,7 +22993,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
if (IS_VAR != IS_CONST) {
zend_string_release(name);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23014,7 +23003,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
retval = zend_std_get_static_property(ce, name, 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} 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);
@@ -23062,7 +23051,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
}
@@ -23126,10 +23115,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23141,18 +23130,18 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(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_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23164,18 +23153,18 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_RW(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_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23187,10 +23176,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
zval *container;
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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23207,25 +23196,25 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
if (IS_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- 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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23238,18 +23227,18 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_UNSET(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_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23263,8 +23252,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -23276,7 +23265,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -23303,8 +23292,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23317,19 +23306,19 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23342,18 +23331,18 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23365,12 +23354,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -23381,7 +23368,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -23408,8 +23395,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23425,8 +23412,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -23435,11 +23422,11 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_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, IS_VAR, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -23454,18 +23441,18 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
zval *container, *property;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == 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, IS_VAR, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23478,15 +23465,15 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
zval *property_name;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
+ property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == 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, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -23500,7 +23487,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
zval *object_ptr;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -23508,27 +23495,27 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
ZVAL_DEREF(object_ptr);
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
zend_free_op free_op2;
- zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_free_op free_op2, free_op_data1;
zval rv;
zval *value;
- zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
zval *variable_ptr;
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
zend_assign_to_string_offset(object_ptr, offset, value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
FREE_OP(free_op_data1);
} else {
zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
variable_ptr = Z_INDIRECT(rv);
@@ -23548,7 +23535,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
}
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -23563,12 +23550,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zval *variable_ptr;
SAVE_OPLINE();
- 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);
+ value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
+ variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_VAR == IS_TMP_VAR) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -23578,11 +23565,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
/* zend_assign_to_variable() always takes care of op2, never free it! */
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23596,7 +23583,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
zval *value_ptr;
SAVE_OPLINE();
- value_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
@@ -23605,22 +23592,22 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
(value_ptr == &EG(uninitialized_zval) ||
(opline->extended_value == ZEND_RETURNS_FUNCTION &&
!(Z_VAR_FLAGS_P(value_ptr) & IS_VAR_RET_REF)))) {
- if (!(free_op2.var != NULL)) {
+ if (!(free_op2 != NULL)) {
PZVAL_LOCK(value_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor_nogc(free_op2.var);};
+ if (free_op2) {zval_ptr_dtor_nogc(free_op2);};
HANDLE_EXCEPTION();
}
return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
- if (!(free_op2.var != NULL)) {
+ if (!(free_op2 != NULL)) {
PZVAL_LOCK(value_ptr);
}
}
- variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
@@ -23637,7 +23624,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
}
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
- if (!(free_op2.var != NULL)) {
+ if (!(free_op2 != NULL)) {
Z_DELREF_P(variable_ptr);
}
}
@@ -23646,8 +23633,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor_nogc(free_op2.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
+ if (free_op2) {zval_ptr_dtor_nogc(free_op2);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23665,7 +23652,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
- function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -23675,19 +23662,19 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -23752,11 +23739,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op2);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23801,7 +23788,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
} else if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -23829,7 +23816,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
}
}
if (IS_VAR != IS_CONST) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
} else {
if (UNEXPECTED(ce->constructor == NULL)) {
@@ -23875,7 +23862,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_VAR == IS_UNUSED) {
@@ -23894,10 +23881,10 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23911,15 +23898,15 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
- expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -23931,7 +23918,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
} 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);
+ zval_ptr_dtor_nogc(free_op1);
} else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) {
Z_ADDREF_P(expr_ptr);
}
@@ -23939,7 +23926,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -23982,7 +23969,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -24051,7 +24038,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -24068,10 +24055,10 @@ 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) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -24088,10 +24075,10 @@ 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) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24105,15 +24092,15 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_ulong hval;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_VAR != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ SEPARATE_ZVAL_NOREF(container);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -24160,7 +24147,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
@@ -24169,14 +24156,14 @@ num_index_dim:
//??? zval_copy_ctor(offset);
//??? }
Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
} else {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24189,13 +24176,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(container);
+ if (IS_VAR != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -24203,8 +24192,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
}
- zval_ptr_dtor_nogc(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ zval_ptr_dtor_nogc(free_op2);
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24231,8 +24220,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -24261,10 +24251,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (opline->extended_value & ZEND_ISSET) {
ZVAL_BOOL(EX_VAR(opline->result.var),
@@ -24290,8 +24280,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_O
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -24387,9 +24377,9 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24403,8 +24393,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -24420,9 +24410,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24435,7 +24425,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
zend_bool result;
SAVE_OPLINE();
- expr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (Z_TYPE_P(expr) == IS_OBJECT) {
zend_class_entry *ce;
@@ -24447,7 +24437,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24461,7 +24451,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
result = 0;
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24495,7 +24485,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -24504,7 +24494,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -24522,10 +24512,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
ZVAL_COPY(&generator->value, value_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
} else {
- zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -24534,7 +24524,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_COPY_VALUE(&generator->value, 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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_VAR == IS_CV) {
@@ -24550,7 +24540,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
/* Set the new yielded key */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -24559,7 +24549,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_COPY_VALUE(&generator->key, 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);
+ zval_ptr_dtor_nogc(free_op2);
} else {
ZVAL_COPY_VALUE(&generator->key, key);
if (IS_VAR == IS_CV) {
@@ -24605,10 +24595,10 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(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_ptr_dtor_nogc(free_op1.var);
- zval_ptr_dtor_nogc(free_op2.var);
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op1);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24622,7 +24612,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
- zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
zval *property = NULL;
zval *value;
zval *zptr;
@@ -24677,7 +24667,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -24704,7 +24694,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -24719,7 +24709,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*
zval *value, *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -24727,7 +24717,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*
ZVAL_DEREF(container);
}
if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
+ if (IS_VAR == IS_VAR && !(free_op1 != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -24760,7 +24750,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*
}
FREE_OP(free_op_data1);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
ZEND_VM_NEXT_OPCODE();
@@ -24775,7 +24765,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina
SAVE_OPLINE();
value = NULL;
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -24796,7 +24786,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24954,7 +24944,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST) {
name = Z_STR_P(varname);
@@ -24977,7 +24967,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
if (IS_VAR != IS_CONST) {
zend_string_release(name);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -24987,7 +24977,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
retval = zend_std_get_static_property(ce, name, 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
} 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);
@@ -25035,7 +25025,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
zval_update_constant(retval, 1 TSRMLS_CC);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
}
@@ -25099,7 +25089,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -25107,10 +25097,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -25122,7 +25112,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -25130,10 +25120,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_
ZVAL_DEREF(container);
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -25150,25 +25140,25 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
if (IS_UNUSED == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25181,7 +25171,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
zval *object_ptr;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -25229,7 +25219,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
}
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -25349,7 +25339,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_UNUSED == IS_UNUSED) {
@@ -25369,15 +25359,15 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
SAVE_OPLINE();
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
- expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -25389,7 +25379,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
} 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);
+ zval_ptr_dtor_nogc(free_op1);
} else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) {
Z_ADDREF_P(expr_ptr);
}
@@ -25509,7 +25499,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -25526,10 +25516,10 @@ 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) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -25546,10 +25536,10 @@ 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) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -25576,8 +25566,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -25606,10 +25597,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (opline->extended_value & ZEND_ISSET) {
ZVAL_BOOL(EX_VAR(opline->result.var),
@@ -25672,7 +25663,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -25681,7 +25672,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -25699,10 +25690,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
}
ZVAL_COPY(&generator->value, value_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
} else {
- zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -25711,7 +25702,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
ZVAL_COPY_VALUE(&generator->value, 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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_VAR == IS_CV) {
@@ -25787,9 +25778,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25802,9 +25793,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25817,9 +25808,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25832,9 +25823,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25847,9 +25838,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25862,9 +25853,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25877,9 +25868,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25892,9 +25883,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25907,9 +25898,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25923,9 +25914,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25939,9 +25930,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25955,9 +25946,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25971,9 +25962,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25987,9 +25978,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26002,9 +25993,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26017,9 +26008,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26032,9 +26023,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26047,9 +26038,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26059,7 +26050,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
- zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
zval *value;
zval *zptr;
@@ -26114,7 +26105,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -26141,7 +26132,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -26156,7 +26147,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
zval *value, *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -26164,7 +26155,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
ZVAL_DEREF(container);
}
if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
+ if (IS_VAR == IS_VAR && !(free_op1 != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -26197,7 +26188,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
}
FREE_OP(free_op_data1);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
ZEND_VM_NEXT_OPCODE();
@@ -26212,7 +26203,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o
SAVE_OPLINE();
value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -26233,7 +26224,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26391,7 +26382,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
@@ -26409,7 +26400,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26437,7 +26428,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -26456,7 +26447,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26481,7 +26472,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
@@ -26497,7 +26488,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26523,7 +26514,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -26540,7 +26531,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26562,10 +26553,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26577,7 +26568,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -26585,10 +26576,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(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_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26600,7 +26591,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -26608,10 +26599,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
ZVAL_DEREF(container);
zend_fetch_dimension_address_RW(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_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26623,10 +26614,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26643,25 +26634,25 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(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_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
if (IS_CV == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
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_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26674,7 +26665,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -26682,10 +26673,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
ZVAL_DEREF(container);
zend_fetch_dimension_address_UNSET(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_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26699,7 +26690,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -26712,7 +26703,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -26739,7 +26730,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26754,17 +26745,17 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26778,17 +26769,17 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == 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, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26800,11 +26791,9 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -26816,7 +26805,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -26843,7 +26832,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26860,7 +26849,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -26870,10 +26859,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -26888,7 +26877,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
zval *container, *property;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -26896,10 +26885,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26912,7 +26901,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *property_name;
SAVE_OPLINE();
- object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -26920,7 +26909,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
}
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -26934,7 +26923,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *object_ptr;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -26982,7 +26971,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
}
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -26998,7 +26987,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
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);
+ variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_CV == IS_TMP_VAR) {
@@ -27012,7 +27001,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
/* zend_assign_to_variable() always takes care of op2, never free it! */
@@ -27053,7 +27042,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
}
}
- variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
@@ -27079,7 +27068,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr);
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -27107,7 +27096,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
@@ -27119,7 +27108,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -27184,10 +27173,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -27306,7 +27295,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
}
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
if (IS_CV == IS_UNUSED) {
@@ -27325,7 +27314,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
CHECK_EXCEPTION();
@@ -27341,15 +27330,15 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
} else {
- expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -27361,7 +27350,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE
} 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);
+ zval_ptr_dtor_nogc(free_op1);
} else if (IS_VAR == IS_CV && Z_REFCOUNTED_P(expr_ptr)) {
Z_ADDREF_P(expr_ptr);
}
@@ -27460,14 +27449,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
zend_ulong hval;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_VAR != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
+ SEPARATE_ZVAL_NOREF(container);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -27531,7 +27520,7 @@ num_index_dim:
} else {
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -27544,13 +27533,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- ZVAL_DEREF(container);
+ if (IS_VAR != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -27559,7 +27550,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
}
}
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -27574,7 +27565,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OP
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -27645,7 +27636,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -27672,7 +27663,7 @@ num_index_prop:
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -27686,7 +27677,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER(ZEND_O
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -27704,7 +27695,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER(ZEND_O
}
ZVAL_BOOL(EX_VAR(opline->result.var), result);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -27738,7 +27729,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -27747,7 +27738,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -27765,10 +27756,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
ZVAL_COPY(&generator->value, value_ptr);
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
+ if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
} else {
- zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -27777,7 +27768,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_COPY_VALUE(&generator->value, 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);
+ zval_ptr_dtor_nogc(free_op1);
} else {
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_VAR == IS_CV) {
@@ -27848,9 +27839,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op1.var);
+ zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -27871,7 +27862,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(execute_data TSRMLS_CC);
+ obj = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_CONST ||
(IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
@@ -27896,14 +27887,14 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- if (UNEXPECTED(ce != EX(scope))) {
- zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(ce != EG(scope))) {
+ zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
- if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EX(scope)))) {
- zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
+ zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
}
}
@@ -27911,7 +27902,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -27945,7 +27936,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(execute_data TSRMLS_CC);
+ zval *object = _get_obj_zval_ptr_unused(execute_data);
zval *property = opline->op2.zv;
zval *value;
zval *zptr;
@@ -28000,7 +27991,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -28041,7 +28032,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -28276,7 +28267,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
@@ -28322,7 +28313,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -28366,7 +28357,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
@@ -28408,7 +28399,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -28449,7 +28440,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = opline->op2.zv;
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -28462,7 +28453,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -28504,14 +28495,14 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -28528,14 +28519,14 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -28550,11 +28541,9 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = opline->op2.zv;
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -28566,7 +28555,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -28610,7 +28599,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -28620,7 +28609,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -28638,7 +28627,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
property = opline->op2.zv;
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -28646,7 +28635,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OP
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -28662,7 +28651,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(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
property_name = opline->op2.zv;
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -28737,7 +28726,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(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
@@ -28813,7 +28802,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
@@ -28899,7 +28888,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
zval_update_constant(value, 1 TSRMLS_CC);
- EG(scope) = EX(scope);
+ EG(scope) = EX(func)->op_array.scope;
}
if (IS_UNUSED == IS_CONST) {
CACHE_PTR(Z_CACHE_SLOT_P(opline->op2.zv), value);
@@ -28959,14 +28948,14 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_UNUSED != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
+ SEPARATE_ZVAL_NOREF(container);
offset = opline->op2.zv;
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -29043,13 +29032,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = opline->op2.zv;
- ZVAL_DEREF(container);
+ if (IS_UNUSED != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -29073,7 +29064,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = opline->op2.zv;
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -29144,7 +29135,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) {
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -29185,7 +29176,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = opline->op2.zv;
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -29348,8 +29339,8 @@ 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(execute_data TSRMLS_CC);
- zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *object = _get_obj_zval_ptr_unused(execute_data);
+ zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zval *value;
zval *zptr;
@@ -29365,7 +29356,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
@@ -29403,7 +29394,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29427,7 +29418,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
}
@@ -29445,7 +29436,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -29458,7 +29449,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (*
}
return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
- zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_fetch_dimension_address_RW(&rv, container, dim, IS_TMP_VAR TSRMLS_CC);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
@@ -29485,7 +29476,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (*
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
CHECK_EXCEPTION();
@@ -29501,7 +29492,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
var_ptr = NULL;
if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
@@ -29523,7 +29514,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -29682,8 +29673,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -29696,7 +29687,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
@@ -29728,7 +29719,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29747,7 +29738,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -29773,8 +29764,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -29787,7 +29778,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_NULL(retval);
CHECK_EXCEPTION();
@@ -29815,7 +29806,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29832,7 +29823,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -29857,8 +29848,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -29870,7 +29861,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -29897,7 +29888,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -29911,16 +29902,16 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -29936,15 +29927,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -29959,12 +29950,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -29975,7 +29964,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -30002,7 +29991,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -30019,8 +30008,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -30029,8 +30018,8 @@ 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, IS_UNUSED, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -30048,15 +30037,15 @@ 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(execute_data TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
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, IS_UNUSED, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -30072,14 +30061,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(execute_data TSRMLS_CC);
- property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
+ property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
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, IS_UNUSED, 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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
@@ -30097,7 +30086,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDL
int use_copy = 0;
SAVE_OPLINE();
- var = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ var = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -30105,7 +30094,9 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDL
}
if (Z_TYPE_P(var) != IS_STRING) {
- ZVAL_DEREF(var);
+ if (IS_TMP_VAR != IS_TMP_VAR) {
+ ZVAL_DEREF(var);
+ }
if (Z_TYPE_P(var) != IS_STRING) {
use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
@@ -30117,7 +30108,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDL
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -30125,7 +30116,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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -30143,7 +30134,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC
SAVE_OPLINE();
- function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -30153,18 +30144,18 @@ 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(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -30229,10 +30220,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -30278,15 +30269,15 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_UNUSED != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ SEPARATE_ZVAL_NOREF(container);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -30333,7 +30324,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
@@ -30342,12 +30333,12 @@ num_index_dim:
//??? zval_copy_ctor(offset);
//??? }
Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
} else {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -30362,13 +30353,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(container);
+ if (IS_UNUSED != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -30376,7 +30369,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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -30392,8 +30385,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEN
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -30463,7 +30456,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) {
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -30489,7 +30482,7 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -30505,8 +30498,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZE
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -30522,7 +30515,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZE
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -30612,7 +30605,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER
/* Set the new yielded key */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -30669,8 +30662,8 @@ 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(execute_data TSRMLS_CC);
- zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *object = _get_obj_zval_ptr_unused(execute_data);
+ zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zval *value;
zval *zptr;
@@ -30686,7 +30679,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
@@ -30724,7 +30717,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -30748,7 +30741,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
}
@@ -30766,7 +30759,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -30779,7 +30772,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_VAR(int (*
}
return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
- zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
zend_fetch_dimension_address_RW(&rv, container, dim, IS_VAR TSRMLS_CC);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
@@ -30806,7 +30799,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_VAR(int (*
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
CHECK_EXCEPTION();
@@ -30822,7 +30815,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
var_ptr = NULL;
if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
@@ -30844,7 +30837,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31003,8 +30996,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -31017,7 +31010,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
@@ -31049,7 +31042,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -31068,7 +31061,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31094,8 +31087,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -31108,7 +31101,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_NULL(retval);
CHECK_EXCEPTION();
@@ -31136,7 +31129,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -31153,7 +31146,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31178,8 +31171,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -31191,7 +31184,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -31218,7 +31211,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31232,16 +31225,16 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -31257,15 +31250,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -31280,12 +31273,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -31296,7 +31287,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -31323,7 +31314,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31340,8 +31331,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -31350,8 +31341,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_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, IS_UNUSED, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -31369,15 +31360,15 @@ 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(execute_data TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
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, IS_UNUSED, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -31393,14 +31384,14 @@ 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(execute_data TSRMLS_CC);
- property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
+ property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
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, IS_UNUSED, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
@@ -31418,7 +31409,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL
int use_copy = 0;
SAVE_OPLINE();
- var = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ var = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -31426,7 +31417,9 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL
}
if (Z_TYPE_P(var) != IS_STRING) {
- ZVAL_DEREF(var);
+ if (IS_VAR != IS_TMP_VAR) {
+ ZVAL_DEREF(var);
+ }
if (Z_TYPE_P(var) != IS_STRING) {
use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
@@ -31438,7 +31431,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -31446,7 +31439,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL
* which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
* string offsets or overloaded objects
*/
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31464,7 +31457,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC
SAVE_OPLINE();
- function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -31474,18 +31467,18 @@ 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(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -31550,10 +31543,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31599,15 +31592,15 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_UNUSED != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ SEPARATE_ZVAL_NOREF(container);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -31654,7 +31647,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
@@ -31663,12 +31656,12 @@ num_index_dim:
//??? zval_copy_ctor(offset);
//??? }
Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
} else {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -31683,13 +31676,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(container);
+ if (IS_UNUSED != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -31697,7 +31692,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31713,8 +31708,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEN
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -31784,7 +31779,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) {
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -31810,7 +31805,7 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -31826,8 +31821,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZE
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -31843,7 +31838,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZE
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -31933,7 +31928,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
/* Set the new yielded key */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -31942,7 +31937,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
ZVAL_COPY_VALUE(&generator->key, 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);
+ zval_ptr_dtor_nogc(free_op2);
} else {
ZVAL_COPY_VALUE(&generator->key, key);
if (IS_VAR == IS_CV) {
@@ -31990,7 +31985,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(execute_data TSRMLS_CC);
+ zval *object = _get_obj_zval_ptr_unused(execute_data);
zval *property = NULL;
zval *value;
zval *zptr;
@@ -32045,7 +32040,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -32086,7 +32081,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -32482,7 +32477,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(execute_data TSRMLS_CC);
+ zval *object = _get_obj_zval_ptr_unused(execute_data);
zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
zval *value;
zval *zptr;
@@ -32537,7 +32532,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -32578,7 +32573,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -32813,7 +32808,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
@@ -32859,7 +32854,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -32903,7 +32898,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
zval *zptr;
SAVE_OPLINE();
- object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
@@ -32945,7 +32940,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -32986,7 +32981,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -32999,7 +32994,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -33041,14 +33036,14 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -33065,14 +33060,14 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
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, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -33087,11 +33082,9 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
@@ -33103,7 +33096,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -33147,7 +33140,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -33157,7 +33150,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -33175,7 +33168,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -33183,7 +33176,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -33199,7 +33192,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(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -33232,7 +33225,9 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLE
}
if (Z_TYPE_P(var) != IS_STRING) {
- ZVAL_DEREF(var);
+ if (IS_CV != IS_TMP_VAR) {
+ ZVAL_DEREF(var);
+ }
if (Z_TYPE_P(var) != IS_STRING) {
use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
@@ -33244,7 +33239,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLE
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -33279,7 +33274,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(execute_data TSRMLS_CC);
+ object = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
@@ -33355,7 +33350,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
@@ -33403,14 +33398,14 @@ 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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
if (IS_UNUSED != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
+ SEPARATE_ZVAL_NOREF(container);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -33487,13 +33482,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
zval *offset;
SAVE_OPLINE();
- container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- ZVAL_DEREF(container);
+ if (IS_UNUSED != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -33517,7 +33514,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -33588,7 +33585,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_UNUSED == IS_CV || IS_UNUSED == IS_VAR) {
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -33629,7 +33626,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(execute_data TSRMLS_CC);
+ container = _get_obj_zval_ptr_unused(execute_data);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -34289,7 +34286,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;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
@@ -34309,11 +34306,8 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
zval *varptr, *arg;
SAVE_OPLINE();
- if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
- if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
- return ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
- }
- } else {
+
+ if (!(opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
return ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -34328,20 +34322,18 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
if (IS_CV == IS_CV) {
Z_ADDREF_P(varptr);
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
- ZVAL_COPY_VALUE(arg, varptr);
} else {
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
- ZVAL_COPY(arg, varptr);
-
}
+
+ arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ ZVAL_COPY_VALUE(arg, varptr);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -34360,7 +34352,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
if (IS_CV == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
ZEND_VM_NEXT_OPCODE();
@@ -34371,12 +34363,11 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZVAL_COPY_VALUE(arg, varptr);
} else if (IS_CV == IS_VAR &&
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) {
- ZVAL_COPY_VALUE(arg, varptr);
- ZVAL_MAKE_REF(arg);
+ ZVAL_NEW_REF(arg, varptr);
} else {
- ZVAL_MAKE_REF(varptr);
- Z_ADDREF_P(varptr);
- ZVAL_REF(arg, Z_REF_P(varptr));
+ ZVAL_NEW_REF(arg, varptr);
+ Z_ADDREF_P(arg);
+ ZVAL_REF(varptr, Z_REF_P(arg));
}
ZEND_VM_NEXT_OPCODE();
@@ -34393,7 +34384,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;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
@@ -34477,7 +34468,7 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_COPY(param, arg);
}
- EX(call)->num_args = opline->op2.num;
+ ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -34532,14 +34523,14 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- if (UNEXPECTED(ce != EX(scope))) {
- zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(ce != EG(scope))) {
+ zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
- if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EX(scope)))) {
- zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EX(scope) ? EX(scope)->name->val : "");
+ if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
+ zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name->val, EG(scope) ? EG(scope)->name->val : "");
}
}
}
@@ -34547,7 +34538,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -34735,7 +34726,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -34748,7 +34739,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
return_value = EX_VAR(opline->result.var);
}
- call = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_CODE,
+ new_op_array->scope = EG(scope); /* ??? */
+
+ call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
(zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
if (EX(symbol_table)) {
@@ -34762,7 +34755,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
- call->frame_info = VM_FRAME_TOP_CODE;
+ ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
zend_execute_ex(call TSRMLS_CC);
}
@@ -35503,7 +35496,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -35825,7 +35818,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -35911,7 +35904,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -36121,7 +36114,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36144,7 +36137,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
ZVAL_DEREF(container);
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36185,7 +36178,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36218,7 +36211,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
ZVAL_DEREF(container);
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36248,7 +36241,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -36297,7 +36290,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36321,7 +36314,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36336,8 +36329,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
@@ -36352,7 +36343,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
/* here we are sure we are dealing with an object */
do {
if (IS_CONST == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -36406,7 +36397,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36432,7 +36423,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36688,7 +36679,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
@@ -36877,8 +36868,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) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -36897,8 +36888,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) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -36920,8 +36911,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
}
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
+ SEPARATE_ZVAL_NOREF(container);
offset = opline->op2.zv;
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -37004,7 +36995,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
}
offset = opline->op2.zv;
- ZVAL_DEREF(container);
+ if (IS_CV != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -37042,6 +37035,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -37070,8 +37064,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -37169,7 +37163,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -37430,23 +37424,39 @@ static int ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zval *varname;
zval *value;
zval *variable_ptr;
- Bucket *p;
uint32_t idx;
SAVE_OPLINE();
varname = opline->op2.zv;
- 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;
+
+ /* We store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname)) - 1;
+ if (EXPECTED(idx < EG(symbol_table).ht.nNumUsed)) {
+ Bucket *p = EG(symbol_table).ht.arData + idx;
+
+ if (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;
+ goto check_indirect;
+ }
+ }
+
+ 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);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+ } else {
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+check_indirect:
/* GLOBAL variable may be an INDIRECT pointer to CV */
if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
value = Z_INDIRECT_P(value);
@@ -37454,23 +37464,6 @@ static int ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
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);
- }
- }
- }
}
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
@@ -37488,9 +37481,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37503,9 +37496,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37518,9 +37511,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37533,9 +37526,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37548,9 +37541,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37563,9 +37556,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37578,9 +37571,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37593,9 +37586,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37608,9 +37601,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37624,9 +37617,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37640,9 +37633,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_equal_function(result,
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37656,9 +37649,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_not_equal_function(result,
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37672,9 +37665,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_is_smaller_function(result,
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37688,9 +37681,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37703,9 +37696,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37718,9 +37711,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37733,9 +37726,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37748,9 +37741,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37760,7 +37753,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
USE_OPLINE
zend_free_op free_op2, free_op_data1;
zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zval *value;
zval *zptr;
@@ -37776,7 +37769,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
@@ -37814,7 +37807,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -37838,7 +37831,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
}
@@ -37869,7 +37862,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMP(int (*bina
}
return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
- zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_fetch_dimension_address_RW(&rv, container, dim, IS_TMP_VAR TSRMLS_CC);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
@@ -37896,7 +37889,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMP(int (*bina
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
CHECK_EXCEPTION();
@@ -37912,7 +37905,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
@@ -37934,7 +37927,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38094,7 +38087,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
SAVE_OPLINE();
object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -38107,7 +38100,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
@@ -38139,7 +38132,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -38158,7 +38151,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38185,7 +38178,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
SAVE_OPLINE();
object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -38198,7 +38191,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_NULL(retval);
CHECK_EXCEPTION();
@@ -38226,7 +38219,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -38243,7 +38236,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38267,8 +38260,8 @@ 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_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38287,9 +38280,9 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(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_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -38310,9 +38303,9 @@ 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");
}
ZVAL_DEREF(container);
- 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_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -38328,8 +38321,8 @@ 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_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38352,19 +38345,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (IS_TMP_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
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_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -38384,9 +38377,9 @@ 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");
}
ZVAL_DEREF(container);
- 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_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2), IS_TMP_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -38404,7 +38397,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -38416,7 +38409,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -38443,7 +38436,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38457,7 +38450,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -38465,8 +38458,8 @@ 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, IS_CV, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -38482,15 +38475,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == 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, IS_CV, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -38505,12 +38498,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -38521,7 +38512,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_TMP_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -38548,7 +38539,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38565,7 +38556,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
@@ -38575,8 +38566,8 @@ 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, IS_CV, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -38595,14 +38586,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_CV == 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, IS_CV, property, IS_TMP_VAR, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -38619,13 +38610,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
object = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_CV == 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, IS_CV, 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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
@@ -38648,27 +38639,27 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
ZVAL_DEREF(object_ptr);
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
zend_free_op free_op2;
- zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_CV, 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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_free_op free_op2, free_op_data1;
zval rv;
zval *value;
- zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zval *variable_ptr;
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
zend_assign_to_string_offset(object_ptr, offset, value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
FREE_OP(free_op_data1);
} else {
zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_TMP_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
variable_ptr = Z_INDIRECT(rv);
@@ -38703,12 +38694,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
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 (IS_TMP_VAR == IS_TMP_VAR) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -38739,7 +38730,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
- function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_TMP_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -38755,12 +38746,12 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -38825,10 +38816,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38843,9 +38834,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_equal_function(result,
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -38887,7 +38878,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -38930,7 +38921,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -38984,9 +38975,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
}
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ SEPARATE_ZVAL_NOREF(container);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -39033,7 +39024,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
@@ -39042,12 +39033,12 @@ num_index_dim:
//??? zval_copy_ctor(offset);
//??? }
Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
} else {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -39066,9 +39057,11 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(container);
+ if (IS_CV != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -39076,7 +39069,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_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -39093,7 +39086,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OP
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -39163,7 +39156,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -39189,7 +39182,7 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -39206,7 +39199,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER(ZEND_O
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -39222,7 +39215,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER(ZEND_O
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -39312,7 +39305,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* Set the new yielded key */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST) {
@@ -39368,9 +39361,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
_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);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39388,9 +39381,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39403,9 +39396,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39418,9 +39411,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39433,9 +39426,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39448,9 +39441,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39463,9 +39456,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39478,9 +39471,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39493,9 +39486,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39508,9 +39501,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39524,9 +39517,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39540,9 +39533,9 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39556,9 +39549,9 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_not_equal_function(result,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39572,9 +39565,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_is_smaller_function(result,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39588,9 +39581,9 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39603,9 +39596,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39618,9 +39611,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39633,9 +39626,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39648,9 +39641,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39660,7 +39653,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
USE_OPLINE
zend_free_op free_op2, free_op_data1;
zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zval *value;
zval *zptr;
@@ -39676,7 +39669,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
@@ -39714,7 +39707,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -39738,7 +39731,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
}
@@ -39769,7 +39762,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_VAR(int (*bina
}
return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
- zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
zend_fetch_dimension_address_RW(&rv, container, dim, IS_VAR TSRMLS_CC);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
@@ -39796,7 +39789,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_VAR(int (*bina
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
FREE_OP(free_op_data1);
CHECK_EXCEPTION();
@@ -39812,7 +39805,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
@@ -39834,7 +39827,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -39994,7 +39987,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
SAVE_OPLINE();
object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -40007,7 +40000,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(retval);
}
@@ -40039,7 +40032,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -40058,7 +40051,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40085,7 +40078,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
SAVE_OPLINE();
object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -40098,7 +40091,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_NULL(retval);
CHECK_EXCEPTION();
@@ -40126,7 +40119,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -40143,7 +40136,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40315,8 +40308,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40335,9 +40328,9 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(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_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -40358,9 +40351,9 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_RW(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_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -40376,8 +40369,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40400,19 +40393,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
if (IS_VAR == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
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_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -40432,9 +40425,9 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
ZVAL_DEREF(container);
- zend_fetch_dimension_address_UNSET(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_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2), IS_VAR TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -40452,7 +40445,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -40464,7 +40457,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -40491,7 +40484,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40505,7 +40498,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -40513,8 +40506,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -40530,15 +40523,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == 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, IS_CV, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -40553,12 +40546,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
zend_free_op free_op2;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
@@ -40569,7 +40560,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
/* here we are sure we are dealing with an object */
do {
if (IS_VAR == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -40596,7 +40587,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
} while (0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40613,7 +40604,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
@@ -40623,8 +40614,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_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, IS_CV, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -40643,14 +40634,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV == 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, IS_CV, property, IS_VAR, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ zval_ptr_dtor_nogc(free_op2);
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -40667,13 +40658,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
object = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV == 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, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
@@ -40696,27 +40687,27 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
ZVAL_DEREF(object_ptr);
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
zend_free_op free_op2;
- zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_free_op free_op2, free_op_data1;
zval rv;
zval *value;
- zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
zval *variable_ptr;
if (UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
zend_assign_to_string_offset(object_ptr, offset, value, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
FREE_OP(free_op_data1);
} else {
zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_VAR TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
variable_ptr = Z_INDIRECT(rv);
@@ -40751,12 +40742,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
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 (IS_VAR == IS_TMP_VAR) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -40770,7 +40761,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
/* zend_assign_to_variable() always takes care of op2, never free it! */
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40784,7 +40775,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
zval *value_ptr;
SAVE_OPLINE();
- value_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
@@ -40793,17 +40784,17 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
(value_ptr == &EG(uninitialized_zval) ||
(opline->extended_value == ZEND_RETURNS_FUNCTION &&
!(Z_VAR_FLAGS_P(value_ptr) & IS_VAR_RET_REF)))) {
- if (!(free_op2.var != NULL)) {
+ if (!(free_op2 != NULL)) {
PZVAL_LOCK(value_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor_nogc(free_op2.var);};
+ if (free_op2) {zval_ptr_dtor_nogc(free_op2);};
HANDLE_EXCEPTION();
}
return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
- if (!(free_op2.var != NULL)) {
+ if (!(free_op2 != NULL)) {
PZVAL_LOCK(value_ptr);
}
}
@@ -40825,7 +40816,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
- if (!(free_op2.var != NULL)) {
+ if (!(free_op2 != NULL)) {
Z_DELREF_P(variable_ptr);
}
}
@@ -40834,7 +40825,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr);
}
- if (free_op2.var) {zval_ptr_dtor_nogc(free_op2.var);};
+ if (free_op2) {zval_ptr_dtor_nogc(free_op2);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40852,7 +40843,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
- function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -40868,12 +40859,12 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
@@ -40938,10 +40929,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40956,9 +40947,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -41000,7 +40991,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zend_string *str;
zend_ulong hval;
@@ -41043,7 +41034,7 @@ str_index:
/* do nothing */
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
@@ -41129,8 +41120,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) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -41149,8 +41140,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) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -41172,9 +41163,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
}
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ SEPARATE_ZVAL_NOREF(container);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -41221,7 +41212,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
@@ -41230,12 +41221,12 @@ num_index_dim:
//??? zval_copy_ctor(offset);
//??? }
Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
} else {
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
}
CHECK_EXCEPTION();
@@ -41254,9 +41245,11 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- ZVAL_DEREF(container);
+ if (IS_CV != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
@@ -41264,7 +41257,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -41294,6 +41287,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -41322,8 +41316,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -41351,7 +41345,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OP
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht = Z_ARRVAL_P(container);
@@ -41421,7 +41415,7 @@ num_index_prop:
result = 0;
if (UNEXPECTED(Z_TYPE_P(offset) != IS_LONG)) {
- if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
ZVAL_DEREF(offset);
}
if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
@@ -41447,7 +41441,7 @@ num_index_prop:
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -41464,7 +41458,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER(ZEND_O
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_property)) {
@@ -41480,7 +41474,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER(ZEND_O
result = ((opline->extended_value & ZEND_ISSET) == 0);
}
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
CHECK_EXCEPTION();
@@ -41609,7 +41603,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* Set the new yielded key */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
- zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST) {
@@ -41618,7 +41612,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_COPY_VALUE(&generator->key, 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);
+ zval_ptr_dtor_nogc(free_op2);
} else {
ZVAL_COPY_VALUE(&generator->key, key);
if (IS_VAR == IS_CV) {
@@ -41665,9 +41659,9 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
_get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
+ zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -41736,7 +41730,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -42165,7 +42159,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HA
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -42188,7 +42182,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_H
ZVAL_DEREF(container);
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -42214,7 +42208,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -42460,8 +42454,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) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -42480,8 +42474,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) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -42512,6 +42506,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -42540,8 +42535,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -43028,7 +43023,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -43350,7 +43345,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -43436,7 +43431,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -43498,7 +43493,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(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_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -43521,7 +43516,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
ZVAL_DEREF(container);
zend_fetch_dimension_address_RW(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_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -43562,7 +43557,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
}
ZVAL_DEREF(container);
zend_fetch_dimension_address_W(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_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -43595,7 +43590,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
ZVAL_DEREF(container);
zend_fetch_dimension_address_UNSET(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_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -43625,7 +43620,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -43674,7 +43669,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -43698,7 +43693,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -43713,8 +43708,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
zval *offset;
- zval *retval;
- zend_property_info *prop_info;
SAVE_OPLINE();
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
@@ -43729,7 +43722,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
/* here we are sure we are dealing with an object */
do {
if (IS_CV == IS_CONST &&
- EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
+ EXPECTED(Z_OBJCE_P(container) == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
zend_property_info *prop_info = CACHED_PTR(Z_CACHE_SLOT_P(offset) + 1);
zend_object *zobj = Z_OBJ_P(container);
@@ -43783,7 +43776,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -43809,7 +43802,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
- if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
+ if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -44095,7 +44088,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
GC_REFCOUNT(obj)++; /* For $this pointer */
}
- EX(call) = zend_vm_stack_push_call_frame(VM_FRAME_NESTED_FUNCTION,
+ EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
@@ -44252,8 +44245,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
}
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
- SEPARATE_ZVAL_NOREF(container);
}
+ SEPARATE_ZVAL_NOREF(container);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -44336,7 +44329,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
}
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- ZVAL_DEREF(container);
+ if (IS_CV != IS_UNUSED) {
+ ZVAL_DEREF(container);
+ }
if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl
index 03ed7ca65e..42da7aee85 100644
--- a/Zend/zend_vm_execute.skl
+++ b/Zend/zend_vm_execute.skl
@@ -34,7 +34,7 @@ ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value
return;
}
- execute_data = zend_vm_stack_push_call_frame(VM_FRAME_TOP_CODE,
+ execute_data = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_CODE,
(zend_function*)op_array, 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);
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 69c25085aa..5836adaefb 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -100,18 +100,18 @@ $op2_type = array(
);
$op1_free = array(
- "ANY" => "(free_op1.var != NULL)",
+ "ANY" => "(free_op1 != NULL)",
"TMP" => "1",
- "VAR" => "(free_op1.var != NULL)",
+ "VAR" => "(free_op1 != NULL)",
"CONST" => "0",
"UNUSED" => "0",
"CV" => "0",
);
$op2_free = array(
- "ANY" => "(free_op2.var != NULL)",
+ "ANY" => "(free_op2 != NULL)",
"TMP" => "1",
- "VAR" => "(free_op2.var != NULL)",
+ "VAR" => "(free_op2 != NULL)",
"CONST" => "0",
"UNUSED" => "0",
"CV" => "0",
@@ -119,8 +119,8 @@ $op2_free = array(
$op1_get_zval_ptr = array(
"ANY" => "get_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
- "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
- "VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1)",
+ "VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "opline->op1.zv",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
@@ -128,8 +128,8 @@ $op1_get_zval_ptr = array(
$op2_get_zval_ptr = array(
"ANY" => "get_zval_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
- "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
- "VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2)",
+ "VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "opline->op2.zv",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
@@ -138,7 +138,7 @@ $op2_get_zval_ptr = array(
$op1_get_zval_ptr_ptr = array(
"ANY" => "get_zval_ptr_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
"TMP" => "NULL",
- "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
+ "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "NULL",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
@@ -147,7 +147,7 @@ $op1_get_zval_ptr_ptr = array(
$op2_get_zval_ptr_ptr = array(
"ANY" => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
"TMP" => "NULL",
- "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
+ "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "NULL",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
@@ -155,8 +155,8 @@ $op2_get_zval_ptr_ptr = array(
$op1_get_zval_ptr_deref = array(
"ANY" => "get_zval_ptr_deref(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
- "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)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1)",
+ "VAR" => "_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1)",
"CONST" => "opline->op1.zv",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var TSRMLS_CC)",
@@ -164,8 +164,8 @@ $op1_get_zval_ptr_deref = array(
$op2_get_zval_ptr_deref = array(
"ANY" => "get_zval_ptr_deref(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
- "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)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2)",
+ "VAR" => "_get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2)",
"CONST" => "opline->op2.zv",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var TSRMLS_CC)",
@@ -174,7 +174,7 @@ $op2_get_zval_ptr_deref = array(
$op1_get_zval_ptr_ptr_undef = array(
"ANY" => "get_zval_ptr_ptr_undef(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
"TMP" => "NULL",
- "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
+ "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "NULL",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op1.var TSRMLS_CC)",
@@ -183,7 +183,7 @@ $op1_get_zval_ptr_ptr_undef = array(
$op2_get_zval_ptr_ptr_undef = array(
"ANY" => "get_zval_ptr_ptr_undef(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
"TMP" => "NULL",
- "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
+ "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "NULL",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op2.var TSRMLS_CC)",
@@ -191,62 +191,62 @@ $op2_get_zval_ptr_ptr_undef = array(
$op1_get_obj_zval_ptr = array(
"ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
- "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
- "VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1)",
+ "VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "opline->op1.zv",
- "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
+ "UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
);
$op2_get_obj_zval_ptr = array(
"ANY" => "get_obj_zval_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
- "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
- "VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2)",
+ "VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "opline->op2.zv",
- "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
+ "UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
);
$op1_get_obj_zval_ptr_deref = array(
"ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
- "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)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1)",
+ "VAR" => "_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1)",
"CONST" => "opline->op1.zv",
- "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
+ "UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
"CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var TSRMLS_CC)",
);
$op2_get_obj_zval_ptr_deref = array(
"ANY" => "get_obj_zval_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
- "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)",
+ "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2)",
+ "VAR" => "_get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2)",
"CONST" => "opline->op2.zv",
- "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
+ "UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
"CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var TSRMLS_CC)",
);
$op1_get_obj_zval_ptr_ptr = array(
"ANY" => "get_obj_zval_ptr_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
"TMP" => "NULL",
- "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
+ "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "NULL",
- "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
+ "UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
);
$op2_get_obj_zval_ptr_ptr = array(
"ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
"TMP" => "NULL",
- "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
+ "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "NULL",
- "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
+ "UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
"CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
);
$op1_free_op = array(
"ANY" => "FREE_OP(free_op1)",
- "TMP" => "zval_ptr_dtor_nogc(free_op1.var)",
- "VAR" => "zval_ptr_dtor_nogc(free_op1.var)",
+ "TMP" => "zval_ptr_dtor_nogc(free_op1)",
+ "VAR" => "zval_ptr_dtor_nogc(free_op1)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
@@ -254,44 +254,44 @@ $op1_free_op = array(
$op2_free_op = array(
"ANY" => "FREE_OP(free_op2)",
- "TMP" => "zval_ptr_dtor_nogc(free_op2.var)",
- "VAR" => "zval_ptr_dtor_nogc(free_op2.var)",
+ "TMP" => "zval_ptr_dtor_nogc(free_op2)",
+ "VAR" => "zval_ptr_dtor_nogc(free_op2)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
);
$op1_free_op_if_var = array(
- "ANY" => "if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(free_op1.var);}",
+ "ANY" => "if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(free_op1);}",
"TMP" => "",
- "VAR" => "zval_ptr_dtor_nogc(free_op1.var)",
+ "VAR" => "zval_ptr_dtor_nogc(free_op1)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
);
$op2_free_op_if_var = array(
- "ANY" => "if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(free_op1.var);}",
+ "ANY" => "if (opline->op2_type == IS_VAR) {zval_ptr_dtor_nogc(free_op2);}",
"TMP" => "",
- "VAR" => "zval_ptr_dtor_nogc(free_op2.var)",
+ "VAR" => "zval_ptr_dtor_nogc(free_op2)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
);
$op1_free_op_var_ptr = array(
- "ANY" => "if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}",
+ "ANY" => "if (free_op1) {zval_ptr_dtor_nogc(free_op1);}",
"TMP" => "",
- "VAR" => "if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);}",
+ "VAR" => "if (free_op1) {zval_ptr_dtor_nogc(free_op1);}",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
);
$op2_free_op_var_ptr = array(
- "ANY" => "if (free_op2.var) {zval_ptr_dtor_nogc(free_op2.var);}",
+ "ANY" => "if (free_op2) {zval_ptr_dtor_nogc(free_op2);}",
"TMP" => "",
- "VAR" => "if (free_op2.var) {zval_ptr_dtor_nogc(free_op2.var);}",
+ "VAR" => "if (free_op2) {zval_ptr_dtor_nogc(free_op2);}",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
@@ -1217,7 +1217,9 @@ function gen_vm($def, $skel) {
out($f, $GLOBALS['header_text']);
fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
+ fputs($f, "BEGIN_EXTERN_C()\n\n");
fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n");
+ fputs($f, "END_EXTERN_C()\n\n");
foreach ($opcodes as $code => $dsc) {
$code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT);
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index c06fd84ff4..9d969877e0 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -21,8 +21,12 @@
#ifndef ZEND_VM_OPCODES_H
#define ZEND_VM_OPCODES_H
+BEGIN_EXTERN_C()
+
ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
+END_EXTERN_C()
+
#define ZEND_NOP 0
#define ZEND_ADD 1
#define ZEND_SUB 2
diff --git a/ext/calendar/julian.c b/ext/calendar/julian.c
index 659ffc1740..904727ff04 100644
--- a/ext/calendar/julian.c
+++ b/ext/calendar/julian.c
@@ -47,7 +47,7 @@
*
* CALENDAR OVERVIEW
*
- * Julias Ceasar created the calendar in 46 B.C. as a modified form of
+ * Julius Caesar created the calendar in 46 B.C. as a modified form of
* the old Roman republican calendar which was based on lunar cycles.
* The new Julian calendar set fixed lengths for the months, abandoning
* the lunar cycle. It also specified that there would be exactly 12
diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt
index 4eeb1ca93e..6183cae9ee 100644
--- a/ext/calendar/tests/unixtojd.phpt
+++ b/ext/calendar/tests/unixtojd.phpt
@@ -21,10 +21,10 @@ putenv('TZ=UTC');
// -uses --INI-- section with date.timezone=UTC
// -uses putenv('TZ=UTC')
// date.timezone=UTC
-// -if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
+// -if omitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -easter_date() calls mktime() and localtime()
// -whereas unixtojd(1000000000) calls localtime(1000000000)
-// -if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
+// -if omitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
//
// unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours
// -this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly)
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index e1a9503dff..7de6d949bb 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -254,7 +254,7 @@ PHP_FUNCTION(com_create_instance)
ITypeLib_Release(TL);
}
} else if (obj->typeinfo && COMG(autoreg_on)) {
- int idx;
+ UINT idx;
if (SUCCEEDED(ITypeInfo_GetContainingTypeLib(obj->typeinfo, &TL, &idx))) {
/* check if the library is already in the cache by getting its name */
@@ -693,7 +693,6 @@ PHP_FUNCTION(com_event_sink)
{
zval *object, *sinkobject, *sink=NULL;
char *dispname = NULL, *typelibname = NULL;
- zend_bool gotguid = 0;
php_com_dotnet_object *obj;
ITypeInfo *typeinfo = NULL;
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index 7e15865950..e4ed4916af 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -387,7 +387,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
#define COM_ERR_CONST(x) { \
zend_long __tmp; \
- ULongToUIntPtr(x, &__tmp); \
+ ULongToIntPtr(x, &__tmp); \
REGISTER_LONG_CONSTANT(#x, __tmp, CONST_CS|CONST_PERSISTENT); \
}
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index 17b69d2460..f07d7ff65d 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -67,11 +67,11 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
hr = LoadRegTypeLib((REFGUID)&clsid, major_i, minor_i, LANG_NEUTRAL, &TL);
/* if that failed, assumed that the GUID is actually a CLSID and
- * attemp to get the library via an instance of that class */
+ * attempt to get the library via an instance of that class */
if (FAILED(hr) && (major == NULL || minor == NULL)) {
IDispatch *disp = NULL;
ITypeInfo *info = NULL;
- int idx;
+ UINT idx;
if (SUCCEEDED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID*)&disp)) &&
SUCCEEDED(hr = IDispatch_GetTypeInfo(disp, 0, LANG_NEUTRAL, &info))) {
@@ -96,7 +96,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
DWORD VersionCount;
char version[20];
char *libname;
- DWORD libnamelen;
+ long libnamelen;
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "TypeLib", 0, KEY_READ, &hkey) &&
ERROR_SUCCESS == RegQueryInfoKey(hkey, NULL, NULL, NULL, &SubKeys,
@@ -116,7 +116,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
continue;
}
/* get the default value for this key and compare */
- libnamelen = (DWORD)strlen(search_string)+1;
+ libnamelen = (long)strlen(search_string)+1;
if (ERROR_SUCCESS == RegQueryValue(hsubkey, version, libname, &libnamelen)) {
if (0 == stricmp(libname, search_string)) {
char *str = NULL;
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 6a81eed102..7317b8d0e4 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -39,8 +39,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
HashPosition pos;
int keytype;
zend_string *strindex;
- zend_long intindex = -1;
- zend_long max_index = 0;
+ zend_ulong intindex = 0;
VARIANT *va;
zval *item;
@@ -54,15 +53,15 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
goto bogus;
} else if (HASH_KEY_NON_EXISTENT == keytype) {
break;
- }
- if (intindex > max_index) {
- max_index = intindex;
+ } else if (intindex > UINT_MAX) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: max number %u of elements in safe array exceeded", UINT_MAX);
+ break;
}
}
/* allocate the structure */
bound.lLbound = 0;
- bound.cElements = (ULONG)(intindex + 1);
+ bound.cElements = zend_hash_num_elements(HASH_OF(z));
sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
/* get a lock on the array itself */
diff --git a/ext/ctype/ctype.xml b/ext/ctype/ctype.xml
index 5837b9b5d0..0e7c714b70 100644
--- a/ext/ctype/ctype.xml
+++ b/ext/ctype/ctype.xml
@@ -9,7 +9,7 @@
current locale.
</para>
<para>
- When called with an integer argument theese functions
+ When called with an integer argument these functions
behave exactly like their C counterparts.
</para>
<para>
diff --git a/ext/curl/tests/curl_multi_init_param.phpt b/ext/curl/tests/curl_multi_init_param.phpt
new file mode 100644
index 0000000000..e7848976aa
--- /dev/null
+++ b/ext/curl/tests/curl_multi_init_param.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test curl_multi_init() fail if any parameter is passed
+--CREDITS--
+Paulo Eduardo <pauloelr [at] gmail [dot] com>
+#testfest SP 2014
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; ?>
+--FILE--
+<?php
+/* Prototype : resource curl_multi_init(void)
+ * Description : Returns a new cURL multi handle
+ * Source code : ext/curl/multi.c
+ * Test documentation: http://wiki.php.net/qa/temp/ext/curl
+ */
+
+// start testing
+
+//create the multiple cURL handle
+$mh = curl_multi_init('test');
+var_dump($mh);
+
+?>
+===DONE===
+--EXPECTF--
+Warning: curl_multi_init() expects exactly 0 parameters, %d given in %s on line %d
+NULL
+===DONE===
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index a503f9e01e..eb6d0af310 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -336,7 +336,7 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
{
uint32_t i;
- /* If there is no transistion time, we pick the first one, if that doesn't
+ /* If there is no transition time, we pick the first one, if that doesn't
* exist we return NULL */
if (!tz->timecnt || !tz->trans) {
*transition_time = 0;
@@ -346,8 +346,8 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
return NULL;
}
- /* If the TS is lower than the first transistion time, then we scan over
- * all the transistion times to find the first non-DST one, or the first
+ /* If the TS is lower than the first transition time, then we scan over
+ * all the transition times to find the first non-DST one, or the first
* one in case there are only DST entries. Not sure which smartass came up
* with this idea in the first though :) */
if (ts < tz->trans[0]) {
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index 0fd9bfbe10..157f0f4941 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -2,589 +2,589 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[583] = {
{ "Africa/Abidjan" , 0x000000 },
{ "Africa/Accra" , 0x000055 },
{ "Africa/Addis_Ababa" , 0x00019D },
- { "Africa/Algiers" , 0x0001F3 },
- { "Africa/Asmara" , 0x00031E },
- { "Africa/Asmera" , 0x000374 },
- { "Africa/Bamako" , 0x0003CA },
- { "Africa/Bangui" , 0x00041F },
- { "Africa/Banjul" , 0x000474 },
- { "Africa/Bissau" , 0x0004C9 },
- { "Africa/Blantyre" , 0x00052F },
- { "Africa/Brazzaville" , 0x000584 },
- { "Africa/Bujumbura" , 0x0005D9 },
- { "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" , 0x01B912 },
- { "Asia/Hovd" , 0x01BAD4 },
- { "Asia/Irkutsk" , 0x01BC4C },
- { "Asia/Istanbul" , 0x01BE37 },
- { "Asia/Jakarta" , 0x01C224 },
- { "Asia/Jayapura" , 0x01C2CE },
- { "Asia/Jerusalem" , 0x01C36B },
- { "Asia/Kabul" , 0x01C69A },
- { "Asia/Kamchatka" , 0x01C6EB },
- { "Asia/Karachi" , 0x01C8E4 },
- { "Asia/Kashgar" , 0x01C999 },
- { "Asia/Kathmandu" , 0x01C9EE },
- { "Asia/Katmandu" , 0x01CA54 },
- { "Asia/Khandyga" , 0x01CABA },
- { "Asia/Kolkata" , 0x01CCE4 },
- { "Asia/Krasnoyarsk" , 0x01CD5D },
- { "Asia/Kuala_Lumpur" , 0x01CF4A },
- { "Asia/Kuching" , 0x01D007 },
- { "Asia/Kuwait" , 0x01D0F5 },
- { "Asia/Macao" , 0x01D14A },
- { "Asia/Macau" , 0x01D285 },
- { "Asia/Magadan" , 0x01D3C0 },
- { "Asia/Makassar" , 0x01D5C4 },
- { "Asia/Manila" , 0x01D689 },
- { "Asia/Muscat" , 0x01D70E },
- { "Asia/Nicosia" , 0x01D763 },
- { "Asia/Novokuznetsk" , 0x01DA4B },
- { "Asia/Novosibirsk" , 0x01DC6B },
- { "Asia/Omsk" , 0x01DE5B },
- { "Asia/Oral" , 0x01E047 },
- { "Asia/Phnom_Penh" , 0x01E217 },
- { "Asia/Pontianak" , 0x01E26C },
- { "Asia/Pyongyang" , 0x01E32E },
- { "Asia/Qatar" , 0x01E3BE },
- { "Asia/Qyzylorda" , 0x01E424 },
- { "Asia/Rangoon" , 0x01E5FA },
- { "Asia/Riyadh" , 0x01E672 },
- { "Asia/Saigon" , 0x01E6C7 },
- { "Asia/Sakhalin" , 0x01E769 },
- { "Asia/Samarkand" , 0x01E966 },
- { "Asia/Seoul" , 0x01EA9C },
- { "Asia/Shanghai" , 0x01EB63 },
- { "Asia/Singapore" , 0x01EC0F },
- { "Asia/Srednekolymsk" , 0x01ECC6 },
- { "Asia/Taipei" , 0x01EEC6 },
- { "Asia/Tashkent" , 0x01EFF7 },
- { "Asia/Tbilisi" , 0x01F128 },
- { "Asia/Tehran" , 0x01F2E2 },
- { "Asia/Tel_Aviv" , 0x01F550 },
- { "Asia/Thimbu" , 0x01F87F },
- { "Asia/Thimphu" , 0x01F8E5 },
- { "Asia/Tokyo" , 0x01F94B },
- { "Asia/Ujung_Pandang" , 0x01F9D5 },
- { "Asia/Ulaanbaatar" , 0x01FA52 },
- { "Asia/Ulan_Bator" , 0x01FBAD },
- { "Asia/Urumqi" , 0x01FCFA },
- { "Asia/Ust-Nera" , 0x01FD5C },
- { "Asia/Vientiane" , 0x01FF6E },
- { "Asia/Vladivostok" , 0x01FFC3 },
- { "Asia/Yakutsk" , 0x0201AD },
- { "Asia/Yekaterinburg" , 0x020397 },
- { "Asia/Yerevan" , 0x0205B8 },
- { "Atlantic/Azores" , 0x0207B8 },
- { "Atlantic/Bermuda" , 0x020CBB },
- { "Atlantic/Canary" , 0x020F9C },
- { "Atlantic/Cape_Verde" , 0x021272 },
- { "Atlantic/Faeroe" , 0x0212EB },
- { "Atlantic/Faroe" , 0x02158F },
- { "Atlantic/Jan_Mayen" , 0x021833 },
- { "Atlantic/Madeira" , 0x021B65 },
- { "Atlantic/Reykjavik" , 0x02206E },
- { "Atlantic/South_Georgia" , 0x022227 },
- { "Atlantic/St_Helena" , 0x022439 },
- { "Atlantic/Stanley" , 0x02226B },
- { "Australia/ACT" , 0x02248E },
- { "Australia/Adelaide" , 0x0227B1 },
- { "Australia/Brisbane" , 0x022AE3 },
- { "Australia/Broken_Hill" , 0x022BB0 },
- { "Australia/Canberra" , 0x022EF4 },
- { "Australia/Currie" , 0x023217 },
- { "Australia/Darwin" , 0x023550 },
- { "Australia/Eucla" , 0x0235DC },
- { "Australia/Hobart" , 0x0236B8 },
- { "Australia/LHI" , 0x023A1C },
- { "Australia/Lindeman" , 0x023CBD },
- { "Australia/Lord_Howe" , 0x023DA4 },
- { "Australia/Melbourne" , 0x024055 },
- { "Australia/North" , 0x024380 },
- { "Australia/NSW" , 0x0243FA },
- { "Australia/Perth" , 0x02471D },
- { "Australia/Queensland" , 0x0247FB },
- { "Australia/South" , 0x0248AD },
- { "Australia/Sydney" , 0x024BD0 },
- { "Australia/Tasmania" , 0x024F13 },
- { "Australia/Victoria" , 0x02525E },
- { "Australia/West" , 0x025581 },
- { "Australia/Yancowinna" , 0x02563D },
- { "Brazil/Acre" , 0x025965 },
- { "Brazil/DeNoronha" , 0x025A69 },
- { "Brazil/East" , 0x025B89 },
- { "Brazil/West" , 0x025E66 },
- { "Canada/Atlantic" , 0x025F5E },
- { "Canada/Central" , 0x026446 },
- { "Canada/East-Saskatchewan" , 0x026D50 },
- { "Canada/Eastern" , 0x026860 },
- { "Canada/Mountain" , 0x026ED9 },
- { "Canada/Newfoundland" , 0x02724F },
- { "Canada/Pacific" , 0x02777A },
- { "Canada/Saskatchewan" , 0x027B93 },
- { "Canada/Yukon" , 0x027D1C },
- { "CET" , 0x02801F },
- { "Chile/Continental" , 0x028328 },
- { "Chile/EasterIsland" , 0x0286C3 },
- { "CST6CDT" , 0x028A05 },
- { "Cuba" , 0x028D56 },
- { "EET" , 0x0290C9 },
- { "Egypt" , 0x02937C },
- { "Eire" , 0x029763 },
- { "EST" , 0x029C74 },
- { "EST5EDT" , 0x029CB8 },
- { "Etc/GMT" , 0x02A009 },
- { "Etc/GMT+0" , 0x02A0D5 },
- { "Etc/GMT+1" , 0x02A15F },
- { "Etc/GMT+10" , 0x02A1EC },
- { "Etc/GMT+11" , 0x02A27A },
- { "Etc/GMT+12" , 0x02A308 },
- { "Etc/GMT+2" , 0x02A423 },
- { "Etc/GMT+3" , 0x02A4AF },
- { "Etc/GMT+4" , 0x02A53B },
- { "Etc/GMT+5" , 0x02A5C7 },
- { "Etc/GMT+6" , 0x02A653 },
- { "Etc/GMT+7" , 0x02A6DF },
- { "Etc/GMT+8" , 0x02A76B },
- { "Etc/GMT+9" , 0x02A7F7 },
- { "Etc/GMT-0" , 0x02A091 },
- { "Etc/GMT-1" , 0x02A119 },
- { "Etc/GMT-10" , 0x02A1A5 },
- { "Etc/GMT-11" , 0x02A233 },
- { "Etc/GMT-12" , 0x02A2C1 },
- { "Etc/GMT-13" , 0x02A34F },
- { "Etc/GMT-14" , 0x02A396 },
- { "Etc/GMT-2" , 0x02A3DD },
- { "Etc/GMT-3" , 0x02A469 },
- { "Etc/GMT-4" , 0x02A4F5 },
- { "Etc/GMT-5" , 0x02A581 },
- { "Etc/GMT-6" , 0x02A60D },
- { "Etc/GMT-7" , 0x02A699 },
- { "Etc/GMT-8" , 0x02A725 },
- { "Etc/GMT-9" , 0x02A7B1 },
- { "Etc/GMT0" , 0x02A04D },
- { "Etc/Greenwich" , 0x02A83D },
- { "Etc/UCT" , 0x02A881 },
- { "Etc/Universal" , 0x02A8C5 },
- { "Etc/UTC" , 0x02A909 },
- { "Etc/Zulu" , 0x02A94D },
- { "Europe/Amsterdam" , 0x02A991 },
- { "Europe/Andorra" , 0x02ADCF },
- { "Europe/Athens" , 0x02B04B },
- { "Europe/Belfast" , 0x02B38E },
- { "Europe/Belgrade" , 0x02B8C5 },
- { "Europe/Berlin" , 0x02BB8E },
- { "Europe/Bratislava" , 0x02BEF2 },
- { "Europe/Brussels" , 0x02C224 },
- { "Europe/Bucharest" , 0x02C65B },
- { "Europe/Budapest" , 0x02C985 },
- { "Europe/Busingen" , 0x02CCEE },
- { "Europe/Chisinau" , 0x02CFA5 },
- { "Europe/Copenhagen" , 0x02D333 },
- { "Europe/Dublin" , 0x02D63D },
- { "Europe/Gibraltar" , 0x02DB4E },
- { "Europe/Guernsey" , 0x02DFA5 },
- { "Europe/Helsinki" , 0x02E4DC },
- { "Europe/Isle_of_Man" , 0x02E792 },
- { "Europe/Istanbul" , 0x02ECC9 },
- { "Europe/Jersey" , 0x02F0B6 },
- { "Europe/Kaliningrad" , 0x02F5ED },
- { "Europe/Kiev" , 0x02F858 },
- { "Europe/Lisbon" , 0x02FB74 },
- { "Europe/Ljubljana" , 0x030078 },
- { "Europe/London" , 0x030341 },
- { "Europe/Luxembourg" , 0x030878 },
- { "Europe/Madrid" , 0x030CCE },
- { "Europe/Malta" , 0x031094 },
- { "Europe/Mariehamn" , 0x03144D },
- { "Europe/Minsk" , 0x031703 },
- { "Europe/Monaco" , 0x031916 },
- { "Europe/Moscow" , 0x031D51 },
- { "Europe/Nicosia" , 0x031FAB },
- { "Europe/Oslo" , 0x032293 },
- { "Europe/Paris" , 0x0325C5 },
- { "Europe/Podgorica" , 0x032A0B },
- { "Europe/Prague" , 0x032CD4 },
- { "Europe/Riga" , 0x033006 },
- { "Europe/Rome" , 0x03334B },
- { "Europe/Samara" , 0x03370E },
- { "Europe/San_Marino" , 0x033977 },
- { "Europe/Sarajevo" , 0x033D3A },
- { "Europe/Simferopol" , 0x034003 },
- { "Europe/Skopje" , 0x034254 },
- { "Europe/Sofia" , 0x03451D },
- { "Europe/Stockholm" , 0x034825 },
- { "Europe/Tallinn" , 0x034AD4 },
- { "Europe/Tirane" , 0x034E0E },
- { "Europe/Tiraspol" , 0x035114 },
- { "Europe/Uzhgorod" , 0x0354A2 },
- { "Europe/Vaduz" , 0x0357B9 },
- { "Europe/Vatican" , 0x035A68 },
- { "Europe/Vienna" , 0x035E2B },
- { "Europe/Vilnius" , 0x036158 },
- { "Europe/Volgograd" , 0x036497 },
- { "Europe/Warsaw" , 0x0366B8 },
- { "Europe/Zagreb" , 0x036A99 },
- { "Europe/Zaporozhye" , 0x036D62 },
- { "Europe/Zurich" , 0x0370A3 },
- { "Factory" , 0x037352 },
- { "GB" , 0x0373C3 },
- { "GB-Eire" , 0x0378FA },
- { "GMT" , 0x037E31 },
- { "GMT+0" , 0x037EFD },
- { "GMT-0" , 0x037EB9 },
- { "GMT0" , 0x037E75 },
- { "Greenwich" , 0x037F41 },
- { "Hongkong" , 0x037F85 },
- { "HST" , 0x038147 },
- { "Iceland" , 0x03818B },
- { "Indian/Antananarivo" , 0x038344 },
- { "Indian/Chagos" , 0x0383B8 },
- { "Indian/Christmas" , 0x03841A },
- { "Indian/Cocos" , 0x03845E },
- { "Indian/Comoro" , 0x0384A2 },
- { "Indian/Kerguelen" , 0x0384F7 },
- { "Indian/Mahe" , 0x03854C },
- { "Indian/Maldives" , 0x0385A1 },
- { "Indian/Mauritius" , 0x0385F6 },
- { "Indian/Mayotte" , 0x03866C },
- { "Indian/Reunion" , 0x0386C1 },
- { "Iran" , 0x038716 },
- { "Israel" , 0x038984 },
- { "Jamaica" , 0x038CB3 },
- { "Japan" , 0x038D78 },
- { "Kwajalein" , 0x038E02 },
- { "Libya" , 0x038E65 },
- { "MET" , 0x038F6E },
- { "Mexico/BajaNorte" , 0x039277 },
- { "Mexico/BajaSur" , 0x0395E0 },
- { "Mexico/General" , 0x039825 },
- { "MST" , 0x039A83 },
- { "MST7MDT" , 0x039AC7 },
- { "Navajo" , 0x039E18 },
- { "NZ" , 0x03A191 },
- { "NZ-CHAT" , 0x03A50F },
- { "Pacific/Apia" , 0x03A7F3 },
- { "Pacific/Auckland" , 0x03A98F },
- { "Pacific/Bougainville" , 0x03AD1B },
- { "Pacific/Chatham" , 0x03AD92 },
- { "Pacific/Chuuk" , 0x03B085 },
- { "Pacific/Easter" , 0x03B0DE },
- { "Pacific/Efate" , 0x03B42D },
- { "Pacific/Enderbury" , 0x03B4F3 },
- { "Pacific/Fakaofo" , 0x03B561 },
- { "Pacific/Fiji" , 0x03B5B2 },
- { "Pacific/Funafuti" , 0x03B745 },
- { "Pacific/Galapagos" , 0x03B789 },
- { "Pacific/Gambier" , 0x03B801 },
- { "Pacific/Guadalcanal" , 0x03B866 },
- { "Pacific/Guam" , 0x03B8BB },
- { "Pacific/Honolulu" , 0x03B911 },
- { "Pacific/Johnston" , 0x03B988 },
- { "Pacific/Kiritimati" , 0x03BA07 },
- { "Pacific/Kosrae" , 0x03BA72 },
- { "Pacific/Kwajalein" , 0x03BACF },
- { "Pacific/Majuro" , 0x03BB3B },
- { "Pacific/Marquesas" , 0x03BB9A },
- { "Pacific/Midway" , 0x03BC01 },
- { "Pacific/Nauru" , 0x03BC8B },
- { "Pacific/Niue" , 0x03BD03 },
- { "Pacific/Norfolk" , 0x03BD61 },
- { "Pacific/Noumea" , 0x03BDB6 },
- { "Pacific/Pago_Pago" , 0x03BE46 },
- { "Pacific/Palau" , 0x03BEBD },
- { "Pacific/Pitcairn" , 0x03BF01 },
- { "Pacific/Pohnpei" , 0x03BF56 },
- { "Pacific/Ponape" , 0x03BFAB },
- { "Pacific/Port_Moresby" , 0x03BFF0 },
- { "Pacific/Rarotonga" , 0x03C042 },
- { "Pacific/Saipan" , 0x03C11E },
- { "Pacific/Samoa" , 0x03C181 },
- { "Pacific/Tahiti" , 0x03C1F8 },
- { "Pacific/Tarawa" , 0x03C25D },
- { "Pacific/Tongatapu" , 0x03C2B1 },
- { "Pacific/Truk" , 0x03C33D },
- { "Pacific/Wake" , 0x03C382 },
- { "Pacific/Wallis" , 0x03C3D2 },
- { "Pacific/Yap" , 0x03C416 },
- { "Poland" , 0x03C45B },
- { "Portugal" , 0x03C83C },
- { "PRC" , 0x03CD38 },
- { "PST8PDT" , 0x03CDD8 },
- { "ROC" , 0x03D129 },
- { "ROK" , 0x03D25A },
- { "Singapore" , 0x03D321 },
- { "Turkey" , 0x03D3D8 },
- { "UCT" , 0x03D7C5 },
- { "Universal" , 0x03D809 },
- { "US/Alaska" , 0x03D84D },
- { "US/Aleutian" , 0x03DBB6 },
- { "US/Arizona" , 0x03DF1C },
- { "US/Central" , 0x03DFAA },
- { "US/East-Indiana" , 0x03E9B4 },
- { "US/Eastern" , 0x03E4B5 },
- { "US/Hawaii" , 0x03EC1E },
- { "US/Indiana-Starke" , 0x03EC8F },
- { "US/Michigan" , 0x03F000 },
- { "US/Mountain" , 0x03F337 },
- { "US/Pacific" , 0x03F6B0 },
- { "US/Pacific-New" , 0x03FAB5 },
- { "US/Samoa" , 0x03FEBA },
- { "UTC" , 0x03FF31 },
- { "W-SU" , 0x040228 },
- { "WET" , 0x03FF75 },
- { "Zulu" , 0x04046B },
+ { "Africa/Algiers" , 0x00021C },
+ { "Africa/Asmara" , 0x000347 },
+ { "Africa/Asmera" , 0x0003C6 },
+ { "Africa/Bamako" , 0x000445 },
+ { "Africa/Bangui" , 0x00049A },
+ { "Africa/Banjul" , 0x0004EF },
+ { "Africa/Bissau" , 0x000544 },
+ { "Africa/Blantyre" , 0x0005AA },
+ { "Africa/Brazzaville" , 0x0005FF },
+ { "Africa/Bujumbura" , 0x000654 },
+ { "Africa/Cairo" , 0x0006A9 },
+ { "Africa/Casablanca" , 0x000A90 },
+ { "Africa/Ceuta" , 0x000CF2 },
+ { "Africa/Conakry" , 0x000FF9 },
+ { "Africa/Dakar" , 0x00104E },
+ { "Africa/Dar_es_Salaam" , 0x0010A3 },
+ { "Africa/Djibouti" , 0x001122 },
+ { "Africa/Douala" , 0x0011A1 },
+ { "Africa/El_Aaiun" , 0x0011F6 },
+ { "Africa/Freetown" , 0x001421 },
+ { "Africa/Gaborone" , 0x001476 },
+ { "Africa/Harare" , 0x0014CB },
+ { "Africa/Johannesburg" , 0x001520 },
+ { "Africa/Juba" , 0x00158E },
+ { "Africa/Kampala" , 0x0016A1 },
+ { "Africa/Khartoum" , 0x001720 },
+ { "Africa/Kigali" , 0x001833 },
+ { "Africa/Kinshasa" , 0x001888 },
+ { "Africa/Lagos" , 0x0018F4 },
+ { "Africa/Libreville" , 0x001949 },
+ { "Africa/Lome" , 0x00199E },
+ { "Africa/Luanda" , 0x0019F3 },
+ { "Africa/Lubumbashi" , 0x001A48 },
+ { "Africa/Lusaka" , 0x001AB4 },
+ { "Africa/Malabo" , 0x001B09 },
+ { "Africa/Maputo" , 0x001B5E },
+ { "Africa/Maseru" , 0x001BB3 },
+ { "Africa/Mbabane" , 0x001C21 },
+ { "Africa/Mogadishu" , 0x001C8F },
+ { "Africa/Monrovia" , 0x001D0E },
+ { "Africa/Nairobi" , 0x001D74 },
+ { "Africa/Ndjamena" , 0x001DF3 },
+ { "Africa/Niamey" , 0x001E5F },
+ { "Africa/Nouakchott" , 0x001EB4 },
+ { "Africa/Ouagadougou" , 0x001F09 },
+ { "Africa/Porto-Novo" , 0x001F5E },
+ { "Africa/Sao_Tome" , 0x001FB3 },
+ { "Africa/Timbuktu" , 0x002008 },
+ { "Africa/Tripoli" , 0x00205D },
+ { "Africa/Tunis" , 0x002166 },
+ { "Africa/Windhoek" , 0x002278 },
+ { "America/Adak" , 0x0024BF },
+ { "America/Anchorage" , 0x002835 },
+ { "America/Anguilla" , 0x002BA9 },
+ { "America/Antigua" , 0x002BFE },
+ { "America/Araguaina" , 0x002C64 },
+ { "America/Argentina/Buenos_Aires" , 0x002DC9 },
+ { "America/Argentina/Catamarca" , 0x002F77 },
+ { "America/Argentina/ComodRivadavia" , 0x003138 },
+ { "America/Argentina/Cordoba" , 0x0032DE },
+ { "America/Argentina/Jujuy" , 0x0034B3 },
+ { "America/Argentina/La_Rioja" , 0x003667 },
+ { "America/Argentina/Mendoza" , 0x00381F },
+ { "America/Argentina/Rio_Gallegos" , 0x0039DF },
+ { "America/Argentina/Salta" , 0x003B94 },
+ { "America/Argentina/San_Juan" , 0x003D40 },
+ { "America/Argentina/San_Luis" , 0x003EF8 },
+ { "America/Argentina/Tucuman" , 0x0040BE },
+ { "America/Argentina/Ushuaia" , 0x00427A },
+ { "America/Aruba" , 0x004435 },
+ { "America/Asuncion" , 0x00449B },
+ { "America/Atikokan" , 0x004780 },
+ { "America/Atka" , 0x004856 },
+ { "America/Bahia" , 0x004BBC },
+ { "America/Bahia_Banderas" , 0x004D4F },
+ { "America/Barbados" , 0x004FC8 },
+ { "America/Belem" , 0x005062 },
+ { "America/Belize" , 0x00515D },
+ { "America/Blanc-Sablon" , 0x0052D9 },
+ { "America/Boa_Vista" , 0x00538D },
+ { "America/Bogota" , 0x005496 },
+ { "America/Boise" , 0x005502 },
+ { "America/Buenos_Aires" , 0x005899 },
+ { "America/Cambridge_Bay" , 0x005A32 },
+ { "America/Campo_Grande" , 0x005D5A },
+ { "America/Cancun" , 0x006049 },
+ { "America/Caracas" , 0x00628B },
+ { "America/Catamarca" , 0x0062F2 },
+ { "America/Cayenne" , 0x006498 },
+ { "America/Cayman" , 0x0064FA },
+ { "America/Chicago" , 0x00654F },
+ { "America/Chihuahua" , 0x006A66 },
+ { "America/Coral_Harbour" , 0x006CD1 },
+ { "America/Cordoba" , 0x006D63 },
+ { "America/Costa_Rica" , 0x006F09 },
+ { "America/Creston" , 0x006F93 },
+ { "America/Cuiaba" , 0x00701F },
+ { "America/Curacao" , 0x0072FD },
+ { "America/Danmarkshavn" , 0x007363 },
+ { "America/Dawson" , 0x0074A7 },
+ { "America/Dawson_Creek" , 0x0077C4 },
+ { "America/Denver" , 0x00799E },
+ { "America/Detroit" , 0x007D24 },
+ { "America/Dominica" , 0x008083 },
+ { "America/Edmonton" , 0x0080D8 },
+ { "America/Eirunepe" , 0x008490 },
+ { "America/El_Salvador" , 0x0085A8 },
+ { "America/Ensenada" , 0x00861D },
+ { "America/Fort_Wayne" , 0x008AC4 },
+ { "America/Fortaleza" , 0x008986 },
+ { "America/Glace_Bay" , 0x008D2E },
+ { "America/Godthab" , 0x0090A5 },
+ { "America/Goose_Bay" , 0x009369 },
+ { "America/Grand_Turk" , 0x009826 },
+ { "America/Grenada" , 0x009A05 },
+ { "America/Guadeloupe" , 0x009A5A },
+ { "America/Guatemala" , 0x009AAF },
+ { "America/Guayaquil" , 0x009B38 },
+ { "America/Guyana" , 0x009B95 },
+ { "America/Halifax" , 0x009C16 },
+ { "America/Havana" , 0x00A12C },
+ { "America/Hermosillo" , 0x00A49F },
+ { "America/Indiana/Indianapolis" , 0x00A57D },
+ { "America/Indiana/Knox" , 0x00A80E },
+ { "America/Indiana/Marengo" , 0x00ABA5 },
+ { "America/Indiana/Petersburg" , 0x00AE4B },
+ { "America/Indiana/Tell_City" , 0x00B398 },
+ { "America/Indiana/Vevay" , 0x00B631 },
+ { "America/Indiana/Vincennes" , 0x00B86C },
+ { "America/Indiana/Winamac" , 0x00BB20 },
+ { "America/Indianapolis" , 0x00B12E },
+ { "America/Inuvik" , 0x00BDD9 },
+ { "America/Iqaluit" , 0x00C0D0 },
+ { "America/Jamaica" , 0x00C3F2 },
+ { "America/Jujuy" , 0x00C4B7 },
+ { "America/Juneau" , 0x00C661 },
+ { "America/Kentucky/Louisville" , 0x00C9DF },
+ { "America/Kentucky/Monticello" , 0x00CDFD },
+ { "America/Knox_IN" , 0x00D182 },
+ { "America/Kralendijk" , 0x00D4F3 },
+ { "America/La_Paz" , 0x00D559 },
+ { "America/Lima" , 0x00D5C0 },
+ { "America/Los_Angeles" , 0x00D668 },
+ { "America/Louisville" , 0x00DA79 },
+ { "America/Lower_Princes" , 0x00DE6E },
+ { "America/Maceio" , 0x00DED4 },
+ { "America/Managua" , 0x00E00E },
+ { "America/Manaus" , 0x00E0C1 },
+ { "America/Marigot" , 0x00E1C3 },
+ { "America/Martinique" , 0x00E218 },
+ { "America/Matamoros" , 0x00E284 },
+ { "America/Mazatlan" , 0x00E4DD },
+ { "America/Mendoza" , 0x00E74A },
+ { "America/Menominee" , 0x00E8FE },
+ { "America/Merida" , 0x00EC7F },
+ { "America/Metlakatla" , 0x00EEBA },
+ { "America/Mexico_City" , 0x00EFF5 },
+ { "America/Miquelon" , 0x00F270 },
+ { "America/Moncton" , 0x00F4E2 },
+ { "America/Monterrey" , 0x00F979 },
+ { "America/Montevideo" , 0x00FBDC },
+ { "America/Montreal" , 0x00FEEE },
+ { "America/Montserrat" , 0x0103DE },
+ { "America/Nassau" , 0x010433 },
+ { "America/New_York" , 0x010778 },
+ { "America/Nipigon" , 0x010C83 },
+ { "America/Nome" , 0x010FD4 },
+ { "America/Noronha" , 0x011352 },
+ { "America/North_Dakota/Beulah" , 0x011482 },
+ { "America/North_Dakota/Center" , 0x011816 },
+ { "America/North_Dakota/New_Salem" , 0x011BAA },
+ { "America/Ojinaga" , 0x011F53 },
+ { "America/Panama" , 0x0121B4 },
+ { "America/Pangnirtung" , 0x012209 },
+ { "America/Paramaribo" , 0x01253F },
+ { "America/Phoenix" , 0x0125D1 },
+ { "America/Port-au-Prince" , 0x01268F },
+ { "America/Port_of_Spain" , 0x0129B3 },
+ { "America/Porto_Acre" , 0x0128AF },
+ { "America/Porto_Velho" , 0x012A08 },
+ { "America/Puerto_Rico" , 0x012AFE },
+ { "America/Rainy_River" , 0x012B69 },
+ { "America/Rankin_Inlet" , 0x012EA1 },
+ { "America/Recife" , 0x013187 },
+ { "America/Regina" , 0x0132B1 },
+ { "America/Resolute" , 0x01346F },
+ { "America/Rio_Branco" , 0x013757 },
+ { "America/Rosario" , 0x01385F },
+ { "America/Santa_Isabel" , 0x013A05 },
+ { "America/Santarem" , 0x013DA8 },
+ { "America/Santiago" , 0x013EAD },
+ { "America/Santo_Domingo" , 0x014256 },
+ { "America/Sao_Paulo" , 0x01431C },
+ { "America/Scoresbysund" , 0x01462B },
+ { "America/Shiprock" , 0x014919 },
+ { "America/Sitka" , 0x014C92 },
+ { "America/St_Barthelemy" , 0x01501A },
+ { "America/St_Johns" , 0x01506F },
+ { "America/St_Kitts" , 0x0155C2 },
+ { "America/St_Lucia" , 0x015617 },
+ { "America/St_Thomas" , 0x01566C },
+ { "America/St_Vincent" , 0x0156C1 },
+ { "America/Swift_Current" , 0x015716 },
+ { "America/Tegucigalpa" , 0x015837 },
+ { "America/Thule" , 0x0158B6 },
+ { "America/Thunder_Bay" , 0x015AFD },
+ { "America/Tijuana" , 0x015E46 },
+ { "America/Toronto" , 0x0161DF },
+ { "America/Tortola" , 0x0166FF },
+ { "America/Vancouver" , 0x016754 },
+ { "America/Virgin" , 0x016B91 },
+ { "America/Whitehorse" , 0x016BE6 },
+ { "America/Winnipeg" , 0x016F03 },
+ { "America/Yakutat" , 0x017343 },
+ { "America/Yellowknife" , 0x0176AE },
+ { "Antarctica/Casey" , 0x0179BE },
+ { "Antarctica/Davis" , 0x017A5C },
+ { "Antarctica/DumontDUrville" , 0x017AFD },
+ { "Antarctica/Macquarie" , 0x017B8E },
+ { "Antarctica/Mawson" , 0x017DDB },
+ { "Antarctica/McMurdo" , 0x017E57 },
+ { "Antarctica/Palmer" , 0x018202 },
+ { "Antarctica/Rothera" , 0x01851E },
+ { "Antarctica/South_Pole" , 0x018594 },
+ { "Antarctica/Syowa" , 0x018912 },
+ { "Antarctica/Troll" , 0x018980 },
+ { "Antarctica/Vostok" , 0x018B52 },
+ { "Arctic/Longyearbyen" , 0x018BC3 },
+ { "Asia/Aden" , 0x018EF5 },
+ { "Asia/Almaty" , 0x018F4A },
+ { "Asia/Amman" , 0x0190C9 },
+ { "Asia/Anadyr" , 0x01937F },
+ { "Asia/Aqtau" , 0x019581 },
+ { "Asia/Aqtobe" , 0x019780 },
+ { "Asia/Ashgabat" , 0x019938 },
+ { "Asia/Ashkhabad" , 0x019A55 },
+ { "Asia/Baghdad" , 0x019B72 },
+ { "Asia/Bahrain" , 0x019CE7 },
+ { "Asia/Baku" , 0x019D4D },
+ { "Asia/Bangkok" , 0x01A035 },
+ { "Asia/Beirut" , 0x01A08A },
+ { "Asia/Bishkek" , 0x01A397 },
+ { "Asia/Brunei" , 0x01A543 },
+ { "Asia/Calcutta" , 0x01A5A5 },
+ { "Asia/Chita" , 0x01A61E },
+ { "Asia/Choibalsan" , 0x01A833 },
+ { "Asia/Chongqing" , 0x01A9AC },
+ { "Asia/Chungking" , 0x01AA4C },
+ { "Asia/Colombo" , 0x01AAEC },
+ { "Asia/Dacca" , 0x01AB88 },
+ { "Asia/Damascus" , 0x01AC2E },
+ { "Asia/Dhaka" , 0x01AF7E },
+ { "Asia/Dili" , 0x01B024 },
+ { "Asia/Dubai" , 0x01B0AE },
+ { "Asia/Dushanbe" , 0x01B103 },
+ { "Asia/Gaza" , 0x01B206 },
+ { "Asia/Harbin" , 0x01B559 },
+ { "Asia/Hebron" , 0x01B5F9 },
+ { "Asia/Ho_Chi_Minh" , 0x01B955 },
+ { "Asia/Hong_Kong" , 0x01B9F7 },
+ { "Asia/Hovd" , 0x01BBB9 },
+ { "Asia/Irkutsk" , 0x01BD31 },
+ { "Asia/Istanbul" , 0x01BF1C },
+ { "Asia/Jakarta" , 0x01C309 },
+ { "Asia/Jayapura" , 0x01C3B3 },
+ { "Asia/Jerusalem" , 0x01C450 },
+ { "Asia/Kabul" , 0x01C77F },
+ { "Asia/Kamchatka" , 0x01C7D0 },
+ { "Asia/Karachi" , 0x01C9C9 },
+ { "Asia/Kashgar" , 0x01CA7E },
+ { "Asia/Kathmandu" , 0x01CAD3 },
+ { "Asia/Katmandu" , 0x01CB39 },
+ { "Asia/Khandyga" , 0x01CB9F },
+ { "Asia/Kolkata" , 0x01CDC9 },
+ { "Asia/Krasnoyarsk" , 0x01CE42 },
+ { "Asia/Kuala_Lumpur" , 0x01D02F },
+ { "Asia/Kuching" , 0x01D0EC },
+ { "Asia/Kuwait" , 0x01D1DA },
+ { "Asia/Macao" , 0x01D22F },
+ { "Asia/Macau" , 0x01D36A },
+ { "Asia/Magadan" , 0x01D4A5 },
+ { "Asia/Makassar" , 0x01D6A9 },
+ { "Asia/Manila" , 0x01D76E },
+ { "Asia/Muscat" , 0x01D7F3 },
+ { "Asia/Nicosia" , 0x01D848 },
+ { "Asia/Novokuznetsk" , 0x01DB30 },
+ { "Asia/Novosibirsk" , 0x01DD50 },
+ { "Asia/Omsk" , 0x01DF40 },
+ { "Asia/Oral" , 0x01E12C },
+ { "Asia/Phnom_Penh" , 0x01E2FC },
+ { "Asia/Pontianak" , 0x01E351 },
+ { "Asia/Pyongyang" , 0x01E413 },
+ { "Asia/Qatar" , 0x01E498 },
+ { "Asia/Qyzylorda" , 0x01E4FE },
+ { "Asia/Rangoon" , 0x01E6D4 },
+ { "Asia/Riyadh" , 0x01E74C },
+ { "Asia/Saigon" , 0x01E7A1 },
+ { "Asia/Sakhalin" , 0x01E843 },
+ { "Asia/Samarkand" , 0x01EA40 },
+ { "Asia/Seoul" , 0x01EB76 },
+ { "Asia/Shanghai" , 0x01EC69 },
+ { "Asia/Singapore" , 0x01ED15 },
+ { "Asia/Srednekolymsk" , 0x01EDCC },
+ { "Asia/Taipei" , 0x01EFCC },
+ { "Asia/Tashkent" , 0x01F0FD },
+ { "Asia/Tbilisi" , 0x01F22E },
+ { "Asia/Tehran" , 0x01F3E8 },
+ { "Asia/Tel_Aviv" , 0x01F656 },
+ { "Asia/Thimbu" , 0x01F985 },
+ { "Asia/Thimphu" , 0x01F9EB },
+ { "Asia/Tokyo" , 0x01FA51 },
+ { "Asia/Ujung_Pandang" , 0x01FADB },
+ { "Asia/Ulaanbaatar" , 0x01FB58 },
+ { "Asia/Ulan_Bator" , 0x01FCB3 },
+ { "Asia/Urumqi" , 0x01FE00 },
+ { "Asia/Ust-Nera" , 0x01FE62 },
+ { "Asia/Vientiane" , 0x020074 },
+ { "Asia/Vladivostok" , 0x0200C9 },
+ { "Asia/Yakutsk" , 0x0202B3 },
+ { "Asia/Yekaterinburg" , 0x02049D },
+ { "Asia/Yerevan" , 0x0206BE },
+ { "Atlantic/Azores" , 0x0208BE },
+ { "Atlantic/Bermuda" , 0x020DC1 },
+ { "Atlantic/Canary" , 0x0210A2 },
+ { "Atlantic/Cape_Verde" , 0x021378 },
+ { "Atlantic/Faeroe" , 0x0213F1 },
+ { "Atlantic/Faroe" , 0x021695 },
+ { "Atlantic/Jan_Mayen" , 0x021939 },
+ { "Atlantic/Madeira" , 0x021C6B },
+ { "Atlantic/Reykjavik" , 0x022174 },
+ { "Atlantic/South_Georgia" , 0x02232D },
+ { "Atlantic/St_Helena" , 0x02253F },
+ { "Atlantic/Stanley" , 0x022371 },
+ { "Australia/ACT" , 0x022594 },
+ { "Australia/Adelaide" , 0x0228B7 },
+ { "Australia/Brisbane" , 0x022BE9 },
+ { "Australia/Broken_Hill" , 0x022CB6 },
+ { "Australia/Canberra" , 0x022FFA },
+ { "Australia/Currie" , 0x02331D },
+ { "Australia/Darwin" , 0x023656 },
+ { "Australia/Eucla" , 0x0236E2 },
+ { "Australia/Hobart" , 0x0237BE },
+ { "Australia/LHI" , 0x023B22 },
+ { "Australia/Lindeman" , 0x023DC3 },
+ { "Australia/Lord_Howe" , 0x023EAA },
+ { "Australia/Melbourne" , 0x02415B },
+ { "Australia/North" , 0x024486 },
+ { "Australia/NSW" , 0x024500 },
+ { "Australia/Perth" , 0x024823 },
+ { "Australia/Queensland" , 0x024901 },
+ { "Australia/South" , 0x0249B3 },
+ { "Australia/Sydney" , 0x024CD6 },
+ { "Australia/Tasmania" , 0x025019 },
+ { "Australia/Victoria" , 0x025364 },
+ { "Australia/West" , 0x025687 },
+ { "Australia/Yancowinna" , 0x025743 },
+ { "Brazil/Acre" , 0x025A6B },
+ { "Brazil/DeNoronha" , 0x025B6F },
+ { "Brazil/East" , 0x025C8F },
+ { "Brazil/West" , 0x025F6C },
+ { "Canada/Atlantic" , 0x026064 },
+ { "Canada/Central" , 0x02654C },
+ { "Canada/East-Saskatchewan" , 0x026E56 },
+ { "Canada/Eastern" , 0x026966 },
+ { "Canada/Mountain" , 0x026FDF },
+ { "Canada/Newfoundland" , 0x027355 },
+ { "Canada/Pacific" , 0x027880 },
+ { "Canada/Saskatchewan" , 0x027C99 },
+ { "Canada/Yukon" , 0x027E22 },
+ { "CET" , 0x028125 },
+ { "Chile/Continental" , 0x02842E },
+ { "Chile/EasterIsland" , 0x0287C9 },
+ { "CST6CDT" , 0x028B0B },
+ { "Cuba" , 0x028E5C },
+ { "EET" , 0x0291CF },
+ { "Egypt" , 0x029482 },
+ { "Eire" , 0x029869 },
+ { "EST" , 0x029D7A },
+ { "EST5EDT" , 0x029DBE },
+ { "Etc/GMT" , 0x02A10F },
+ { "Etc/GMT+0" , 0x02A1DB },
+ { "Etc/GMT+1" , 0x02A265 },
+ { "Etc/GMT+10" , 0x02A2F2 },
+ { "Etc/GMT+11" , 0x02A380 },
+ { "Etc/GMT+12" , 0x02A40E },
+ { "Etc/GMT+2" , 0x02A529 },
+ { "Etc/GMT+3" , 0x02A5B5 },
+ { "Etc/GMT+4" , 0x02A641 },
+ { "Etc/GMT+5" , 0x02A6CD },
+ { "Etc/GMT+6" , 0x02A759 },
+ { "Etc/GMT+7" , 0x02A7E5 },
+ { "Etc/GMT+8" , 0x02A871 },
+ { "Etc/GMT+9" , 0x02A8FD },
+ { "Etc/GMT-0" , 0x02A197 },
+ { "Etc/GMT-1" , 0x02A21F },
+ { "Etc/GMT-10" , 0x02A2AB },
+ { "Etc/GMT-11" , 0x02A339 },
+ { "Etc/GMT-12" , 0x02A3C7 },
+ { "Etc/GMT-13" , 0x02A455 },
+ { "Etc/GMT-14" , 0x02A49C },
+ { "Etc/GMT-2" , 0x02A4E3 },
+ { "Etc/GMT-3" , 0x02A56F },
+ { "Etc/GMT-4" , 0x02A5FB },
+ { "Etc/GMT-5" , 0x02A687 },
+ { "Etc/GMT-6" , 0x02A713 },
+ { "Etc/GMT-7" , 0x02A79F },
+ { "Etc/GMT-8" , 0x02A82B },
+ { "Etc/GMT-9" , 0x02A8B7 },
+ { "Etc/GMT0" , 0x02A153 },
+ { "Etc/Greenwich" , 0x02A943 },
+ { "Etc/UCT" , 0x02A987 },
+ { "Etc/Universal" , 0x02A9CB },
+ { "Etc/UTC" , 0x02AA0F },
+ { "Etc/Zulu" , 0x02AA53 },
+ { "Europe/Amsterdam" , 0x02AA97 },
+ { "Europe/Andorra" , 0x02AED5 },
+ { "Europe/Athens" , 0x02B151 },
+ { "Europe/Belfast" , 0x02B494 },
+ { "Europe/Belgrade" , 0x02B9CB },
+ { "Europe/Berlin" , 0x02BC94 },
+ { "Europe/Bratislava" , 0x02BFF8 },
+ { "Europe/Brussels" , 0x02C32A },
+ { "Europe/Bucharest" , 0x02C761 },
+ { "Europe/Budapest" , 0x02CA8B },
+ { "Europe/Busingen" , 0x02CDF4 },
+ { "Europe/Chisinau" , 0x02D0AB },
+ { "Europe/Copenhagen" , 0x02D439 },
+ { "Europe/Dublin" , 0x02D743 },
+ { "Europe/Gibraltar" , 0x02DC54 },
+ { "Europe/Guernsey" , 0x02E0AB },
+ { "Europe/Helsinki" , 0x02E5E2 },
+ { "Europe/Isle_of_Man" , 0x02E898 },
+ { "Europe/Istanbul" , 0x02EDCF },
+ { "Europe/Jersey" , 0x02F1BC },
+ { "Europe/Kaliningrad" , 0x02F6F3 },
+ { "Europe/Kiev" , 0x02F95E },
+ { "Europe/Lisbon" , 0x02FC7A },
+ { "Europe/Ljubljana" , 0x03017E },
+ { "Europe/London" , 0x030447 },
+ { "Europe/Luxembourg" , 0x03097E },
+ { "Europe/Madrid" , 0x030DD4 },
+ { "Europe/Malta" , 0x03119A },
+ { "Europe/Mariehamn" , 0x031553 },
+ { "Europe/Minsk" , 0x031809 },
+ { "Europe/Monaco" , 0x031A1C },
+ { "Europe/Moscow" , 0x031E57 },
+ { "Europe/Nicosia" , 0x0320B1 },
+ { "Europe/Oslo" , 0x032399 },
+ { "Europe/Paris" , 0x0326CB },
+ { "Europe/Podgorica" , 0x032B11 },
+ { "Europe/Prague" , 0x032DDA },
+ { "Europe/Riga" , 0x03310C },
+ { "Europe/Rome" , 0x033451 },
+ { "Europe/Samara" , 0x033814 },
+ { "Europe/San_Marino" , 0x033A7D },
+ { "Europe/Sarajevo" , 0x033E40 },
+ { "Europe/Simferopol" , 0x034109 },
+ { "Europe/Skopje" , 0x03435A },
+ { "Europe/Sofia" , 0x034623 },
+ { "Europe/Stockholm" , 0x03492B },
+ { "Europe/Tallinn" , 0x034BDA },
+ { "Europe/Tirane" , 0x034F14 },
+ { "Europe/Tiraspol" , 0x03521A },
+ { "Europe/Uzhgorod" , 0x0355A8 },
+ { "Europe/Vaduz" , 0x0358BF },
+ { "Europe/Vatican" , 0x035B6E },
+ { "Europe/Vienna" , 0x035F31 },
+ { "Europe/Vilnius" , 0x03625E },
+ { "Europe/Volgograd" , 0x03659D },
+ { "Europe/Warsaw" , 0x0367BE },
+ { "Europe/Zagreb" , 0x036B9F },
+ { "Europe/Zaporozhye" , 0x036E68 },
+ { "Europe/Zurich" , 0x0371A9 },
+ { "Factory" , 0x037458 },
+ { "GB" , 0x0374C9 },
+ { "GB-Eire" , 0x037A00 },
+ { "GMT" , 0x037F37 },
+ { "GMT+0" , 0x038003 },
+ { "GMT-0" , 0x037FBF },
+ { "GMT0" , 0x037F7B },
+ { "Greenwich" , 0x038047 },
+ { "Hongkong" , 0x03808B },
+ { "HST" , 0x03824D },
+ { "Iceland" , 0x038291 },
+ { "Indian/Antananarivo" , 0x03844A },
+ { "Indian/Chagos" , 0x0384C9 },
+ { "Indian/Christmas" , 0x03852B },
+ { "Indian/Cocos" , 0x03856F },
+ { "Indian/Comoro" , 0x0385B3 },
+ { "Indian/Kerguelen" , 0x038632 },
+ { "Indian/Mahe" , 0x038687 },
+ { "Indian/Maldives" , 0x0386DC },
+ { "Indian/Mauritius" , 0x038731 },
+ { "Indian/Mayotte" , 0x0387A7 },
+ { "Indian/Reunion" , 0x038826 },
+ { "Iran" , 0x03887B },
+ { "Israel" , 0x038AE9 },
+ { "Jamaica" , 0x038E18 },
+ { "Japan" , 0x038EDD },
+ { "Kwajalein" , 0x038F67 },
+ { "Libya" , 0x038FCA },
+ { "MET" , 0x0390D3 },
+ { "Mexico/BajaNorte" , 0x0393DC },
+ { "Mexico/BajaSur" , 0x039745 },
+ { "Mexico/General" , 0x03998A },
+ { "MST" , 0x039BE8 },
+ { "MST7MDT" , 0x039C2C },
+ { "Navajo" , 0x039F7D },
+ { "NZ" , 0x03A2F6 },
+ { "NZ-CHAT" , 0x03A674 },
+ { "Pacific/Apia" , 0x03A958 },
+ { "Pacific/Auckland" , 0x03AAF4 },
+ { "Pacific/Bougainville" , 0x03AE80 },
+ { "Pacific/Chatham" , 0x03AEF7 },
+ { "Pacific/Chuuk" , 0x03B1EA },
+ { "Pacific/Easter" , 0x03B243 },
+ { "Pacific/Efate" , 0x03B592 },
+ { "Pacific/Enderbury" , 0x03B658 },
+ { "Pacific/Fakaofo" , 0x03B6C6 },
+ { "Pacific/Fiji" , 0x03B717 },
+ { "Pacific/Funafuti" , 0x03B8AA },
+ { "Pacific/Galapagos" , 0x03B8EE },
+ { "Pacific/Gambier" , 0x03B966 },
+ { "Pacific/Guadalcanal" , 0x03B9CB },
+ { "Pacific/Guam" , 0x03BA20 },
+ { "Pacific/Honolulu" , 0x03BA76 },
+ { "Pacific/Johnston" , 0x03BAED },
+ { "Pacific/Kiritimati" , 0x03BB6C },
+ { "Pacific/Kosrae" , 0x03BBD7 },
+ { "Pacific/Kwajalein" , 0x03BC34 },
+ { "Pacific/Majuro" , 0x03BCA0 },
+ { "Pacific/Marquesas" , 0x03BCFF },
+ { "Pacific/Midway" , 0x03BD66 },
+ { "Pacific/Nauru" , 0x03BDF0 },
+ { "Pacific/Niue" , 0x03BE68 },
+ { "Pacific/Norfolk" , 0x03BEC6 },
+ { "Pacific/Noumea" , 0x03BF1B },
+ { "Pacific/Pago_Pago" , 0x03BFAB },
+ { "Pacific/Palau" , 0x03C022 },
+ { "Pacific/Pitcairn" , 0x03C066 },
+ { "Pacific/Pohnpei" , 0x03C0BB },
+ { "Pacific/Ponape" , 0x03C110 },
+ { "Pacific/Port_Moresby" , 0x03C155 },
+ { "Pacific/Rarotonga" , 0x03C1A7 },
+ { "Pacific/Saipan" , 0x03C283 },
+ { "Pacific/Samoa" , 0x03C2E6 },
+ { "Pacific/Tahiti" , 0x03C35D },
+ { "Pacific/Tarawa" , 0x03C3C2 },
+ { "Pacific/Tongatapu" , 0x03C416 },
+ { "Pacific/Truk" , 0x03C4A2 },
+ { "Pacific/Wake" , 0x03C4E7 },
+ { "Pacific/Wallis" , 0x03C537 },
+ { "Pacific/Yap" , 0x03C57B },
+ { "Poland" , 0x03C5C0 },
+ { "Portugal" , 0x03C9A1 },
+ { "PRC" , 0x03CE9D },
+ { "PST8PDT" , 0x03CF3D },
+ { "ROC" , 0x03D28E },
+ { "ROK" , 0x03D3BF },
+ { "Singapore" , 0x03D4B2 },
+ { "Turkey" , 0x03D569 },
+ { "UCT" , 0x03D956 },
+ { "Universal" , 0x03D99A },
+ { "US/Alaska" , 0x03D9DE },
+ { "US/Aleutian" , 0x03DD47 },
+ { "US/Arizona" , 0x03E0AD },
+ { "US/Central" , 0x03E13B },
+ { "US/East-Indiana" , 0x03EB45 },
+ { "US/Eastern" , 0x03E646 },
+ { "US/Hawaii" , 0x03EDAF },
+ { "US/Indiana-Starke" , 0x03EE20 },
+ { "US/Michigan" , 0x03F191 },
+ { "US/Mountain" , 0x03F4C8 },
+ { "US/Pacific" , 0x03F841 },
+ { "US/Pacific-New" , 0x03FC46 },
+ { "US/Samoa" , 0x04004B },
+ { "UTC" , 0x0400C2 },
+ { "W-SU" , 0x0403B9 },
+ { "WET" , 0x040106 },
+ { "Zulu" , 0x0405FC },
};
/* This is a generated file, do not modify */
-const unsigned char timelib_timezone_db_data_builtin[263343] = {
+const unsigned char timelib_timezone_db_data_builtin[263744] = {
/* Africa/Abidjan */
@@ -620,11 +620,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Africa/Addis_Ababa */
0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x54, 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, 0xC0, 0xAF, 0xF2, 0x98,
-0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
-0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D,
-0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D, 0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00,
/* Africa/Algiers */
0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -649,19 +651,23 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Africa/Asmara */
0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x52, 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, 0xC0, 0xAF, 0xF2, 0x98,
-0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
-0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D,
-0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D, 0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00,
/* Africa/Asmera */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 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, 0xC0, 0xAF, 0xF2, 0x98,
-0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
-0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12,
-0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,
/* Africa/Bamako */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -895,20 +901,23 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Africa/Dar_es_Salaam */
0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x5A, 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, 0xB6, 0xA3, 0xD3, 0xAC,
-0xD6, 0x9D, 0x7F, 0xD0, 0xEF, 0x12, 0x66, 0xD4, 0x01, 0x02, 0x01, 0x00, 0x00, 0x24, 0xD4, 0x00,
-0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x08, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00,
/* Africa/Djibouti */
0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4A, 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, 0x91, 0xF3, 0xD2, 0x0C,
-0x01, 0x00, 0x00, 0x28, 0x74, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F,
-0xF8, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00,
/* Africa/Douala */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1011,9 +1020,9 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Africa/Kampala */
0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDF, 0x1C,
-0xB4, 0xC2, 0x9A, 0xD0, 0xD6, 0x9D, 0x86, 0xD8, 0xE7, 0x8C, 0x47, 0x54, 0x01, 0x02, 0x03, 0x01,
-0x00, 0x00, 0x1E, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x89, 0xCF, 0xF2, 0x01, 0x44, 0x1F, 0x42, 0x00, 0x00, 0x00, 0x00,
@@ -1140,11 +1149,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Africa/Mogadishu */
0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 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, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xB6, 0xA3, 0xCE, 0x50,
-0xE7, 0x8C, 0x4A, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x00, 0x00, 0x00, 0x23, 0x28,
-0x00, 0x04, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00,
/* Africa/Monrovia */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -3306,7 +3317,7 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* America/Grand_Turk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF,
+0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF,
0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0,
0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60,
0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60,
@@ -3325,15 +3336,15 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
-0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF,
-0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00,
-0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E,
-0x0A, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, 0x0A, 0x00, 0x00, 0x00, 0x00,
/* America/Grenada */
0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9074,14 +9085,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Asia/Pyongyang */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x93, 0x7E, 0x78,
-0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70,
-0xE2, 0x4F, 0x29, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x03, 0x00,
-0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00,
-0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x4B, 0x53, 0x54,
-0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89, 0x98, 0x00, 0x00, 0x00, 0x00,
-
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0x8B, 0xD7, 0xF1, 0x9C,
+0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70, 0x01, 0x02, 0x03, 0x04,
+0x00, 0x00, 0x75, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x4C, 0x4D,
+0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89,
+0x98, 0x00, 0x00, 0x00, 0x00,
/* Asia/Qatar */
0x50, 0x48, 0x50, 0x31, 0x01, 0x51, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9214,17 +9224,20 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Asia/Seoul */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78,
-0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0,
-0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80,
-0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70,
-0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03,
-0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00,
-0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D,
-0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00,
-0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01,
-0xD4, 0x64, 0xDA, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78,
+0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0,
+0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8,
+0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68,
+0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68,
+0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90,
+0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05,
+0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00,
+0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00,
+0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54,
+0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01, 0xD4, 0x64, 0xDA, 0x00,
+0x00, 0x00, 0x00,
/* Asia/Shanghai */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16232,12 +16245,12 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Indian/Antananarivo */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xF3, 0xCD, 0xF4,
-0xE2, 0x33, 0xC0, 0xC0, 0xE2, 0xAB, 0xB9, 0x40, 0x01, 0x02, 0x03, 0x00, 0x00, 0x2C, 0x8C, 0x00,
-0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A,
-0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00,
-0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2,
-0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2, 0x00, 0x00, 0x00, 0x00,
/* Indian/Chagos */
0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16264,11 +16277,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Indian/Comoro */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 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, 0x91, 0xF3, 0xD1, 0xF0,
-0x01, 0x00, 0x00, 0x28, 0x90, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD,
-0x8A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD, 0x8A, 0x00, 0x00, 0x00, 0x00,
/* Indian/Kerguelen */
0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16306,11 +16321,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* Indian/Mayotte */
0x50, 0x48, 0x50, 0x31, 0x01, 0x59, 0x54, 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, 0x91, 0xF3, 0xD0, 0x18,
-0x01, 0x00, 0x00, 0x2A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD,
-0xC5, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD, 0xC5, 0x00, 0x00, 0x00, 0x00,
/* Indian/Reunion */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -17688,17 +17705,20 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
/* ROK */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78,
-0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0,
-0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80,
-0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70,
-0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03,
-0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00,
-0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D,
-0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00,
-0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01,
-0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78,
+0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0,
+0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8,
+0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68,
+0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68,
+0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90,
+0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05,
+0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00,
+0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00,
+0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54,
+0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00,
+0x00, 0x00, 0x00,
/* Singapore */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -18547,4 +18567,4 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = {
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.9", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2014.10", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/tests/002.phpt b/ext/date/tests/002.phpt
index 92d0d5f105..adbea5e231 100644
--- a/ext/date/tests/002.phpt
+++ b/ext/date/tests/002.phpt
@@ -3,7 +3,7 @@ strtotime() function
--SKIPIF--
<?php
if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
?>
--FILE--
diff --git a/ext/date/tests/bug13142.phpt b/ext/date/tests/bug13142.phpt
index 5254142baa..5849a94427 100644
--- a/ext/date/tests/bug13142.phpt
+++ b/ext/date/tests/bug13142.phpt
@@ -8,7 +8,7 @@ if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
die("skip. set TZ env is not supported at runtime.");
}
if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
?>
--FILE--
diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt
index 5b79bec525..27d6ff1250 100644
--- a/ext/date/tests/bug26317.phpt
+++ b/ext/date/tests/bug26317.phpt
@@ -4,7 +4,7 @@ Bug #26317 (military timezone offset signedness)
date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
--FILE--
<?php
diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt
index c8aeb00c9f..e742c39da5 100644
--- a/ext/date/tests/bug26320.phpt
+++ b/ext/date/tests/bug26320.phpt
@@ -4,7 +4,7 @@ Bug #26320 (strtotime handling of XML Schema/ISO 8601 format)
date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
--FILE--
<?php
diff --git a/ext/date/tests/date_interval_create_from_date_string.phpt b/ext/date/tests/date_interval_create_from_date_string.phpt
new file mode 100644
index 0000000000..9a1745c9ac
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Test date_interval_create_from_date_string() function : basic functionality
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$string = '1 day'; //P1D
+$i = date_interval_create_from_date_string($string);
+var_dump($i->d);
+
+$string = '2 weeks'; //14 days
+$i = date_interval_create_from_date_string($string);
+var_dump($i->d);
+
+$string = '3 months';
+$i = date_interval_create_from_date_string($string);
+var_dump($i->m);
+
+$string = '4 years';
+$i = date_interval_create_from_date_string($string);
+var_dump($i->y);
+
+$string = '1 year + 1 day';
+$i = date_interval_create_from_date_string($string);
+var_dump($i->y);
+var_dump($i->d);
+?>
+--EXPECTF--
+int(1)
+int(14)
+int(3)
+int(4)
+int(1)
+int(1) \ No newline at end of file
diff --git a/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt
new file mode 100644
index 0000000000..369db5714a
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Test date_interval_create_from_date_string() function : null parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$i = date_interval_create_from_date_string(null); //returns a empty object
+var_dump($i);
+?>
+--EXPECTF--
+object(DateInterval)#1 (15) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(0)
+ ["h"]=>
+ int(0)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+} \ No newline at end of file
diff --git a/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt b/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt
new file mode 100644
index 0000000000..15db956553
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Test date_interval_create_from_date_string() function : wrong parameter (array)
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$wrong_parameter = array();
+$i = date_interval_create_from_date_string($wrong_parameter);
+?>
+--EXPECTF--
+Warning: date_interval_create_from_date_string() expects parameter 1 to be string, array given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt b/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt
new file mode 100644
index 0000000000..a3407c3967
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Test date_interval_create_from_date_string() function : with 2 parameters (wrong).
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$i = date_interval_create_from_date_string('1 year', 'wrong');
+?>
+--EXPECTF--
+Warning: date_interval_create_from_date_string() expects exactly 1 parameter, 2 given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set.phpt b/ext/date/tests/date_timestamp_set.phpt
new file mode 100644
index 0000000000..e01660193f
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test the basics to function date_timestamp_set().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = date_create();
+
+date_timestamp_set($dtms021, 1234567890);
+
+var_dump(date_format($dtms021, 'B => (U) => T Y-M-d H:i:s'));
+?>
+--EXPECTF--
+string(47) "021 => (1234567890) => UTC 2009-Feb-13 23:31:30" \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_nullparam.phpt b/ext/date/tests/date_timestamp_set_nullparam.phpt
new file mode 100644
index 0000000000..1bcb800242
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_nullparam.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Test the function date_timestamp_set() with first null parameter.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = date_create();
+
+date_timestamp_set(null, 1234567890);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 1 to be DateTime, null given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_nullparam2.phpt b/ext/date/tests/date_timestamp_set_nullparam2.phpt
new file mode 100644
index 0000000000..1442da4426
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_nullparam2.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Test the function date_timestamp_set() with second null parameter.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = date_create();
+
+var_dump(date_timestamp_set($dtms021, null));
+?>
+--EXPECTF--
+object(DateTime)#1 (3) {
+ ["date"]=>
+ string(26) "1970-01-01 00:00:00.000000"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+} \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_001.phpt b/ext/date/tests/date_timestamp_set_wrongparam_001.phpt
new file mode 100644
index 0000000000..9a0fca99c1
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_001.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Check the function date_timestamp_set() with first parameter wrong (array).
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = array();
+
+date_timestamp_set($dtms021, 123456789);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 1 to be DateTime, array given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_002.phpt b/ext/date/tests/date_timestamp_set_wrongparam_002.phpt
new file mode 100644
index 0000000000..ed31cb217d
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_002.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Check the function date_timestamp_set() with first parameter wrong (integer).
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+date_timestamp_set(987654321, 123456789);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 1 to be DateTime, integer given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_003.phpt b/ext/date/tests/date_timestamp_set_wrongparam_003.phpt
new file mode 100644
index 0000000000..f965334d9d
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_003.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Check the function date_timestamp_set() with second parameter wrong (array).
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = new DateTime();
+
+$wrong_parameter = array();
+
+date_timestamp_set($dtms021, $wrong_parameter);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 2 to be long, array given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_004.phpt b/ext/date/tests/date_timestamp_set_wrongparam_004.phpt
new file mode 100644
index 0000000000..b171e98bd4
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_004.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Check the function date_timestamp_set() with 3 parameters.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = new DateTime();
+
+date_timestamp_set($dtms021, 123456789, 'error');
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects exactly 2 parameters, 3 given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/timezone_version_get.phpt b/ext/date/tests/timezone_version_get.phpt
new file mode 100644
index 0000000000..e076004289
--- /dev/null
+++ b/ext/date/tests/timezone_version_get.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Test the basics to function timezone_version_get().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+var_dump(timezone_version_get());
+?>
+--EXPECTREGEX--
+string\([6-7]\) \"20[0-9][0-9]\.[1-9][0-9]?\" \ No newline at end of file
diff --git a/ext/date/tests/timezone_version_get_basic1.phpt b/ext/date/tests/timezone_version_get_basic1.phpt
new file mode 100644
index 0000000000..27224e3d44
--- /dev/null
+++ b/ext/date/tests/timezone_version_get_basic1.phpt
@@ -0,0 +1,12 @@
+--TEST--
+timezone_version_get: Test that timezone_location_get returns a date concatenated with a dot and a version number
+--CREDITS--
+Rodrigo Wanderley de Melo Cardoso <rodrigogepem@gmail.com>
+#PHPTestFest2014 São Paulo 2014-07-05
+--INI--
+date.timezone=UTC
+--FILE--
+<?php $versionTimezone = timezone_version_get();
+echo $versionTimezone; ?>
+--EXPECTREGEX--
+^[12][0-9]{3}.[0-9]+$ \ No newline at end of file
diff --git a/ext/dba/README b/ext/dba/README
index 0c22830e54..a79413f100 100755
--- a/ext/dba/README
+++ b/ext/dba/README
@@ -39,7 +39,7 @@ inifile This is available since PHP 4.3.3 to be able to modify php.ini
As the functions dba_firstkey() and dba_nextkey() return string
representations of the key there is a new function dba_key_split()
available since PHP 5 which allows to convert the string keys into
- array keys without loosing FALSE.
+ array keys without losing FALSE.
qdbm This is available since PHP 5.0.0. The qdbm library can be loaded
from http://qdbm.sourceforge.net.
diff --git a/ext/ereg/regex/regcomp.c b/ext/ereg/regex/regcomp.c
index 156eee9329..730bcf568a 100644
--- a/ext/ereg/regex/regcomp.c
+++ b/ext/ereg/regex/regcomp.c
@@ -450,7 +450,7 @@ int starordinary; /* is a leading * an ordinary character? */
register sopno subno;
# define BACKSL (1<<CHAR_BIT)
- pos = HERE(); /* repetion op, if any, covers from here */
+ pos = HERE(); /* repetition op, if any, covers from here */
assert(MORE()); /* caller should have ensured this */
c = GETNEXT();
diff --git a/ext/exif/tests/bug68113.phpt b/ext/exif/tests/bug68113.phpt
index 0fa4c4aca8..e4a1cbf53b 100644
--- a/ext/exif/tests/bug68113.phpt
+++ b/ext/exif/tests/bug68113.phpt
@@ -10,8 +10,8 @@ var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
?>
Done
--EXPECTF--
-Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2
+Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s%ebug68113.php on line 2
-Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2
+Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s%ebug68113.php on line 2
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/fileinfo/fileinfo.php b/ext/fileinfo/fileinfo.php
index 1ee9efbeb8..791d03a213 100644
--- a/ext/fileinfo/fileinfo.php
+++ b/ext/fileinfo/fileinfo.php
@@ -3,7 +3,7 @@ if(!extension_loaded('fileinfo')) {
dl('fileinfo.' . PHP_SHLIB_SUFFIX);
}
if(!extension_loaded('fileinfo')) {
- die("fileinfo extension is not avaliable, please compile it.\n");
+ die("fileinfo extension is not available, please compile it.\n");
}
// normal operation
diff --git a/ext/fileinfo/libmagic/patchlevel.h b/ext/fileinfo/libmagic/patchlevel.h
index a53c6830d8..65551b402e 100644
--- a/ext/fileinfo/libmagic/patchlevel.h
+++ b/ext/fileinfo/libmagic/patchlevel.h
@@ -351,7 +351,7 @@
*
* Revision 1.8 93/02/19 15:01:26 ian
* Numerous changes from Guy Harris too numerous to mention but including
- * byte-order independance, fixing "old-style masking", etc. etc. A bugfix
+ * byte-order independence, fixing "old-style masking", etc. etc. A bugfix
* for broken symlinks from martin@@d255s004.zfe.siemens.de.
*
* Revision 1.7 93/01/05 14:57:27 ian
diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic
index 4e1ce98ed2..938ac5f73a 100644
--- a/ext/fileinfo/tests/magic
+++ b/ext/fileinfo/tests/magic
@@ -3918,7 +3918,7 @@
>7 string x version %.2s
# We skip the path here, because it is often long (so file will
# truncate it) and mostly redundant.
-# The inverted index functionality was added some time betwen
+# The inverted index functionality was added some time between
# versions 11 and 15, so look for -q if version is above 14:
>7 string >14
>>10 search/100 \ -q\ with inverted index
@@ -3972,7 +3972,7 @@
# .cwk
0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document
# .plt
-0 string \020\341\000\000\010\010 Claris Works pallete files .plt
+0 string \020\341\000\000\010\010 Claris Works palette files .plt
# .msp a dictionary file I am not sure about this I have only one .msp file
0 string \002\271\262\000\040\002\000\164 Claris works dictionary
@@ -4443,9 +4443,9 @@
>6 byte&0x04 =0x8 \b, [4-Scr]
#------------------------------------------------------------------------------
-# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
+# game boy: file(1) magic for the Nintendo (Color) Game Boy raw ROM format
#
-0x104 belong 0xCEED6666 Gameboy ROM:
+0x104 belong 0xCEED6666 Game Boy ROM:
>0x134 string >\0 "%.16s"
>0x146 byte 0x03 \b,[SGB]
>0x147 byte 0x00 \b, [ROM ONLY]
@@ -4605,8 +4605,8 @@
0 string \x01ZZZZZ\x01 3DO "Opera" file system
# From Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
-0 string GBS Nintendo Gameboy Music/Audio Data
-12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
+0 string GBS Nintendo Game Boy Music/Audio Data
+12 string GameBoy\ Music\ Module Nintendo Game Boy Music Module
# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
0 string PPF30 Playstation Patch File version 3.0
@@ -15279,7 +15279,7 @@
# $File: oasis,v 1.1 2011/03/15 02:09:38 christos Exp $
# OASIS
# Summary: OASIS stream file
-# Long descripton: Open Artwork System Interchange Standard
+# Long description: Open Artwork System Interchange Standard
# File extension: .oas
# Full name: Ben Cowley (bcowley@broadcom.com)
# Philip Dixon (pdixon@broadcom.com)
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 530dce6f53..dec6bfb4ec 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -44,6 +44,7 @@ static const filter_list_entry filter_list[] = {
{ "float", FILTER_VALIDATE_FLOAT, php_filter_float },
{ "validate_regexp", FILTER_VALIDATE_REGEXP, php_filter_validate_regexp },
+ { "validate_domain", FILTER_VALIDATE_DOMAIN, php_filter_validate_domain },
{ "validate_url", FILTER_VALIDATE_URL, php_filter_validate_url },
{ "validate_email", FILTER_VALIDATE_EMAIL, php_filter_validate_email },
{ "validate_ip", FILTER_VALIDATE_IP, php_filter_validate_ip },
@@ -231,6 +232,7 @@ PHP_MINIT_FUNCTION(filter)
REGISTER_LONG_CONSTANT("FILTER_VALIDATE_FLOAT", FILTER_VALIDATE_FLOAT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILTER_VALIDATE_REGEXP", FILTER_VALIDATE_REGEXP, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_DOMAIN", FILTER_VALIDATE_DOMAIN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILTER_VALIDATE_URL", FILTER_VALIDATE_URL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILTER_VALIDATE_EMAIL", FILTER_VALIDATE_EMAIL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILTER_VALIDATE_IP", FILTER_VALIDATE_IP, CONST_CS | CONST_PERSISTENT);
@@ -278,6 +280,8 @@ PHP_MINIT_FUNCTION(filter)
REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_RES_RANGE", FILTER_FLAG_NO_RES_RANGE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_PRIV_RANGE", FILTER_FLAG_NO_PRIV_RANGE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_HOSTNAME", FILTER_FLAG_HOSTNAME, CONST_CS | CONST_PERSISTENT);
+
sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init TSRMLS_CC);
return SUCCESS;
@@ -760,7 +764,7 @@ PHP_FUNCTION(filter_input)
/* }}} */
/* {{{ proto mixed filter_var(mixed variable [, long filter [, mixed options]])
- * Returns the filtered version of the vriable.
+ * Returns the filtered version of the variable.
*/
PHP_FUNCTION(filter_var)
{
diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h
index b07b6ca534..8bfbb2df8b 100644
--- a/ext/filter/filter_private.h
+++ b/ext/filter/filter_private.h
@@ -55,6 +55,8 @@
#define FILTER_FLAG_NO_RES_RANGE 0x400000
#define FILTER_FLAG_NO_PRIV_RANGE 0x800000
+#define FILTER_FLAG_HOSTNAME 0x100000
+
#define FILTER_VALIDATE_INT 0x0101
#define FILTER_VALIDATE_BOOLEAN 0x0102
#define FILTER_VALIDATE_FLOAT 0x0103
@@ -64,7 +66,8 @@
#define FILTER_VALIDATE_EMAIL 0x0112
#define FILTER_VALIDATE_IP 0x0113
#define FILTER_VALIDATE_MAC 0x0114
-#define FILTER_VALIDATE_LAST 0x0114
+#define FILTER_VALIDATE_DOMAIN 0x0115
+#define FILTER_VALIDATE_LAST 0x0115
#define FILTER_VALIDATE_ALL 0x0100
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index be1c2f0d40..01497192f0 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -14,6 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Derick Rethans <derick@php.net> |
| Pierre-A. Joye <pierre@php.net> |
+ | Kévin Dunglas <dunglas@gmail.com> |
+----------------------------------------------------------------------+
*/
@@ -80,6 +81,8 @@
#define FORMAT_IPV4 4
#define FORMAT_IPV6 6
+static int _php_filter_validate_ipv6(char *str, size_t str_len TSRMLS_DC);
+
static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
zend_long ctx_value;
int sign = 0, digit = 0;
@@ -452,6 +455,65 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
RETURN_VALIDATION_FAILED
}
}
+
+static int _php_filter_validate_domain(char * domain, int len, zend_long flags) /* {{{ */
+{
+ char *e, *s, *t;
+ size_t l;
+ int hostname = flags & FILTER_FLAG_HOSTNAME;
+ unsigned char i = 1;
+
+ s = domain;
+ l = len;
+ e = domain + l;
+ t = e - 1;
+
+ /* Ignore trailing dot */
+ if (*t == '.') {
+ e = t;
+ l--;
+ }
+
+ /* The total length cannot exceed 253 characters (final dot not included) */
+ if (l > 253) {
+ return 0;
+ }
+
+ /* First char must be alphanumeric */
+ if(*s == '.' || (hostname && !isalnum((int)*(unsigned char *)s))) {
+ return 0;
+ }
+
+ while (s < e) {
+ if (*s == '.') {
+ /* The first and the last character of a label must be alphanumeric */
+ if (*(s + 1) == '.' || (hostname && (!isalnum((int)*(unsigned char *)(s - 1)) || !isalnum((int)*(unsigned char *)(s + 1))))) {
+ return 0;
+ }
+
+ /* Reset label length counter */
+ i = 1;
+ } else {
+ if (i > 63 || (hostname && *s != '-' && !isalnum((int)*(unsigned char *)s))) {
+ return 0;
+ }
+
+ i++;
+ }
+
+ s++;
+ }
+
+ return 1;
+}
+/* }}} */
+
+void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ if (!_php_filter_validate_domain(Z_STRVAL_P(value), Z_STRLEN_P(value), flags)) {
+ RETURN_VALIDATION_FAILED
+ }
+}
/* }}} */
void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
@@ -473,25 +535,28 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
if (url->scheme != NULL && (!strcasecmp(url->scheme, "http") || !strcasecmp(url->scheme, "https"))) {
- char *e, *s;
+ char *e, *s, *t;
+ size_t l;
if (url->host == NULL) {
goto bad_url;
}
- e = url->host + strlen(url->host);
s = url->host;
-
- /* First char of hostname must be alphanumeric */
- if(!isalnum((int)*(unsigned char *)s)) {
- goto bad_url;
+ l = strlen(s);
+ e = url->host + l;
+ t = e - 1;
+
+ /* An IPv6 enclosed by square brackets is a valid hostname */
+ if (*s == '[' && *t == ']' && _php_filter_validate_ipv6((s + 1), l - 2 TSRMLS_CC)) {
+ php_url_free(url);
+ return;
}
- while (s < e) {
- if (!isalnum((int)*(unsigned char *)s) && *s != '-' && *s != '.') {
- goto bad_url;
- }
- s++;
+ // Validate domain
+ if (!_php_filter_validate_domain(url->host, l, FILTER_FLAG_HOSTNAME)) {
+ php_url_free(url);
+ RETURN_VALIDATION_FAILED
}
}
diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h
index 126a0c6c8b..a82b2e6159 100644
--- a/ext/filter/php_filter.h
+++ b/ext/filter/php_filter.h
@@ -75,6 +75,7 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL);
diff --git a/ext/filter/tests/008.phpt b/ext/filter/tests/008.phpt
index a499219ee7..54880e59cc 100644
--- a/ext/filter/tests/008.phpt
+++ b/ext/filter/tests/008.phpt
@@ -11,7 +11,7 @@ var_dump(filter_list(array()));
echo "Done\n";
?>
--EXPECTF--
-array(20) {
+array(21) {
[0]=>
string(3) "int"
[1]=>
@@ -21,36 +21,38 @@ array(20) {
[3]=>
string(15) "validate_regexp"
[4]=>
- string(12) "validate_url"
+ string(15) "validate_domain"
[5]=>
- string(14) "validate_email"
+ string(12) "validate_url"
[6]=>
- string(11) "validate_ip"
+ string(14) "validate_email"
[7]=>
- string(12) "validate_mac"
+ string(11) "validate_ip"
[8]=>
- string(6) "string"
+ string(12) "validate_mac"
[9]=>
- string(8) "stripped"
+ string(6) "string"
[10]=>
- string(7) "encoded"
+ string(8) "stripped"
[11]=>
- string(13) "special_chars"
+ string(7) "encoded"
[12]=>
- string(18) "full_special_chars"
+ string(13) "special_chars"
[13]=>
- string(10) "unsafe_raw"
+ string(18) "full_special_chars"
[14]=>
- string(5) "email"
+ string(10) "unsafe_raw"
[15]=>
- string(3) "url"
+ string(5) "email"
[16]=>
- string(10) "number_int"
+ string(3) "url"
[17]=>
- string(12) "number_float"
+ string(10) "number_int"
[18]=>
- string(12) "magic_quotes"
+ string(12) "number_float"
[19]=>
+ string(12) "magic_quotes"
+ [20]=>
string(8) "callback"
}
diff --git a/ext/filter/tests/015.phpt b/ext/filter/tests/015.phpt
index 476615ae37..44926a1cac 100644
--- a/ext/filter/tests/015.phpt
+++ b/ext/filter/tests/015.phpt
@@ -11,6 +11,22 @@ $values = Array(
'http://www.example/img/test.png',
'http://www.example/img/dir/',
'http://www.example/img/dir',
+'http://www.thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com/',
+'http://toolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolong.com',
+'http://eauBcFReEmjLcoZwI0RuONNnwU4H9r151juCaqTI5VeIP5jcYIqhx1lh5vV00l2rTs6y7hOp7rYw42QZiq6VIzjcYrRm8gFRMk9U9Wi1grL8Mr5kLVloYLthHgyA94QK3SaXCATklxgo6XvcbXIqAGG7U0KxTr8hJJU1p2ZQ2mXHmp4DhYP8N9SRuEKzaCPcSIcW7uj21jZqBigsLsNAXEzU8SPXZjmVQVtwQATPWeWyGW4GuJhjP4Q8o0.com',
+'http://kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.CQ1oT5Uq3jJt6Uhy3VH9u3Gi5YhfZCvZVKgLlaXNFhVKB1zJxvunR7SJa.com.',
+'http://kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58R.example.com',
+'http://[2001:0db8:0000:85a3:0000:0000:ac1f:8001]',
+'http://[2001:db8:0:85a3:0:0:ac1f:8001]:123/me.html',
+'http://[2001:db8:0:85a3::ac1f:8001]/',
+'http://[::1]',
+'http://cont-ains.h-yph-en-s.com',
+'http://..com',
+'http://a.-bc.com',
+'http://ab.cd-.com',
+'http://-.abc.com',
+'http://abc.-.abc.com',
+'http://underscore_.example.com',
'http//www.example/wrong/url/',
'http:/www.example',
'file:///tmp/test.c',
@@ -56,6 +72,22 @@ string(32) "http://www.example.com/index.php"
string(31) "http://www.example/img/test.png"
string(27) "http://www.example/img/dir/"
string(26) "http://www.example/img/dir"
+string(79) "http://www.thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com/"
+bool(false)
+bool(false)
+string(261) "http://kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.CQ1oT5Uq3jJt6Uhy3VH9u3Gi5YhfZCvZVKgLlaXNFhVKB1zJxvunR7SJa.com."
+bool(false)
+string(48) "http://[2001:0db8:0000:85a3:0000:0000:ac1f:8001]"
+string(50) "http://[2001:db8:0:85a3:0:0:ac1f:8001]:123/me.html"
+string(36) "http://[2001:db8:0:85a3::ac1f:8001]/"
+string(12) "http://[::1]"
+string(31) "http://cont-ains.h-yph-en-s.com"
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
bool(false)
bool(false)
string(18) "file:///tmp/test.c"
diff --git a/ext/filter/tests/033.phpt b/ext/filter/tests/033.phpt
index d76f9ab3b8..3819c6a01c 100644
--- a/ext/filter/tests/033.phpt
+++ b/ext/filter/tests/033.phpt
@@ -14,6 +14,7 @@ int 1 123
boolean 1
float 1 123
validate_regexp O'Henry
+validate_domain PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc<>() O'Henry 하퍼 aa:bb:cc:dd:ee:ff
validate_url http://a.b.c
validate_email foo@bar.com
validate_ip 1.2.3.4
@@ -29,4 +30,4 @@ url PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 12
number_int 1 1234 123 123
number_float 1 1234 123 123
magic_quotes PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc<>() O\'Henry 하퍼 aa:bb:cc:dd:ee:ff
-callback PHP 1 FOO@BAR.COM HTTP://A.B.C 1.2.3.4 123 123ABC<>() O'HENRY 하퍼 AA:BB:CC:DD:EE:FF \ No newline at end of file
+callback PHP 1 FOO@BAR.COM HTTP://A.B.C 1.2.3.4 123 123ABC<>() O'HENRY 하퍼 AA:BB:CC:DD:EE:FF
diff --git a/ext/filter/tests/056.phpt b/ext/filter/tests/056.phpt
new file mode 100644
index 0000000000..4a27a9fa10
--- /dev/null
+++ b/ext/filter/tests/056.phpt
@@ -0,0 +1,68 @@
+--TEST--
+filter_var() and FILTER_VALIDATE_DOMAIN
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
+--FILE--
+<?php
+
+$values = Array(
+'example.com',
+'www.thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
+'toolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolong.com',
+'eauBcFReEmjLcoZwI0RuONNnwU4H9r151juCaqTI5VeIP5jcYIqhx1lh5vV00l2rTs6y7hOp7rYw42QZiq6VIzjcYrRm8gFRMk9U9Wi1grL8Mr5kLVloYLthHgyA94QK3SaXCATklxgo6XvcbXIqAGG7U0KxTr8hJJU1p2ZQ2mXHmp4DhYP8N9SRuEKzaCPcSIcW7uj21jZqBigsLsNAXEzU8SPXZjmVQVtwQATPWeWyGW4GuJhjP4Q8o0.com',
+'kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.CQ1oT5Uq3jJt6Uhy3VH9u3Gi5YhfZCvZVKgLlaXNFhVKB1zJxvunR7SJa.com.',
+'cont-ains.h-yph-en-s.com',
+'..com',
+'ab..cc.dd',
+'a.-bc.com',
+'ab.cd-.com',
+'-.abc.com',
+'abc.-.abc.com',
+'underscore_.example.com',
+'',
+-1,
+array(),
+'\r\n',
+);
+foreach ($values as $value) {
+ var_dump(filter_var($value, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
+}
+
+var_dump(filter_var('_example.com', FILTER_VALIDATE_DOMAIN));
+var_dump(filter_var('_example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
+var_dump(filter_var('test_.example.com', FILTER_VALIDATE_DOMAIN));
+var_dump(filter_var('test_.example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
+var_dump(filter_var('te_st.example.com', FILTER_VALIDATE_DOMAIN));
+var_dump(filter_var('te_st.example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
+var_dump(filter_var('test._example.com', FILTER_VALIDATE_DOMAIN));
+var_dump(filter_var('test._example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(11) "example.com"
+string(71) "www.thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com"
+bool(false)
+bool(false)
+string(254) "kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.CQ1oT5Uq3jJt6Uhy3VH9u3Gi5YhfZCvZVKgLlaXNFhVKB1zJxvunR7SJa.com."
+string(24) "cont-ains.h-yph-en-s.com"
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+string(12) "_example.com"
+bool(false)
+string(17) "test_.example.com"
+bool(false)
+string(17) "te_st.example.com"
+bool(false)
+string(17) "test._example.com"
+bool(false)
+Done
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index f2051fe195..e54eda0790 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -69,8 +69,8 @@ typedef struct ftpbuf
ftptype_t type; /* current transfer type */
int pasv; /* 0=off; 1=pasv; 2=ready */
php_sockaddr_storage pasvaddr; /* passive mode address */
- zend_long timeout_sec; /* User configureable timeout (seconds) */
- int autoseek; /* User configureable autoseek flag */
+ zend_long timeout_sec; /* User configurable timeout (seconds) */
+ int autoseek; /* User configurable autoseek flag */
int nb; /* "nonblocking" transfer in progress */
databuf_t *data; /* Data connection for "nonblocking" transfers */
diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h
index b61d972e80..0ace31ba03 100644
--- a/ext/gd/libgd/gd.h
+++ b/ext/gd/libgd/gd.h
@@ -782,7 +782,7 @@ int gdImageBrightness(gdImagePtr src, int brightness);
/* Set the contrast level <contrast> for the image <src> */
int gdImageContrast(gdImagePtr src, double contrast);
-/* Simply adds or substracts respectively red, green or blue to a pixel */
+/* Simply adds or subtracts respectively red, green or blue to a pixel */
int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha);
/* Image convolution by a 3x3 custom matrix */
diff --git a/ext/gd/libgd/gd_arc_f_buggy.c b/ext/gd/libgd/gd_arc_f_buggy.c
index c26e42171a..ffab551230 100644
--- a/ext/gd/libgd/gd_arc_f_buggy.c
+++ b/ext/gd/libgd/gd_arc_f_buggy.c
@@ -1,6 +1,6 @@
/* This is potentially great stuff, but fails against the test
program at the end. This would probably be much more
- efficent than the implementation currently in gd.c if the
+ efficient than the implementation currently in gd.c if the
errors in the output were corrected. TBB */
#if 0
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index 4148cf47bb..763efcf68c 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -464,7 +464,7 @@ static void *fontFetch (char **error, void *key)
return NULL;
}
- /* FIXME - This mapping stuff is imcomplete - where is the spec? */
+ /* FIXME - This mapping stuff is incomplete - where is the spec? */
/* EAM - It's worse than that. It's pointless to match character encodings here.
* As currently written, the stored a->face->charmap only matches one of
* the actual charmaps and we cannot know at this stage if it is the right
diff --git a/ext/gd/libgd/webpimg.c b/ext/gd/libgd/webpimg.c
index 01bef93c48..95a8081e05 100644
--- a/ext/gd/libgd/webpimg.c
+++ b/ext/gd/libgd/webpimg.c
@@ -169,7 +169,7 @@ static inline uint32 get_le32(const uint8* const data) {
* Y2/U2/V2: The Y/U/V data of the second image
*
* Returns the PSNR (http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio)
- * value computed bewteen the two images
+ * value computed between the two images
*/
double GetPSNRYuv(const uint8* Y1,
const uint8* U1,
@@ -210,7 +210,7 @@ double GetPSNRYuv(const uint8* Y1,
* imgdata: data buffer containing webp image
* imgdata_size: size of the imgdata buffer
*
- * Returns the PSNR value computed bewteen the two images
+ * Returns the PSNR value computed between the two images
*/
double WebPGetPSNR(const uint8* Y1,
const uint8* U1,
diff --git a/ext/gd/libgd/webpimg.h b/ext/gd/libgd/webpimg.h
index db23de5bb2..bc0f9722bd 100644
--- a/ext/gd/libgd/webpimg.h
+++ b/ext/gd/libgd/webpimg.h
@@ -57,7 +57,7 @@ typedef enum WebPResultType {
* 3. p_Y/p_U/p_V : pointer to the Y/U/V data buffer (this routine will
* allocate memory for the buffer, fill the buffer with
* appropriate data and transfer owner ship of the buffer
- * to caller. Caller is reponsible for freeing the memory).
+ * to caller. Caller is responsible for freeing the memory).
* Note that the memory for Y, U, V buffers is alloacted
* in one chunk, hence one should call free(*p_Y) only.
* Do not try to free the U and V buffers.
diff --git a/ext/gd/tests/imagealphablending_error1.phpt b/ext/gd/tests/imagealphablending_error1.phpt
new file mode 100644
index 0000000000..6d49f32b07
--- /dev/null
+++ b/ext/gd/tests/imagealphablending_error1.phpt
@@ -0,0 +1,19 @@
+--TEST--
+test imagealphablending without arguments
+
+--CREDITS--
+Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
+‪#‎phpspMaisTestFest PHPSP on 2014-07-05
+
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available.");
+?>
+
+--FILE--
+<?php
+imagealphablending();
+?>
+
+--EXPECTF--
+Warning: imagealphablending() expects exactly 2 parameters, 0 given in %s on line %d \ No newline at end of file
diff --git a/ext/gd/tests/imagecolorresolvealpha_error3.phpt b/ext/gd/tests/imagecolorresolvealpha_error3.phpt
new file mode 100644
index 0000000000..735b4c97db
--- /dev/null
+++ b/ext/gd/tests/imagecolorresolvealpha_error3.phpt
@@ -0,0 +1,19 @@
+--TEST--
+test imagecolorresolvealpha without arguments
+
+--CREDITS--
+Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
+‪#‎phpspMaisTestFest PHPSP on 2014-07-05
+
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available.");
+?>
+
+--FILE--
+<?php
+imagecolorresolvealpha();
+?>
+
+--EXPECTF--
+Warning: imagecolorresolvealpha() expects exactly 5 parameters, 0 given in %s on line %d \ No newline at end of file
diff --git a/ext/gd/tests/imagesavealpha_error2.phpt b/ext/gd/tests/imagesavealpha_error2.phpt
new file mode 100644
index 0000000000..1a7083d526
--- /dev/null
+++ b/ext/gd/tests/imagesavealpha_error2.phpt
@@ -0,0 +1,19 @@
+--TEST--
+test imagesavealpha without arguments
+
+--CREDITS--
+Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
+‪#‎phpspMaisTestFest PHPSP on 2014-07-05
+
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available.");
+?>
+
+--FILE--
+<?php
+imagesavealpha();
+?>
+
+--EXPECTF--
+Warning: imagesavealpha() expects exactly 2 parameters, 0 given in %s on line %d \ No newline at end of file
diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000000..1aaba7b27b
--- /dev/null
+++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo
Binary files differ
diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
new file mode 100644
index 0000000000..d2496d78fc
--- /dev/null
+++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:40+0100\n"
+"Last-Translator: <ab@php.net>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: de_DE\n"
+
+msgid "hello"
+msgstr "hallo"
diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000000..79d02c1732
--- /dev/null
+++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo
Binary files differ
diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
new file mode 100644
index 0000000000..670d7ddadf
--- /dev/null
+++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:40+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: en_US\n"
+
+msgid "hello"
+msgstr "hello"
diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000000..c2f3cdd6b7
--- /dev/null
+++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo
Binary files differ
diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
new file mode 100644
index 0000000000..c2f708c526
--- /dev/null
+++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:59+0100\n"
+"Last-Translator: <ab@php.net>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: fr_FR\n"
+
+msgid "hello"
+msgstr "salut"
diff --git a/ext/gettext/tests/bug66267.phpt b/ext/gettext/tests/bug66267.phpt
new file mode 100644
index 0000000000..26963acb7e
--- /dev/null
+++ b/ext/gettext/tests/bug66267.phpt
@@ -0,0 +1,55 @@
+--TEST--
+#66265: gettext doesn't switch locales within the same script
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+ die("skip\n");
+}
+if (PHP_ZTS) {
+ /* this is supposed to fail on the TS build at least on Windows,
+ should be even XFAIL till it's fixed there */
+ die("skip NTS only");
+}
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ $loc = ["de_DE", "fr_FR", "en_US"];
+ foreach($loc as $l) {
+ if (!setlocale(LC_ALL, $l)) {
+ die("SKIP '$l' locale not supported.");
+ }
+ }
+}
+?>
+--FILE--
+<?php
+
+$domain = 'domain';
+
+$loc = ["de_DE", "fr_FR", "en_US"];
+
+foreach ($loc as $l) {
+ putenv("LC_ALL=$l");
+
+ $path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "66265");
+ bindtextdomain($domain, $path);
+ bind_textdomain_codeset($domain, "UTF-8");
+ textdomain($domain);
+
+ echo 'LC_ALL=', getenv('LC_ALL'), "\n";
+ echo 'hello=', _('hello'), "\n";
+ echo "\n";
+}
+
+?>
+==DONE==
+--EXPECTF--
+LC_ALL=de_DE
+hello=hallo
+
+LC_ALL=fr_FR
+hello=salut
+
+LC_ALL=en_US
+hello=hello
+
+==DONE==
+
diff --git a/ext/iconv/tests/iconv_basic_001-win32.phpt b/ext/iconv/tests/iconv_basic_001-win32.phpt
new file mode 100644
index 0000000000..59a3dbd863
--- /dev/null
+++ b/ext/iconv/tests/iconv_basic_001-win32.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test the basics to function iconv.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
+<?php if(substr(PHP_OS, 0, 3) != 'WIN' ) {die('skip windows only test');} ?>
+--FILE--
+<?php
+$in_charset = 'UTF-8';
+$out_charset = 'ASCII//TRANSLIT';
+$string_to_translate = 'Žluťoučký kůň\n';
+
+$string_out = iconv($in_charset, $out_charset, $string_to_translate);
+
+var_dump($string_out);
+?>
+--EXPECT--
+string(16) "Zlutouck'y kun\n"
diff --git a/ext/iconv/tests/iconv_basic_001.phpt b/ext/iconv/tests/iconv_basic_001.phpt
new file mode 100644
index 0000000000..6fcb5dbe8a
--- /dev/null
+++ b/ext/iconv/tests/iconv_basic_001.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test the basics to function iconv.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
+<?php if(substr(PHP_OS, 0, 3) == 'WIN' ) {die('skip not for windows');} ?>
+--FILE--
+<?php
+$in_charset = 'UTF-8';
+$out_charset = 'ASCII//TRANSLIT';
+$string_to_translate = 'Žluťoučký kůň\n';
+
+$string_out = iconv($in_charset, $out_charset, $string_to_translate);
+
+var_dump($string_out);
+?>
+--EXPECT--
+string(15) "Zlutoucky kun\n"
diff --git a/ext/interbase/tests/002.phpt b/ext/interbase/tests/002.phpt
index 070a6f0069..37b0a4f344 100644
--- a/ext/interbase/tests/002.phpt
+++ b/ext/interbase/tests/002.phpt
@@ -3,7 +3,7 @@ InterBase: connect, close and pconnect
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/003.phpt b/ext/interbase/tests/003.phpt
index 652e3bdc52..8ee86d3e9e 100644
--- a/ext/interbase/tests/003.phpt
+++ b/ext/interbase/tests/003.phpt
@@ -3,7 +3,7 @@ InterBase: misc sql types (may take a while)
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
ibase_connect($test_base);
diff --git a/ext/interbase/tests/004.phpt b/ext/interbase/tests/004.phpt
index 579445dbdd..e81474a4c4 100644
--- a/ext/interbase/tests/004.phpt
+++ b/ext/interbase/tests/004.phpt
@@ -3,7 +3,7 @@ InterBase: BLOB test
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt
index c5167c132e..cb68b0a1d5 100644
--- a/ext/interbase/tests/005.phpt
+++ b/ext/interbase/tests/005.phpt
@@ -3,7 +3,7 @@ InterBase: transactions
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
@@ -63,7 +63,7 @@ simple default transaction test without ibase_trans()
/*
default transaction on default link
First open transaction on link will be default.
-$tr_def_l1 may be ommited. All queryes without link and trans
+$tr_def_l1 may be omitted. All queryes without link and trans
parameters run in this context
*/
diff --git a/ext/interbase/tests/006.phpt b/ext/interbase/tests/006.phpt
index ad6120f393..a32807eec0 100644
--- a/ext/interbase/tests/006.phpt
+++ b/ext/interbase/tests/006.phpt
@@ -3,7 +3,7 @@ InterBase: binding (may take a while)
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/007.phpt b/ext/interbase/tests/007.phpt
index 069b7eda26..92e7c73984 100644
--- a/ext/interbase/tests/007.phpt
+++ b/ext/interbase/tests/007.phpt
@@ -3,7 +3,7 @@ InterBase: array handling
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/008.phpt b/ext/interbase/tests/008.phpt
index 8292fc38c5..6728b9d7d3 100644
--- a/ext/interbase/tests/008.phpt
+++ b/ext/interbase/tests/008.phpt
@@ -6,7 +6,7 @@ if (PHP_OS == "WINNT") echo "skip";
include("skipif.inc");
?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c
index bc279b25f7..607add2fcf 100644
--- a/ext/intl/collator/collator_convert.c
+++ b/ext/intl/collator/collator_convert.c
@@ -273,7 +273,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
}
}
- /* Object wasn't successfuly converted => bail out. */
+ /* Object wasn't successfully converted => bail out. */
if( zstr == NULL )
{
COLLATOR_CONVERT_RETURN_FAILED( obj );
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index 4fd7c4597e..6f29c9b6de 100644
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -482,7 +482,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
sortKeyIndxBuf = erealloc( sortKeyIndxBuf, sortKeyIndxBufSize );
}
- sortKeyIndxBuf[sortKeyCount].key = (char*)sortKeyBufOffset; /* remeber just offset, cause address */
+ sortKeyIndxBuf[sortKeyCount].key = (char*)sortKeyBufOffset; /* remember just offset, cause address */
/* of 'sortKeyBuf' may be changed due to realloc. */
sortKeyIndxBuf[sortKeyCount].zstr = hashData;
diff --git a/ext/intl/doc/datefmt_api.php b/ext/intl/doc/datefmt_api.php
index 272abdb57c..2084e1a2c8 100644
--- a/ext/intl/doc/datefmt_api.php
+++ b/ext/intl/doc/datefmt_api.php
@@ -150,7 +150,7 @@ class DateFormatter {
* time patterns, parsing as much as possible to obtain a value.
* 'false' sets the parser to strictly parse strings into dates.
* Extra space, unrecognized tokens, or invalid values
- * ("Feburary 30th") are not accepted.
+ * ("February 30th") are not accepted.
*
* @return boolean 'true' if successful; 'false' if an error occurred.
*/
@@ -338,7 +338,7 @@ class DateFormatter {
* time patterns, parsing as much as possible to obtain a value.
* 'false' sets the parser to strictly parse strings into dates.
* Extra space, unrecognized tokens, or invalid values
- * ("Feburary 30th") are not accepted.
+ * ("February 30th") are not accepted.
*
* @return boolean 'true' if successful; 'false' if an error occurred.
*/
diff --git a/ext/intl/intl_convert.c b/ext/intl/intl_convert.c
index 7f756b9e7f..50a742082f 100644
--- a/ext/intl/intl_convert.c
+++ b/ext/intl/intl_convert.c
@@ -61,7 +61,7 @@ void intl_convert_utf8_to_utf16(
if( *status == U_ZERO_ERROR )
{
- /* String is converted successfuly */
+ /* String is converted successfully */
(*target)[dst_len] = 0;
*target_len = dst_len;
return;
diff --git a/ext/intl/tests/bug60192-compare.phpt b/ext/intl/tests/bug60192-compare.phpt
index 0fd24cce80..12f3273538 100644
--- a/ext/intl/tests/bug60192-compare.phpt
+++ b/ext/intl/tests/bug60192-compare.phpt
@@ -8,7 +8,7 @@ Bug #60192 (SegFault when Collator not constructed properly)
<?php
class Collator2 extends Collator{
public function __construct() {
- // ommitting parent::__construct($someLocale);
+ // omitting parent::__construct($someLocale);
}
}
diff --git a/ext/intl/tests/bug60192-getlocale.phpt b/ext/intl/tests/bug60192-getlocale.phpt
index 50e3ec35e4..9f340c5f67 100644
--- a/ext/intl/tests/bug60192-getlocale.phpt
+++ b/ext/intl/tests/bug60192-getlocale.phpt
@@ -9,7 +9,7 @@ Bug #60192 (SegFault when Collator not constructed properly)
class Collator2 extends Collator{
public function __construct() {
- // ommitting parent::__construct($someLocale);
+ // omitting parent::__construct($someLocale);
}
}
diff --git a/ext/intl/tests/bug60192-getsortkey.phpt b/ext/intl/tests/bug60192-getsortkey.phpt
index 39755ae8f9..f3e68f9c61 100644
--- a/ext/intl/tests/bug60192-getsortkey.phpt
+++ b/ext/intl/tests/bug60192-getsortkey.phpt
@@ -9,7 +9,7 @@ Bug #60192 (SegFault when Collator not constructed properly)
class Collator2 extends Collator{
public function __construct() {
- // ommitting parent::__construct($someLocale);
+ // omitting parent::__construct($someLocale);
}
}
diff --git a/ext/intl/tests/bug60192-sort.phpt b/ext/intl/tests/bug60192-sort.phpt
index 57057215e6..ee506d3a5a 100644
--- a/ext/intl/tests/bug60192-sort.phpt
+++ b/ext/intl/tests/bug60192-sort.phpt
@@ -9,7 +9,7 @@ Bug #60192 (SegFault when Collator not constructed properly)
class Collator2 extends Collator{
public function __construct() {
- // ommitting parent::__construct($someLocale);
+ // omitting parent::__construct($someLocale);
}
}
diff --git a/ext/intl/tests/bug60192-sortwithsortkeys.phpt b/ext/intl/tests/bug60192-sortwithsortkeys.phpt
index 445f4a03b9..c26b2daf85 100644
--- a/ext/intl/tests/bug60192-sortwithsortkeys.phpt
+++ b/ext/intl/tests/bug60192-sortwithsortkeys.phpt
@@ -9,7 +9,7 @@ Bug #60192 (SegFault when Collator not constructed properly)
class Collator2 extends Collator{
public function __construct() {
- // ommitting parent::__construct($someLocale);
+ // omitting parent::__construct($someLocale);
}
}
diff --git a/ext/intl/tests/bug67052-win32.phpt b/ext/intl/tests/bug67052-win32.phpt
new file mode 100644
index 0000000000..5bc6497bea
--- /dev/null
+++ b/ext/intl/tests/bug67052-win32.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+
+function ut_main()
+{
+ setlocale(LC_ALL, 'de-de');
+ $fmt = new NumberFormatter( 'sl_SI.UTF-8', NumberFormatter::DECIMAL);
+ $num = "1.234.567,891";
+ $res_str = $fmt->parse($num)."\n";
+ $res_str .= setlocale(LC_NUMERIC, 0);
+ return $res_str;
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+
+?>
+--EXPECT--
+1234567,891
+de-de
+
diff --git a/ext/intl/tests/bug67052.phpt b/ext/intl/tests/bug67052.phpt
index c8363b9c7a..8edd65de71 100644
--- a/ext/intl/tests/bug67052.phpt
+++ b/ext/intl/tests/bug67052.phpt
@@ -2,6 +2,11 @@
Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die("skip Valid only on non Windows");
+}
+?>
--FILE--
<?php
diff --git a/ext/intl/tests/collator_create3.phpt b/ext/intl/tests/collator_create3.phpt
index c602e794cd..5041e635fa 100644
--- a/ext/intl/tests/collator_create3.phpt
+++ b/ext/intl/tests/collator_create3.phpt
@@ -1,8 +1,9 @@
--TEST--
-create() icu >= 53.1
+create() icu >= 53.1 && icu < 54.1
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
diff --git a/ext/intl/tests/collator_create4.phpt b/ext/intl/tests/collator_create4.phpt
new file mode 100644
index 0000000000..2c22e6a442
--- /dev/null
+++ b/ext/intl/tests/collator_create4.phpt
@@ -0,0 +1,79 @@
+--TEST--
+create() icu >= 53.1
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+
+/*
+ * Try creating collator with different locales
+ * with Procedural and Object methods.
+ */
+
+function ut_main()
+{
+ $res_str = '';
+
+ $locales = array(
+ 'EN-US-ODESSA',
+ 'UK_UA_ODESSA',
+ 'uk-ua_CALIFORNIA@currency=;currency=GRN',
+ '',
+ 'root',
+ 'uk@currency=EURO',
+ '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
+ );
+
+ foreach( $locales as $locale )
+ {
+ // Create Collator with the current locale.
+ $coll = ut_coll_create( $locale );
+ if( !is_object($coll) )
+ {
+ $res_str .= "Error creating collator with '$locale' locale: " .
+ intl_get_error_message() . "\n";
+ continue;
+ }
+
+ // Get the requested, valid and actual locales.
+ $vloc = ut_coll_get_locale( $coll, Locale::VALID_LOCALE );
+ $aloc = ut_coll_get_locale( $coll, Locale::ACTUAL_LOCALE );
+
+ // Show them.
+ $res_str .= "Locale: '$locale'\n" .
+ " ULOC_REQUESTED_LOCALE = '$locale'\n" .
+ " ULOC_VALID_LOCALE = '$vloc'\n" .
+ " ULOC_ACTUAL_LOCALE = '$aloc'\n";
+ }
+
+ return $res_str;
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+
+?>
+--EXPECTF--
+Locale: 'EN-US-ODESSA'
+ ULOC_REQUESTED_LOCALE = 'EN-US-ODESSA'
+ ULOC_VALID_LOCALE = 'en_US'
+ ULOC_ACTUAL_LOCALE = 'root'
+Locale: 'UK_UA_ODESSA'
+ ULOC_REQUESTED_LOCALE = 'UK_UA_ODESSA'
+ ULOC_VALID_LOCALE = 'uk'
+ ULOC_ACTUAL_LOCALE = 'uk'
+Error creating collator with 'uk-ua_CALIFORNIA@currency=;currency=GRN' locale: collator_create: unable to open ICU collator: U_ILLEGAL_ARGUMENT_ERROR
+Locale: ''
+ ULOC_REQUESTED_LOCALE = ''
+ ULOC_VALID_LOCALE = '%s'
+ ULOC_ACTUAL_LOCALE = '%s'
+Locale: 'root'
+ ULOC_REQUESTED_LOCALE = 'root'
+ ULOC_VALID_LOCALE = 'root'
+ ULOC_ACTUAL_LOCALE = 'root'
+Locale: 'uk@currency=EURO'
+ ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
+ ULOC_VALID_LOCALE = 'uk'
+ ULOC_ACTUAL_LOCALE = 'uk'
+Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
diff --git a/ext/intl/tests/collator_get_error_code.phpt b/ext/intl/tests/collator_get_error_code.phpt
index 45a8e710f4..c886943d5d 100644
--- a/ext/intl/tests/collator_get_error_code.phpt
+++ b/ext/intl/tests/collator_get_error_code.phpt
@@ -6,7 +6,7 @@ get_error_code()
<?php
/*
- * Retreive error code.
+ * Retrieve error code.
*/
diff --git a/ext/intl/tests/collator_get_error_message.phpt b/ext/intl/tests/collator_get_error_message.phpt
index af4b9c3821..2c1cc79a5f 100644
--- a/ext/intl/tests/collator_get_error_message.phpt
+++ b/ext/intl/tests/collator_get_error_message.phpt
@@ -6,7 +6,7 @@ get_error_message()
<?php
/*
- * Retreive error message.
+ * Retrieve error message.
*/
diff --git a/ext/intl/tests/collator_get_sort_key_variant3.phpt b/ext/intl/tests/collator_get_sort_key_variant3.phpt
index cc2a23b2b8..f4cb88e3e7 100644
--- a/ext/intl/tests/collator_get_sort_key_variant3.phpt
+++ b/ext/intl/tests/collator_get_sort_key_variant3.phpt
@@ -1,8 +1,9 @@
--TEST--
-collator_get_sort_key()
+collator_get_sort_key() icu >= 53.1 && icu < 54.1
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
diff --git a/ext/intl/tests/collator_get_sort_key_variant4.phpt b/ext/intl/tests/collator_get_sort_key_variant4.phpt
new file mode 100644
index 0000000000..2c86f21111
--- /dev/null
+++ b/ext/intl/tests/collator_get_sort_key_variant4.phpt
@@ -0,0 +1,98 @@
+--TEST--
+collator_get_sort_key() icu >= 54.1
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+
+/*
+ * Get sort keys using various locales
+ */
+function sort_arrays( $locale, $data )
+{
+ $res_str = '';
+
+ $coll = ut_coll_create( $locale );
+
+ foreach($data as $value) {
+ $res_val = ut_coll_get_sort_key( $coll, $value );
+ $res_str .= "source: ".$value."\n".
+ "key: ".bin2hex($res_val)."\n";
+ }
+
+ return $res_str;
+}
+
+
+function ut_main()
+{
+ $res_str = '';
+
+ // Regular strings keys
+ $test_params = array(
+ 'abc', 'abd', 'aaa',
+ 'аа', 'а', 'z',
+ '', null , '3',
+ 'y' , 'i' , 'k'
+ );
+
+ $res_str .= sort_arrays( 'en_US', $test_params );
+
+ // Sort a non-ASCII array using ru_RU locale.
+ $test_params = array(
+ 'абг', 'абв', 'жжж', 'эюя'
+ );
+
+ $res_str .= sort_arrays( 'ru_RU', $test_params );
+
+ // Sort an array using Lithuanian locale.
+ $res_str .= sort_arrays( 'lt_LT', $test_params );
+
+ return $res_str . "\n";
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+?>
+--EXPECT--
+source: abc
+key: 292b2d01070107
+source: abd
+key: 292b2f01070107
+source: aaa
+key: 29292901070107
+source: аа
+key: 5e060601060106
+source: а
+key: 5e0601050105
+source: z
+key: 5b01050105
+source:
+key: 0101
+source:
+key: 0101
+source: 3
+key: 1a01050105
+source: y
+key: 5901050105
+source: i
+key: 3901050105
+source: k
+key: 3d01050105
+source: абг
+key: 2806101401070107
+source: абв
+key: 2806101201070107
+source: жжж
+key: 2830303001070107
+source: эюя
+key: 28ccd0d401070107
+source: абг
+key: 5e06101401070107
+source: абв
+key: 5e06101201070107
+source: жжж
+key: 5e30303001070107
+source: эюя
+key: 5eccd0d401070107
diff --git a/ext/intl/tests/dateformat_calendars_variant2.phpt b/ext/intl/tests/dateformat_calendars_variant2.phpt
index 61cdea8408..b3b1701c55 100644
--- a/ext/intl/tests/dateformat_calendars_variant2.phpt
+++ b/ext/intl/tests/dateformat_calendars_variant2.phpt
@@ -6,6 +6,7 @@ date.timezone=Atlantic/Azores
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_calendars_variant3.phpt b/ext/intl/tests/dateformat_calendars_variant3.phpt
new file mode 100644
index 0000000000..36a67e6f04
--- /dev/null
+++ b/ext/intl/tests/dateformat_calendars_variant3.phpt
@@ -0,0 +1,45 @@
+--TEST--
+IntlDateFormatter, calendars and time zone
+--INI--
+date.timezone=Atlantic/Azores
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt1 = new IntlDateFormatter('en_US',
+ IntlDateFormatter::FULL,
+ IntlDateFormatter::FULL,
+ 'GMT+05:12',
+ IntlDateFormatter::TRADITIONAL);
+$fmt2 = new IntlDateFormatter('en_US',
+ IntlDateFormatter::FULL,
+ IntlDateFormatter::FULL,
+ 'GMT+05:12',
+ IntlDateFormatter::GREGORIAN);
+$fmt3 = new IntlDateFormatter('en_US@calendar=hebrew',
+ IntlDateFormatter::FULL,
+ IntlDateFormatter::FULL,
+ 'GMT+05:12',
+ IntlDateFormatter::TRADITIONAL);
+var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000')));
+var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000')));
+var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000')));
+
+new IntlDateFormatter('en_US@calendar=hebrew',
+ IntlDateFormatter::FULL,
+ IntlDateFormatter::FULL,
+ 'GMT+05:12',
+ -1);
+?>
+==DONE==
+--EXPECTF--
+string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12"
+string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12"
+string(44) "Sunday, 6 Tevet 5772 at 5:12:00 AM GMT+05:12"
+
+Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %sdateformat_calendars_variant%d.php on line %d
+==DONE==
diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt
index 8a8c45d412..1beff145de 100644
--- a/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt
+++ b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt
@@ -4,6 +4,7 @@ IntlDateFormatter: several forms of the calendar arg
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt
new file mode 100644
index 0000000000..4086e4558a
--- /dev/null
+++ b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt
@@ -0,0 +1,53 @@
+--TEST--
+IntlDateFormatter: several forms of the calendar arg
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+$cal = new IntlGregorianCalendar('UTC', NULL);
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
+echo $df->format($ts), "\n";
+
+$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic');
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
+echo $df->format($ts), "\n";
+
+//override calendar's timezone
+$cal = new IntlGregorianCalendar('UTC', NULL);
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal);
+echo $df->format($ts), "\n";
+
+//default calendar is gregorian
+$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0);
+echo $df->format($ts), "\n";
+
+//try now with traditional
+$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL);
+echo $df->format($ts), "\n";
+
+//the timezone can be overridden when not specifying a calendar
+$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL);
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0);
+echo $df->format($ts), "\n";
+
+?>
+==DONE==
+--EXPECTF--
+domingo%S 1 de enero de 2012, 0:00:00 (GMT)
+domingo%S 8 de Safar de 1433, 0:00:00 (GMT)
+domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
+sábado, 31 de diciembre de 2011 d. C., 23:00:00 (hora estándar de las Azores)
+sábado, 7 de Safar de 1433 AH, 23:00:00 (hora estándar de las Azores)
+domingo%S 8 de Safar de 1433 AH, 0:00:00 (GMT)
+domingo%S 1 de enero de 2012, 0:00:00 (GMT)
+==DONE==
diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt
index 0c5486263f..0312524148 100644
--- a/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt
+++ b/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt
@@ -4,6 +4,7 @@ IntlDateFormatter::formatObject(): IntlCalendar tests
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt
new file mode 100644
index 0000000000..2ca57c245f
--- /dev/null
+++ b/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt
@@ -0,0 +1,40 @@
+--TEST--
+IntlDateFormatter::formatObject(): IntlCalendar tests
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", "Europe/Lisbon");
+
+$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon
+echo IntlDateFormatter::formatObject($cal), "\n";
+echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
+echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n";
+echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
+echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
+
+$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00');
+echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n";
+
+$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil');
+$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.);
+echo IntlDateFormatter::formatObject($cal), "\n";
+echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n";
+
+?>
+==DONE==
+
+--EXPECTF--
+01/01/2012, 00:00:00
+domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental
+Jan 1, 2012, 12:00:00 AM
+1/1/12, 12:00:00 AM Western European Standard %STime
+Sun 2012-01-1 00,00,00.000 Portugal Time
+domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00
+06/02/1433, 00:00:00
+Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time
+==DONE==
diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt
index fec88e9d13..5ee72446f1 100644
--- a/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt
+++ b/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt
@@ -4,6 +4,7 @@ IntlDateFormatter::formatObject(): DateTime tests
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt
new file mode 100644
index 0000000000..c47e2b59bd
--- /dev/null
+++ b/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt
@@ -0,0 +1,33 @@
+--TEST--
+IntlDateFormatter::formatObject(): DateTime tests
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", "Europe/Lisbon");
+
+$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon
+echo IntlDateFormatter::formatObject($dt), "\n";
+echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
+echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n";
+echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
+echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
+
+$dt = new DateTime('2012-01-01 05:00:00+03:00');
+echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
+
+?>
+==DONE==
+
+--EXPECTF--
+01/01/2012, 00:00:00
+domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental
+Jan 1, 2012, 12:00:00 AM
+1/1/12, 12:00:00 AM Western European Standard %STime
+Sun 2012-01-1 00,00,00.000 Portugal Time
+domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00
+==DONE==
diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt
index 5dee52db92..97f2911cfe 100644
--- a/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt
+++ b/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt
@@ -4,6 +4,7 @@ IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt
new file mode 100644
index 0000000000..dc9db09740
--- /dev/null
+++ b/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt
@@ -0,0 +1,55 @@
+--TEST--
+IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+function d(IntlDateFormatter $df) {
+global $ts;
+echo $df->format($ts), "\n";
+var_dump($df->getCalendar(),
+$df->getCalendarObject()->getType(),
+$df->getCalendarObject()->getTimeZone()->getId());
+echo "\n";
+}
+
+$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk');
+d($df);
+
+
+//changing the calendar with a cal type should not change tz
+$df->setCalendar(IntlDateFormatter::TRADITIONAL);
+d($df);
+
+//but changing with an actual calendar should
+$cal = IntlCalendar::createInstance("UTC");
+$df->setCalendar($cal);
+d($df);
+
+?>
+==DONE==
+--EXPECT--
+dimanche 1 janvier 2012 ap. J.-C. à 03:00:00 heure de Kaliningrad
+int(1)
+string(9) "gregorian"
+string(12) "Europe/Minsk"
+
+dimanche 8 safar 1433 AH à 03:00:00 heure de Kaliningrad
+int(0)
+string(7) "islamic"
+string(12) "Europe/Minsk"
+
+dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 UTC
+bool(false)
+string(9) "gregorian"
+string(3) "UTC"
+
+==DONE==
diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt
index fe0663e069..a06bbc1eaa 100644
--- a/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt
+++ b/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt
@@ -4,6 +4,7 @@ IntlDateFormatter: get/setTimeZone()
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt
new file mode 100644
index 0000000000..adedd74965
--- /dev/null
+++ b/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt
@@ -0,0 +1,62 @@
+--TEST--
+IntlDateFormatter: get/setTimeZone()
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+function d(IntlDateFormatter $df) {
+global $ts;
+echo $df->format($ts), "\n";
+var_dump(
+$df->getTimeZoneID(),
+$df->getTimeZone()->getID());
+echo "\n";
+}
+
+$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk');
+d($df);
+
+$df->setTimeZone(NULL);
+d($df);
+
+$df->setTimeZone('Europe/Madrid');
+d($df);
+
+$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris'));
+d($df);
+
+$df->setTimeZone(new DateTimeZone('Europe/Amsterdam'));
+d($df);
+
+?>
+==DONE==
+--EXPECTF--
+domingo, 1 de janeiro de 2012 às 03:00:00 Hor%s do Extremo Leste da Europa
+string(12) "Europe/Minsk"
+string(12) "Europe/Minsk"
+
+sábado, 31 de dezembro de 2011 às 23:00:00 Hor%s Padrão %Sdos Açores
+string(15) "Atlantic/Azores"
+string(15) "Atlantic/Azores"
+
+domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central
+string(13) "Europe/Madrid"
+string(13) "Europe/Madrid"
+
+domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central
+string(12) "Europe/Paris"
+string(12) "Europe/Paris"
+
+domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central
+string(16) "Europe/Amsterdam"
+string(16) "Europe/Amsterdam"
+
+==DONE==
diff --git a/ext/intl/tests/dateformat_timezone_arg_variations3.phpt b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt
index 0ef743ea43..f8aaf2bd4a 100644
--- a/ext/intl/tests/dateformat_timezone_arg_variations3.phpt
+++ b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt
@@ -4,6 +4,7 @@ IntlDateFormatter: several forms of the timezone arg
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_timezone_arg_variations4.phpt b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt
new file mode 100644
index 0000000000..7be709a66f
--- /dev/null
+++ b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt
@@ -0,0 +1,46 @@
+--TEST--
+IntlDateFormatter: several forms of the timezone arg
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+//should use Atlantic/Azores
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL);
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam');
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York'));
+echo $df->format($ts), "\n";
+
+//time zone has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+//calendar has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
+echo $df->format($ts), "\n";
+
+--EXPECTF--
+sábado, 31 de diciembre de 2011, 23:00:00 (hora estándar de las Azores)
+domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
+domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental)
+sábado, 31 de diciembre de 2011, 19:00:00 (hora estándar oriental)
+domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
+domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental)
+domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
+
diff --git a/ext/intl/tests/formatter_format4.phpt b/ext/intl/tests/formatter_format4.phpt
index 88d457bdb3..96dd7be53e 100644
--- a/ext/intl/tests/formatter_format4.phpt
+++ b/ext/intl/tests/formatter_format4.phpt
@@ -1,8 +1,9 @@
--TEST--
-numfmt_format() icu >= 53.1
+numfmt_format() icu >= 53.1 && icu < 54.1
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
diff --git a/ext/intl/tests/formatter_format5.phpt b/ext/intl/tests/formatter_format5.phpt
new file mode 100644
index 0000000000..cbaf140a0f
--- /dev/null
+++ b/ext/intl/tests/formatter_format5.phpt
@@ -0,0 +1,130 @@
+--TEST--
+numfmt_format() icu >= 54.1
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+
+/*
+ * Format a number using misc locales/patterns.
+ */
+
+/*
+ * TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed
+ * currency and percent formatting.
+ */
+
+function ut_main()
+{
+ $styles = array(
+ NumberFormatter::PATTERN_DECIMAL => '##.#####################',
+ NumberFormatter::DECIMAL => '',
+ NumberFormatter::CURRENCY => '',
+ NumberFormatter::PERCENT => '',
+ NumberFormatter::SCIENTIFIC => '',
+ NumberFormatter::SPELLOUT => '@@@@@@@',
+ NumberFormatter::ORDINAL => '',
+ NumberFormatter::DURATION => '',
+ NumberFormatter::PATTERN_RULEBASED => '#####.###',
+ 1234999, // bad one
+ );
+
+ $integer = array(
+ NumberFormatter::ORDINAL => '',
+ NumberFormatter::DURATION => '',
+ );
+ $locales = array(
+ 'en_US',
+ 'ru_UA',
+ 'de',
+ 'fr',
+ 'en_UK'
+ );
+
+ $str_res = '';
+ $number = 1234567.891234567890000;
+
+ foreach( $locales as $locale )
+ {
+ $str_res .= "\nLocale is: $locale\n";
+ foreach( $styles as $style => $pattern )
+ {
+ $fmt = ut_nfmt_create( $locale, $style, $pattern );
+
+ if(!$fmt) {
+ $str_res .= "Bad formatter!\n";
+ continue;
+ }
+ $str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, $number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n";
+ }
+ }
+ return $str_res;
+}
+
+include_once( 'ut_common.inc' );
+
+// Run the test
+ut_run();
+
+?>
+--EXPECTREGEX--
+Locale is: en_US
+'1234567.89123457'
+'1,234,567.891'
+'\$1,234,567.89'
+'123,456,789%'
+'1.23456789123457E6'
+'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven'
+'1,234,567(th|ᵗʰ)'
+'342:56:07'
+'#####.###'
+'USD1,234,567.89'
+
+Locale is: ru_UA
+'1234567,89123457'
+'1 234 567,891'
+'1 234 567,89 ?(грн\.|₴)'
+'123 456 789 ?%'
+'1,23456789123457E6'
+'один миллион двести тридцать четыре тысячи пятьсот шестьдесят семь запятая восемь девять один два три четыре пять семь'
+'1 234 567.?'
+'1 234 567'
+'#####.###'
+'1 234 567,89 UAH'
+
+Locale is: de
+'1234567,89123457'
+'1.234.567,891'
+'(¤ )?1.234.567,89( ¤)?'
+'123\.456\.789 %'
+'1,23456789123457E6'
+'eine Million zwei­hundert­vier­und­dreißig­tausend­fünf­hundert­sieben­und­sechzig Komma acht neun eins zwei drei vier fünf sieben'
+'1.234.567.?'
+'1.234.567'
+'#####.###'
+'1.234.567,89 ¤¤'
+
+Locale is: fr
+'1234567,89123457'
+'1 234 567,891'
+'1 234 567,89 ¤'
+'123 456 789 ?%'
+'1,23456789123457E6'
+'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq sept'
+'1 234 567e'
+'1 234 567'
+'#####.###'
+'1 234 567,89 ¤¤'
+
+Locale is: en_UK
+'1234567.89123457'
+'1,234,567.891'
+'¤1,234,567.89'
+'123,456,789%'
+'1.23456789123457E6'
+'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven'
+'1,234,567(th|ᵗʰ)'
+'342:56:07'
+'#####.###'
+'¤¤1,234,567.89'
diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt
index c390366b5e..766c508d31 100644
--- a/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt
+++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt
@@ -4,6 +4,7 @@ MessageFormat accepts IntlCalendar args
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt
new file mode 100644
index 0000000000..8f778b9029
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt
@@ -0,0 +1,30 @@
+--TEST--
+MessageFormat accepts IntlCalendar args
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+ini_set('date.timezone', 'Europe/Lisbon');
+
+$cal = new IntlGregorianCalendar(2012,04,17,17,35,36);
+
+$msgf = new MessageFormatter('pt_PT', '{0,date,full} {0,time,h:m:s a V}');
+echo $msgf->format(array($cal)), "\n";
+
+//NOT FIXED:
+/*$msgf = new MessageFormatter('en_US',
+'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
+
+echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
+ $msgf->format(array($time, 'time')), "\n";
+*/
+
+?>
+==DONE==
+--EXPECT--
+quinta-feira, 17 de maio de 2012 5:35:36 da tarde ptlis
+==DONE==
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index d9e92541e9..3e4fb60825 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -1143,7 +1143,7 @@ zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node ex
{
php_libxml_func_handler export_hnd;
- /* Initialize in case this module hasnt been loaded yet */
+ /* Initialize in case this module hasn't been loaded yet */
php_libxml_initialize();
export_hnd.export_func = export_function;
diff --git a/ext/mbstring/README_PHP3-i18n-ja b/ext/mbstring/README_PHP3-i18n-ja
index 869fe3e495..eabe9e90f2 100644
--- a/ext/mbstring/README_PHP3-i18n-ja
+++ b/ext/mbstring/README_PHP3-i18n-ja
@@ -371,7 +371,7 @@ o i18n.internal_encoding - internal encoding
encodings, following conditions have to be satisfied in order
to use them:
- per byte encoding
- - single byte charactor in range of 00h-7fh which is compatible
+ - single byte character in range of 00h-7fh which is compatible
with ASCII
- multibyte without 00h-7fh
In case of Japanese, EUC-JP and UTF-8 are the only encoding that
@@ -408,7 +408,7 @@ o i18n.script_encoding - script encoding
entering the script parser.
Be aware that auto detection may fail under some conditions.
- For best auto detection, add multibyte charactor at beginning of
+ For best auto detection, add multibyte character at beginning of
script.
diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32
index 6b7e05a329..cf6143699b 100644
--- a/ext/mbstring/config.w32
+++ b/ext/mbstring/config.w32
@@ -1,53 +1,71 @@
// $Id$
// vim:ft=javascript
+ARG_WITH("libmbfl", "use external libmbfl", "no");
ARG_ENABLE("mbstring", "multibyte string functions", "no");
ARG_ENABLE("mbregex", "multibyte regex support", "no");
ARG_ENABLE("mbregex-backtrack", "check multibyte regex backtrack", "yes");
if (PHP_MBSTRING != "no") {
- FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
- "ext\\mbstring\\libmbfl\\config.h", true);
- FSO.CopyFile("ext\\mbstring\\oniguruma\\win32\\config.h",
- "ext\\mbstring\\oniguruma\\config.h", true);
-
- EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED,
- "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
- -Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
- /D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
- /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT");
-
- ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
- mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
- mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \
- mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_cp51932.c \
- mbfilter_euc_cn.c mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \
- mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \
- mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \
- mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c \
- mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \
- mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \
- mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \
- mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c mbfilter_sjis_2004.c \
- mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \
- mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \
- mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \
- mbfilter_koi8u.c mbfilter_cp1254.c mbfilter_euc_jp_2004.c \
- mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \
- mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c \
- mbfilter_sjis_mac.c \
- mbfilter_iso2022jp_2004.c mbfilter_iso2022jp_mobile.c \
- mbfilter_tl_jisx0201_jisx0208.c", "mbstring");
+ EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED);
+
+ if (PHP_LIBMBFL != "no" &&
+ CHECK_HEADER_ADD_INCLUDE("mbfl/mbfilter.h", "CFLAGS_LIBMBFL", PHP_LIBMBFL + "\\include") &&
+ CHECK_LIB("mbfl.lib", "libmbfl", PHP_LIBMBFL + "\\lib")) {
+
+ ADD_FLAG("LIBS_MBSTRING", get_define("LIBS_LIBMBFL"));
+ ADD_FLAG("LDFLAGS_MBSTRING", get_define("LDFLAGS_LIBMBFL"));
+ ADD_FLAG("CFLAGS_MBSTRING", get_define("CFLAGS_LIBMBFL") +
+ " /I ext/mbstring/oniguruma /D NOT_RUBY=1 \
+ /D HAVE_STDARG_PROTOTYPES=1 /D HAVE_STDLIB_H \
+ /D HAVE_STRICMP /D EXPORT");
+
+ PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h");
+ } else {
+ STDOUT.WriteLine("Using bundled libmbfl...");
+
+ ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
+ -Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
+ /D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
+ /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT")
- ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
- mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
- mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
- mbfl_string.c mbfl_allocators.c", "mbstring");
+ FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
+ "ext\\mbstring\\libmbfl\\config.h", true);
- ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
- nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
- nls_ua.c nls_tr.c", "mbstring");
+ ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
+ mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
+ mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \
+ mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_cp51932.c \
+ mbfilter_euc_cn.c mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \
+ mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \
+ mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \
+ mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c \
+ mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \
+ mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \
+ mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \
+ mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c mbfilter_sjis_2004.c \
+ mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \
+ mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \
+ mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \
+ mbfilter_koi8u.c mbfilter_cp1254.c mbfilter_euc_jp_2004.c \
+ mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \
+ mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c \
+ mbfilter_sjis_mac.c \
+ mbfilter_iso2022jp_2004.c mbfilter_iso2022jp_mobile.c \
+ mbfilter_tl_jisx0201_jisx0208.c", "mbstring");
+
+ ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
+ mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
+ mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
+ mbfl_string.c mbfl_allocators.c", "mbstring");
+
+ ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
+ nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
+ nls_ua.c nls_tr.c", "mbstring");
+
+ PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
+ }
AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support');
AC_DEFINE('HAVE_MBSTR_CN', 1, 'CN');
@@ -56,7 +74,8 @@ if (PHP_MBSTRING != "no") {
AC_DEFINE('HAVE_MBSTR_RU', 1, 'RU');
AC_DEFINE('HAVE_MBSTR_TW', 1, 'TW');
- PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
+ FSO.CopyFile("ext\\mbstring\\oniguruma\\win32\\config.h",
+ "ext\\mbstring\\oniguruma\\config.h", true);
if (PHP_MBREGEX != "no") {
AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h');
diff --git a/ext/mbstring/libmbfl/filters/unicode_prop.h b/ext/mbstring/libmbfl/filters/unicode_prop.h
index d21ec61dfb..4feb5756e3 100644
--- a/ext/mbstring/libmbfl/filters/unicode_prop.h
+++ b/ext/mbstring/libmbfl/filters/unicode_prop.h
@@ -22,7 +22,7 @@
*
*/
-/* charactor property table */
+/* character property table */
#define MBFL_CHP_CTL 0x01
#define MBFL_CHP_DIGIT 0x02
#define MBFL_CHP_UALPHA 0x04
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
index 6a630c8fcd..b11119a80b 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
@@ -45,7 +45,7 @@
#define MBFL_ENCTYPE_ENC_STRM 0x00002000
#define MBFL_ENCTYPE_GL_UNSAFE 0x00004000
-/* wchar plane, special charactor */
+/* wchar plane, special character */
#define MBFL_WCSPLANE_MASK 0xffff
#define MBFL_WCSPLANE_UCS2MAX 0x00010000
#define MBFL_WCSPLANE_UTF32MAX 0x00110000
diff --git a/ext/mbstring/tests/mb_strtolower_variation3.phpt b/ext/mbstring/tests/mb_strtolower_variation3.phpt
index 08b3467853..99256e1ec4 100644
--- a/ext/mbstring/tests/mb_strtolower_variation3.phpt
+++ b/ext/mbstring/tests/mb_strtolower_variation3.phpt
@@ -14,7 +14,7 @@ function_exists('mb_strtolower') or die("skip mb_strtolower() is not available i
/*
* Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower
- * to check correct conversion is occuring (Japanese characters should not be converted).
+ * to check correct conversion is occurring (Japanese characters should not be converted).
*/
echo "*** Testing mb_strtolower() : usage variations ***\n";
diff --git a/ext/mbstring/tests/mb_strtoupper_variation3.phpt b/ext/mbstring/tests/mb_strtoupper_variation3.phpt
index a4bf3b128f..f0cb0fa47c 100644
--- a/ext/mbstring/tests/mb_strtoupper_variation3.phpt
+++ b/ext/mbstring/tests/mb_strtoupper_variation3.phpt
@@ -14,7 +14,7 @@ function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available i
/*
* Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower
- * to check correct conversion is occuring (Japanese characters should not be converted).
+ * to check correct conversion is occurring (Japanese characters should not be converted).
*/
echo "*** Testing mb_strtoupper() : usage variations ***\n";
diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt
index e718107b9b..ace9f829d8 100644
--- a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt
+++ b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt
@@ -23,7 +23,7 @@ $cipher = MCRYPT_TRIPLEDES;
$data = b"This is the secret message which must be encrypted";
$mode = MCRYPT_DECRYPT;
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt
index 7e29579779..65ef3ad8e2 100644
--- a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt
+++ b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt
@@ -23,7 +23,7 @@ $cipher = MCRYPT_TRIPLEDES;
$data = b"This is the secret message which must be encrypted";
$mode = MCRYPT_ENCRYPT;
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt
index 51a64943b2..8b3cbd8366 100644
--- a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt
+++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt
@@ -21,13 +21,13 @@ echo "*** Testing mcrypt_encrypt() : TripleDES functionality ***\n";
//test tripledes, aes
//test different lengths of key, iv
//test no iv being passed on CBC, ECB
-//test upto 32 bytes with unlimited strength
+//test up to 32 bytes with unlimited strength
$cipher = MCRYPT_TRIPLEDES;
$mode = MCRYPT_MODE_CBC;
$data = b'This is the secret message which must be encrypted';
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt
index 941eb7935f..ea6b2c2160 100644
--- a/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt
+++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt
@@ -20,7 +20,7 @@ $cipher = MCRYPT_TRIPLEDES;
$mode = MCRYPT_MODE_ECB;
$data = b'This is the secret message which must be encrypted';
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
index 621f7b1dbd..5f5a4bea56 100644
--- a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
+++ b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
@@ -30,7 +30,7 @@ $cipher = MCRYPT_RIJNDAEL_128;
$mode = MCRYPT_MODE_CBC;
$data = b'This is the secret message which must be encrypted';
-// keys upto 128 bits (16 bytes)
+// keys up to 128 bits (16 bytes)
$keys = array(
null,
'',
diff --git a/ext/mysql/tests/mysql_deprecated_api.phpt b/ext/mysql/tests/mysql_deprecated_api.phpt
index ebf72375cf..8844617c66 100644
--- a/ext/mysql/tests/mysql_deprecated_api.phpt
+++ b/ext/mysql/tests/mysql_deprecated_api.phpt
@@ -13,7 +13,7 @@ error_reporting=E_ALL | E_NOTICE | E_STRICT
/*
We use an extra test to cover deprecation warning.
Due to this extra test we can silence deprecation warnings
- in have other test using @ operator without loosing the information
+ in have other test using @ operator without losing the information
which function is deprecated and, without reducing test portability.
*/
include "table.inc";
diff --git a/ext/mysqli/tests/mysqli_ps_select_union.phpt b/ext/mysqli/tests/mysqli_ps_select_union.phpt
index fed81b309d..a4659c4267 100644
--- a/ext/mysqli/tests/mysqli_ps_select_union.phpt
+++ b/ext/mysqli/tests/mysqli_ps_select_union.phpt
@@ -44,8 +44,8 @@ require_once('skipifconnectfailure.inc');
if ($IS_MYSQLND) {
/*
Advantage mysqlnd -
- The metadata mysqlnd has availabe after prepare is better than
- the one made availabe by the MySQL Client Library (libmysql).
+ The metadata mysqlnd has available after prepare is better than
+ the one made available by the MySQL Client Library (libmysql).
"libmysql" will give wrong results and that is OK -
http://bugs.mysql.com/bug.php?id=47483
*/
diff --git a/ext/mysqli/tests/mysqli_result_references.phpt b/ext/mysqli/tests/mysqli_result_references.phpt
index 9b5d476ac4..e009267754 100644
--- a/ext/mysqli/tests/mysqli_result_references.phpt
+++ b/ext/mysqli/tests/mysqli_result_references.phpt
@@ -19,7 +19,7 @@ require_once('skipifconnectfailure.inc');
$idx = 0;
while ($row = mysqli_fetch_assoc($res)) {
- /* mysqlnd: force seperation - create copies */
+ /* mysqlnd: force separation - create copies */
$references[$idx] = array(
'id' => &$row['id'],
'label' => $row['label'] . '');
@@ -30,7 +30,7 @@ require_once('skipifconnectfailure.inc');
mysqli_data_seek($res, 0);
while ($row = mysqli_fetch_assoc($res)) {
- /* mysqlnd: force seperation - create copies */
+ /* mysqlnd: force separation - create copies */
$references[$idx] = array(
'id' => &$row['id'],
'label' => $row['label'] . '');
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
while ($row = mysqli_fetch_assoc($res)) {
- /* mysqlnd: force seperation - create copies*/
+ /* mysqlnd: force separation - create copies*/
$references[$idx] = array(
'id' => &$row['id'],
'label' => $row['label'] . '');
diff --git a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt
index 3935365257..60c5491b54 100644
--- a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt
+++ b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt
@@ -48,7 +48,7 @@ if ((version_compare(PHP_VERSION, '6.0', '==') == 1))
$references[$idx]['row_copy'] = $rows[$i];
$references[$idx]['id_ref'] = &$rows[$i]['id'];
$references[$idx]['id_copy'] = $rows[$i]['id'];
- /* enforce seperation */
+ /* enforce separation */
$references[$idx]['id_copy_mod']= $rows[$i]['id'] + 0;
}
mysqli_free_result($res);
diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt
index 03d15902af..e7bce112af 100644
--- a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt
+++ b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt
@@ -21,9 +21,9 @@ require_once('skipifconnectfailure.inc');
echo "Test 1:\n";
$stmt = $link->prepare("SELECT ? FOO");
- var_dump($foo); // here you can see the bar member var beeing a string
+ var_dump($foo); // here you can see the bar member var being a string
$stmt->bind_param("s", $foo->bar);
- var_dump($foo); // this will show $foo->bar beeing a reference string
+ var_dump($foo); // this will show $foo->bar being a reference string
$stmt->bind_result($one);
$stmt->execute();
$stmt->fetch();
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 41f34e366a..08a10dbbd1 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1306,7 +1306,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC);
DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
- (void*)&this_fd, 1) && this_fd >= 0) {
+ (void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
PHP_SAFE_FD_SET(this_fd, fds);
@@ -1336,7 +1336,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC);
DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
- (void*)&this_fd, 1) && this_fd >= 0) {
+ (void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
if (PHP_SAFE_FD_ISSET(this_fd, fds)) {
if (disproportion) {
*bckwd = *fwd;
diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
index 1a23781eb0..aab977d24c 100644
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -29,7 +29,7 @@
#define MYSQLND_STRING_TO_INT_CONVERSION
/*
- This force mysqlnd to do a single (or more depending on ammount of data)
+ This force mysqlnd to do a single (or more depending on amount of data)
non-blocking read() calls before sending a command to the server. Useful
for debugging, if previous function hasn't consumed all the output sent
to it - like stmt_send_long_data() error because the data was larger that
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index dba13ced93..122a27fd48 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1475,7 +1475,7 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
* semantics. With the PECL OCI 1.3.x extensions, we release pconnections when oci_close
* takes the refcount to zero.
*
- * If oci_old_close_semantics is set, we artifically bump up the refcount and decremented
+ * If oci_old_close_semantics is set, we artificially bump up the refcount and decremented
* only at request shutdown.
*/
php_oci_connection_release(connection TSRMLS_CC);
diff --git a/ext/oci8/tests/bug36010.phpt b/ext/oci8/tests/bug36010.phpt
index d181046871..3ad49ecad8 100644
--- a/ext/oci8/tests/bug36010.phpt
+++ b/ext/oci8/tests/bug36010.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #36010 (Crash when executing SQL statment with lob parameter twice)
+Bug #36010 (Crash when executing SQL statement with lob parameter twice)
--SKIPIF--
<?php
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 6729163996..594a37383e 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -437,7 +437,7 @@ static void _free_odbc_result(zend_resource *rsrc TSRMLS_DC)
(SQLUSMALLINT) SQL_COMMIT);
#endif
rc = SQLFreeStmt(res->stmt,SQL_DROP);
- /* We don't want the connection to be closed after the last statment has been closed
+ /* We don't want the connection to be closed after the last statement has been closed
* Connections will be closed on shutdown
* zend_list_delete(res->conn_ptr->id);
*/
@@ -2493,8 +2493,8 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
*
* We do have to hash non-persistent connections, and reuse connections.
* In the case where two connects were being made, without closing the first
- * connect, access violations were occuring. This is because some of the
- * "globals" in this module should actualy be per-connection variables. I
+ * connect, access violations were occurring. This is because some of the
+ * "globals" in this module should actually be per-connection variables. I
* simply fixed things to get them working for now. Shane
*/
/* {{{ odbc_do_connect */
diff --git a/ext/odbc/tests/bug60616.phpt b/ext/odbc/tests/bug60616.phpt
index 937049a9b8..72226f23bb 100644
--- a/ext/odbc/tests/bug60616.phpt
+++ b/ext/odbc/tests/bug60616.phpt
@@ -12,7 +12,7 @@ $euc_jp = base64_decode($euc_jp_base64);
$ascii = 'abcdefghijklmnopqrstuvwxyz;]=#0123456789';
include 'config.inc';
-ini_set("odbc.defaultlrl", 4); // Set artifically low
+ini_set("odbc.defaultlrl", 4); // Set artificially low
$conn = odbc_connect($dsn, $user, $pass);
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 5c6880beea..6f3f1310a0 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -204,7 +204,8 @@ 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_FREE ||
+ op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_END_SILENCE)) {
int parent = op_array->brk_cont_array[i].parent;
while (parent >= 0 &&
@@ -223,7 +224,8 @@ 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_FREE ||
+ op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_END_SILENCE)) {
if (i != j) {
op_array->brk_cont_array[j] = op_array->brk_cont_array[i];
}
diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c
index aa62a4542d..9031a38f56 100644
--- a/ext/opcache/Optimizer/optimize_func_calls.c
+++ b/ext/opcache/Optimizer/optimize_func_calls.c
@@ -143,8 +143,6 @@ void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS
if (!(opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) && call_stack[call - 1].func) {
if (ARG_SHOULD_BE_SENT_BY_REF(call_stack[call - 1].func, opline->op2.num)) {
opline->extended_value |= ZEND_ARG_COMPILE_TIME_BOUND | ZEND_ARG_SEND_BY_REF;
- } else if (opline->extended_value) {
- opline->extended_value |= ZEND_ARG_COMPILE_TIME_BOUND;
} else {
opline->opcode = ZEND_SEND_VAR;
opline->extended_value = 0;
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index 1a6d0b675a..32009791ed 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -65,7 +65,7 @@ int zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name)
(op_array->vars[i]->h == hash_value &&
op_array->vars[i]->len == name->len &&
memcmp(op_array->vars[i]->val, name->val, name->len) == 0)) {
- return (int)(zend_intptr_t)EX_VAR_NUM_2(NULL, i);
+ return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
}
i++;
}
@@ -96,7 +96,7 @@ int zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name)
}
}
- return (int)(zend_intptr_t)EX_VAR_NUM_2(NULL, i);
+ return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
}
int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC)
@@ -283,6 +283,14 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
case ZEND_ASSIGN_DIM:
case ZEND_SEPARATE:
return 0;
+ case ZEND_SEND_VAR:
+ opline->extended_value = 0;
+ opline->opcode = ZEND_SEND_VAL;
+ break;
+ case ZEND_SEND_VAR_EX:
+ opline->extended_value = 0;
+ opline->opcode = ZEND_SEND_VAL_EX;
+ break;
case ZEND_SEND_VAR_NO_REF:
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) {
if (opline->extended_value & ZEND_ARG_SEND_BY_REF) {
diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h
index ba91b147c9..ee44bf671c 100644
--- a/ext/opcache/Optimizer/zend_optimizer_internal.h
+++ b/ext/opcache/Optimizer/zend_optimizer_internal.h
@@ -25,7 +25,7 @@
#include "ZendAccelerator.h"
#define VAR_NUM(v) EX_VAR_TO_NUM(v)
-#define NUM_VAR(v) ((uint32_t)(zend_uintptr_t)EX_VAR_NUM_2(0, v))
+#define NUM_VAR(v) ((uint32_t)(zend_uintptr_t)ZEND_CALL_VAR_NUM(0, v))
#define INV_COND(op) ((op) == ZEND_JMPZ ? ZEND_JMPNZ : ZEND_JMPZ)
#define INV_EX_COND(op) ((op) == ZEND_JMPZ_EX ? ZEND_JMPNZ : ZEND_JMPZ)
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index d79e42740d..34b5b47808 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -824,7 +824,7 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
zend_file_handle ps_handle;
char *full_path_ptr = NULL;
- /** check that the persistant script is indeed the same file we cached
+ /** check that the persistent script is indeed the same file we cached
* (if part of the path is a symlink than it possible that the user will change it)
* See bug #15140
*/
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index fcaf96408c..3cde5188ca 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -242,7 +242,7 @@ static ZEND_INI_MH(OnEnable)
}
ZEND_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("opcache.enable" , "1", PHP_INI_ALL, OnEnable, enabled , zend_accel_globals, accel_globals)
+ STD_PHP_INI_BOOLEAN("opcache.enable" , "1", PHP_INI_ALL, OnEnable, enabled , zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.use_cwd" , "1", PHP_INI_SYSTEM, OnUpdateBool, accel_directives.use_cwd , zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.validate_timestamps", "1", PHP_INI_ALL , OnUpdateBool, accel_directives.validate_timestamps, zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.inherited_hack" , "1", PHP_INI_SYSTEM, OnUpdateBool, accel_directives.inherited_hack , zend_accel_globals, accel_globals)
@@ -448,7 +448,7 @@ static zend_module_entry accel_module_entry = {
NULL,
NULL,
zend_accel_info,
- ACCELERATOR_VERSION "FE",
+ ACCELERATOR_VERSION "FE",
STANDARD_MODULE_PROPERTIES
};
diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt
index be0b5f9b5b..3a1e4fb03c 100644
--- a/ext/openssl/tests/bug64802.phpt
+++ b/ext/openssl/tests/bug64802.phpt
@@ -3,7 +3,7 @@ Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
-if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
+if (!defined('OPENSSL_KEYTYPE_EC')) die("skip no EC available");
?>
--FILE--
<?php
diff --git a/ext/openssl/tests/stream_server_reneg_limit.phpt b/ext/openssl/tests/stream_server_reneg_limit.phpt
index 3abaa48e41..d355505e54 100644
--- a/ext/openssl/tests/stream_server_reneg_limit.phpt
+++ b/ext/openssl/tests/stream_server_reneg_limit.phpt
@@ -6,6 +6,10 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (!function_exists("proc_open")) die("skip no proc_open");
exec('openssl help', $out, $code);
if ($code > 0) die("skip couldn't locate openssl binary");
+if(substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip not suitable for Windows');
+}
+?>
--FILE--
<?php
diff --git a/ext/pcntl/README b/ext/pcntl/README
index cadd11121c..7b80924e49 100644
--- a/ext/pcntl/README
+++ b/ext/pcntl/README
@@ -1,7 +1,7 @@
Process Control Module for PHP (pcntl)
This module will attempt to implement all features related to process spawning and
-control (fork(), waitpid(), signal(), WIF's, etc). This is extremly experimental,
+control (fork(), waitpid(), signal(), WIF's, etc). This is extremely experimental,
with hope to become stable on most UNIX's. I greatly apreciate any feedback, fixes,
and or suggestions on how to improve/better implement
this functionality.
diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog
index 279398ef40..f07c59787b 100644
--- a/ext/pcre/pcrelib/ChangeLog
+++ b/ext/pcre/pcrelib/ChangeLog
@@ -1544,7 +1544,7 @@ Version 8.10 25-Jun-2010
7. Minor change to pcretest.c to avoid a compiler warning.
-8. Added four artifical Unicode properties to help with an option to make
+8. Added four artificial Unicode properties to help with an option to make
\s etc use properties (see next item). The new properties are: Xan
(alphanumeric), Xsp (Perl space), Xps (POSIX space), and Xwd (word).
@@ -4169,7 +4169,7 @@ Version 4.3 21-May-03
(i) The utf8_table... variables are now declared "const".
(ii) The code for \cx, which used the "case flipping" table to upper case
- lower case letters, now just substracts 32. This is ASCII-specific,
+ lower case letters, now just subtracts 32. This is ASCII-specific,
but the whole concept of \cx is ASCII-specific, so it seems
reasonable.
diff --git a/ext/pcre/pcrelib/HACKING b/ext/pcre/pcrelib/HACKING
index 691b7a14e5..8395504212 100644
--- a/ext/pcre/pcrelib/HACKING
+++ b/ext/pcre/pcrelib/HACKING
@@ -360,7 +360,7 @@ reference number if the reference is to a unique capturing group (either by
number or by name). When named groups are used, there may be more than one
group with the same name. In this case, a reference by name generates OP_DNREF
or OP_DNREFI. These are followed by two counts: the index (not the byte offset)
-in the group name table of the first entry for the requred name, followed by
+in the group name table of the first entry for the required name, followed by
the number of groups with the same name.
diff --git a/ext/pcre/pcrelib/README b/ext/pcre/pcrelib/README
index 88f2dfd4ef..5a1d553fff 100644
--- a/ext/pcre/pcrelib/README
+++ b/ext/pcre/pcrelib/README
@@ -392,7 +392,7 @@ library. They are also documented in the pcrebuild man page.
avoided by linking with libedit (which has a BSD licence) instead.
Enabling libreadline causes the -lreadline option to be added to the pcretest
- build. In many operating environments with a sytem-installed readline
+ build. In many operating environments with a system-installed readline
library this is sufficient. However, in some environments (e.g. if an
unmodified distribution version of readline is in use), it may be necessary
to specify something like LIBS="-lncurses" as well. This is because, to quote
diff --git a/ext/pcre/pcrelib/doc/pcre.txt b/ext/pcre/pcrelib/doc/pcre.txt
index 14cbb8bf2b..548d80b90f 100644
--- a/ext/pcre/pcrelib/doc/pcre.txt
+++ b/ext/pcre/pcrelib/doc/pcre.txt
@@ -1242,7 +1242,7 @@ PCRETEST OPTION FOR LIBREADLINE SUPPORT
pcretest linked in this way, there may be licensing issues.
Setting this option causes the -lreadline option to be added to the
- pcretest build. In many operating environments with a sytem-installed
+ pcretest build. In many operating environments with a system-installed
libreadline this is sufficient. However, in some environments (e.g. if
an unmodified distribution version of readline is in use), some extra
configuration may be necessary. The INSTALL file for libreadline says
diff --git a/ext/pcre/pcrelib/pcre_exec.c b/ext/pcre/pcrelib/pcre_exec.c
index ab58735d5c..be0af11633 100644
--- a/ext/pcre/pcrelib/pcre_exec.c
+++ b/ext/pcre/pcrelib/pcre_exec.c
@@ -1038,7 +1038,7 @@ for (;;)
the result of a recursive call to match() whatever happened so it was
possible to reduce stack usage by turning this into a tail recursion,
except in the case of a possibly empty group. However, now that there is
- the possiblity of (*THEN) occurring in the final alternative, this
+ the possibility of (*THEN) occurring in the final alternative, this
optimization is no longer always possible.
We can optimize if we know there are no (*THEN)s in the pattern; at present
diff --git a/ext/pcre/pcrelib/pcre_printint.c b/ext/pcre/pcrelib/pcre_printint.c
index 8cbb161395..1a91c50046 100644
--- a/ext/pcre/pcrelib/pcre_printint.c
+++ b/ext/pcre/pcrelib/pcre_printint.c
@@ -68,7 +68,7 @@ appropriately for an application, not for building PCRE. */
#include "pcre.h"
#include "pcre_internal.h"
-/* These are the funtions that are contained within. It doesn't seem worth
+/* These are the functions that are contained within. It doesn't seem worth
having a separate .h file just for this. */
#endif /* PCRE_INCLUDED */
diff --git a/ext/pcre/pcrelib/pcre_study.c b/ext/pcre/pcrelib/pcre_study.c
index 2fe43c6920..0e26db9d6c 100644
--- a/ext/pcre/pcrelib/pcre_study.c
+++ b/ext/pcre/pcrelib/pcre_study.c
@@ -988,7 +988,7 @@ do
tcode = set_table_bit(start_bits, tcode + 1, TRUE, cd, utf);
break;
- /* Single-char upto sets the bit and tries the next */
+ /* Single-char up to sets the bit and tries the next */
case OP_UPTO:
case OP_MINUPTO:
diff --git a/ext/pcre/pcrelib/pcredemo.c b/ext/pcre/pcrelib/pcredemo.c
index 946aba45cd..1ca77f1537 100644
--- a/ext/pcre/pcrelib/pcredemo.c
+++ b/ext/pcre/pcrelib/pcredemo.c
@@ -144,7 +144,7 @@ if (rc < 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\nMatch succeeded at offset %d\n", ovector[0]);
@@ -362,7 +362,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\nMatch succeeded again at offset %d\n", ovector[0]);
diff --git a/ext/pcre/pcrelib/sljit/sljitLir.c b/ext/pcre/pcrelib/sljit/sljitLir.c
index 1acecba8b4..0afce2524a 100644
--- a/ext/pcre/pcrelib/sljit/sljitLir.c
+++ b/ext/pcre/pcrelib/sljit/sljitLir.c
@@ -1428,7 +1428,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler
#endif
if (SLJIT_UNLIKELY((src1 & SLJIT_IMM) && !(src2 & SLJIT_IMM))) {
- /* Immediate is prefered as second argument by most architectures. */
+ /* Immediate is preferred as second argument by most architectures. */
switch (condition) {
case SLJIT_C_LESS:
condition = SLJIT_C_GREATER;
diff --git a/ext/pcre/pcrelib/sljit/sljitLir.h b/ext/pcre/pcrelib/sljit/sljitLir.h
index e2cd21846d..9c9acdfe21 100644
--- a/ext/pcre/pcrelib/sljit/sljitLir.h
+++ b/ext/pcre/pcrelib/sljit/sljitLir.h
@@ -90,7 +90,7 @@ of sljitConfigInternal.h */
#define SLJIT_SUCCESS 0
/* After the call of sljit_generate_code(), the error code of the compiler
is set to this value to avoid future sljit calls (in debug mode at least).
- The complier should be freed after sljit_generate_code(). */
+ The compiler should be freed after sljit_generate_code(). */
#define SLJIT_ERR_COMPILED 1
/* Cannot allocate non executable memory. */
#define SLJIT_ERR_ALLOC_FAILED 2
@@ -898,7 +898,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
/* After the code generation the address for label, jump and const instructions
are computed. Since these structures are freed by sljit_free_compiler, the
- addresses must be preserved by the user program elsewere. */
+ addresses must be preserved by the user program elsewhere. */
static SLJIT_INLINE sljit_uw sljit_get_label_addr(struct sljit_label *label) { return label->addr; }
static SLJIT_INLINE sljit_uw sljit_get_jump_addr(struct sljit_jump *jump) { return jump->addr; }
static SLJIT_INLINE sljit_uw sljit_get_const_addr(struct sljit_const *const_) { return const_->addr; }
diff --git a/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c b/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
index 6747c4f617..1342eaebf1 100644
--- a/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
+++ b/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
@@ -304,7 +304,7 @@ static sljit_uw patch_pc_relative_loads(sljit_uw *last_pc_patch, sljit_uw *code_
return counter;
}
-/* In some rare ocasions we may need future patches. The probability is close to 0 in practice. */
+/* In some rare occasions we may need future patches. The probability is close to 0 in practice. */
struct future_patch {
struct future_patch* next;
sljit_si index;
@@ -1205,7 +1205,7 @@ static sljit_si generate_int(struct sljit_compiler *compiler, sljit_si reg, slji
sljit_uw imm2;
sljit_si rol;
- /* Step1: Search a zero byte (8 continous zero bit). */
+ /* Step1: Search a zero byte (8 continuous zero bit). */
mask = 0xff000000;
rol = 8;
while(1) {
diff --git a/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c b/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
index d0b392e7a4..548b6c446f 100644
--- a/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
+++ b/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
@@ -1843,7 +1843,7 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
if (src1 != dst)
overflow_ra = reg_map[src1];
else {
- /* Rare ocasion. */
+ /* Rare occasion. */
FAIL_IF(ADD(TMP_EREG2, reg_map[src1], ZERO));
overflow_ra = TMP_EREG2;
}
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index aca52ebf20..8e35c1ee9a 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -472,7 +472,7 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
}
/* }}} */
-/* {{{ proto object PDO::prepare(string statment [, array options])
+/* {{{ proto object PDO::prepare(string statement [, array options])
Prepares a statement for execution and returns a statement object */
static PHP_METHOD(PDO, prepare)
{
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 705d08bacf..27cc157ed7 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2016,7 +2016,7 @@ static PHP_METHOD(PDOStatement, setFetchMode)
/* }}} */
/* {{{ proto bool PDOStatement::nextRowset()
- Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeded, false otherwise */
+ Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeeded, false otherwise */
static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
{
@@ -2486,6 +2486,7 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
pdo_stmt_t *stmt = row->stmt;
int colno = -1;
zval zobj;
+ zend_long lval;
ZVAL_NULL(rv);
if (stmt) {
@@ -2493,6 +2494,11 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) {
fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC);
}
+ } else if (Z_TYPE_P(member) == IS_STRING
+ && is_numeric_string_ex(Z_STRVAL_P(member), Z_STRLEN_P(member), &lval, NULL, 0, NULL) == IS_LONG) {
+ if (lval >= 0 && lval < stmt->column_count) {
+ fetch_value(stmt, rv, lval, NULL TSRMLS_CC);
+ }
} else {
convert_to_string(member);
/* TODO: replace this with a hash of available column names to column
@@ -2541,19 +2547,24 @@ static int row_prop_exists(zval *object, zval *member, int check_empty, void **c
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
int colno = -1;
+ zend_long lval;
if (stmt) {
if (Z_TYPE_P(member) == IS_LONG) {
return Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count;
+ } else if (Z_TYPE_P(member) == IS_STRING) {
+ if (is_numeric_string_ex(Z_STRVAL_P(member), Z_STRLEN_P(member), &lval, NULL, 0, NULL) == IS_LONG) {
+ return lval >=0 && lval < stmt->column_count;
+ }
} else {
convert_to_string(member);
+ }
- /* TODO: replace this with a hash of available column names to column
- * numbers */
- for (colno = 0; colno < stmt->column_count; colno++) {
- if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
- return 1;
- }
+ /* TODO: replace this with a hash of available column names to column
+ * numbers */
+ for (colno = 0; colno < stmt->column_count; colno++) {
+ if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
+ return 1;
}
}
}
diff --git a/ext/pdo/tests/bug_39656.phpt b/ext/pdo/tests/bug_39656.phpt
index 7d113ef4aa..9ee54916bb 100644
--- a/ext/pdo/tests/bug_39656.phpt
+++ b/ext/pdo/tests/bug_39656.phpt
@@ -1,5 +1,5 @@
--TEST--
-PDO Common: Bug #39656 (Crash when calling fetch() on a PDO statment object after closeCursor())
+PDO Common: Bug #39656 (Crash when calling fetch() on a PDO statement object after closeCursor())
--SKIPIF--
<?php
if (!extension_loaded('pdo')) die('skip');
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
index 96489ef861..f809e02b11 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
@@ -49,7 +49,7 @@ MySQLPDOTest::skip();
}
if ($label !== $value) {
- printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d charachters). Check manually\n",
+ printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d characters). Check manually\n",
$offset, strlen($label), strlen($value));
return false;
}
@@ -64,7 +64,7 @@ MySQLPDOTest::skip();
$ret = $stmt->fetch(PDO::FETCH_ASSOC);
if ($ret['label'] !== $value) {
- printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d charachters). Check manually\n",
+ printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d characters). Check manually\n",
$offset, strlen($ret['label']), strlen($value));
return false;
}
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index 9132999461..2abc84ba33 100644
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -174,7 +174,7 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
}
if (stmt) {
- /* always propogate the error code back up to the dbh,
+ /* always propagate the error code back up to the dbh,
* so that we can catch the error information when execute
* is called via query. See Bug #33707 */
if (H->einfo.errmsg) {
diff --git a/ext/pgsql/README b/ext/pgsql/README
index 785b4f034b..86df804fbd 100644
--- a/ext/pgsql/README
+++ b/ext/pgsql/README
@@ -43,7 +43,7 @@ module with specific version. You need to install PostgreSQL
somewhere in your system to build PHP with PostgreSQL support.
==== Note For PostgreSQL 7.2 ====
-I've tested upto 7.2.2.
+I've tested up to 7.2.2.
==== TODO List ===
Make pg_convert() smater.
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 4b1cc31cc8..119a47f24c 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1373,7 +1373,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* ensure that the link did not die */
if (PGG(auto_reset_persistent) & 1) {
/* need to send & get something from backend to
- make sure we catch CONNECTION_BAD everytime */
+ make sure we catch CONNECTION_BAD every time */
PGresult *pg_result;
pg_result = PQexec(le->ptr, "select 1");
PQclear(pg_result);
@@ -1478,7 +1478,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
PGG(num_links)++;
}
- /* set notice processer */
+ /* set notice processor */
if (! PGG(ignore_notices) && Z_TYPE_P(return_value) == IS_RESOURCE) {
PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void*)Z_RES_HANDLE_P(return_value));
}
@@ -4344,7 +4344,7 @@ PHP_FUNCTION(pg_escape_bytea)
#endif
to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len);
- RETVAL_STRINGL(to, to_len-1); /* to_len includes addtional '\0' */
+ RETVAL_STRINGL(to, to_len-1); /* to_len includes additional '\0' */
}
/* }}} */
diff --git a/ext/pgsql/tests/80_bug36625.phpt b/ext/pgsql/tests/80_bug36625.phpt
index e1b7fa1b50..87dd84adc4 100644
--- a/ext/pgsql/tests/80_bug36625.phpt
+++ b/ext/pgsql/tests/80_bug36625.phpt
@@ -42,7 +42,13 @@ var_dump(file_exists($tracefile));
?>
===DONE===
--CLEAN--
-<?php unlink($tracefile); ?>
+<?php
+
+$tracefile = dirname(__FILE__) . '/trace.tmp';
+
+unlink($tracefile);
+
+?>
--EXPECTF--
bool(false)
resource(%d) of type (pgsql result)
diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag
index faa9db0c70..6516ddfabd 100644
--- a/ext/phar/Makefile.frag
+++ b/ext/phar/Makefile.frag
@@ -39,7 +39,7 @@ install-pharcmd: pharcmd
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
$(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir)
-@rm -f $(INSTALL_ROOT)$(bindir)/phar
- $(LN_S) -f $(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar
+ $(LN_S) -f $(INSTALL_ROOT)$(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1
@$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index 6d6cbc4918..bd7324c78e 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -564,7 +564,7 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value T
#else
ZVAL_LONG(&stat_blocks,-1);
#endif
- /* Store numeric indexes in propper order */
+ /* Store numeric indexes in proper order */
zend_hash_next_index_insert(HASH_OF(return_value), &stat_dev);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_ino);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_mode);
diff --git a/ext/readline/tests/readline_read_history_error_001.phpt b/ext/readline/tests/readline_read_history_error_001.phpt
new file mode 100644
index 0000000000..0a65a66d5c
--- /dev/null
+++ b/ext/readline/tests/readline_read_history_error_001.phpt
@@ -0,0 +1,14 @@
+--TEST--
+readline_read_history() function - Error cases
+--CREDITS--
+Pedro Manoel Evangelista <pedro.evangelista at gmail dot com>
+--SKIPIF--
+<?php if (!extension_loaded("readline") || !function_exists('readline_read_history')) die("skip"); ?>
+--FILE--
+<?php
+var_dump(readline_read_history());
+var_dump(readline_read_history('nofile'));
+?>
+--EXPECT--
+bool(false)
+bool(false)
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index b972c2899c..e9c59ea86e 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -3359,12 +3359,10 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
continue;
}
prop = NULL;
- if (prop_info->offset >= 0) {
- if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) {
- prop = &ce->default_static_members_table[prop_info->offset];
- } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) {
- prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)];
- }
+ if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) {
+ prop = &ce->default_static_members_table[prop_info->offset];
+ } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) {
+ prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)];
}
if (!prop) {
continue;
diff --git a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt
index 4772f6548d..5655d19972 100644
--- a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt
+++ b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt
@@ -41,11 +41,11 @@ Name: arr1
Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_ASC_or_SORT_DESC
+Name: sort_order
Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING
+Name: sort_flags
Is passed by reference: yes
Can be passed by value: yes
@@ -53,18 +53,6 @@ Name: arr2
Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_ASC_or_SORT_DESC
-Is passed by reference: yes
-Can be passed by value: yes
-
-Name: SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING
-Is passed by reference: yes
-Can be passed by value: yes
-
-Name: more_array_and_sort_options
-Is passed by reference: yes
-Can be passed by value: yes
-
=> sort:
Name: arg
diff --git a/ext/shmop/README b/ext/shmop/README
index a8ea03af91..c4970376b0 100644
--- a/ext/shmop/README
+++ b/ext/shmop/README
@@ -6,7 +6,7 @@ Shared Memory Operations Extension to PHP
to communicate the deamon via SHM. PHP already had a shared memory
extension (sysvshm) written by Christian Cartus <cartus@atrior.de>,
unfortunately this extension was designed with PHP only in mind and
- offers high level features which are extremly bothersome for basic SHM
+ offers high level features which are extremely bothersome for basic SHM
we had in mind. After spending a day trying to reverse engineer and figure
out the format of sysvshm we decided that it would be much easier to
add our own extension to php for simple SHM operations, we were right :)).
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 250b1f0ebe..90c1bff951 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1588,7 +1588,7 @@ PHP_FUNCTION(snmpwalk)
/* }}} */
/* {{{ proto mixed snmprealwalk(string host, string community, mixed object_id [, int timeout [, int retries]])
- Return all objects including their respective object id withing the specified one */
+ Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmprealwalk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_1);
@@ -1616,7 +1616,7 @@ PHP_FUNCTION(snmp_get_quick_print)
/* }}} */
/* {{{ proto bool snmp_set_quick_print(int quick_print)
- Return all objects including their respective object id withing the specified one */
+ Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmp_set_quick_print)
{
zend_long a1;
@@ -1698,7 +1698,7 @@ PHP_FUNCTION(snmp2_walk)
/* }}} */
/* {{{ proto mixed snmp2_real_walk(string host, string community, mixed object_id [, int timeout [, int retries]])
- Return all objects including their respective object id withing the specified one */
+ Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmp2_real_walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_2c);
@@ -1893,7 +1893,7 @@ PHP_METHOD(snmp, getnext)
/* }}} */
/* {{{ proto mixed SNMP::walk(mixed object_id [, bool $suffix_as_key = FALSE [, int $max_repetitions [, int $non_repeaters]])
- Return all objects including their respective object id withing the specified one as array of oid->value pairs */
+ Return all objects including their respective object id within the specified one as array of oid->value pairs */
PHP_METHOD(snmp, walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, (-1));
diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old
index b219c61f8a..821dc31072 100644
--- a/ext/soap/TODO.old
+++ b/ext/soap/TODO.old
@@ -18,7 +18,7 @@ when using wsdls and function names are similar find the best match
void test(int);
void test(string);
maybe use the same alogrithim as ext/java.
-investigate further http keep_alive... inital testing proved slower.. maybe php_streams will speed things up..
+investigate further http keep_alive... initial testing proved slower.. maybe php_streams will speed things up..
provide schema 1999/2001 support....
through memory leak testing
possible using shared memory for sdl caching...
diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php
index fd5767cc17..bd52f28771 100644
--- a/ext/soap/interop/client_round2_interop.php
+++ b/ext/soap/interop/client_round2_interop.php
@@ -93,7 +93,7 @@ class Interop_Client
function _fetchEndpoints(&$soapclient, $test) {
$this->_getEndpoints($test, 1);
- // retreive endpoints from the endpoint server
+ // retrieve endpoints from the endpoint server
$endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/"));
if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) {
if ($this->html) print "<pre>";
@@ -133,7 +133,7 @@ class Interop_Client
/**
* fetchEndpoints
- * retreive endpoints interop server
+ * retrieve endpoints interop server
*
* @return boolean result
* @access private
@@ -158,7 +158,7 @@ class Interop_Client
}
return NULL;
}
- // retreive all endpoints now
+ // retrieve all endpoints now
$this->currentTest = $test;
$x = $this->_getEndpoints($test);
return $x;
@@ -166,7 +166,7 @@ class Interop_Client
/**
* getEndpoints
- * retreive endpoints from either database or interop server
+ * retrieve endpoints from either database or interop server
*
* @param string base (see local var $tests)
* @param boolean all (if false, only get valid endpoints, status=1)
@@ -182,7 +182,7 @@ class Interop_Client
/**
* _getEndpoints
- * retreive endpoints from database
+ * retrieve endpoints from database
*
* @param string base (see local var $tests)
* @param boolean all (if false, only get valid endpoints, status=1)
@@ -222,7 +222,7 @@ class Interop_Client
/**
* getResults
- * retreive results from the database, stuff them into the endpoint array
+ * retrieve results from the database, stuff them into the endpoint array
*
* @access private
*/
@@ -230,7 +230,7 @@ class Interop_Client
// be sure we have the right endpoints for this test result
$this->getEndpoints($test);
- // retreive the results and put them into the endpoint info
+ // retrieve the results and put them into the endpoint info
$sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl";
$results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC );
foreach ($results as $result) {
@@ -657,12 +657,12 @@ try {
/**
* getResults
- * retreive results from the database, stuff them into the endpoint array
+ * retrieve results from the database, stuff them into the endpoint array
*
* @access private
*/
function getMethodList($test = 'base') {
- // retreive the results and put them into the endpoint info
+ // retrieve the results and put them into the endpoint info
$sql = "select distinct(function) from results where class='$test' order by function";
$results = $this->dbc->getAll($sql);
$ar = array();
diff --git a/ext/soap/package.xml b/ext/soap/package.xml
index e43fd36024..6c68f8dd4c 100644
--- a/ext/soap/package.xml
+++ b/ext/soap/package.xml
@@ -34,7 +34,7 @@
<date>2002-07-07</date>
<state>alpha</state>
<notes>
- - First offical PEAR/PECL release
+ - First official PEAR/PECL release
</notes>
</release>
<filelist>
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index cf6e26b179..9ecf40c067 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -87,7 +87,7 @@ struct _sdlBinding {
void *bindingAttributes; /* sdlSoapBindingPtr */
};
-/* Soap Binding Specfic stuff */
+/* Soap Binding Specific stuff */
struct _sdlSoapBinding {
sdlEncodingStyle style;
sdlTransport transport; /* not implemented yet */
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index 6d36792981..f32555cd93 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -92,7 +92,7 @@ struct _soapService {
zend_class_entry *ce;
zval *argv;
int argc;
- int persistance;
+ int persistence;
} soap_class;
zval soap_object;
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 2b37622a7a..0e7d004564 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1259,7 +1259,7 @@ PHP_METHOD(SoapServer, setPersistence)
if (service->type == SOAP_CLASS) {
if (value == SOAP_PERSISTENCE_SESSION ||
value == SOAP_PERSISTENCE_REQUEST) {
- service->soap_class.persistance = value;
+ service->soap_class.persistence = value;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence with bogus value (%pd)", value);
return;
@@ -1299,7 +1299,7 @@ PHP_METHOD(SoapServer, setClass)
service->type = SOAP_CLASS;
service->soap_class.ce = ce;
- service->soap_class.persistance = SOAP_PERSISTENCE_REQUEST;
+ service->soap_class.persistence = SOAP_PERSISTENCE_REQUEST;
service->soap_class.argc = num_args;
if (service->soap_class.argc > 0) {
int i;
@@ -1657,7 +1657,7 @@ PHP_METHOD(SoapServer, handle)
} else if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
/* If persistent then set soap_obj from from the previous created session (if available) */
- if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) {
+ if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) {
zval *tmp_soap;
zval *session_vars;
@@ -1741,7 +1741,7 @@ PHP_METHOD(SoapServer, handle)
}
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
/* If session then update session hash with new object */
- if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) {
+ if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) {
zval *tmp_soap_pp;
zval *session_vars = &PS(http_session_vars);
@@ -1848,7 +1848,7 @@ PHP_METHOD(SoapServer, handle)
call_status = call_user_function(NULL, soap_obj, &function_name, &retval, num_params, params TSRMLS_CC);
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ if (service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
zval_ptr_dtor(soap_obj);
soap_obj = NULL;
}
@@ -1875,7 +1875,7 @@ PHP_METHOD(SoapServer, handle)
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
#else
if (soap_obj) {
#endif
@@ -1919,7 +1919,7 @@ PHP_METHOD(SoapServer, handle)
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
#else
if (soap_obj) {
#endif
@@ -3113,7 +3113,7 @@ PHP_METHOD(SoapClient, __doRequest)
/* {{{ proto void SoapClient::__setCookie(string name [, strung value])
Sets cookie thet will sent with SOAP request.
- The call to this function will effect all folowing calls of SOAP methods.
+ The call to this function will effect all following calls of SOAP methods.
If value is not specified cookie is removed. */
PHP_METHOD(SoapClient, __setCookie)
{
@@ -4711,6 +4711,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
if (type->attributes &&
(attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType",
sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType")-1)) != NULL &&
+ attr->extraAttributes &&
(ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) {
char *end = strchr(ext->val, '[');
int len;
@@ -4734,6 +4735,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
if (type->attributes &&
(attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType",
sizeof(SOAP_1_2_ENC_NAMESPACE":itemType")-1)) != NULL &&
+ attr->extraAttributes &&
(ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) {
smart_str_appends(buf, ext->val);
smart_str_appendc(buf, ' ');
@@ -4751,6 +4753,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
if (type->attributes &&
(attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize")-1)) != NULL &&
+ attr->extraAttributes &&
(ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize")-1)) != NULL) {
smart_str_appendc(buf, '[');
smart_str_appends(buf, ext->val);
diff --git a/ext/soap/tests/bug68361.phpt b/ext/soap/tests/bug68361.phpt
new file mode 100644
index 0000000000..6dbba8a425
--- /dev/null
+++ b/ext/soap/tests/bug68361.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #68361 Segmentation fault on SoapClient::__getTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$xml = <<<XML
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="TestServer" targetNamespace="http://foo.bar/testserver" xmlns:tns="http://foo.bar/testserver" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://foo.bar/testserver/types">
+ <types>
+ <xsd:schema targetNamespace="http://foo.bar/testserver/types" xmlns="http://foo.bar/testserver/types">
+ <xsd:complexType name="ArrayOfEmployeeReturn">
+ <xsd:complexContent>
+ <xsd:restriction base="soapenc:Array">
+ <xsd:attribute ref="soapenc:arrayType" arrayType="ns:Employee[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="Employee">
+ <xsd:sequence>
+ <xsd:element name="id" type="xsd:int"/>
+ <xsd:element name="department" type="xsd:string"/>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="age" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="Employee" nillable="true" type="ns:Employee"/>
+ <xsd:complexType name="User">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="age" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="User" nillable="true" type="ns:User"/>
+ </xsd:schema>
+ </types>
+ <message name="getEmployeeRequest">
+ <part name="name" type="xsd:name"/>
+ </message>
+ <message name="getEmployeeResponse">
+ <part name="employeeReturn" type="ns:ArrayOfEmployeeReturn"/>
+ </message>
+ <message name="getUserRequest">
+ <part name="id" type="xsd:id"/>
+ </message>
+ <message name="getUserResponse">
+ <part name="userReturn" element="ns:User"/>
+ </message>
+ <portType name="TestServerPortType">
+ <operation name="getEmployee">
+ <input message="tns:getEmployeeRequest"/>
+ <output message="tns:getEmployeeResponse"/>
+ </operation>
+ <operation name="getUser">
+ <input message="tns:getUserRequest"/>
+ <output message="tns:getUserResponse"/>
+ </operation>
+ </portType>
+ <binding name="TestServerBinding" type="tns:TestServerPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getEmployee">
+ <soap:operation soapAction="http://foo.bar/testserver/#getEmployee"/>
+ <input>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </output>
+ </operation>
+ <operation name="getUser">
+ <soap:operation soapAction="http://foo.bar/testserver/#getUser"/>
+ <input>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="TestServerService">
+ <port name="TestServerPort" binding="tns:TestServerBinding">
+ <soap:address location="http://localhost/wsdl-creator/TestClass.php"/>
+ </port>
+ </service>
+</definitions>
+XML;
+
+file_put_contents(__DIR__ . "/bug68361.xml", $xml);
+$client = new SoapClient(__DIR__ . "/bug68361.xml");
+
+$res = $client->__getTypes(); // Segmentation fault here
+
+print_r($res);
+?>
+--CLEAN--
+<?php
+unlink(__DIR__ . "/bug68361.xml");
+?>
+--EXPECT--
+Array
+(
+ [0] => anyType ArrayOfEmployeeReturn[]
+ [1] => struct Employee {
+ int id;
+ string department;
+ string name;
+ int age;
+}
+ [2] => struct User {
+ string name;
+ int age;
+}
+)
diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl
index 7f1514acbf..a9429981c3 100644
--- a/ext/soap/tests/bugs/bug27742.wsdl
+++ b/ext/soap/tests/bugs/bug27742.wsdl
@@ -726,7 +726,7 @@
</element>
<element name="genres">
<annotation>
- <documentation xml:lang="en">Containes genre information where available for the program records. A program may have more than one genre with different relevence factors.</documentation>
+ <documentation xml:lang="en">Contains genre information where available for the program records. A program may have more than one genre with different relevance factors.</documentation>
</annotation>
<complexType>
<sequence maxOccurs="unbounded">
@@ -749,7 +749,7 @@
</element>
<element name="relevance" type="xsd:int">
<annotation>
- <documentation xml:lang="en">A relevence factor that applies to the genre classification for the program. A relevence factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
+ <documentation xml:lang="en">A relevance factor that applies to the genre classification for the program. A relevance factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
</annotation>
</element>
</sequence>
diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt
index a39f4b56bf..7ff667423c 100644
--- a/ext/soap/tests/bugs/bug50698_2.phpt
+++ b/ext/soap/tests/bugs/bug50698_2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatiable and incompatiable endpoints.)
+Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatible and incompatiable endpoints.)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--INI--
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index b1ee5798c9..209b4d1659 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -70,6 +70,8 @@ struct sockaddr_un {
#endif
PHP_SOCKETS_API int php_sockets_le_socket(void);
+PHP_SOCKETS_API php_socket *php_create_socket(void);
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC);
#define php_sockets_le_socket_name "Socket"
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 0dab51bed6..584d98576f 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -384,7 +384,7 @@ PHP_SOCKETS_API int php_sockets_le_socket(void) /* {{{ */
/* allocating function to make programming errors due to uninitialized fields
* less likely */
-static php_socket *php_create_socket(void) /* {{{ */
+PHP_SOCKETS_API php_socket *php_create_socket(void) /* {{{ */
{
php_socket *php_sock = emalloc(sizeof(php_socket));
@@ -398,7 +398,7 @@ static php_socket *php_create_socket(void) /* {{{ */
}
/* }}} */
-static void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
{
php_socket *php_sock = rsrc->ptr;
diff --git a/ext/sockets/tests/mcast_ipv4_send.phpt b/ext/sockets/tests/mcast_ipv4_send.phpt
index ac5bce9162..0dd858f297 100644
--- a/ext/sockets/tests/mcast_ipv4_send.phpt
+++ b/ext/sockets/tests/mcast_ipv4_send.phpt
@@ -1,65 +1,66 @@
---TEST--
-Multicast support: IPv4 send options
---SKIPIF--
-<?php
-if (!extension_loaded('sockets')) {
- die('skip sockets extension not available.');
-}
-if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
- die("skip interface 1 either doesn't exist or has no ipv4 address");
-}
---FILE--
-<?php
-$domain = AF_INET;
-$level = IPPROTO_IP;
-$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err");
-
-echo "Setting IP_MULTICAST_TTL\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_LOOP\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_IF\n";
-echo "interface 0:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "interface 1:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "\n";
-
---EXPECT--
-Setting IP_MULTICAST_TTL
-bool(true)
-int(9)
-
-Setting IP_MULTICAST_LOOP
-bool(true)
-int(0)
-bool(true)
-int(1)
-
-Setting IP_MULTICAST_IF
-interface 0:
-bool(true)
-int(0)
-interface 1:
-bool(true)
-int(1)
+--TEST--
+Multicast support: IPv4 send options
+--SKIPIF--
+<?php
+if (!extension_loaded('sockets')) {
+ die('skip sockets extension not available.');
+}
+$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("err");
+if (socket_set_option($s, IPPROTO_IP, IP_MULTICAST_IF, 1) === false) {
+ die("skip interface 1 either doesn't exist or has no ipv4 address");
+}
+--FILE--
+<?php
+$domain = AF_INET;
+$level = IPPROTO_IP;
+$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err");
+
+echo "Setting IP_MULTICAST_TTL\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
+var_dump($r);
+echo "\n";
+
+echo "Setting IP_MULTICAST_LOOP\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
+var_dump($r);
+$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
+var_dump($r);
+echo "\n";
+
+echo "Setting IP_MULTICAST_IF\n";
+echo "interface 0:\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_IF);
+var_dump($r);
+echo "interface 1:\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_IF);
+var_dump($r);
+echo "\n";
+
+--EXPECT--
+Setting IP_MULTICAST_TTL
+bool(true)
+int(9)
+
+Setting IP_MULTICAST_LOOP
+bool(true)
+int(0)
+bool(true)
+int(1)
+
+Setting IP_MULTICAST_IF
+interface 0:
+bool(true)
+int(0)
+interface 1:
+bool(true)
+int(1)
diff --git a/ext/spl/internal/recursivecachingiterator.inc b/ext/spl/internal/recursivecachingiterator.inc
index 0676d435f2..cd5d3e31f5 100644
--- a/ext/spl/internal/recursivecachingiterator.inc
+++ b/ext/spl/internal/recursivecachingiterator.inc
@@ -80,7 +80,7 @@ class RecursiveCachingIterator extends CachingIterator implements RecursiveItera
/** @return whether the current element has children
* @note The check whether the Iterator for the children can be created was
* already executed. Hence when flag CATCH_GET_CHILD was given in
- * constructor this fucntion returns false so that getChildren does
+ * constructor this function returns false so that getChildren does
* not try to access those children.
*/
function hasChildren()
diff --git a/ext/spl/spl.php b/ext/spl/spl.php
index c276f1f2ee..ff9d1b6bbe 100755
--- a/ext/spl/spl.php
+++ b/ext/spl/spl.php
@@ -958,7 +958,7 @@ class SplFileInfo
*
* @param mode open mode
* @param use_include_path whether to search include paths (don't use)
- * @param context resource context to pased to open function
+ * @param context resource context to passed to open function
* @throw RuntimeException if file cannot be opened (e.g. insufficient
* access rights).
* @return The opened file as a SplFileObject instance
diff --git a/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt b/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt
index f57fe78fb8..659f61c80d 100644
--- a/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt
+++ b/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt
@@ -1,5 +1,5 @@
--TEST--
-Tries to create a SplFixedArray using the fromArray() function and a multi dimentional array.
+Tries to create a SplFixedArray using the fromArray() function and a multi dimensional array.
--CREDITS--
Philip Norton philipnorton42@gmail.com
--FILE--
diff --git a/ext/spl/tests/bug53071.phpt b/ext/spl/tests/bug53071.phpt
index c2c2605e2e..9d5dac4cd0 100644
--- a/ext/spl/tests/bug53071.phpt
+++ b/ext/spl/tests/bug53071.phpt
@@ -12,7 +12,7 @@ function LimitedScope()
$myA = new myClass();
$myB = new SplObjectStorage();
$myC = new myClass();
- $myC->member = $myA; // myC has a referece to myA
+ $myC->member = $myA; // myC has a reference to myA
$myB->Attach($myC); // myB attaches myC
$myA->member = $myB; // myA has myB, comleting the cycle
}
diff --git a/ext/sqlite3/libsqlite/sqlite3.c b/ext/sqlite3/libsqlite/sqlite3.c
index e5aa96f6b0..99aeccc46f 100644
--- a/ext/sqlite3/libsqlite/sqlite3.c
+++ b/ext/sqlite3/libsqlite/sqlite3.c
@@ -10022,7 +10022,7 @@ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void);
** shared locks begins at SHARED_FIRST.
**
** The same locking strategy and
-** byte ranges are used for Unix. This leaves open the possiblity of having
+** byte ranges are used for Unix. This leaves open the possibility of having
** clients on win95, winNT, and unix all talking to the same shared file
** and all locking correctly. To do so would require that samba (or whatever
** tool is being used for file sharing) implements locks correctly between
@@ -11971,7 +11971,7 @@ struct TriggerStep {
u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT */
u8 orconf; /* OE_Rollback etc. */
Trigger *pTrig; /* The trigger that this step is a part of */
- Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
+ Select *pSelect; /* SELECT statement or RHS of INSERT INTO .. SELECT ... */
Token target; /* Target table for DELETE, UPDATE, INSERT */
Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
ExprList *pExprList; /* SET clause for UPDATE. */
@@ -13019,7 +13019,7 @@ SQLITE_PRIVATE int sqlite3MemdebugNoType(void*,u8);
**
*************************************************************************
**
-** This file contains definitions of global variables and contants.
+** This file contains definitions of global variables and constants.
*/
/* An array to map all upper-case characters into their corresponding
@@ -13908,7 +13908,7 @@ struct Mem {
#endif
/*
-** Each auxilliary data pointer stored by a user defined function
+** Each auxiliary data pointer stored by a user defined function
** implementation calling sqlite3_set_auxdata() is stored in an instance
** of this structure. All such structures associated with a single VM
** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed
@@ -17632,7 +17632,7 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void){
** 1. All memory allocations sizes are rounded up to a power of 2.
**
** 2. If two adjacent free blocks are the halves of a larger block,
-** then the two blocks are coalesed into the single larger block.
+** then the two blocks are coalesced into the single larger block.
**
** 3. New memory is allocated from the first available free block.
**
@@ -18570,7 +18570,7 @@ SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
/*
** The sqlite3_mutex.id, sqlite3_mutex.nRef, and sqlite3_mutex.owner fields
-** are necessary under two condidtions: (1) Debug builds and (2) using
+** are necessary under two conditions: (1) Debug builds and (2) using
** home-grown mutexes. Encapsulate these conditions into a single #define.
*/
#if defined(SQLITE_DEBUG) || defined(SQLITE_HOMEGROWN_RECURSIVE_MUTEX)
@@ -21904,7 +21904,7 @@ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
** occur.
**
** 2002-Feb-14: This routine is extended to remove MS-Access style
-** brackets from around identifers. For example: "[a-b-c]" becomes
+** brackets from around identifiers. For example: "[a-b-c]" becomes
** "a-b-c".
*/
SQLITE_PRIVATE int sqlite3Dequote(char *z){
@@ -22146,7 +22146,7 @@ do_atof_calc:
/* store the result */
*pResult = result;
- /* return true if number and no extra non-whitespace chracters after */
+ /* return true if number and no extra non-whitespace characters after */
return z>=zEnd && nDigits>0 && eValid && nonNum==0;
#else
return !sqlite3Atoi64(z, pResult, length, enc);
@@ -22837,7 +22837,7 @@ SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){
}
/*
-** Attempt to add, substract, or multiply the 64-bit signed value iB against
+** Attempt to add, subtract, or multiply the 64-bit signed value iB against
** the other 64-bit signed integer at *pA and store the result in *pA.
** Return 0 on success. Or if the operation would have resulted in an
** overflow, leave *pA unchanged and return 1.
@@ -26863,7 +26863,7 @@ static int unixRead(
#endif
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this read request as possible by transfering
+ /* Deal with as much of this read request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -26998,7 +26998,7 @@ static int unixWrite(
#endif
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this write request as possible by transfering
+ /* Deal with as much of this write request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -28557,7 +28557,7 @@ static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
** looks at the filesystem type and tries to guess the best locking
** strategy from that.
**
-** For finder-funtion F, two objects are created:
+** For finder-function F, two objects are created:
**
** (1) The real finder-function named "FImpt()".
**
@@ -29998,7 +29998,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){
** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will
** force proxy locking to be used for every database file opened, and 0
** will force automatic proxy locking to be disabled for all database
-** files (explicity calling the SQLITE_SET_LOCKPROXYFILE pragma or
+** files (explicitly calling the SQLITE_SET_LOCKPROXYFILE pragma or
** sqlite_file_control API is not affected by SQLITE_FORCE_PROXY_LOCKING).
*/
@@ -30529,7 +30529,7 @@ static int proxyTakeConch(unixFile *pFile){
fprintf(stderr, "fchmod %o FAILED with %d %s\n",
cmode, code, strerror(code));
} else {
- fprintf(stderr, "fchmod %o SUCCEDED\n",cmode);
+ fprintf(stderr, "fchmod %o SUCCEEDED\n",cmode);
}
}else{
int code = errno;
@@ -33761,7 +33761,7 @@ static int winRead(
pFile->h, pBuf, amt, offset, pFile->locktype));
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this read request as possible by transfering
+ /* Deal with as much of this read request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -33833,7 +33833,7 @@ static int winWrite(
pFile->h, pBuf, amt, offset, pFile->locktype));
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this write request as possible by transfering
+ /* Deal with as much of this write request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -33965,7 +33965,7 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
#ifdef SQLITE_TEST
/*
** Count the number of fullsyncs and normal syncs. This is used to test
-** that syncs and fullsyncs are occuring at the right times.
+** that syncs and fullsyncs are occurring at the right times.
*/
SQLITE_API int sqlite3_sync_count = 0;
SQLITE_API int sqlite3_fullsync_count = 0;
@@ -39330,8 +39330,8 @@ SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){
** Check to see if element iRowid was inserted into the rowset as
** part of any insert batch prior to iBatch. Return 1 or 0.
**
-** If this is the first test of a new batch and if there exist entires
-** on pRowSet->pEntry, then sort those entires into the forest at
+** If this is the first test of a new batch and if there exist entries
+** on pRowSet->pEntry, then sort those entries into the forest at
** pRowSet->pForest so that they can be tested.
*/
SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 iRowid){
@@ -39613,7 +39613,7 @@ SQLITE_PRIVATE int sqlite3WalFramesize(Wal *pWal);
** Definition: Two databases (or the same database at two points it time)
** are said to be "logically equivalent" if they give the same answer to
** all queries. Note in particular the content of freelist leaf
-** pages can be changed arbitarily without effecting the logical equivalence
+** pages can be changed arbitrarily without effecting the logical equivalence
** of the database.
**
** (7) At any time, if any subset, including the empty set and the total set,
@@ -39838,7 +39838,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */
** outstanding transactions have been abandoned, the pager is able to
** transition back to OPEN state, discarding the contents of the
** page-cache and any other in-memory state at the same time. Everything
-** is reloaded from disk (and, if necessary, hot-journal rollback peformed)
+** is reloaded from disk (and, if necessary, hot-journal rollback performed)
** when a read-transaction is next opened on the pager (transitioning
** the pager into READER state). At that point the system has recovered
** from the error.
@@ -41196,7 +41196,7 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){
}
pPager->journalOff += (nMaster+20);
- /* If the pager is in peristent-journal mode, then the physical
+ /* If the pager is in persistent-journal mode, then the physical
** journal-file may extend past the end of the master-journal name
** and 8 bytes of magic data just written to the file. This is
** dangerous because the code to rollback a hot-journal file
@@ -41369,7 +41369,7 @@ static void pager_unlock(Pager *pPager){
/*
** This function is called whenever an IOERR or FULL error that requires
-** the pager to transition into the ERROR state may ahve occurred.
+** the pager to transition into the ERROR state may have occurred.
** The first argument is a pointer to the pager structure, the second
** the error-code about to be returned by a pager API function. The
** value returned is a copy of the second argument to this function.
@@ -48080,7 +48080,7 @@ SQLITE_PRIVATE int sqlite3WalOpen(
}
/*
-** Change the size to which the WAL file is trucated on each reset.
+** Change the size to which the WAL file is truncated on each reset.
*/
SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){
if( pWal ) pWal->mxWalSize = iLimit;
@@ -54531,7 +54531,7 @@ SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
** compiler to crash when getCellInfo() is implemented as a macro.
** But there is a measureable speed advantage to using the macro on gcc
** (when less compiler optimizations like -Os or -O0 are used and the
-** compiler is not doing agressive inlining.) So we use a real function
+** compiler is not doing aggressive inlining.) So we use a real function
** for MSVC and a macro for everything else. Ticket #2457.
*/
#ifndef NDEBUG
@@ -54929,7 +54929,7 @@ static int accessPayload(
/*
** Read part of the key associated with cursor pCur. Exactly
-** "amt" bytes will be transfered into pBuf[]. The transfer
+** "amt" bytes will be transferred into pBuf[]. The transfer
** begins at "offset".
**
** The caller must ensure that pCur is pointing to a valid row
@@ -54949,7 +54949,7 @@ SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pB
/*
** Read part of the data associated with cursor pCur. Exactly
-** "amt" bytes will be transfered into pBuf[]. The transfer
+** "amt" bytes will be transferred into pBuf[]. The transfer
** begins at "offset".
**
** Return SQLITE_OK on success or an error code if anything goes
@@ -62945,7 +62945,7 @@ SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
**
** This function may be called exact once on a each virtual machine.
** After this routine is called the VM has been "packaged" and is ready
-** to run. After this routine is called, futher calls to
+** to run. After this routine is called, further calls to
** sqlite3VdbeAddOp() functions are prohibited. This routine disconnects
** the Vdbe from the Parse object that helped generate it so that the
** the Vdbe becomes an independent entity and the Parse object can be
@@ -62997,7 +62997,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady(
/* Allocate space for memory registers, SQL variables, VDBE cursors and
** an array to marshal SQL function arguments in.
*/
- zCsr = (u8*)&p->aOp[p->nOp]; /* Memory avaliable for allocation */
+ zCsr = (u8*)&p->aOp[p->nOp]; /* Memory available for allocation */
zEnd = (u8*)&p->aOp[pParse->nOpAlloc]; /* First byte past end of zCsr[] */
resolveP2Values(p, &nArg);
@@ -63323,7 +63323,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){
/* The complex case - There is a multi-file write-transaction active.
** This requires a master journal file to ensure the transaction is
- ** committed atomicly.
+ ** committed atomically.
*/
#ifndef SQLITE_OMIT_DISKIO
else{
@@ -65560,7 +65560,7 @@ SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
** The following routines are used by user-defined functions to specify
** the function result.
**
-** The setStrOrError() funtion calls sqlite3VdbeMemSetStr() to store the
+** The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the
** result as a string or blob but if the string or blob is too large, it
** then sets the error code to SQLITE_TOOBIG
*/
@@ -65981,7 +65981,7 @@ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
}
/*
-** Return the auxilary data pointer, if any, for the iArg'th argument to
+** Return the auxiliary data pointer, if any, for the iArg'th argument to
** the user-function defined by pCtx.
*/
SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
@@ -65996,7 +65996,7 @@ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
}
/*
-** Set the auxilary data pointer and delete function, for the iArg'th
+** Set the auxiliary data pointer and delete function, for the iArg'th
** argument to the user-function defined by pCtx. Any previous value is
** deleted by calling the delete function specified when it was set.
*/
@@ -75506,7 +75506,7 @@ SQLITE_PRIVATE int sqlite3MemJournalSize(void){
/*
** Walk an expression tree. Invoke the callback once for each node
-** of the expression, while decending. (In other words, the callback
+** of the expression, while descending. (In other words, the callback
** is invoked before visiting children.)
**
** The return value from the callback should be one of the WRC_*
@@ -77026,7 +77026,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames(
/*
** Resolve all names in all expressions of a SELECT and in all
-** decendents of the SELECT, including compounds off of p->pPrior,
+** descendants of the SELECT, including compounds off of p->pPrior,
** subqueries in expressions, and subqueries used as FROM clause
** terms.
**
@@ -77119,7 +77119,7 @@ SQLITE_PRIVATE void sqlite3ResolveSelfReference(
** affinity of that column is returned. Otherwise, 0x00 is returned,
** indicating no affinity for the expression.
**
-** i.e. the WHERE clause expresssions in the following statements all
+** i.e. the WHERE clause expressions in the following statements all
** have an affinity:
**
** CREATE TABLE t1(a);
@@ -77835,7 +77835,7 @@ static int exprStructSize(Expr *p){
** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size
** (unreduced) Expr objects as they or originally constructed by the parser.
** During expression analysis, extra information is computed and moved into
-** later parts of teh Expr object and that extra information might get chopped
+** later parts of the Expr object and that extra information might get chopped
** off if the expression is reduced. Note also that it does not work to
** make a EXPRDUP_REDUCE copy of a reduced expression. It is only legal
** to reduce a pristine expression tree from the parser. The implementation
@@ -81503,7 +81503,7 @@ static void renameParentFunc(
** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
** statement. The second is a table name. The table name in the CREATE
** TRIGGER statement is replaced with the third argument and the result
-** returned. This is analagous to renameTableFunc() above, except for CREATE
+** returned. This is analogous to renameTableFunc() above, except for CREATE
** TRIGGER, not CREATE INDEX and CREATE TABLE.
*/
static void renameTriggerFunc(
@@ -83682,7 +83682,7 @@ static void initAvgEq(Index *pIdx){
/* Set nSum to the number of distinct (iCol+1) field prefixes that
** occur in the stat4 table for this index before pFinal. Set
** sumEq to the sum of the nEq values for column iCol for the same
- ** set (adding the value only once where there exist dupicate
+ ** set (adding the value only once where there exist duplicate
** prefixes). */
for(i=0; i<(pIdx->nSample-1); i++){
if( aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] ){
@@ -95333,7 +95333,7 @@ static int xferOptimization(
}
#endif
#ifndef SQLITE_OMIT_FOREIGN_KEY
- /* Disallow the transfer optimization if the destination table constains
+ /* Disallow the transfer optimization if the destination table contains
** any foreign key constraints. This is more restrictive than necessary.
** But the main beneficiary of the transfer optimization is the VACUUM
** command, and the VACUUM command disables foreign key constraints. So
@@ -96561,7 +96561,7 @@ static int sqlite3LoadExtension(
** entry point name "sqlite3_extension_init" was not found, then
** construct an entry point name "sqlite3_X_init" where the X is
** replaced by the lowercase value of every ASCII alphabetic
- ** character in the filename after the last "/" upto the first ".",
+ ** character in the filename after the last "/" up to the first ".",
** and eliding the first three characters if they are "lib".
** Examples:
**
@@ -101878,7 +101878,7 @@ static void generateWithRecursiveQuery(
int iQueue; /* The Queue table */
int iDistinct = 0; /* To ensure unique results if UNION */
int eDest = SRT_Table; /* How to write to Queue */
- SelectDest destQueue; /* SelectDest targetting the Queue table */
+ SelectDest destQueue; /* SelectDest targeting the Queue table */
int i; /* Loop counter */
int rc; /* Result code */
ExprList *pOrderBy; /* The ORDER BY clause */
@@ -102383,7 +102383,7 @@ multi_select_end:
/*
** Code an output subroutine for a coroutine implementation of a
-** SELECT statment.
+** SELECT statement.
**
** The data to be output is contained in pIn->iSdst. There are
** pIn->nSdst columns to be output. pDest is where the output should
@@ -103184,7 +103184,7 @@ static int flattenSubquery(
pSubSrc = pSub->pSrc;
assert( pSubSrc );
/* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants,
- ** not arbitrary expresssions, we allowed some combining of LIMIT and OFFSET
+ ** not arbitrary expressions, we allowed some combining of LIMIT and OFFSET
** because they could be computed at compile-time. But when LIMIT and OFFSET
** became arbitrary expressions, we were forced to add restrictions (13)
** and (14). */
@@ -103570,7 +103570,7 @@ static u8 minMaxQuery(AggInfo *pAggInfo, ExprList **ppMinMax){
/*
** The select statement passed as the first argument is an aggregate query.
-** The second argment is the associated aggregate-info object. This
+** The second argument is the associated aggregate-info object. This
** function tests if the SELECT is of the form:
**
** SELECT count(*) FROM <tbl>
@@ -103903,7 +103903,7 @@ static void selectPopWith(Walker *pWalker, Select *p){
** without worrying about messing up the presistent representation
** of the view.
**
-** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword
+** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword
** on joins and the ON and USING clause of joins.
**
** (4) Scan the list of columns in the result set (pEList) looking
@@ -104871,7 +104871,7 @@ SQLITE_PRIVATE int sqlite3Select(
*/
if( pGroupBy ){
KeyInfo *pKeyInfo; /* Keying information for the group by clause */
- int j1; /* A-vs-B comparision jump */
+ int j1; /* A-vs-B comparison jump */
int addrOutputRow; /* Start of subroutine that outputs a result row */
int regOutputRow; /* Return address register for output subroutine */
int addrSetAbort; /* Set the abort flag and return */
@@ -107168,7 +107168,7 @@ SQLITE_PRIVATE void sqlite3Update(
}
/* Populate the array of registers beginning at regNew with the new
- ** row data. This array is used to check constaints, create the new
+ ** row data. This array is used to check constraints, create the new
** table and index records, and as the values for any new.* references
** made by triggers.
**
@@ -107542,7 +107542,7 @@ static int execExecSql(sqlite3 *db, char **pzErrMsg, const char *zSql){
** step (3) requires additional temporary disk space approximately equal
** to the size of the original database for the rollback journal.
** Hence, temporary disk space that is approximately 2x the size of the
-** orginal database is required. Every page of the database is written
+** original database is required. Every page of the database is written
** approximately 3 times: Once for step (2) and twice for step (3).
** Two writes per page are required in step (3) because the original
** database content must be written into the rollback journal prior to
@@ -109122,7 +109122,7 @@ static int whereLoopResize(sqlite3*, WhereLoop*, int);
** 1. Then using those as a basis to compute the N best WherePath objects
** of length 2. And so forth until the length of WherePaths equals the
** number of nodes in the FROM clause. The best (lowest cost) WherePath
-** at the end is the choosen query plan.
+** at the end is the chosen query plan.
*/
struct WherePath {
Bitmask maskLoop; /* Bitmask of all WhereLoop objects in this path */
@@ -110367,7 +110367,7 @@ static void exprAnalyzeOrTerm(
}
if( (chngToIN & getMask(&pWInfo->sMaskSet, pOrTerm->leftCursor))==0 ){
/* This term must be of the form t1.a==t2.b where t2 is in the
- ** chngToIN set but t1 is not. This term will be either preceeded
+ ** chngToIN set but t1 is not. This term will be either preceded
** or follwed by an inverted copy (t2.b==t1.a). Skip this term
** and use its inversion. */
testcase( pOrTerm->wtFlags & TERM_COPIED );
@@ -111396,7 +111396,7 @@ static void whereKeyStats(
** number of rows that the index scan is expected to visit without
** considering the range constraints. If nEq is 0, this is the number of
** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced)
-** to account for the range contraints pLower and pUpper.
+** to account for the range constraints pLower and pUpper.
**
** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be
** used, each range inequality reduces the search space by a factor of 4.
@@ -114067,7 +114067,7 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){
** strict. With GROUP BY and DISTINCT the only requirement is that
** equivalent rows appear immediately adjacent to one another. GROUP BY
** and DISTINT do not require rows to appear in any particular order as long
-** as equivelent rows are grouped together. Thus for GROUP BY and DISTINCT
+** as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT
** the pOrderBy terms can be matched in any order. With ORDER BY, the
** pOrderBy terms must be matched in strict left-to-right order.
*/
@@ -119734,7 +119734,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[];
** a statement.
**
** (4) CREATE The keyword CREATE has been seen at the beginning of a
-** statement, possibly preceeded by EXPLAIN and/or followed by
+** statement, possibly preceded by EXPLAIN and/or followed by
** TEMP or TEMPORARY
**
** (5) TRIGGER We are in the middle of a trigger definition that must be
@@ -119787,7 +119787,7 @@ SQLITE_API int sqlite3_complete(const char *zSql){
};
#else
/* If triggers are not supported by this compile then the statement machine
- ** used to detect the end of a statement is much simplier
+ ** used to detect the end of a statement is much simpler
*/
static const u8 trans[3][3] = {
/* Token: */
@@ -124622,7 +124622,7 @@ struct Fts3Table {
#endif
#ifdef SQLITE_TEST
- /* True to disable the incremental doclist optimization. This is controled
+ /* True to disable the incremental doclist optimization. This is controlled
** by special insert command 'test-no-incr-doclist'. */
int bNoIncrDoclist;
#endif
@@ -124665,7 +124665,7 @@ struct Fts3Cursor {
/*
** The Fts3Cursor.eSearch member is always set to one of the following.
-** Actualy, Fts3Cursor.eSearch can be greater than or equal to
+** Actually, Fts3Cursor.eSearch can be greater than or equal to
** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index
** of the column to be searched. For example, in
**
@@ -132785,7 +132785,7 @@ static const char cType[] = {
**
** In these routine, the letters are in reverse order. So the 'y' rule
** is that 'y' is a consonant unless it is followed by another
-** consonent.
+** consonant.
*/
static int isVowel(const char*);
static int isConsonant(const char *z){
@@ -132881,7 +132881,7 @@ static int doubleConsonant(const char *z){
/*
** Return TRUE if the word ends with three letters which
-** are consonant-vowel-consonent and where the final consonant
+** are consonant-vowel-consonant and where the final consonant
** is not 'w', 'x', or 'y'.
**
** The word is reversed here. So we are really checking the
@@ -132897,7 +132897,7 @@ static int star_oh(const char *z){
/*
** If the word ends with zFrom and xCond() is true for the stem
-** of the word that preceeds the zFrom ending, then change the
+** of the word that precedes the zFrom ending, then change the
** ending to zTo.
**
** The input word *pz and zFrom are both in reverse order. zTo
@@ -139692,7 +139692,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken(
/*
** SQLite value pRowid contains the rowid of a row that may or may not be
** present in the FTS3 table. If it is, delete it and adjust the contents
-** of subsiduary data structures accordingly.
+** of subsidiary data structures accordingly.
*/
static int fts3DeleteByRowid(
Fts3Table *p,
@@ -140399,7 +140399,7 @@ static int fts3StringAppend(
}
/* If there is insufficient space allocated at StrBuffer.z, use realloc()
- ** to grow the buffer until so that it is big enough to accomadate the
+ ** to grow the buffer until so that it is big enough to accommodate the
** appended data.
*/
if( pStr->n+nAppend+1>=pStr->nAlloc ){
@@ -141300,7 +141300,7 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets(
sCtx.iTerm = 0;
(void)fts3ExprIterate(pCsr->pExpr, fts3ExprTermOffsetInit, (void *)&sCtx);
- /* Retreive the text stored in column iCol. If an SQL NULL is stored
+ /* Retrieve the text stored in column iCol. If an SQL NULL is stored
** in column iCol, jump immediately to the next iteration of the loop.
** If an OOM occurs while retrieving the data (this can happen if SQLite
** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 57d0065b25..bacd98cf30 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -615,7 +615,7 @@ PHP_FUNCTION(usort)
return;
}
- /* Increase reference counter, so the attemts to modify the array in user
+ /* Increase reference counter, so the attempts to modify the array in user
* comparison function will create a copy of array and won't affect the
* original array. The fact of modification is detected using refcount
* comparison. The result of sorting in such case is undefined and the
@@ -660,7 +660,7 @@ PHP_FUNCTION(uasort)
return;
}
- /* Increase reference counter, so the attemts to modify the array in user
+ /* Increase reference counter, so the attempts to modify the array in user
* comparison function will create a copy of array and won't affect the
* original array. The fact of modification is detected using refcount
* comparison. The result of sorting in such case is undefined and the
@@ -748,7 +748,7 @@ PHP_FUNCTION(uksort)
return;
}
- /* Increase reference counter, so the attemts to modify the array in user
+ /* Increase reference counter, so the attempts to modify the array in user
* comparison function will create a copy of array and won't affect the
* original array. The fact of modification is detected using refcount
* comparison. The result of sorting in such case is undefined and the
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index a168069cfb..9ffe0fe14e 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -549,12 +549,9 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 0, 1)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */
- ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC)
- ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING)
- ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr2)
- ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC)
- ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING)
- ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, more_array_and_sort_options)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags)
+ ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
@@ -4114,13 +4111,17 @@ PHP_FUNCTION(putenv)
if (putenv(pe.putenv_string) == 0) { /* success */
# else
error_code = SetEnvironmentVariable(pe.key, value);
-# if _MSC_VER < 1500
- /* Yet another VC6 bug, unset may return env not found */
- if (error_code != 0 ||
- (error_code == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)) {
-# else
- if (error_code != 0) { /* success */
-# endif
+
+ if (error_code != 0
+# ifndef ZTS
+ /* We need both SetEnvironmentVariable and _putenv here as some
+ dependency lib could use either way to read the environment.
+ Obviously the CRT version will be useful more often. But
+ generally, doing both brings us on the safe track at least
+ in NTS build. */
+ && _putenv(pe.putenv_string) == 0
+# endif
+ ) { /* success */
# endif
#endif
zend_hash_str_add_mem(&BG(putenv_ht), pe.key, pe.key_len, &pe, sizeof(putenv_entry));
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index a822ac4da0..6a09ce3af5 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -517,7 +517,7 @@ no_results:
continue;
}
}
- /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that
+ /* we need to do this every time since GLOB_ONLYDIR does not guarantee that
* all directories will be filtered. GNU libc documentation states the
* following:
* If the information about the type of the file is easily available
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 6106fe2c86..ca6942a9c9 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -242,9 +242,11 @@ PHP_FUNCTION(passthru)
PHPAPI zend_string *php_escape_shell_cmd(char *str)
{
register int x, y, l = (int)strlen(str);
- char *p = NULL;
size_t estimate = (2 * l) + 1;
zend_string *cmd;
+#ifndef PHP_WIN32
+ char *p = NULL;
+#endif
TSRMLS_FETCH();
@@ -277,7 +279,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
cmd->val[y++] = str[x];
break;
#else
- /* % is Windows specific for enviromental variables, ^%PATH% will
+ /* % is Windows specific for environmental variables, ^%PATH% will
output PATH whil ^%PATH^% not. escapeshellcmd->val will escape all %.
*/
case '%':
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 4804e49338..e7d870d719 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1601,7 +1601,7 @@ PHP_NAMED_FUNCTION(php_if_fstat)
#else
ZVAL_LONG(&stat_blocks,-1);
#endif
- /* Store numeric indexes in propper order */
+ /* Store numeric indexes in proper order */
zend_hash_next_index_insert(HASH_OF(return_value), &stat_dev);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_ino);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_mode);
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 53aede1469..80d4ca4388 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -1048,7 +1048,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
#else
ZVAL_LONG(&stat_blocks,-1);
#endif
- /* Store numeric indexes in propper order */
+ /* Store numeric indexes in proper order */
zend_hash_next_index_insert(HASH_OF(return_value), &stat_dev);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_ino);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_mode);
diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h
index 14405022b6..ac3f52697b 100644
--- a/ext/standard/flock_compat.h
+++ b/ext/standard/flock_compat.h
@@ -21,7 +21,7 @@
#ifndef FLOCK_COMPAT_H
#define FLOCK_COMPAT_H
-/* php_flock internally uses fcntl whther or not flock is available
+/* php_flock internally uses fcntl whether or not flock is available
* This way our php_flock even works on NFS files.
* More info: /usr/src/linux/Documentation
*/
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index ed93345bac..526a45b470 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -635,11 +635,10 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
zend_string_release(basename);
/* Trim off trailing whitespace characters */
- tmp_len--;
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';
+ (ent->d_name[tmp_len - 1] == '\n' || ent->d_name[tmp_len - 1] == '\r' ||
+ ent->d_name[tmp_len - 1] == '\t' || ent->d_name[tmp_len - 1] == ' ')) {
+ ent->d_name[--tmp_len] = '\0';
}
return sizeof(php_stream_dirent);
@@ -789,7 +788,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
goto stat_errexit;
}
- ssb->sb.st_mode = 0644; /* FTP won't give us a valid mode, so aproximate one based on being readable */
+ ssb->sb.st_mode = 0644; /* FTP won't give us a valid mode, so approximate one based on being readable */
php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
diff --git a/ext/standard/html_tables/ents_html401.txt b/ext/standard/html_tables/ents_html401.txt
index 7e1564b229..bd3ded9fde 100644
--- a/ext/standard/html_tables/ents_html401.txt
+++ b/ext/standard/html_tables/ents_html401.txt
@@ -1,4 +1,4 @@
-#039 0027 //artifical; there's no &apos; in HTML 4.01
+#039 0027 //artificial; there's no &apos; in HTML 4.01
nbsp 00A0
iexcl 00A1
cent 00A2
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 54159e3785..adeb1c5be6 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -461,7 +461,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR
snprintf(markername, sizeof(markername), "APP%d", marker - M_APP0);
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(info), markername, strlen(markername))) == NULL) {
- /* XXX we onyl catch the 1st tag of it's kind! */
+ /* XXX we only catch the 1st tag of it's kind! */
add_assoc_stringl(info, markername, buffer, length);
}
@@ -533,7 +533,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
case M_APP14:
case M_APP15:
if (info) {
- if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app markes... */
+ if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app marks... */
return result;
}
} else {
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index 011407da29..bb1b9c5a6a 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -150,7 +150,7 @@ PHPAPI zend_string *php_lookup_class_name(zval *object)
/* {{{ php_store_class_name
*/
-PHPAPI void php_store_class_name(zval *object, const char *name, uint32_t len)
+PHPAPI void php_store_class_name(zval *object, const char *name, size_t len)
{
zval val;
TSRMLS_FETCH();
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index 5327869a50..55b8509f04 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -90,7 +90,7 @@ char _codes[26] =
/* These letters are passed through unchanged */
#define NOCHANGE(c) (ENCODE(c) & 2) /* FJMNR */
-/* These form dipthongs when preceding H */
+/* These form diphthongs when preceding H */
#define AFFECTH(c) (ENCODE(c) & 4) /* CGPST */
/* These make C and G soft */
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 4af72c34b8..85709bc9f1 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -560,7 +560,7 @@ PHP_FUNCTION(unpack)
{
char *format, *input;
zend_string *formatarg, *inputarg;
- size_t formatlen, inputpos, inputlen;
+ zend_long formatlen, inputpos, inputlen;
int i;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &formatarg,
@@ -717,7 +717,7 @@ PHP_FUNCTION(unpack)
inputpos = 0;
}
- if ((size >=0 && (inputpos + size) <= inputlen) || (size < 0 && -size <= (inputlen - inputpos))) {
+ if ((inputpos + size) <= inputlen) {
switch ((int) type) {
case 'a': {
/* a will not strip any trailing whitespace or null padding */
diff --git a/ext/standard/password.c b/ext/standard/password.c
index c58c28ab3c..087b3ace76 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -278,7 +278,7 @@ PHP_FUNCTION(password_verify)
}
/* We're using this method instead of == in order to provide
- * resistence towards timing attacks. This is a constant time
+ * resistance towards timing attacks. This is a constant time
* equality check that will always check every byte of both
* values. */
for (i = 0; i < hash_len; i++) {
@@ -345,12 +345,11 @@ PHP_FUNCTION(password_hash)
if (options && (option_buffer = zend_symtable_str_find(options, "salt", sizeof("salt")-1)) != NULL) {
char *buffer;
- size_t buffer_len_int = 0;
- size_t buffer_len;
+ size_t buffer_len = 0;
switch (Z_TYPE_P(option_buffer)) {
case IS_STRING:
buffer = estrndup(Z_STRVAL_P(option_buffer), Z_STRLEN_P(option_buffer));
- buffer_len_int = Z_STRLEN_P(option_buffer);
+ buffer_len = Z_STRLEN_P(option_buffer);
break;
case IS_LONG:
case IS_DOUBLE:
@@ -361,7 +360,7 @@ PHP_FUNCTION(password_hash)
convert_to_string(&cast_option_buffer);
if (Z_TYPE(cast_option_buffer) == IS_STRING) {
buffer = estrndup(Z_STRVAL(cast_option_buffer), Z_STRLEN(cast_option_buffer));
- buffer_len_int = Z_STRLEN(cast_option_buffer);
+ buffer_len = Z_STRLEN(cast_option_buffer);
zval_dtor(&cast_option_buffer);
break;
}
@@ -377,16 +376,19 @@ PHP_FUNCTION(password_hash)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-string salt parameter supplied");
RETURN_NULL();
}
- if (buffer_len_int < 0) {
+
+ /* XXX all the crypt related APIs work with int for string length.
+ That should be revised for size_t and then we maybe don't require
+ the > INT_MAX check. */
+ if (buffer_len > INT_MAX) {
efree(hash_format);
efree(buffer);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long");
- }
- buffer_len = (size_t) buffer_len_int;
- if (buffer_len < required_salt_len) {
+ RETURN_NULL();
+ } else if (buffer_len < required_salt_len) {
efree(hash_format);
efree(buffer);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %lu expecting %lu", (unsigned long) buffer_len, (unsigned long) required_salt_len);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len);
RETURN_NULL();
} else if (php_password_salt_is_alphabet(buffer, buffer_len) == FAILURE) {
salt = safe_emalloc(required_salt_len, 1, 1);
@@ -394,7 +396,7 @@ PHP_FUNCTION(password_hash)
efree(hash_format);
efree(buffer);
efree(salt);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %lu", (unsigned long) buffer_len);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd", buffer_len);
RETURN_NULL();
}
salt_len = required_salt_len;
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 1989a2eabc..8026b08d45 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -418,7 +418,7 @@ static php_stream_wrapper_ops php_stdio_wops = {
NULL /* rmdir */
};
-php_stream_wrapper php_stream_php_wrapper = {
+PHPAPI php_stream_wrapper php_stream_php_wrapper = {
&php_stdio_wops,
NULL,
0, /* is_url */
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 084efc291c..6d6a5bde27 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -27,7 +27,7 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *pa
php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
extern PHPAPI php_stream_wrapper php_stream_http_wrapper;
extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper;
-extern php_stream_wrapper php_stream_php_wrapper;
-extern php_stream_wrapper php_plain_files_wrapper;
+extern PHPAPI php_stream_wrapper php_stream_php_wrapper;
+extern PHPAPI php_stream_wrapper php_plain_files_wrapper;
#endif
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index 177e960765..fa2747f3bf 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -54,7 +54,7 @@ extern "C" {
PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D);
PHPAPI zend_string *php_lookup_class_name(zval *object);
-PHPAPI void php_store_class_name(zval *object, const char *name, uint32_t len);
+PHPAPI void php_store_class_name(zval *object, const char *name, size_t len);
#ifdef __cplusplus
};
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index 23225cdc42..a4df8f51f9 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -57,6 +57,7 @@ PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t
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);
+PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC);
#define PHP_VAR_SERIALIZE_INIT(d) \
do { \
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index 55388e3c13..47b55af466 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -271,7 +271,7 @@ PHP_FUNCTION(mt_srand)
* We have a problem here in that only n==M will get mapped to b which
# means the chances of getting b is much much less than getting any of
# the other values in the range. We can fix this by increasing our range
- # artifically and using:
+ # artificially and using:
#
# n' = a + n(b-a+1)/M
*
diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h
index ddb9803512..6d9e8a443c 100644
--- a/ext/standard/scanf.h
+++ b/ext/standard/scanf.h
@@ -23,7 +23,7 @@
#define SCAN_MAX_ARGS 0xFF /* Maximum number of variable which can be */
- /* passed to (f|s)scanf. This is an artifical */
+ /* passed to (f|s)scanf. This is an artificial */
/* upper limit to keep resources in check and */
/* minimize the possibility of exploits */
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 152ae6d66f..c5c6520cf7 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2807,7 +2807,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl
char *key;
smart_str result = {0};
- /* we will collect all possible key lenghts */
+ /* we will collect all possible key lengths */
ZVAL_NULL(&dummy);
zend_hash_init(&num_hash, 8, NULL, NULL, 0);
@@ -2829,7 +2829,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl
if (len < minlen) {
minlen = len;
}
- /* remember possible key lenght */
+ /* remember possible key length */
zend_hash_index_add(&num_hash, len, &dummy);
}
} ZEND_HASH_FOREACH_END();
@@ -2854,7 +2854,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl
if (len < minlen) {
minlen = len;
}
- /* remember possible key lenght */
+ /* remember possible key length */
zend_hash_index_add(&num_hash, len, &dummy);
} else {
len = str_key->len;
diff --git a/ext/standard/tests/array/array_search_variation4.phpt b/ext/standard/tests/array/array_search_variation4.phpt
index c247879ccc..7feb2ef147 100644
--- a/ext/standard/tests/array/array_search_variation4.phpt
+++ b/ext/standard/tests/array/array_search_variation4.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test array_search() function : usage variations - haystack as resource/multi dimentional array
+Test array_search() function : usage variations - haystack as resource/multi dimensional array
--FILE--
<?php
/*
diff --git a/ext/standard/tests/array/in_array_variation4.phpt b/ext/standard/tests/array/in_array_variation4.phpt
index a27bb196b4..9a5312b268 100644
--- a/ext/standard/tests/array/in_array_variation4.phpt
+++ b/ext/standard/tests/array/in_array_variation4.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test in_array() function : usage variations - haystack as resource/multi dimentional array
+Test in_array() function : usage variations - haystack as resource/multi dimensional array
--FILE--
<?php
/*
diff --git a/ext/standard/tests/file/fgetc_variation1.phpt b/ext/standard/tests/file/fgetc_variation1.phpt
index 007b2e0f9c..03258cac5d 100644
--- a/ext/standard/tests/file/fgetc_variation1.phpt
+++ b/ext/standard/tests/file/fgetc_variation1.phpt
@@ -34,7 +34,7 @@ for(; $loop_counter < count($file_modes); $loop_counter++) {
var_dump( feof($file_handle) ); // expected false
var_dump( ftell($file_handle) ); // ensure that file pointer is at eof
var_dump( fgetc($file_handle) ); // try n read a char, none expected
- var_dump( feof($file_handle) ); // ensure thta file pointer is at eof
+ var_dump( feof($file_handle) ); // ensure that file pointer is at eof
var_dump( ftell($file_handle) ); // file pointer position
// close the file handle
diff --git a/ext/standard/tests/file/fgets_variation6-win32.phpt b/ext/standard/tests/file/fgets_variation6-win32.phpt
index 14cb46f185..0334050aaa 100644
--- a/ext/standard/tests/file/fgets_variation6-win32.phpt
+++ b/ext/standard/tests/file/fgets_variation6-win32.phpt
@@ -49,7 +49,7 @@ foreach($file_modes as $file_mode) {
var_dump( fgets($file_handle) ); // try n read a line, none expected
var_dump( ftell($file_handle) ); // file pointer position
- var_dump( feof($file_handle) ); // ensure thta file pointer is at eof
+ var_dump( feof($file_handle) ); // ensure that file pointer is at eof
//close file
fclose($file_handle);
diff --git a/ext/standard/tests/file/fgets_variation6.phpt b/ext/standard/tests/file/fgets_variation6.phpt
index da6c2149b9..69215d9020 100644
--- a/ext/standard/tests/file/fgets_variation6.phpt
+++ b/ext/standard/tests/file/fgets_variation6.phpt
@@ -49,7 +49,7 @@ foreach($file_modes as $file_mode) {
var_dump( fgets($file_handle) ); // try n read a line, none expected
var_dump( ftell($file_handle) ); // file pointer position
- var_dump( feof($file_handle) ); // ensure thta file pointer is at eof
+ var_dump( feof($file_handle) ); // ensure that file pointer is at eof
//close file
fclose($file_handle);
diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc
index b3cd99e1c1..aff9d107d9 100644
--- a/ext/standard/tests/file/file.inc
+++ b/ext/standard/tests/file/file.inc
@@ -451,7 +451,7 @@ function delete_file($filename) {
Description: Deletes given number of files if exists.
$file_path = location of the files
$name_prefix = prefix for the filename, rest of the name is incremental(increment by 1 only)
- numeric starting from suffix upto count
+ numeric starting from suffix up to count
$count = number of files to be deleted
$name_suffix = first numeric suffix in the name
Returns: An array with following key/value pair
@@ -495,7 +495,7 @@ function delete_files($file_path,
$file_path = location of link files
$link_file_count = Number of link files
$link_name_prefix = prefix for the linkname, rest of the name is incremental(increment by 1 only)
- numeric starting from $link_name_suffix upto count
+ numeric starting from $link_name_suffix up to count
$link_name_suffix = first numeric suffix in the name
Returns: An array with following key/value pair
diff --git a/ext/standard/tests/file/fscanf_variation18.phpt b/ext/standard/tests/file/fscanf_variation18.phpt
index 71b72984b8..bdd444d0e5 100644
--- a/ext/standard/tests/file/fscanf_variation18.phpt
+++ b/ext/standard/tests/file/fscanf_variation18.phpt
@@ -35,8 +35,8 @@ $integer_values = array (
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/file/fscanf_variation2.phpt b/ext/standard/tests/file/fscanf_variation2.phpt
index 77ae474ccc..8179aee78e 100644
--- a/ext/standard/tests/file/fscanf_variation2.phpt
+++ b/ext/standard/tests/file/fscanf_variation2.phpt
@@ -34,8 +34,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/file/fscanf_variation20.phpt b/ext/standard/tests/file/fscanf_variation20.phpt
index 7ce609c680..3c176773ed 100644
--- a/ext/standard/tests/file/fscanf_variation20.phpt
+++ b/ext/standard/tests/file/fscanf_variation20.phpt
@@ -34,8 +34,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/file/fscanf_variation27.phpt b/ext/standard/tests/file/fscanf_variation27.phpt
index 7a691fcc60..04f2dd5a62 100644
--- a/ext/standard/tests/file/fscanf_variation27.phpt
+++ b/ext/standard/tests/file/fscanf_variation27.phpt
@@ -34,8 +34,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/file/fscanf_variation33.phpt b/ext/standard/tests/file/fscanf_variation33.phpt
index 7ecff33fb9..2dc404ac76 100644
--- a/ext/standard/tests/file/fscanf_variation33.phpt
+++ b/ext/standard/tests/file/fscanf_variation33.phpt
@@ -40,8 +40,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/file/fscanf_variation39.phpt b/ext/standard/tests/file/fscanf_variation39.phpt
index 1b17015bc1..30d299662a 100644
--- a/ext/standard/tests/file/fscanf_variation39.phpt
+++ b/ext/standard/tests/file/fscanf_variation39.phpt
@@ -40,8 +40,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/file/fscanf_variation45.phpt b/ext/standard/tests/file/fscanf_variation45.phpt
index 7db0cc9748..cfd1fe2c4f 100644
--- a/ext/standard/tests/file/fscanf_variation45.phpt
+++ b/ext/standard/tests/file/fscanf_variation45.phpt
@@ -34,8 +34,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/file/fscanf_variation9.phpt b/ext/standard/tests/file/fscanf_variation9.phpt
index f3551f08d2..609c3ef139 100644
--- a/ext/standard/tests/file/fscanf_variation9.phpt
+++ b/ext/standard/tests/file/fscanf_variation9.phpt
@@ -41,8 +41,8 @@ $integer_values = array (
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/general_functions/bug39322.phpt b/ext/standard/tests/general_functions/bug39322.phpt
index a9f83c75bf..da06e89847 100644
--- a/ext/standard/tests/general_functions/bug39322.phpt
+++ b/ext/standard/tests/general_functions/bug39322.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #39322 (proc_terminate() loosing process resource)
+Bug #39322 (proc_terminate() losing process resource)
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
diff --git a/ext/standard/tests/general_functions/getrusage_basic.phpt b/ext/standard/tests/general_functions/getrusage_basic.phpt
index c9b34597cf..0e5b42c420 100644
--- a/ext/standard/tests/general_functions/getrusage_basic.phpt
+++ b/ext/standard/tests/general_functions/getrusage_basic.phpt
@@ -18,7 +18,7 @@ echo "Simple testcase for getrusage() function\n";
$dat = getrusage();
if (!is_array($dat)) {
- echo "TEST FAILED : getrusage shoudl return an array\n";
+ echo "TEST FAILED : getrusage should return an array\n";
}
// echo the fields which are common to all platforms
diff --git a/ext/standard/tests/general_functions/intval.phpt b/ext/standard/tests/general_functions/intval.phpt
index 7986e2dd14..095d66e3f2 100644
--- a/ext/standard/tests/general_functions/intval.phpt
+++ b/ext/standard/tests/general_functions/intval.phpt
@@ -25,8 +25,8 @@ $valid_ints = array(
'0Xfff',
'0XFA',
-0x80000000, // max negative integer as hexadecimal
- '0x7fffffff', // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ '0x7fffffff', // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
'0123', // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/general_functions/is_int.phpt b/ext/standard/tests/general_functions/is_int.phpt
index 7cc3f3b2f5..3aed0c9f17 100644
--- a/ext/standard/tests/general_functions/is_int.phpt
+++ b/ext/standard/tests/general_functions/is_int.phpt
@@ -25,8 +25,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/general_functions/is_int_64bit.phpt b/ext/standard/tests/general_functions/is_int_64bit.phpt
index 9de376eb1c..6f7f5162cd 100644
--- a/ext/standard/tests/general_functions/is_int_64bit.phpt
+++ b/ext/standard/tests/general_functions/is_int_64bit.phpt
@@ -27,8 +27,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/general_functions/php_uname_error.phpt b/ext/standard/tests/general_functions/php_uname_error.phpt
index 5e221b75cc..ca4c3d4022 100644
--- a/ext/standard/tests/general_functions/php_uname_error.phpt
+++ b/ext/standard/tests/general_functions/php_uname_error.phpt
@@ -12,7 +12,7 @@ echo "\n-- Testing php_uname() function with more than expected no. of arguments
var_dump( php_uname('a', true) );
echo "\n-- Testing php_uname() function with invalid mode --\n";
-// am invalid mode shoudl result in same o/p as mode 'a'
+// am invalid mode should result in same o/p as mode 'a'
var_dump( php_uname('z') == php_uname('z') );
class barClass {
diff --git a/ext/standard/tests/general_functions/strval.phpt b/ext/standard/tests/general_functions/strval.phpt
index 372ac6701e..89f5c591e8 100644
--- a/ext/standard/tests/general_functions/strval.phpt
+++ b/ext/standard/tests/general_functions/strval.phpt
@@ -43,8 +43,8 @@ $scalars = array(
/* floats */
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/general_functions/var_export-locale.phpt b/ext/standard/tests/general_functions/var_export-locale.phpt
index b6f87c431c..b4d122e7b3 100644
--- a/ext/standard/tests/general_functions/var_export-locale.phpt
+++ b/ext/standard/tests/general_functions/var_export-locale.phpt
@@ -31,8 +31,8 @@ $valid_ints = array(
'0Xfff',
'0XFA',
-0x80000000, // max negative integer as hexadecimal
- '0x7fffffff', // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ '0x7fffffff', // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
'0123', // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/general_functions/var_export_basic1.phpt b/ext/standard/tests/general_functions/var_export_basic1.phpt
index 3a734c7fe0..8a23fe341b 100644
--- a/ext/standard/tests/general_functions/var_export_basic1.phpt
+++ b/ext/standard/tests/general_functions/var_export_basic1.phpt
@@ -23,8 +23,8 @@ $valid_ints = array(
"'0Xfff'" => '0Xfff',
"'0XFA'" => '0XFA',
"-0x80000000" => -0x80000000, // max negative integer as hexadecimal
- "'0x7fffffff'" => '0x7fffffff', // max postive integer as hexadecimal
- "0x7FFFFFFF" => 0x7FFFFFFF, // max postive integer as hexadecimal
+ "'0x7fffffff'" => '0x7fffffff', // max positive integer as hexadecimal
+ "0x7FFFFFFF" => 0x7FFFFFFF, // max positive integer as hexadecimal
"'0123'" => '0123', // integer as octal
"01912" => 01912, // should be quivalent to octal 1
"-020000000000" => -020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/image/test1bpix.bmp b/ext/standard/tests/image/test1bpix.bmp
index 5522e503d2..ddac2a0dda 100644
--- a/ext/standard/tests/image/test1bpix.bmp
+++ b/ext/standard/tests/image/test1bpix.bmp
Binary files differ
diff --git a/ext/standard/tests/serialize/precision.phpt b/ext/standard/tests/serialize/precision.phpt
index 142b2cecf8..229c514e69 100644
--- a/ext/standard/tests/serialize/precision.phpt
+++ b/ext/standard/tests/serialize/precision.phpt
@@ -15,8 +15,8 @@ $numbers = array(
"0100000000001000", //2^-1022. + 10^-Accuracy[2^-1022.]*1.01
"ffffffffffffef7f", //2^1024. (maximum normal double)
"feffffffffffef7f", //2^1024. - 10^-Accuracy[2^1024.]
- "0100000000000000", //minumum subnormal double
- "0200000000000000", //2nd minumum subnormal double
+ "0100000000000000", //minimum subnormal double
+ "0200000000000000", //2nd minimum subnormal double
"fffffffffffff000", //maximum subnormal double
"fefffffffffff000", //2nd maximum subnormal double
"0000000000000f7f", //+inf
diff --git a/ext/standard/tests/serialize/serialization_error_001.phpt b/ext/standard/tests/serialize/serialization_error_001.phpt
index da6f50cc02..014128b19f 100644
--- a/ext/standard/tests/serialize/serialization_error_001.phpt
+++ b/ext/standard/tests/serialize/serialization_error_001.phpt
@@ -21,7 +21,7 @@ var_dump( unserialize() );
//Test serialize with one more than the expected number of arguments
var_dump( serialize(1,2) );
-var_dump( unserialize(1,2) );
+var_dump( unserialize(1,2,3) );
echo "Done";
?>
@@ -31,12 +31,12 @@ echo "Done";
Warning: serialize() expects exactly 1 parameter, 0 given in %s on line 16
NULL
-Warning: unserialize() expects exactly 1 parameter, 0 given in %s on line 17
+Warning: unserialize() expects at least 1 parameter, 0 given in %s on line 17
bool(false)
Warning: serialize() expects exactly 1 parameter, 2 given in %s on line 20
NULL
-Warning: unserialize() expects exactly 1 parameter, 2 given in %s on line 21
+Warning: unserialize() expects at most 2 parameters, 3 given in %s on line 21
bool(false)
Done
diff --git a/ext/standard/tests/serialize/unserialize_classes.phpt b/ext/standard/tests/serialize/unserialize_classes.phpt
new file mode 100644
index 0000000000..2a9d8a743c
--- /dev/null
+++ b/ext/standard/tests/serialize/unserialize_classes.phpt
@@ -0,0 +1,88 @@
+--TEST--
+Test unserialize() with second parameter
+--FILE--
+<?php
+class foo {
+ public $x = "bar";
+}
+$z = array(new foo(), 2, "3");
+$s = serialize($z);
+
+var_dump(unserialize($s));
+var_dump(unserialize($s, ["allowed_classes" => false]));
+var_dump(unserialize($s, ["allowed_classes" => true]));
+var_dump(unserialize($s, ["allowed_classes" => ["bar"]]));
+var_dump(unserialize($s, ["allowed_classes" => ["FOO"]]));
+var_dump(unserialize($s, ["allowed_classes" => ["bar", "foO"]]));
+
+--EXPECTF--
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(__PHP_Incomplete_Class)#%d (2) {
+ ["__PHP_Incomplete_Class_Name"]=>
+ string(3) "foo"
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(__PHP_Incomplete_Class)#%d (2) {
+ ["__PHP_Incomplete_Class_Name"]=>
+ string(3) "foo"
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
diff --git a/ext/standard/tests/strings/addcslashes_005.phpt b/ext/standard/tests/strings/addcslashes_005.phpt
new file mode 100644
index 0000000000..f0b2fbcecb
--- /dev/null
+++ b/ext/standard/tests/strings/addcslashes_005.phpt
@@ -0,0 +1,12 @@
+--TEST--
+addcslashes(); function test with warning
+--CREDITS--
+ marcosptf - <marcosptf@yahoo.com.br>
+#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05
+--FILE--
+<?php
+echo addcslashes("zoo['.']","z..A");
+?>
+--EXPECTF--
+Warning: addcslashes(): Invalid '..'-range, '..'-range needs to be incrementing in %s on line %d
+\zoo['\.']
diff --git a/ext/standard/tests/strings/bin2hex_001.phpt b/ext/standard/tests/strings/bin2hex_001.phpt
new file mode 100644
index 0000000000..e73500a30e
--- /dev/null
+++ b/ext/standard/tests/strings/bin2hex_001.phpt
@@ -0,0 +1,11 @@
+--TEST--
+bin2hex(); function test
+--CREDITS--
+marcosptf - <marcosptf@yahoo.com.br>
+#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05
+--FILE--
+<?php
+echo bin2hex("123456");
+?>
+--EXPECT--
+313233343536
diff --git a/ext/standard/tests/strings/sprintf_variation10.phpt b/ext/standard/tests/strings/sprintf_variation10.phpt
index 702dc34c77..e989d9f8b8 100644
--- a/ext/standard/tests/strings/sprintf_variation10.phpt
+++ b/ext/standard/tests/strings/sprintf_variation10.phpt
@@ -23,8 +23,8 @@ $integer_values = array (
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation19.phpt b/ext/standard/tests/strings/sprintf_variation19.phpt
index ae7b910573..542ba52aa3 100644
--- a/ext/standard/tests/strings/sprintf_variation19.phpt
+++ b/ext/standard/tests/strings/sprintf_variation19.phpt
@@ -23,8 +23,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation21.phpt b/ext/standard/tests/strings/sprintf_variation21.phpt
index afedfcaf7c..cbbf16e066 100644
--- a/ext/standard/tests/strings/sprintf_variation21.phpt
+++ b/ext/standard/tests/strings/sprintf_variation21.phpt
Binary files differ
diff --git a/ext/standard/tests/strings/sprintf_variation28.phpt b/ext/standard/tests/strings/sprintf_variation28.phpt
index 8fad68b0d9..40af96f960 100644
--- a/ext/standard/tests/strings/sprintf_variation28.phpt
+++ b/ext/standard/tests/strings/sprintf_variation28.phpt
@@ -29,8 +29,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation28_64bit.phpt b/ext/standard/tests/strings/sprintf_variation28_64bit.phpt
index cd83093a74..92fdf78da1 100644
--- a/ext/standard/tests/strings/sprintf_variation28_64bit.phpt
+++ b/ext/standard/tests/strings/sprintf_variation28_64bit.phpt
@@ -25,8 +25,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation3.phpt b/ext/standard/tests/strings/sprintf_variation3.phpt
index 51a89ea08b..0435cf3d77 100644
--- a/ext/standard/tests/strings/sprintf_variation3.phpt
+++ b/ext/standard/tests/strings/sprintf_variation3.phpt
@@ -23,8 +23,8 @@ $valid_ints = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation34.phpt b/ext/standard/tests/strings/sprintf_variation34.phpt
index c6186b6780..8a5cd809d6 100644
--- a/ext/standard/tests/strings/sprintf_variation34.phpt
+++ b/ext/standard/tests/strings/sprintf_variation34.phpt
@@ -29,8 +29,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation34_64bit.phpt b/ext/standard/tests/strings/sprintf_variation34_64bit.phpt
index f9a7805f98..27e3f0c73e 100644
--- a/ext/standard/tests/strings/sprintf_variation34_64bit.phpt
+++ b/ext/standard/tests/strings/sprintf_variation34_64bit.phpt
@@ -25,8 +25,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation40.phpt b/ext/standard/tests/strings/sprintf_variation40.phpt
index 0da6a10b8a..6efcee0608 100644
--- a/ext/standard/tests/strings/sprintf_variation40.phpt
+++ b/ext/standard/tests/strings/sprintf_variation40.phpt
@@ -29,8 +29,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
index da6f37ace4..029e94c782 100644
--- a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
+++ b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
@@ -25,8 +25,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation46.phpt b/ext/standard/tests/strings/sprintf_variation46.phpt
index 36aef14dd8..311d8c192a 100644
--- a/ext/standard/tests/strings/sprintf_variation46.phpt
+++ b/ext/standard/tests/strings/sprintf_variation46.phpt
@@ -23,8 +23,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/str_pad.phpt b/ext/standard/tests/strings/str_pad.phpt
index 645d8ff385..0c0c2026cd 100644
--- a/ext/standard/tests/strings/str_pad.phpt
+++ b/ext/standard/tests/strings/str_pad.phpt
Binary files differ
diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt
index 73c193b6d7..795050a9a4 100644
--- a/ext/standard/tests/strings/str_repeat.phpt
+++ b/ext/standard/tests/strings/str_repeat.phpt
Binary files differ
diff --git a/ext/standard/tests/strings/strncasecmp_variation6.phpt b/ext/standard/tests/strings/strncasecmp_variation6.phpt
index 765032b773..56276e9554 100644
--- a/ext/standard/tests/strings/strncasecmp_variation6.phpt
+++ b/ext/standard/tests/strings/strncasecmp_variation6.phpt
@@ -13,11 +13,11 @@ echo "*** Test strncasecmp() function: with binary inputs ***\n";
/* A binary function should work with all 256 characters that a character(8-bit) can take */
echo "\n-- Checking with all 256 characters given, in binary format --\n";
-/* loop through to get all 256 character's equivelent binary value, and check working of strncasecmp() */
+/* loop through to get all 256 character's equivalent binary value, and check working of strncasecmp() */
$count = 1;
for($ASCII = 0; $ASCII <= 255; $ASCII++) {
$str1 = decbin($ASCII); //ASCII value in binary form
- $str2 = decbin( ord( chr($ASCII) ) ); //Getting equivelent ASCII value for the character in binary form
+ $str2 = decbin( ord( chr($ASCII) ) ); //Getting equivalent ASCII value for the character in binary form
echo "-- Iteration $count --\n";
var_dump( strncasecmp($str1, $str2, 8) ); //comparing all the 8-bits; expected: int(0)
var_dump( strncasecmp($str1, $str2, 4) ); //comparing only 4-bits; expected: int(0)
diff --git a/ext/standard/tests/strings/strncmp_variation6.phpt b/ext/standard/tests/strings/strncmp_variation6.phpt
index 7a79d29a51..b3b918920e 100644
--- a/ext/standard/tests/strings/strncmp_variation6.phpt
+++ b/ext/standard/tests/strings/strncmp_variation6.phpt
@@ -13,11 +13,11 @@ echo "*** Test strncmp() function: with binary inputs ***\n";
echo "\n-- Checking with all 256 characters given, in binary format --\n";
/* A binary function should work with all 256 characters that a character(8-bit) can take */
-/* loop through to get all 256 character's equivelent binary value, and check working of strncmp() */
+/* loop through to get all 256 character's equivalent binary value, and check working of strncmp() */
$count = 1;
for($ASCII = 0; $ASCII <= 255; $ASCII++) {
$str1 = decbin($ASCII); //ASCII value in binary form
- $str2 = decbin( ord( chr($ASCII) ) ); //Getting equivelent ASCII value for the character in binary form
+ $str2 = decbin( ord( chr($ASCII) ) ); //Getting equivalent ASCII value for the character in binary form
echo "-- Iteration $count --\n";
var_dump( strncmp($str1, $str2, 8) ); //comparing all the 8-bits; expected: int(0)
var_dump( strncmp($str1, $str2, 4) ); //comparing only 4-bits; expected: int(0)
diff --git a/ext/standard/tests/strings/unpack_bug68225.phpt b/ext/standard/tests/strings/unpack_bug68225.phpt
new file mode 100644
index 0000000000..7f8cdd4701
--- /dev/null
+++ b/ext/standard/tests/strings/unpack_bug68225.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #68225 unpack and X format code
+--FILE--
+<?php
+
+$data = pack('VV', 1, 2);
+
+$result = unpack('Va/X' ,$data);
+var_dump($result);
+
+$result = unpack('Va/X4' ,$data);
+var_dump($result);
+
+$result = unpack('V1a/X4/V1b/V1c/X4/V1d', $data);
+var_dump($result);
+
+?>
+===DONE===
+--EXPECTF--
+array(1) {
+ ["a"]=>
+ int(1)
+}
+array(1) {
+ ["a"]=>
+ int(1)
+}
+array(4) {
+ ["a"]=>
+ int(1)
+ ["b"]=>
+ int(1)
+ ["c"]=>
+ int(2)
+ ["d"]=>
+ int(2)
+}
+===DONE===
+
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 4f0bd24bdc..24bdd385a5 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -990,7 +990,7 @@ PHP_FUNCTION(serialize)
}
/* }}} */
-/* {{{ proto mixed unserialize(string variable_representation)
+/* {{{ proto mixed unserialize(string variable_representation[, bool|array allowed_classes])
Takes a string representation of variable and recreates it */
PHP_FUNCTION(unserialize)
{
@@ -998,8 +998,10 @@ PHP_FUNCTION(unserialize)
size_t buf_len;
const unsigned char *p;
php_unserialize_data_t var_hash;
+ zval *options = NULL, *classes = NULL;
+ HashTable *class_hash = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &buf, &buf_len, &options) == FAILURE) {
RETURN_FALSE;
}
@@ -1009,8 +1011,32 @@ PHP_FUNCTION(unserialize)
p = (const unsigned char*) buf;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) {
+ if(options != NULL) {
+ classes = zend_hash_str_find(Z_ARRVAL_P(options), "allowed_classes", sizeof("allowed_classes")-1);
+ if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes TSRMLS_CC))) {
+ ALLOC_HASHTABLE(class_hash);
+ zend_hash_init(class_hash, (Z_TYPE_P(classes) == IS_ARRAY)?zend_hash_num_elements(Z_ARRVAL_P(classes)):0, NULL, NULL, 0);
+ }
+ if(class_hash && Z_TYPE_P(classes) == IS_ARRAY) {
+ zval *entry;
+ zend_string *lcname;
+
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(classes), entry) {
+ convert_to_string_ex(entry);
+ lcname = zend_string_alloc(Z_STRLEN_P(entry), 0);
+ zend_str_tolower_copy(lcname->val, Z_STRVAL_P(entry), Z_STRLEN_P(entry));
+ zend_hash_add_empty_element(class_hash, lcname);
+ zend_string_release(lcname);
+ } ZEND_HASH_FOREACH_END();
+ }
+ }
+
+ if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash TSRMLS_CC)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
+ if(class_hash) {
+ zend_hash_destroy(class_hash);
+ FREE_HASHTABLE(class_hash);
+ }
zval_dtor(return_value);
if (!EG(exception)) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len);
@@ -1018,6 +1044,10 @@ PHP_FUNCTION(unserialize)
RETURN_FALSE;
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
+ if(class_hash) {
+ zend_hash_destroy(class_hash);
+ FREE_HASHTABLE(class_hash);
+ }
}
/* }}} */
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 9be2b0658a..d8b94e75cc 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.7.5 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -226,6 +226,26 @@ static zend_string *unserialize_str(const unsigned char **p, size_t len, size_t
return str;
}
+static inline int unserialize_allowed_class(zend_string *class_name, HashTable *classes)
+{
+ zend_string *lcname;
+ int res;
+ ALLOCA_FLAG(use_heap)
+
+ if(classes == NULL) {
+ return 1;
+ }
+ if(!zend_hash_num_elements(classes)) {
+ return 0;
+ }
+
+ STR_ALLOCA_ALLOC(lcname, class_name->len, use_heap);
+ zend_str_tolower_copy(lcname->val, class_name->val, class_name->len);
+ res = zend_hash_exists(classes, lcname);
+ STR_ALLOCA_FREE(lcname, use_heap);
+ return res;
+}
+
#define YYFILL(n) do { } while (0)
#define YYCTYPE unsigned char
#define YYCURSOR cursor
@@ -233,7 +253,7 @@ static zend_string *unserialize_str(const unsigned char **p, size_t len, size_t
#define YYMARKER marker
-#line 241 "ext/standard/var_unserializer.re"
+#line 261 "ext/standard/var_unserializer.re"
@@ -293,8 +313,8 @@ static inline size_t parse_uiv(const unsigned char *p)
return result;
}
-#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC
-#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC
+#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC
+#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes TSRMLS_CC
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
@@ -302,7 +322,8 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval key, *data, d, *old_data;
ZVAL_UNDEF(&key);
- if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) {
+
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
zval_dtor(&key);
return 0;
}
@@ -354,7 +375,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize(data, p, max, var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
return 0;
}
@@ -462,7 +483,14 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+{
+ HashTable *classes = NULL;
+ return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
+}
+
+
+PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
{
const unsigned char *cursor, *limit, *marker, *start;
zval *rval_ref;
@@ -481,7 +509,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
start = cursor;
-#line 485 "ext/standard/var_unserializer.c"
+#line 513 "ext/standard/var_unserializer.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -541,9 +569,9 @@ yy2:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
yy3:
-#line 826 "ext/standard/var_unserializer.re"
+#line 860 "ext/standard/var_unserializer.re"
{ return 0; }
-#line 547 "ext/standard/var_unserializer.c"
+#line 575 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -586,13 +614,13 @@ yy13:
goto yy3;
yy14:
++YYCURSOR;
-#line 820 "ext/standard/var_unserializer.re"
+#line 854 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
-#line 596 "ext/standard/var_unserializer.c"
+#line 624 "ext/standard/var_unserializer.c"
yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -618,11 +646,12 @@ yy20:
if (yybm[0+yych] & 128) {
goto yy20;
}
- if (yych != ':') goto yy18;
+ if (yych <= '/') goto yy18;
+ if (yych >= ';') goto yy18;
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 681 "ext/standard/var_unserializer.re"
+#line 709 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
zend_long elements;
@@ -672,6 +701,12 @@ yy20:
class_name = zend_string_init(str, len, 0);
do {
+ if(!unserialize_allowed_class(class_name, classes)) {
+ incomplete_class = 1;
+ ce = PHP_IC_ENTRY;
+ break;
+ }
+
/* Try to find class directly */
BG(serialize_lock)++;
ce = zend_lookup_class(class_name TSRMLS_CC);
@@ -761,7 +796,7 @@ yy20:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 765 "ext/standard/var_unserializer.c"
+#line 800 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -786,7 +821,7 @@ yy27:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 673 "ext/standard/var_unserializer.re"
+#line 701 "ext/standard/var_unserializer.re"
{
//??? INIT_PZVAL(rval);
@@ -794,7 +829,7 @@ yy27:
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 798 "ext/standard/var_unserializer.c"
+#line 833 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -815,7 +850,7 @@ yy34:
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
-#line 652 "ext/standard/var_unserializer.re"
+#line 680 "ext/standard/var_unserializer.re"
{
zend_long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -826,7 +861,7 @@ yy34:
}
array_init_size(rval, elements);
-//??? we can't convert from packed to hash during unserialization, becaue
+//??? we can't convert from packed to hash during unserialization, because
//??? reference to some zvals might be keept in var_hash (to support references)
zend_hash_real_init(Z_ARRVAL_P(rval), 0);
@@ -836,7 +871,7 @@ yy34:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 840 "ext/standard/var_unserializer.c"
+#line 875 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -857,7 +892,7 @@ yy41:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 624 "ext/standard/var_unserializer.re"
+#line 652 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
zend_string *str;
@@ -885,7 +920,7 @@ yy41:
ZVAL_STR(rval, str);
return 1;
}
-#line 889 "ext/standard/var_unserializer.c"
+#line 924 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -906,7 +941,7 @@ yy48:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 597 "ext/standard/var_unserializer.re"
+#line 625 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -933,7 +968,7 @@ yy48:
ZVAL_STRINGL(rval, str, len);
return 1;
}
-#line 937 "ext/standard/var_unserializer.c"
+#line 972 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -1021,7 +1056,7 @@ yy61:
}
yy63:
++YYCURSOR;
-#line 588 "ext/standard/var_unserializer.re"
+#line 616 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_LONG == 4
use_double:
@@ -1030,7 +1065,7 @@ use_double:
ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 1034 "ext/standard/var_unserializer.c"
+#line 1069 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1089,7 +1124,7 @@ yy73:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 572 "ext/standard/var_unserializer.re"
+#line 600 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
@@ -1105,7 +1140,7 @@ yy73:
return 1;
}
-#line 1109 "ext/standard/var_unserializer.c"
+#line 1144 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1132,7 +1167,7 @@ yy79:
if (yych <= '9') goto yy79;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 546 "ext/standard/var_unserializer.re"
+#line 574 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_LONG == 4
int digits = YYCURSOR - start - 3;
@@ -1158,7 +1193,7 @@ yy79:
ZVAL_LONG(rval, parse_iv(start + 2));
return 1;
}
-#line 1162 "ext/standard/var_unserializer.c"
+#line 1197 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
@@ -1166,22 +1201,22 @@ yy83:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 540 "ext/standard/var_unserializer.re"
+#line 568 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
ZVAL_BOOL(rval, parse_iv(start + 2));
return 1;
}
-#line 1176 "ext/standard/var_unserializer.c"
+#line 1211 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
-#line 534 "ext/standard/var_unserializer.re"
+#line 562 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
ZVAL_NULL(rval);
return 1;
}
-#line 1185 "ext/standard/var_unserializer.c"
+#line 1220 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1204,7 +1239,7 @@ yy91:
if (yych <= '9') goto yy91;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 511 "ext/standard/var_unserializer.re"
+#line 539 "ext/standard/var_unserializer.re"
{
zend_long id;
@@ -1227,7 +1262,7 @@ yy91:
return 1;
}
-#line 1231 "ext/standard/var_unserializer.c"
+#line 1266 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1250,7 +1285,7 @@ yy97:
if (yych <= '9') goto yy97;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 489 "ext/standard/var_unserializer.re"
+#line 517 "ext/standard/var_unserializer.re"
{
zend_long id;
@@ -1272,9 +1307,9 @@ yy97:
return 1;
}
-#line 1276 "ext/standard/var_unserializer.c"
+#line 1311 "ext/standard/var_unserializer.c"
}
-#line 828 "ext/standard/var_unserializer.re"
+#line 862 "ext/standard/var_unserializer.re"
return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 1898c7734c..7e0dc314d6 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -224,6 +224,26 @@ static zend_string *unserialize_str(const unsigned char **p, size_t len, size_t
return str;
}
+static inline int unserialize_allowed_class(zend_string *class_name, HashTable *classes)
+{
+ zend_string *lcname;
+ int res;
+ ALLOCA_FLAG(use_heap)
+
+ if(classes == NULL) {
+ return 1;
+ }
+ if(!zend_hash_num_elements(classes)) {
+ return 0;
+ }
+
+ STR_ALLOCA_ALLOC(lcname, class_name->len, use_heap);
+ zend_str_tolower_copy(lcname->val, class_name->val, class_name->len);
+ res = zend_hash_exists(classes, lcname);
+ STR_ALLOCA_FREE(lcname, use_heap);
+ return res;
+}
+
#define YYFILL(n) do { } while (0)
#define YYCTYPE unsigned char
#define YYCURSOR cursor
@@ -297,8 +317,8 @@ static inline size_t parse_uiv(const unsigned char *p)
return result;
}
-#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC
-#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC
+#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC
+#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes TSRMLS_CC
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
@@ -306,7 +326,8 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval key, *data, d, *old_data;
ZVAL_UNDEF(&key);
- if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) {
+
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
zval_dtor(&key);
return 0;
}
@@ -358,7 +379,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize(data, p, max, var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
return 0;
}
@@ -466,7 +487,14 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+{
+ HashTable *classes = NULL;
+ return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
+}
+
+
+PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
{
const unsigned char *cursor, *limit, *marker, *start;
zval *rval_ref;
@@ -659,7 +687,7 @@ use_double:
}
array_init_size(rval, elements);
-//??? we can't convert from packed to hash during unserialization, becaue
+//??? we can't convert from packed to hash during unserialization, because
//??? reference to some zvals might be keept in var_hash (to support references)
zend_hash_real_init(Z_ARRVAL_P(rval), 0);
@@ -727,6 +755,12 @@ object ":" uiv ":" ["] {
class_name = zend_string_init(str, len, 0);
do {
+ if(!unserialize_allowed_class(class_name, classes)) {
+ incomplete_class = 1;
+ ce = PHP_IC_ENTRY;
+ break;
+ }
+
/* Try to find class directly */
BG(serialize_lock)++;
ce = zend_lookup_class(class_name TSRMLS_CC);
diff --git a/ext/tokenizer/tests/token_get_all_variation17.phpt b/ext/tokenizer/tests/token_get_all_variation17.phpt
index f71444bc1e..d34508a8d5 100644
--- a/ext/tokenizer/tests/token_get_all_variation17.phpt
+++ b/ext/tokenizer/tests/token_get_all_variation17.phpt
@@ -22,7 +22,7 @@ $source = '<?php
function inverse($x)
{
if($x == 0) {
- throw new Exception("Divison by zero");
+ throw new Exception("Division by zero");
else
return 1/$x;
}
@@ -244,7 +244,7 @@ array(81) {
[0]=>
int(%d)
[1]=>
- string(17) ""Divison by zero""
+ string(18) ""Division by zero""
[2]=>
int(5)
}
diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index 5c47109ee3..edbd013342 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -61,7 +61,7 @@ void php_wddx_packet_start(wddx_packet *packet, char *comment, size_t comment
void php_wddx_packet_end(wddx_packet *packet);
void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TSRMLS_DC);
-int php_wddx_deserialize_ex(char *, int, zval *return_value);
+int php_wddx_deserialize_ex(const char *, size_t, zval *return_value);
#define php_wddx_gather(packet) estrndup(packet->c, packet->len)
#endif /* PHP_WDDX_API_H */
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 705babd885..43deb15afd 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -1046,7 +1046,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
/* {{{ php_wddx_deserialize_ex
*/
-int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value)
+int php_wddx_deserialize_ex(const char *value, size_t vallen, zval *return_value)
{
wddx_stack stack;
XML_Parser parser;
@@ -1060,7 +1060,8 @@ int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value)
XML_SetElementHandler(parser, php_wddx_push_element, php_wddx_pop_element);
XML_SetCharacterDataHandler(parser, php_wddx_process_data);
- XML_Parse(parser, value, vallen, 1);
+ /* XXX value should be parsed in the loop to exhaust size_t */
+ XML_Parse(parser, value, (int)vallen, 1);
XML_ParserFree(parser);
diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.c b/ext/xmlrpc/libxmlrpc/xml_to_soap.c
index ac103e0616..61f9834e9d 100644
--- a/ext/xmlrpc/libxmlrpc/xml_to_soap.c
+++ b/ext/xmlrpc/libxmlrpc/xml_to_soap.c
@@ -243,7 +243,7 @@ XMLRPC_VALUE xml_element_to_SOAP_REQUEST_worker(XMLRPC_REQUEST request,
xCurrent = XMLRPC_CreateValueEmpty();
}
- /* increment recursion depth guage */
+ /* increment recursion depth gauge */
depth ++;
/* safety first. must have a valid element */
diff --git a/ext/xmlwriter/tests/011.phpt b/ext/xmlwriter/tests/011.phpt
new file mode 100644
index 0000000000..51861673a1
--- /dev/null
+++ b/ext/xmlwriter/tests/011.phpt
@@ -0,0 +1,35 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, write_attribute_ns function
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = xmlwriter_open_memory();
+xmlwriter_set_indent($xw, TRUE);
+xmlwriter_set_indent_string($xw, ' ');
+xmlwriter_start_document($xw, '1.0', "UTF-8");
+xmlwriter_start_element($xw, 'root');
+xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1');
+xmlwriter_write_attribute_ns($xw, 'ns1','att1', 'urn:ns1', '<>"\'&');
+xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&");
+xmlwriter_end_element($xw);
+xmlwriter_end_document($xw);
+// Force to write and empty the buffer
+$output = xmlwriter_flush($xw, true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+</root>
diff --git a/ext/xmlwriter/tests/012.phpt b/ext/xmlwriter/tests/012.phpt
new file mode 100644
index 0000000000..b6a4ad8c56
--- /dev/null
+++ b/ext/xmlwriter/tests/012.phpt
@@ -0,0 +1,38 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, full_end_element function
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = xmlwriter_open_memory();
+xmlwriter_set_indent($xw, TRUE);
+xmlwriter_set_indent_string($xw, ' ');
+xmlwriter_start_document($xw, '1.0', "UTF-8");
+xmlwriter_start_element($xw, 'root');
+xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1');
+xmlwriter_write_attribute_ns($xw, 'ns1','att1', 'urn:ns1', '<>"\'&');
+xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&");
+xmlwriter_end_element($xw);
+xmlwriter_start_element($xw, 'empty');
+xmlwriter_full_end_element($xw);
+xmlwriter_full_end_element($xw);
+// Force to write and empty the buffer
+$output = xmlwriter_flush($xw, true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+ <empty></empty>
+</root>
diff --git a/ext/xmlwriter/tests/OO_010.phpt b/ext/xmlwriter/tests/OO_010.phpt
new file mode 100644
index 0000000000..d4444bafe8
--- /dev/null
+++ b/ext/xmlwriter/tests/OO_010.phpt
@@ -0,0 +1,36 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, writeAttributeNS method
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = new XMLWriter();
+$xw->openMemory();
+$xw->setIndent(TRUE);
+$xw->setIndentString(' ');
+$xw->startDocument('1.0', "UTF-8");
+$xw->startElement('root');
+$xw->startElementNS('ns1', 'child1', 'urn:ns1');
+$xw->writeAttributeNS('ns1', 'att1', 'urn:ns1', '<>"\'&');
+$xw->writeElement('chars', "special characters: <>\"'&");
+$xw->endElement();
+$xw->endDocument();
+// Force to write and empty the buffer
+$output = $xw->flush(true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+</root>
diff --git a/ext/xmlwriter/tests/OO_011.phpt b/ext/xmlwriter/tests/OO_011.phpt
new file mode 100644
index 0000000000..0407e1b05f
--- /dev/null
+++ b/ext/xmlwriter/tests/OO_011.phpt
@@ -0,0 +1,39 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, fullEndElement method
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = new XMLWriter();
+$xw->openMemory();
+$xw->setIndent(TRUE);
+$xw->setIndentString(' ');
+$xw->startDocument('1.0', "UTF-8");
+$xw->startElement('root');
+$xw->startElementNS('ns1', 'child1', 'urn:ns1');
+$xw->writeAttributeNS('ns1', 'att1', 'urn:ns1', '<>"\'&');
+$xw->writeElement('chars', "special characters: <>\"'&");
+$xw->endElement();
+$xw->startElement('empty');
+$xw->fullEndElement();
+$xw->fullEndElement();
+// Force to write and empty the buffer
+$output = $xw->flush(true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+ <empty></empty>
+</root>
diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt
new file mode 100644
index 0000000000..2267129307
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Test the basics to function XSLTProcessor::hasExsltSupport().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$proc = new XSLTProcessor();
+var_dump($proc->hasExsltSupport());
+?>
+--EXPECTF--
+bool(true) \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt
new file mode 100644
index 0000000000..d8b8fa846d
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Test the basics to function XSLTProcessor::hasExsltSupport() when the xsl extension os not available.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php (!extension_loaded('xsl')) or die('skip xsl extension is available'); ?>
+--FILE--
+<?php
+$proc = new XSLTProcessor();
+var_dump($proc->hasExsltSupport());
+?>
+--EXPECTF--
+Fatal error: Class 'XSLTProcessor' not found in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt
new file mode 100644
index 0000000000..107157fa28
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Check XSLTProcessor::hasExsltSupport() with 1 parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$proc = new XSLTProcessor();
+var_dump($proc->hasExsltSupport('stringValue'));
+?>
+--EXPECTF--
+bool(true) \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc.phpt
new file mode 100644
index 0000000000..ff4be47e3f
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc.phpt
@@ -0,0 +1,51 @@
+--TEST--
+Test the basics to function XSLTProcessor::transformToDoc().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>royopa</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+var_dump($proc->transformToDoc($xmldoc)->firstChild->tagName);
+?>
+--EXPECT--
+string(4) "html" \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt
new file mode 100644
index 0000000000..735fd72958
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with null parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToDoc(null);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, null given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt
new file mode 100644
index 0000000000..1460de39a4
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with array parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = array();
+
+echo $proc->transformToDoc($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, array given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt
new file mode 100644
index 0000000000..2c6c99ae25
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with 4 parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToDoc($xmldoc, 'string', 98, true);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects at most 2 parameters, 4 given in %s on line %i
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt
new file mode 100644
index 0000000000..19fc3e44ef
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with string parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = 'stringValue';
+
+echo $proc->transformToDoc($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, string given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt
new file mode 100644
index 0000000000..8df84b7cbe
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with boolean parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = true;
+
+echo $proc->transformToDoc($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, boolean given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI.phpt b/ext/xsl/tests/xsltprocessor_transformToURI.phpt
new file mode 100644
index 0000000000..27ed4e2975
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Test the basics to function XSLTProcessor::transformToURI().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+var_dump($proc->transformToURI($xsldoc, 'php://output'));
+?>
+--EXPECTF--
+int(56) \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt
new file mode 100644
index 0000000000..69afeaf7be
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with null parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToURI(null, null);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, null given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt
new file mode 100644
index 0000000000..64b98ce7e5
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with array parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = array();
+$uri = 'php://output';
+
+echo $proc->transformToURI($wrong_parameter, $uri);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, array given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt
new file mode 100644
index 0000000000..7f497ba2b8
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with string parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = 'stringValue';
+$uri = 'php://output';
+
+echo $proc->transformToURI($wrong_parameter, $uri);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, string given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt
new file mode 100644
index 0000000000..c7742422fd
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with boolean parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = false;
+$uri = 'php://output';
+
+echo $proc->transformToURI($wrong_parameter, $uri);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, boolean given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt
new file mode 100644
index 0000000000..c1de1d93c3
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with 3 parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$uri = 'php://output';
+
+echo $proc->transformToURI($xsldoc, $uri, 'stringValue');
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects exactly 2 parameters, 3 given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML.phpt b/ext/xsl/tests/xsltprocessor_transformToXML.phpt
new file mode 100644
index 0000000000..c70200d102
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML.phpt
@@ -0,0 +1,61 @@
+--TEST--
+Test the basics to function XSLTProcessor::transformToXml().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+var_dump($proc->transformToXML($xmldoc));
+?>
+--EXPECT--
+string(135) "<html xmlns:php="http://php.net/xsl"><body>
+<h2>Users</h2>
+<table>
+<tr><td>Bob</td></tr>
+<tr><td>Joe</td></tr>
+</table>
+</body></html>
+" \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt
new file mode 100644
index 0000000000..a7689df078
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToXml() with null parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToXML(null);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, null given in %s on line %i
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt
new file mode 100644
index 0000000000..32e1a8095b
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with array parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = array();
+echo $proc->transformToXML($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, array given in %s on line %d \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt
new file mode 100644
index 0000000000..69b9305e13
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with 3 parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToXML($xmldoc, 'string', 98);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects exactly 1 parameter, 3 given in %s on line %i
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt
new file mode 100644
index 0000000000..05cb7ebd9e
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with string parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = 'stringValue';
+echo $proc->transformToXML($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, string given in %s on line %d \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt
new file mode 100644
index 0000000000..87db6e14d6
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with boolean parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = true;
+echo $proc->transformToXML($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, boolean given in %s on line %d \ No newline at end of file
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 4accc22e30..b50e240656 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -556,7 +556,7 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
- /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that
+ /* we need to do this every time since GLOB_ONLYDIR does not guarantee that
* all directories will be filtered. GNU libc documentation states the
* following:
* If the information about the type of the file is easily available
diff --git a/ext/zlib/tests/bug_52944-darwin.phpt b/ext/zlib/tests/bug_52944-darwin.phpt
deleted file mode 100644
index c25babadf5..0000000000
--- a/ext/zlib/tests/bug_52944-darwin.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Bug #52944 (segfault with zlib filter and corrupted data)
---SKIPIF--
-<?php if (!extension_loaded("zlib")) print "skip"; ?>
-<?php
-if (PHP_OS != 'Darwin') {
- die("skip Darwin only");
-}
---INI--
-allow_url_fopen=1
---FILE--
-<?php
-require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
-
-$fp = fopen('data://text/plain;base64,' . $data, 'r');
-stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
-var_dump(fread($fp,1));
-var_dump(fread($fp,1));
-fclose($fp);
-echo "Done.\n";
---EXPECT--
-string(1) "%"
-string(1) "C"
-Done.
diff --git a/ext/zlib/tests/bug_52944.phpt b/ext/zlib/tests/bug_52944.phpt
index ff82d29cc7..68bd53791d 100644
--- a/ext/zlib/tests/bug_52944.phpt
+++ b/ext/zlib/tests/bug_52944.phpt
@@ -2,10 +2,6 @@
Bug #52944 (segfault with zlib filter and corrupted data)
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
-<?php
-if (PHP_OS == 'Darwin') {
- die("skip not for Darwin");
-}
--INI--
allow_url_fopen=1
--FILE--
diff --git a/ext/zlib/tests/gzfile_variation4.phpt b/ext/zlib/tests/gzfile_variation4.phpt
index 3310231566..9b3128125a 100644
--- a/ext/zlib/tests/gzfile_variation4.phpt
+++ b/ext/zlib/tests/gzfile_variation4.phpt
@@ -2,7 +2,7 @@
Test function gzfile() by substituting argument 1 with float values.
--SKIPIF--
<?php
-if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build');
+if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
?>
--FILE--
<?php
diff --git a/ext/zlib/tests/readgzfile_variation4.phpt b/ext/zlib/tests/readgzfile_variation4.phpt
index 00211f7dfe..32f434cba2 100644
--- a/ext/zlib/tests/readgzfile_variation4.phpt
+++ b/ext/zlib/tests/readgzfile_variation4.phpt
@@ -2,7 +2,7 @@
Test function readgzfile() by substituting argument 1 with float values.
--SKIPIF--
<?php
-if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build');
+if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
?>
--FILE--
<?php
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 000b96ad8e..c3548eae53 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -34,6 +34,18 @@
#include "ext/standard/php_string.h"
#include "php_zlib.h"
+/*
+ * zlib include files can define the following preprocessor defines which rename
+ * the corresponding PHP functions to gzopen64, gzseek64 and gztell64 and thereby
+ * breaking some software, most notably PEAR's Archive_Tar, which halts execution
+ * without error message on gzip compressed archivesa.
+ *
+ * This only seems to happen on 32bit systems with large file support.
+ */
+#undef gzopen
+#undef gzseek
+#undef gztell
+
ZEND_DECLARE_MODULE_GLOBALS(zlib);
/* {{{ Memory management wrappers */
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
index 45ef2a8f7d..2f0d1f7706 100644
--- a/ext/zlib/zlib_filter.c
+++ b/ext/zlib/zlib_filter.c
@@ -386,7 +386,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), "level", sizeof("level") - 1))) {
ZVAL_COPY_VALUE(&tmp, tmpzval);
- /* Psuedo pass through to catch level validating code */
+ /* Pseudo pass through to catch level validating code */
goto factory_setlevel;
}
break;
diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt
index 0c46a88831..59ff3c4f4c 100644
--- a/ext/zlib/zlib_win32_howto.txt
+++ b/ext/zlib/zlib_win32_howto.txt
@@ -1,7 +1,7 @@
Rules for building ZLIB
-----------------------
-The zlib project requires the folowing files:
+The zlib project requires the following files:
php_build\zlib\include\zlib.h
php_build\zlib\include\zconf.h
diff --git a/main/main.c b/main/main.c
index 828831545e..41e84a79f7 100644
--- a/main/main.c
+++ b/main/main.c
@@ -130,7 +130,7 @@ PHPAPI int core_globals_id;
#ifdef PHP_WIN32
#include "win32_internal_function_disabled.h"
-static php_win32_disable_functions(TSRMLS_D)
+static int php_win32_disable_functions(TSRMLS_D)
{
int i;
@@ -2278,7 +2278,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
/* load and startup extensions compiled as shared objects (aka DLLs)
as requested by php.ini entries
- theese are loaded after initialization of internal extensions
+ these are loaded after initialization of internal extensions
as extensions *might* rely on things from ext/standard
which is always an internal extension and to be initialized
ahead of all other internals
diff --git a/main/network.c b/main/network.c
index 9fd1285493..f44cad29a5 100644
--- a/main/network.c
+++ b/main/network.c
@@ -1126,17 +1126,19 @@ PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short p
PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block TSRMLS_DC)
{
int ret = SUCCESS;
- int flags;
- int myflag = 0;
#ifdef PHP_WIN32
+ u_long flags;
+
/* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
flags = !block;
if (ioctlsocket(socketd, FIONBIO, &flags) == SOCKET_ERROR) {
ret = FAILURE;
}
#else
- flags = fcntl(socketd, F_GETFL);
+ int myflag = 0;
+ int flags = fcntl(socketd, F_GETFL);
+
#ifdef O_NONBLOCK
myflag = O_NONBLOCK; /* POSIX version */
#elif defined(O_NDELAY)
diff --git a/main/snprintf.c b/main/snprintf.c
index 826880f62a..0b9182b614 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -1241,7 +1241,7 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, va_
PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */
{
- unsigned int cc;
+ int cc;
va_list ap;
va_start(ap, format);
@@ -1257,7 +1257,7 @@ PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{
PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */
{
- unsigned int cc;
+ int cc;
strx_printv(&cc, buf, len, format, ap);
if (cc >= len) {
diff --git a/main/snprintf.h b/main/snprintf.h
index 789ab7d41a..115a15aa58 100644
--- a/main/snprintf.h
+++ b/main/snprintf.h
@@ -31,7 +31,7 @@ sprintf offers the ability to make a lot of failures since it does not know
snprintf knows the buffers size and will not write behind it. But you will
have to use either a static buffer or allocate a dynamic buffer
- before beeing able to call the function. In other words you must
+ before being able to call the function. In other words you must
be sure that you really know the maximum size of the buffer required.
A bad thing is having a big maximum while in most cases you would
only need a small buffer. If the size of the resulting string is
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 1aa01f270d..8590647818 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -1399,7 +1399,7 @@ static php_stream_wrapper_ops php_plain_files_wrapper_ops = {
php_plain_files_metadata
};
-php_stream_wrapper php_plain_files_wrapper = {
+PHPAPI php_stream_wrapper php_plain_files_wrapper = {
&php_plain_files_wrapper_ops,
NULL,
0
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 13af362681..c6420dc0d0 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1066,7 +1066,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con
* searched for the delimiter.
* The left part of the delimiter may still remain in the buffer,
* so subtract up to <delim_len - 1> from buffered_len, which is
- * the ammount of data we skip on this search as an optimization
+ * the amount of data we skip on this search as an optimization
*/
found_delim = _php_stream_search_delim(
stream, maxlen,
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 746d9c93d9..7427a794b4 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -233,10 +233,11 @@ static int php_sockop_flush(php_stream *stream TSRMLS_DC)
static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
{
- php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
#if ZEND_WIN32
return 0;
#else
+ php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
+
return zend_fstat(sock->socket, &ssb->sb);
#endif
}
diff --git a/php.ini-development b/php.ini-development
index 61519f05aa..c619678878 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -289,20 +289,17 @@ serialize_precision = 17
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
-; or per-virtualhost web server configuration file. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =
; This directive allows you to disable certain functions for security reasons.
-; It receives a comma-delimited list of function names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions =
; This directive allows you to disable certain classes for security reasons.
-; It receives a comma-delimited list of class names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of class names.
; http://php.net/disable-classes
disable_classes =
@@ -607,13 +604,13 @@ html_errors = On
; http://php.net/variables-order
variables_order = "GPCS"
-; This directive determines which super global data (G,P,C,E & S) should
-; be registered into the super global array REQUEST. If so, it also determines
-; the order in which that data is registered. The values for this directive are
-; specified in the same manner as the variables_order directive, EXCEPT one.
-; Leaving this value empty will cause PHP to use the value set in the
-; variables_order directive. It does not mean it will leave the super globals
-; array REQUEST empty.
+; This directive determines which super global data (G,P & C) should be
+; registered into the super global array REQUEST. If so, it also determines
+; the order in which that data is registered. The values for this directive
+; are specified in the same manner as the variables_order directive,
+; EXCEPT one. Leaving this value empty will cause PHP to use the value set
+; in the variables_order directive. It does not mean it will leave the super
+; globals array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
@@ -674,7 +671,7 @@ auto_append_file =
; http://php.net/default-mimetype
default_mimetype = "text/html"
-; PHP's default character set is set to UTF-8
+; PHP's default character set is set to UTF-8.
; http://php.net/default-charset
default_charset = "UTF-8"
@@ -753,7 +750,7 @@ enable_dl = Off
; will look for to know it is OK to continue execution. Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
; http://php.net/cgi.redirect-status-env
-;cgi.redirect_status_env =
+;cgi.redirect_status_env =
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
@@ -1024,7 +1021,7 @@ smtp_port = 25
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
-; the 5th parameter to mail(), even in safe mode.
+; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
diff --git a/php.ini-production b/php.ini-production
index a455b825b5..1310f6c1c6 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -289,20 +289,17 @@ serialize_precision = 17
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
-; or per-virtualhost web server configuration file. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =
; This directive allows you to disable certain functions for security reasons.
-; It receives a comma-delimited list of function names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions =
; This directive allows you to disable certain classes for security reasons.
-; It receives a comma-delimited list of class names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of class names.
; http://php.net/disable-classes
disable_classes =
@@ -607,13 +604,13 @@ html_errors = On
; http://php.net/variables-order
variables_order = "GPCS"
-; This directive determines which super global data (G,P,C,E & S) should
-; be registered into the super global array REQUEST. If so, it also determines
-; the order in which that data is registered. The values for this directive are
-; specified in the same manner as the variables_order directive, EXCEPT one.
-; Leaving this value empty will cause PHP to use the value set in the
-; variables_order directive. It does not mean it will leave the super globals
-; array REQUEST empty.
+; This directive determines which super global data (G,P & C) should be
+; registered into the super global array REQUEST. If so, it also determines
+; the order in which that data is registered. The values for this directive
+; are specified in the same manner as the variables_order directive,
+; EXCEPT one. Leaving this value empty will cause PHP to use the value set
+; in the variables_order directive. It does not mean it will leave the super
+; globals array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
@@ -674,7 +671,7 @@ auto_append_file =
; http://php.net/default-mimetype
default_mimetype = "text/html"
-; PHP's default character set is set to empty.
+; PHP's default character set is set to UTF-8.
; http://php.net/default-charset
default_charset = "UTF-8"
@@ -684,10 +681,12 @@ default_charset = "UTF-8"
;internal_encoding =
; PHP input character encoding is set to empty.
+; If empty, default_charset is used.
; http://php.net/input-encoding
;input_encoding =
; PHP output character encoding is set to empty.
+; If empty, default_charset is used.
; mbstring or iconv output handler is used.
; See also output_buffer.
; http://php.net/output-encoding
@@ -1022,7 +1021,7 @@ smtp_port = 25
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
-; the 5th parameter to mail(), even in safe mode.
+; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
diff --git a/run-tests.php b/run-tests.php
index 17930b29bc..e2d0f9987f 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -342,7 +342,7 @@ function save_or_mail_results()
if ($just_save_results || TRAVIS_CI || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
/*
* Collect information about the host system for our report
- * Fetch phpinfo() output so that we can see the PHP enviroment
+ * Fetch phpinfo() output so that we can see the PHP environment
* Make an archive of all the failed tests
* Send an email
*/
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index d9ae4d97ea..f32c881e05 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -388,8 +388,12 @@ PHP_MINFO_FUNCTION(apache)
}
smart_str_appendc(&tmp1, ' ');
}
- if (tmp1.s && (tmp1.s->len - 1) >= 0) {
- tmp1.s->val[tmp1.s->len - 1] = '\0';
+ if (tmp1.s) {
+ if (tmp1.s->len > 0) {
+ tmp1.s->val[tmp1.s->len - 1] = '\0';
+ } else {
+ tmp1.s->val[0] = '\0';
+ }
}
php_info_print_table_start();
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index f06787543e..2d67321773 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2280,7 +2280,7 @@ consult the installation file that came with this distribution, or visit \n\
/* all remaining arguments are part of the query string
* this section of code concatenates all remaining arguments
- * into a single string, seperating args with a &
+ * into a single string, separating args with a &
* this allows command lines like:
*
* test.php v1=test v2=hello+world!
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index 0cd3096e4d..7925f87562 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -435,7 +435,11 @@ int fcgi_init(void)
str = getenv("_FCGI_SHUTDOWN_EVENT_");
if (str != NULL) {
- HANDLE shutdown_event = (HANDLE) atoi(str);
+ zend_long ev;
+ HANDLE shutdown_event;
+
+ ZEND_ATOL(ev, str);
+ shutdown_event = (HANDLE) ev;
if (!CreateThread(NULL, 0, fcgi_shutdown_thread,
shutdown_event, 0, NULL)) {
return -1;
@@ -443,7 +447,9 @@ int fcgi_init(void)
}
str = getenv("_FCGI_MUTEX_");
if (str != NULL) {
- fcgi_accept_mutex = (HANDLE) atoi(str);
+ zend_long mt;
+ ZEND_ATOL(mt, str);
+ fcgi_accept_mutex = (HANDLE) mt;
}
return is_fastcgi = 1;
} else {
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 19a94218ff..49680cede4 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -259,7 +259,9 @@ static php_cli_server_http_response_status_code_pair template_map[] = {
{ 501, "<h1>%s</h1><p>Request method not supported.</p>" }
};
+#if HAVE_UNISTD_H
static int php_cli_output_is_tty = OUTPUT_NOT_CHECKED;
+#endif
static size_t php_cli_server_client_send_through(php_cli_server_client *client, const char *str, size_t str_len);
static php_cli_server_chunk *php_cli_server_chunk_heap_new_self_contained(size_t len);
@@ -556,7 +558,7 @@ static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */
return;
}
- if (client->sock < 0) {
+ if (!ZEND_VALID_SOCKET(client->sock)) {
php_handle_aborted_connection();
return;
}
@@ -838,7 +840,6 @@ static int php_cli_server_poller_iter_on_active(php_cli_server_poller *poller, v
SOCKET fd;
int events;
} entries[FD_SETSIZE * 2];
- php_socket_t fd = 0;
size_t i;
struct socket_entry *n = entries, *m;
@@ -1338,7 +1339,7 @@ out:
php_network_freeaddresses(sal);
}
if (err) {
- if (retval >= 0) {
+ if (ZEND_VALID_SOCKET(retval)) {
closesocket(retval);
}
if (errstr) {
@@ -2186,7 +2187,7 @@ static void php_cli_server_dtor(php_cli_server *server TSRMLS_DC) /* {{{ */
{
zend_hash_destroy(&server->clients);
zend_hash_destroy(&server->extension_mime_types);
- if (server->server_sock >= 0) {
+ if (ZEND_VALID_SOCKET(server->server_sock)) {
closesocket(server->server_sock);
}
if (server->host) {
@@ -2407,7 +2408,7 @@ static int php_cli_server_do_event_for_each_fd_callback(void *_params, php_socke
return FAILURE;
}
client_sock = accept(server->server_sock, sa, &socklen);
- if (client_sock < 0) {
+ if (!ZEND_VALID_SOCKET(client_sock)) {
char *errstr;
errstr = php_socket_strerror(php_socket_errno(), NULL, 0);
php_cli_server_logf("Failed to accept a client (reason: %s)" TSRMLS_CC, errstr);
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index cc649af79a..31ae4167d1 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -1378,7 +1378,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
/* Here we call the headers_complete callback. This is somewhat
* different than other callbacks because if the user returns 1, we
* will interpret that as saying that this message has no body. This
- * is needed for the annoying case of recieving a response to a HEAD
+ * is needed for the annoying case of receiving a response to a HEAD
* request.
*/
if (settings->on_headers_complete) {
diff --git a/sapi/cli/ps_title.c b/sapi/cli/ps_title.c
index 97eec86e5b..6cef483983 100644
--- a/sapi/cli/ps_title.c
+++ b/sapi/cli/ps_title.c
@@ -129,7 +129,9 @@ static char** save_argv;
* This holds the 'locally' allocated environ from the save_ps_args method.
* This is subsequently free'd at exit.
*/
+#if defined(PS_USE_CLOBBER_ARGV)
static char** frozen_environ, **new_environ;
+#endif
/*
* Call this method early, before any code has used the original argv passed in
@@ -311,7 +313,7 @@ const char* ps_title_errno(int rc)
#ifdef PS_USE_WIN32
case PS_TITLE_WINDOWS_ERROR:
- sprintf(windows_error_details, "Windows error code: %u", GetLastError());
+ sprintf(windows_error_details, "Windows error code: %lu", GetLastError());
return windows_error_details;
#endif
}
diff --git a/sapi/cli/tests/bug64529.phpt b/sapi/cli/tests/bug64529.phpt
index d3755724e8..8452953baf 100644
--- a/sapi/cli/tests/bug64529.phpt
+++ b/sapi/cli/tests/bug64529.phpt
@@ -21,7 +21,7 @@ if (extension_loaded("readline")) {
set php_executable [lindex \$argv 0]
-spawn \$php_executable -n -a
+spawn \$php_executable -n -d cli.prompt="" -a
expect "php >"
@@ -39,7 +39,7 @@ SCRIPT;
set php_executable [lindex \$argv 0]
-spawn \$php_executable -n -a
+spawn \$php_executable -n -d cli.prompt="" -a
expect "Interactive mode enabled"
@@ -60,8 +60,8 @@ system($expect_executable . " " . $script . " " . $php_executable);
@unlink($script);
?>
--EXPECTF--
-spawn %sphp -n -a
+spawn %sphp -n -d cli.prompt="" -a
Interactive %s
-%secho 'hello world';
-%sello worl%s
+%Secho 'hello world';
+%Shello world
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index e0df666108..8bfaf9f52d 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -108,7 +108,7 @@ static int php_embed_startup(sapi_module_struct *sapi_module)
return SUCCESS;
}
-extern EMBED_SAPI_API sapi_module_struct php_embed_module = {
+EMBED_SAPI_API sapi_module_struct php_embed_module = {
"embed", /* name */
"PHP Embedded Library", /* pretty name */
diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 4f7f5eab9c..3473f4b175 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -137,13 +137,14 @@ typedef union _sa_t {
struct sockaddr sa;
struct sockaddr_un sa_unix;
struct sockaddr_in sa_inet;
+ struct sockaddr_in6 sa_inet6;
} sa_t;
static HashTable fcgi_mgmt_vars;
static int is_initialized = 0;
static int in_shutdown = 0;
-static in_addr_t *allowed_clients = NULL;
+static sa_t *allowed_clients = NULL;
static sa_t client_sa;
@@ -266,15 +267,23 @@ void fcgi_set_allowed_clients(char *ip)
*end = 0;
end++;
}
- allowed_clients[n] = inet_addr(cur);
- if (allowed_clients[n] == INADDR_NONE) {
+ if (inet_pton(AF_INET, cur, &allowed_clients[n].sa_inet.sin_addr)>0) {
+ allowed_clients[n].sa.sa_family = AF_INET;
+ n++;
+ } else if (inet_pton(AF_INET6, cur, &allowed_clients[n].sa_inet6.sin6_addr)>0) {
+ allowed_clients[n].sa.sa_family = AF_INET6;
+ n++;
+ } else {
zlog(ZLOG_ERROR, "Wrong IP address '%s' in listen.allowed_clients", cur);
}
- n++;
cur = end;
}
- allowed_clients[n] = INADDR_NONE;
+ allowed_clients[n].sa.sa_family = 0;
free(ip);
+ if (!n) {
+ zlog(ZLOG_ERROR, "There are no allowed addresses for this pool");
+ /* don't clear allowed_clients as it will create an "open for all" security issue */
+ }
}
}
@@ -749,6 +758,43 @@ void fcgi_close(fcgi_request *req, int force, int destroy)
}
}
+static int fcgi_is_allowed() {
+ int i;
+
+ if (client_sa.sa.sa_family == AF_UNIX) {
+ return 1;
+ }
+ if (!allowed_clients) {
+ return 1;
+ }
+ if (client_sa.sa.sa_family == AF_INET) {
+ for (i=0 ; allowed_clients[i].sa.sa_family ; i++) {
+ if (allowed_clients[i].sa.sa_family == AF_INET
+ && !memcmp(&client_sa.sa_inet.sin_addr, &allowed_clients[i].sa_inet.sin_addr, 4)) {
+ return 1;
+ }
+ }
+ }
+ if (client_sa.sa.sa_family == AF_INET6) {
+ for (i=0 ; allowed_clients[i].sa.sa_family ; i++) {
+ if (allowed_clients[i].sa.sa_family == AF_INET6
+ && !memcmp(&client_sa.sa_inet6.sin6_addr, &allowed_clients[i].sa_inet6.sin6_addr, 12)) {
+ return 1;
+ }
+#ifdef IN6_IS_ADDR_V4MAPPED
+ if (allowed_clients[i].sa.sa_family == AF_INET
+ && IN6_IS_ADDR_V4MAPPED(&client_sa.sa_inet6.sin6_addr)
+ && !memcmp(((char *)&client_sa.sa_inet6.sin6_addr)+12, &allowed_clients[i].sa_inet.sin_addr, 4)) {
+ return 1;
+ }
+#endif
+ }
+ }
+
+ zlog(ZLOG_ERROR, "Connection disallowed: IP address '%s' has been dropped.", fcgi_get_last_client_ip());
+ return 0;
+}
+
int fcgi_accept_request(fcgi_request *req)
{
#ifdef _WIN32
@@ -799,23 +845,10 @@ int fcgi_accept_request(fcgi_request *req)
FCGI_UNLOCK(req->listen_socket);
client_sa = sa;
- if (sa.sa.sa_family == AF_INET && req->fd >= 0 && allowed_clients) {
- int n = 0;
- int allowed = 0;
-
- while (allowed_clients[n] != INADDR_NONE) {
- if (allowed_clients[n] == sa.sa_inet.sin_addr.s_addr) {
- allowed = 1;
- break;
- }
- n++;
- }
- if (!allowed) {
- zlog(ZLOG_ERROR, "Connection disallowed: IP address '%s' has been dropped.", inet_ntoa(sa.sa_inet.sin_addr));
- closesocket(req->fd);
- req->fd = -1;
- continue;
- }
+ if (req->fd >= 0 && !fcgi_is_allowed()) {
+ closesocket(req->fd);
+ req->fd = -1;
+ continue;
}
}
@@ -1073,12 +1106,27 @@ void fcgi_free_mgmt_var_cb(zval *zv)
zend_string_free(Z_STR_P(zv));
}
-char *fcgi_get_last_client_ip() /* {{{ */
+const char *fcgi_get_last_client_ip() /* {{{ */
{
- if (client_sa.sa.sa_family == AF_UNIX) {
- return NULL;
+ static char str[INET6_ADDRSTRLEN];
+
+ /* Ipv4 */
+ if (client_sa.sa.sa_family == AF_INET) {
+ return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet.sin_addr, str, INET6_ADDRSTRLEN);
+ }
+#ifdef IN6_IS_ADDR_V4MAPPED
+ /* Ipv4-Mapped-Ipv6 */
+ if (client_sa.sa.sa_family == AF_INET6
+ && IN6_IS_ADDR_V4MAPPED(&client_sa.sa_inet6.sin6_addr)) {
+ return inet_ntop(AF_INET, ((char *)&client_sa.sa_inet6.sin6_addr)+12, str, INET6_ADDRSTRLEN);
}
- return inet_ntoa(client_sa.sa_inet.sin_addr);
+#endif
+ /* Ipv6 */
+ if (client_sa.sa.sa_family == AF_INET6) {
+ return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet6.sin6_addr, str, INET6_ADDRSTRLEN);
+ }
+ /* Unix socket */
+ return NULL;
}
/* }}} */
/*
diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h
index 6d1bb38dba..9c96f763a9 100644
--- a/sapi/fpm/fpm/fastcgi.h
+++ b/sapi/fpm/fpm/fastcgi.h
@@ -133,7 +133,7 @@ int fcgi_flush(fcgi_request *req, int close);
void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len);
void fcgi_free_mgmt_var_cb(zval *ptr);
-char *fcgi_get_last_client_ip();
+const char *fcgi_get_last_client_ip();
/*
* Local variables:
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 18ddccb300..d4e46853ff 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -819,7 +819,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
if (config->pm_start_servers <= 0) {
config->pm_start_servers = config->pm_min_spare_servers + ((config->pm_max_spare_servers - config->pm_min_spare_servers) / 2);
- zlog(ZLOG_WARNING, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers);
+ zlog(ZLOG_NOTICE, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers);
} else if (config->pm_start_servers < config->pm_min_spare_servers || config->pm_start_servers > config->pm_max_spare_servers) {
zlog(ZLOG_ALERT, "[pool %s] pm.start_servers(%d) must not be less than pm.min_spare_servers(%d) and not greater than pm.max_spare_servers(%d)", wp->config->name, config->pm_start_servers, config->pm_min_spare_servers, config->pm_max_spare_servers);
@@ -1159,6 +1159,7 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */
}
fpm_globals.log_level = fpm_global_config.log_level;
+ zlog_set_level(fpm_globals.log_level);
if (fpm_global_config.process_max < 0) {
zlog(ZLOG_ERROR, "process_max can't be negative");
@@ -1199,15 +1200,15 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */
return -1;
}
- if (0 > fpm_log_open(0)) {
+ if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) {
return -1;
}
- if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) {
+ if (0 > fpm_conf_process_all_pools()) {
return -1;
}
- if (0 > fpm_conf_process_all_pools()) {
+ if (0 > fpm_log_open(0)) {
return -1;
}
@@ -1256,7 +1257,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ *
#ifdef HAVE_GLOB
{
g.gl_offs = 0;
- if ((i = glob(inc, GLOB_ERR | GLOB_MARK | GLOB_NOSORT, NULL, &g)) != 0) {
+ if ((i = glob(inc, GLOB_ERR | GLOB_MARK, NULL, &g)) != 0) {
#ifdef GLOB_NOMATCH
if (i == GLOB_NOMATCH) {
zlog(ZLOG_WARNING, "Nothing matches the include pattern '%s' from %s at line %d.", inc, filename, ini_lineno);
diff --git a/sapi/fpm/fpm/fpm_env.c b/sapi/fpm/fpm/fpm_env.c
index 2ff0bdc0e4..3bdb346341 100644
--- a/sapi/fpm/fpm/fpm_env.c
+++ b/sapi/fpm/fpm/fpm_env.c
@@ -212,7 +212,7 @@ int fpm_env_init_main() /* {{{ */
#ifndef HAVE_SETPROCTITLE
#ifdef __linux__
/*
- * This piece of code has been inspirated from nginx and pureftpd code, whic
+ * This piece of code has been inspirated from nginx and pureftpd code, which
* are under BSD licence.
*
* To change the process title in Linux we have to set argv[1] to NULL
diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c
index 4e1a057db1..b0bf32ac16 100644
--- a/sapi/fpm/fpm/fpm_log.c
+++ b/sapi/fpm/fpm/fpm_log.c
@@ -46,6 +46,8 @@ int fpm_log_open(int reopen) /* {{{ */
if (0 > fd) {
zlog(ZLOG_SYSERROR, "failed to open access log (%s)", wp->config->access_log);
return -1;
+ } else {
+ zlog(ZLOG_DEBUG, "open access log (%s)", wp->config->access_log);
}
if (reopen) {
@@ -367,7 +369,7 @@ int fpm_log_write(char *log_format TSRMLS_DC) /* {{{ */
case 'R': /* remote IP address */
if (!test) {
- char *tmp = fcgi_get_last_client_ip();
+ const char *tmp = fcgi_get_last_client_ip();
len2 = snprintf(b, FPM_LOG_BUFFER - len, "%s", tmp ? tmp : "-");
}
break;
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index da14d63d8c..e4e494876f 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -85,13 +85,24 @@ static void *fpm_get_in_addr(struct sockaddr *sa) /* {{{ */
}
/* }}} */
+static int fpm_get_in_port(struct sockaddr *sa) /* {{{ */
+{
+ if (sa->sa_family == AF_INET) {
+ return ntohs(((struct sockaddr_in*)sa)->sin_port);
+ }
+
+ return ntohs(((struct sockaddr_in6*)sa)->sin6_port);
+}
+/* }}} */
+
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 : {
- key = alloca(INET6_ADDRSTRLEN);
- inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, sizeof key);
+ key = alloca(INET6_ADDRSTRLEN+10);
+ inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, INET6_ADDRSTRLEN);
+ sprintf(key+strlen(key), ":%d", fpm_get_in_port(sa));
break;
}
@@ -244,9 +255,10 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
char *dup_address = strdup(wp->config->listen_address);
char *port_str = strrchr(dup_address, ':');
char *addr = NULL;
+ char tmpbuf[INET6_ADDRSTRLEN];
int addr_len;
int port = 0;
- int sock;
+ int sock = -1;
int status;
if (port_str) { /* this is host:port pair */
@@ -256,6 +268,8 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
} else if (strlen(dup_address) == strspn(dup_address, "0123456789")) { /* this is port */
port = atoi(dup_address);
port_str = dup_address;
+ /* IPv6 catch-all + IPv4-mapped */
+ addr = "::";
}
if (port == 0) {
@@ -263,13 +277,11 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
return -1;
}
- // 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++;
- }
+ /* strip brackets from address for getaddrinfo */
+ addr_len = strlen(addr);
+ if (addr[0] == '[' && addr[addr_len - 1] == ']') {
+ addr[addr_len - 1] = '\0';
+ addr++;
}
memset(&hints, 0, sizeof hints);
@@ -281,14 +293,18 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
return -1;
}
- free(dup_address);
-
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;
+ inet_ntop(p->ai_family, fpm_get_in_addr(p->ai_addr), tmpbuf, INET6_ADDRSTRLEN);
+ if (sock < 0) {
+ if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) {
+ zlog(ZLOG_DEBUG, "Found address for %s, socket opened on %s", addr, tmpbuf);
+ }
+ } else {
+ zlog(ZLOG_WARNING, "Found multiple addresses for %s, %s ignored", addr, tmpbuf);
}
}
+ free(dup_address);
freeaddrinfo(servinfo);
return sock;
diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c
index fcec78435b..e28c0cbe7f 100644
--- a/sapi/fpm/fpm/fpm_stdio.c
+++ b/sapi/fpm/fpm/fpm_stdio.c
@@ -42,9 +42,28 @@ int fpm_stdio_init_main() /* {{{ */
}
/* }}} */
+static inline int fpm_use_error_log() { /* {{{ */
+ /*
+ * the error_log is NOT used when running in foreground
+ * and from a tty (user looking at output).
+ * So, error_log is used by
+ * - SysV init launch php-fpm as a daemon
+ * - Systemd launch php-fpm in foreground
+ */
+#if HAVE_UNISTD_H
+ if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) {
+#else
+ if (fpm_global_config.daemonize) {
+#endif
+ return 1;
+ }
+ return 0;
+}
+
+/* }}} */
int fpm_stdio_init_final() /* {{{ */
{
- if (fpm_global_config.daemonize) {
+ if (fpm_use_error_log()) {
/* prevent duping if logging to syslog */
if (fpm_globals.error_log_fd > 0 && fpm_globals.error_log_fd != STDERR_FILENO) {
@@ -67,6 +86,11 @@ int fpm_stdio_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
closelog(); /* ensure to close syslog not to interrupt with PHP syslog code */
} else
#endif
+
+ /* Notice: child cannot use master error_log
+ * because not aware when being reopen
+ * else, should use if (!fpm_use_error_log())
+ */
if (fpm_globals.error_log_fd > 0) {
close(fpm_globals.error_log_fd);
}
@@ -268,11 +292,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */
if (!strcasecmp(fpm_global_config.error_log, "syslog")) {
openlog(fpm_global_config.syslog_ident, LOG_PID | LOG_CONS, fpm_global_config.syslog_facility);
fpm_globals.error_log_fd = ZLOG_SYSLOG;
-#if HAVE_UNISTD_H
- if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) {
-#else
- if (fpm_global_config.daemonize) {
-#endif
+ if (fpm_use_error_log()) {
zlog_set_fd(fpm_globals.error_log_fd);
}
return 0;
@@ -286,7 +306,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */
}
if (reopen) {
- if (fpm_global_config.daemonize) {
+ if (fpm_use_error_log()) {
dup2(fd, STDERR_FILENO);
}
@@ -295,11 +315,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */
fd = fpm_globals.error_log_fd; /* for FD_CLOSEXEC to work */
} else {
fpm_globals.error_log_fd = fd;
-#if HAVE_UNISTD_H
- if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) {
-#else
- if (fpm_global_config.daemonize) {
-#endif
+ if (fpm_use_error_log()) {
zlog_set_fd(fpm_globals.error_log_fd);
}
}
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 68978ee75d..32448fc4d5 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -396,7 +396,6 @@ int fpm_unix_init_main() /* {{{ */
}
}
- zlog_set_level(fpm_globals.log_level);
return 0;
}
/* }}} */
diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in
index b02aa25ba7..3a697c6a65 100644
--- a/sapi/fpm/php-fpm.8.in
+++ b/sapi/fpm/php-fpm.8.in
@@ -84,6 +84,13 @@ Version number
Specify alternative prefix path (the default is @php_fpm_prefix@)
.TP
.PD 0
+.B \-\-pid \fIfile\fP
+.TP
+.PD 1
+.B \-g
+Specify the PID file location.
+.TP
+.PD 0
.B \-\-fpm\-config \fIfile\fP
.TP
.PD 1
@@ -113,12 +120,18 @@ Force to run in background and ignore daemonize option from configuration file.
Force to stay in foreground and ignore daemonize option from configuration file.
.TP
.PD 0
-.B \-\-zend\-extension \fIfile\fP
+.B \-\-force-stderr
.TP
.PD 1
-.B \-z \fIfile\fP
-Load Zend extension
-.IR file
+.B \-O
+Force output to stderr in nodaemonize even if stderr is not a TTY.
+.TP
+.PD 0
+.B \-\-allow\-to\-run\-as\-root
+.TP
+.PD 1
+.B \-R
+Allow pool to run as root (disabled by default)
.SH FILES
.TP 15
.B php-fpm.conf
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index 106689f0a7..850a369002 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -131,6 +131,7 @@
; Per pool prefix
; It only applies on the following directives:
+; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
@@ -150,12 +151,12 @@ group = @php_fpm_group@
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
-; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 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;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
@@ -173,7 +174,7 @@ listen = 127.0.0.1:9000
;listen.group = @php_fpm_group@
;listen.mode = 0660
-; List of ipv4 addresses of FastCGI clients which are allowed to connect.
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
diff --git a/sapi/fpm/tests/002.phpt b/sapi/fpm/tests/002.phpt
index 2ef6cedc38..89e431849a 100644
--- a/sapi/fpm/tests/002.phpt
+++ b/sapi/fpm/tests/002.phpt
@@ -8,12 +8,13 @@ FPM: Startup and connect
include "include.inc";
$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
$cfg = <<<EOT
[global]
error_log = $logfile
[unconfined]
-listen = 127.0.0.1:9000
+listen = 127.0.0.1:$port
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
@@ -23,10 +24,9 @@ EOT;
$fpm = run_fpm($cfg, $tail);
if (is_resource($fpm)) {
- var_dump(fgets($tail));
- var_dump(fgets($tail));
+ fpm_display_log($tail, 2);
$i = 0;
- while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', 9000))) {
+ while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) {
usleep(10000);
}
if ($fp) {
@@ -41,10 +41,8 @@ if (is_resource($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
-"
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
Done
--CLEAN--
<?php
diff --git a/sapi/fpm/tests/003.phpt b/sapi/fpm/tests/003.phpt
index 389cb2401e..f928626ecc 100644
--- a/sapi/fpm/tests/003.phpt
+++ b/sapi/fpm/tests/003.phpt
@@ -8,12 +8,13 @@ FPM: Test IPv6 support
include "include.inc";
$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
$cfg = <<<EOT
[global]
error_log = $logfile
[unconfined]
-listen = [::1]:9000
+listen = [::1]:$port
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
@@ -23,10 +24,9 @@ EOT;
$fpm = run_fpm($cfg, $tail);
if (is_resource($fpm)) {
- var_dump(fgets($tail));
- var_dump(fgets($tail));
+ fpm_display_log($tail, 2);
$i = 0;
- while (($i++ < 30) && !($fp = fsockopen('[::1]', 9000))) {
+ while (($i++ < 30) && !($fp = fsockopen('[::1]', $port))) {
usleep(10000);
}
if ($fp) {
@@ -41,10 +41,8 @@ if (is_resource($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
-"
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
Done
--CLEAN--
<?php
diff --git a/sapi/fpm/tests/004.phpt b/sapi/fpm/tests/004.phpt
new file mode 100644
index 0000000000..2a4d666c64
--- /dev/null
+++ b/sapi/fpm/tests/004.phpt
@@ -0,0 +1,59 @@
+--TEST--
+FPM: Test IPv4/IPv6 support
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = [::]:$port
+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)) {
+ fpm_display_log($tail, 2);
+ $i = 0;
+ while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Done IPv4\n";
+ fclose($fp);
+ }
+ while (($i++ < 30) && !($fp = @fsockopen('[::1]', $port))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Done IPv6\n";
+ fclose($fp);
+ }
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+Done IPv4
+Done IPv6
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/fpm/tests/005.phpt b/sapi/fpm/tests/005.phpt
new file mode 100644
index 0000000000..c565c2a9eb
--- /dev/null
+++ b/sapi/fpm/tests/005.phpt
@@ -0,0 +1,57 @@
+--TEST--
+FPM: Test IPv4 allowed clients
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = [::]:$port
+listen.allowed_clients = 127.0.0.1
+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)) {
+ fpm_display_log($tail, 2);
+ try {
+ run_request('127.0.0.1', $port);
+ echo "IPv4 ok\n";
+ } catch (Exception $e) {
+ echo "IPv4 error\n";
+ }
+ try {
+ run_request('[::1]', $port);
+ echo "IPv6 ok\n";
+ } catch (Exception $e) {
+ echo "IPv6 error\n";
+ }
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+IPv4 ok
+IPv6 error
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/fpm/tests/006.phpt b/sapi/fpm/tests/006.phpt
new file mode 100644
index 0000000000..a12ca253d2
--- /dev/null
+++ b/sapi/fpm/tests/006.phpt
@@ -0,0 +1,57 @@
+--TEST--
+FPM: Test IPv6 allowed clients (bug #68428)
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = [::]:$port
+listen.allowed_clients = ::1
+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)) {
+ fpm_display_log($tail, 2);
+ try {
+ run_request('127.0.0.1', $port);
+ echo "IPv4 ok\n";
+ } catch (Exception $e) {
+ echo "IPv4 error\n";
+ }
+ try {
+ run_request('[::1]', $port);
+ echo "IPv6 ok\n";
+ } catch (Exception $e) {
+ echo "IPv6 error\n";
+ }
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+IPv4 error
+IPv6 ok
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/fpm/tests/007.phpt b/sapi/fpm/tests/007.phpt
new file mode 100644
index 0000000000..0d817907cf
--- /dev/null
+++ b/sapi/fpm/tests/007.phpt
@@ -0,0 +1,68 @@
+--TEST--
+FPM: Test IPv6 all addresses and access_log (bug #68421)
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$accfile = dirname(__FILE__).'/php-fpm.acc.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = [::]:$port
+access.log = $accfile
+ping.path = /ping
+ping.response = pong
+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)) {
+ fpm_display_log($tail, 2);
+ try {
+ var_dump(strpos(run_request('127.0.0.1', $port), 'pong'));
+ echo "IPv4 ok\n";
+ } catch (Exception $e) {
+ echo "IPv4 error\n";
+ }
+ try {
+ var_dump(strpos(run_request('[::1]', $port), 'pong'));
+ echo "IPv6 ok\n";
+ } catch (Exception $e) {
+ echo "IPv6 error\n";
+ }
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+
+ echo file_get_contents($accfile);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+int(%d)
+IPv4 ok
+int(%d)
+IPv6 ok
+127.0.0.1 %s "GET /ping" 200
+::1 %s "GET /ping" 200
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+ $accfile = dirname(__FILE__).'/php-fpm.acc.tmp';
+ @unlink($accfile);
+?>
diff --git a/sapi/fpm/tests/008.phpt b/sapi/fpm/tests/008.phpt
new file mode 100644
index 0000000000..60f1ea6ebd
--- /dev/null
+++ b/sapi/fpm/tests/008.phpt
@@ -0,0 +1,84 @@
+--TEST--
+FPM: Test multi pool (dynamic + ondemand + static) (bug #68423)
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port1 = 9000+PHP_INT_SIZE;
+$port2 = 9001+PHP_INT_SIZE;
+$port3 = 9002+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[pool_dynamic]
+listen = 127.0.0.1:$port1
+ping.path = /ping
+ping.response = pong-dynamic
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+[poold_ondemand]
+listen = 127.0.0.1:$port2
+ping.path = /ping
+ping.response = pong-on-demand
+pm = ondemand
+pm.max_children = 2
+pm.process_idle_timeout = 10
+[pool_static]
+listen = 127.0.0.1:$port3
+ping.path = /ping
+ping.response = pong-static
+pm = static
+pm.max_children = 2
+EOT;
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, 2);
+ try {
+ var_dump(strpos(run_request('127.0.0.1', $port1), 'pong-dynamic'));
+ echo "Dynamic ok\n";
+ } catch (Exception $e) {
+ echo "Dynamic error\n";
+ }
+ try {
+ var_dump(strpos(run_request('127.0.0.1', $port2), 'pong-on-demand'));
+ echo "OnDemand ok\n";
+ } catch (Exception $e) {
+ echo "OnDemand error\n";
+ }
+ try {
+ var_dump(strpos(run_request('127.0.0.1', $port3), 'pong-static'));
+ echo "Static ok\n";
+ } catch (Exception $e) {
+ echo "Static error\n";
+ }
+
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+int(%d)
+Dynamic ok
+int(%d)
+OnDemand ok
+int(%d)
+Static ok
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/fpm/tests/009.phpt b/sapi/fpm/tests/009.phpt
new file mode 100644
index 0000000000..34cdffcf83
--- /dev/null
+++ b/sapi/fpm/tests/009.phpt
@@ -0,0 +1,53 @@
+--TEST--
+FPM: Test Unix Domain Socket
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$socket = dirname(__FILE__).'/php-fpm.sock';
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = $socket
+ping.path = /ping
+ping.response = pong
+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)) {
+ fpm_display_log($tail, 2);
+ try {
+ var_dump(strpos(run_request('unix://'.$socket, -1), 'pong'));
+ echo "UDS ok\n";
+ } catch (Exception $e) {
+ echo "UDS error\n";
+ }
+
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+int(%d)
+UDS ok
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/fpm/tests/010.phpt b/sapi/fpm/tests/010.phpt
new file mode 100644
index 0000000000..37c778db5b
--- /dev/null
+++ b/sapi/fpm/tests/010.phpt
@@ -0,0 +1,84 @@
+--TEST--
+FPM: Test status page
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = 127.0.0.1:$port
+pm.status_path = /status
+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)) {
+ fpm_display_log($tail, 2);
+ try {
+ echo run_request('127.0.0.1', $port, '/status');
+
+ $html = run_request('127.0.0.1', $port, '/status', 'html');
+ var_dump(strpos($html, 'text/html') && strpos($html, 'DOCTYPE') && strpos($html, 'PHP-FPM Status Page'));
+
+ $json = run_request('127.0.0.1', $port, '/status', 'json');
+ var_dump(strpos($json, 'application/json') && strpos($json, '"pool":"unconfined"'));
+
+ $xml = run_request('127.0.0.1', $port, '/status', 'xml');
+ var_dump(strpos($xml, 'text/xml') && strpos($xml, '<?xml'));
+
+ echo "IPv4 ok\n";
+ } catch (Exception $e) {
+ echo "IPv4 error\n";
+ }
+
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+X-Powered-By: PHP/%s
+Expires: %s
+Cache-Control: %s
+Content-type: text/plain%s
+
+pool: unconfined
+process manager: dynamic
+start time: %s
+start since: %d
+accepted conn: 1
+listen queue: 0
+max listen queue: 0
+listen queue len: %d
+idle processes: 1
+active processes: 1
+total processes: 2
+max active processes: 1
+max children reached: 0
+slow requests: 0
+
+bool(true)
+bool(true)
+bool(true)
+IPv4 ok
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/fpm/tests/011.phpt b/sapi/fpm/tests/011.phpt
new file mode 100644
index 0000000000..0b849f873b
--- /dev/null
+++ b/sapi/fpm/tests/011.phpt
@@ -0,0 +1,53 @@
+--TEST--
+FPM: Test IPv4 all addresses (bug #68420)
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = $port
+ping.path = /ping
+ping.response = pong
+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)) {
+ fpm_display_log($tail, 2);
+ try {
+ var_dump(strpos(run_request('127.0.0.1', $port), 'pong'));
+ echo "IPv4 ok\n";
+ } catch (Exception $e) {
+ echo "IPv4 error\n";
+ }
+
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+int(%d)
+IPv4 ok
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/fpm/tests/012.phpt b/sapi/fpm/tests/012.phpt
new file mode 100644
index 0000000000..d96c53081c
--- /dev/null
+++ b/sapi/fpm/tests/012.phpt
@@ -0,0 +1,79 @@
+--TEST--
+FPM: Test reload configuration (bug #68442)
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$pidfile = dirname(__FILE__).'/php-fpm.pid';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+pid = $pidfile
+[unconfined]
+listen = 127.0.0.1:$port
+ping.path = /ping
+ping.response = pong
+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)) {
+ fpm_display_log($tail, 2);
+ try {
+ var_dump(strpos(run_request('127.0.0.1', $port), 'pong'));
+ echo "IPv4 ok\n";
+ } catch (Exception $e) {
+ echo "IPv4 error\n";
+ }
+
+ $pid=file_get_contents($pidfile);
+ if ($pid) {
+ exec("kill -USR2 $pid");
+ } else {
+ die("PID not found\n");
+ }
+ fpm_display_log($tail, 5);
+
+ try {
+ var_dump(strpos(run_request('127.0.0.1', $port), 'pong'));
+ echo "IPv4 ok\n";
+ } catch (Exception $e) {
+ echo "IPv4 error\n";
+ }
+
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+int(%d)
+IPv4 ok
+[%d-%s-%d %d:%d:%d] NOTICE: Reloading in progress ...
+[%d-%s-%d %d:%d:%d] NOTICE: reloading: %s
+[%d-%s-%d %d:%d:%d] NOTICE: using inherited socket fd=%d, "127.0.0.1:%d"
+[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+int(%d)
+IPv4 ok
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+ $pidfile = dirname(__FILE__).'/php-fpm.pid';
+ @unlink($pidfile);
+?>
diff --git a/sapi/fpm/tests/013.phpt b/sapi/fpm/tests/013.phpt
new file mode 100644
index 0000000000..8d6a9d1d85
--- /dev/null
+++ b/sapi/fpm/tests/013.phpt
@@ -0,0 +1,54 @@
+--TEST--
+FPM: Test for log_level in fpm_unix_init_main #68381
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+log_level = warning
+[unconfined]
+listen = 127.0.0.1:$port
+user = foo
+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)) {
+ $i = 0;
+ while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Started\n";
+ fclose($fp);
+ }
+ proc_terminate($fpm);
+ if (!feof($tail)) {
+ echo stream_get_contents($tail);
+ }
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+Started
+Done
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?> \ No newline at end of file
diff --git a/sapi/fpm/tests/014.phpt b/sapi/fpm/tests/014.phpt
new file mode 100644
index 0000000000..ee0e549cc5
--- /dev/null
+++ b/sapi/fpm/tests/014.phpt
@@ -0,0 +1,54 @@
+--TEST--
+FPM: Test for pm.start_servers default calculation message being a notice and not a warning #68458
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+log_level = warning
+[unconfined]
+listen = 127.0.0.1:$port
+user = foo
+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)) {
+ $i = 0;
+ while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Started\n";
+ fclose($fp);
+ }
+ proc_terminate($fpm);
+ if (!feof($tail)) {
+ echo stream_get_contents($tail);
+ }
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+Started
+Done
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?> \ No newline at end of file
diff --git a/sapi/fpm/tests/015.phpt b/sapi/fpm/tests/015.phpt
new file mode 100644
index 0000000000..fba333e256
--- /dev/null
+++ b/sapi/fpm/tests/015.phpt
@@ -0,0 +1,87 @@
+--TEST--
+FPM: Test various messages on start, from master and childs
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port1 = 9000+PHP_INT_SIZE;
+$port2 = 9001+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+log_level = notice
+[pool1]
+listen = 127.0.0.1:$port1
+listen.allowed_clients=127.0.0.1
+user = foo
+pm = dynamic
+pm.max_children = 5
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+catch_workers_output = yes
+[pool2]
+listen = 127.0.0.1:$port2
+listen.allowed_clients=xxx
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 1
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+catch_workers_output = yes
+EOT;
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ $i = 0;
+ while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port1))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Started\n";
+ fclose($fp);
+ }
+ for ($i=0 ; $i<10 ; $i++) {
+ try {
+ run_request('127.0.0.1', $port1);
+ } catch (Exception $e) {
+ echo "Error 1\n";
+ }
+ }
+ try {
+ run_request('127.0.0.1', $port2);
+ } catch (Exception $e) {
+ echo "Error 2\n";
+ }
+ proc_terminate($fpm);
+ if (!feof($tail)) {
+ echo stream_get_contents($tail);
+ }
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+Started
+Error 2
+[%s] NOTICE: [pool pool1] pm.start_servers is not set. It's been set to 2.
+[%s] NOTICE: [pool pool1] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients"
+[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: There are no allowed addresses for this pool"
+[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Connection disallowed: IP address '127.0.0.1' has been dropped."
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+Done
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?> \ No newline at end of file
diff --git a/sapi/fpm/tests/016.phpt b/sapi/fpm/tests/016.phpt
new file mode 100644
index 0000000000..1a9e8e7577
--- /dev/null
+++ b/sapi/fpm/tests/016.phpt
@@ -0,0 +1,87 @@
+--TEST--
+FPM: Test splited configuration and load order #68391
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = __DIR__.'/php-fpm.log.tmp';
+$logdir = __DIR__.'/conf.d';
+$port = 9000+PHP_INT_SIZE;
+
+// Main configuration
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+log_level = notice
+include = $logdir/*.conf
+EOT;
+
+// Splited configuration
+@mkdir($logdir);
+$i=$port;
+$names = ['cccc', 'aaaa', 'eeee', 'dddd', 'bbbb'];
+foreach($names as $name) {
+ $poolcfg = <<<EOT
+[$name]
+listen = 127.0.0.1:$i
+listen.allowed_clients=127.0.0.1
+user = foo
+pm = ondemand
+pm.max_children = 5
+EOT;
+ file_put_contents("$logdir/$name.conf", $poolcfg);
+ $i++;
+}
+
+// Test
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, count($names)+2);
+ $i=$port;
+ foreach($names as $name) {
+ try {
+ run_request('127.0.0.1', $i++);
+ echo "OK $name\n";
+ } catch (Exception $e) {
+ echo "Error 1\n";
+ }
+ }
+ proc_terminate($fpm);
+ if (!feof($tail)) {
+ echo stream_get_contents($tail);
+ }
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+[%s] NOTICE: [pool aaaa] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool bbbb] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool cccc] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool dddd] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool eeee] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+OK cccc
+OK aaaa
+OK eeee
+OK dddd
+OK bbbb
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+Done
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $logdir = __DIR__.'/conf.d';
+ @unlink($logfile);
+ foreach(glob("$logdir/*.conf") as $name) {
+ unlink($name);
+ }
+ @rmdir($logdir);
+?> \ No newline at end of file
diff --git a/sapi/fpm/tests/017.phpt b/sapi/fpm/tests/017.phpt
new file mode 100644
index 0000000000..b3de089a70
--- /dev/null
+++ b/sapi/fpm/tests/017.phpt
@@ -0,0 +1,67 @@
+--TEST--
+FPM: Test fastcgi_finish_request function
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = __DIR__.'/php-fpm.log.tmp';
+$srcfile = __DIR__.'/php-fpm.tmp.php';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = 127.0.0.1:$port
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 1
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+EOT;
+
+$code = <<<EOT
+<?php
+echo "Test Start\n";
+fastcgi_finish_request();
+echo "Test End\n";
+EOT;
+file_put_contents($srcfile, $code);
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, 2);
+ try {
+ $req = run_request('127.0.0.1', $port, $srcfile);
+ echo strstr($req, "Test Start");
+ echo "Request ok\n";
+ } catch (Exception $e) {
+ echo "Request error\n";
+ }
+ proc_terminate($fpm);
+ echo stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+Test Start
+
+Request ok
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+Done
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $srcfile = __DIR__.'/php-fpm.tmp.php';
+ @unlink($logfile);
+ @unlink($srcfile);
+?> \ No newline at end of file
diff --git a/sapi/fpm/tests/019.phpt b/sapi/fpm/tests/019.phpt
new file mode 100644
index 0000000000..cdf8126244
--- /dev/null
+++ b/sapi/fpm/tests/019.phpt
@@ -0,0 +1,80 @@
+--TEST--
+FPM: Test global prefix
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = 'php-fpm.log.tmp';
+$accfile = 'php-fpm.acc.tmp';
+$slwfile = 'php-fpm.slw.tmp';
+$pidfile = 'php-fpm.pid.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+pid = $pidfile
+[test]
+listen = 127.0.0.1:$port
+access.log = $accfile
+slowlog = $slwfile;
+request_slowlog_timeout = 1
+ping.path = /ping
+ping.response = pong
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+catch_workers_output = yes
+EOT;
+
+$fpm = run_fpm($cfg, $tail, '--prefix '.__DIR__);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, 2);
+ try {
+ run_request('127.0.0.1', $port);
+ echo "Ping ok\n";
+ } catch (Exception $e) {
+ echo "Ping error\n";
+ }
+ printf("File %s %s\n", $logfile, (file_exists(__DIR__.'/'.$logfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $accfile, (file_exists(__DIR__.'/'.$accfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $slwfile, (file_exists(__DIR__.'/'.$slwfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "exists" : "missing"));
+
+ proc_terminate($fpm);
+ echo stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+ printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "still exists" : "removed"));
+ readfile(__DIR__.'/'.$accfile);
+}
+
+?>
+--EXPECTF--
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+Ping ok
+File php-fpm.log.tmp exists
+File php-fpm.acc.tmp exists
+File php-fpm.slw.tmp exists
+File php-fpm.pid.tmp exists
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+File php-fpm.pid.tmp removed
+127.0.0.1 - %s "GET /ping" 200
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $accfile = __DIR__.'/php-fpm.acc.tmp';
+ $slwfile = __DIR__.'/php-fpm.slw.tmp';
+ $pidfile = __DIR__.'/php-fpm.pid.tmp';
+ @unlink($logfile);
+ @unlink($accfile);
+ @unlink($slwfile);
+ @unlink($pidfile);
+?>
diff --git a/sapi/fpm/tests/020.phpt b/sapi/fpm/tests/020.phpt
new file mode 100644
index 0000000000..d45eeccff8
--- /dev/null
+++ b/sapi/fpm/tests/020.phpt
@@ -0,0 +1,76 @@
+--TEST--
+FPM: Test pool prefix
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$prefix = __DIR__;
+$logfile = __DIR__.'/php-fpm.log.tmp';
+$accfile = 'php-fpm.acc.tmp';
+$slwfile = 'php-fpm.slw.tmp';
+$pidfile = __DIR__.'/php-fpm.pid.tmp';
+$port = 9000+PHP_INT_SIZE;
+$cfg = <<<EOT
+
+[global]
+error_log = $logfile
+pid = $pidfile
+[test]
+prefix = $prefix;
+listen = 127.0.0.1:$port
+access.log = $accfile
+slowlog = $slwfile;
+request_slowlog_timeout = 1
+ping.path = /ping
+ping.response = pong
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+catch_workers_output = yes
+EOT;
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, 2);
+ try {
+ run_request('127.0.0.1', $port);
+ echo "Ping ok\n";
+ } catch (Exception $e) {
+ echo "Ping error\n";
+ }
+ printf("File %s %s\n", $accfile, (file_exists(__DIR__.'/'.$accfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $slwfile, (file_exists(__DIR__.'/'.$slwfile) ? "exists" : "missing"));
+
+ proc_terminate($fpm);
+ echo stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+ readfile(__DIR__.'/'.$accfile);
+}
+
+?>
+--EXPECTF--
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+Ping ok
+File php-fpm.acc.tmp exists
+File php-fpm.slw.tmp exists
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+127.0.0.1 - %s "GET /ping" 200
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $accfile = __DIR__.'/php-fpm.acc.tmp';
+ $slwfile = __DIR__.'/php-fpm.slw.tmp';
+ $pidfile = __DIR__.'/php-fpm.pid.tmp';
+ @unlink($logfile);
+ @unlink($accfile);
+ @unlink($slwfile);
+ @unlink($pidfile);
+?>
diff --git a/sapi/fpm/tests/fcgi.inc b/sapi/fpm/tests/fcgi.inc
new file mode 100644
index 0000000000..b31676260d
--- /dev/null
+++ b/sapi/fpm/tests/fcgi.inc
@@ -0,0 +1,592 @@
+<?php
+/*
+ * This file is part of PHP-FastCGI-Client.
+ *
+ * (c) Pierrick Charron <pierrick@adoy.net>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace Adoy\FastCGI;
+
+class TimedOutException extends \Exception {}
+class ForbiddenException extends \Exception {}
+
+/**
+ * Handles communication with a FastCGI application
+ *
+ * @author Pierrick Charron <pierrick@adoy.net>
+ * @version 1.0
+ */
+class Client
+{
+ const VERSION_1 = 1;
+
+ const BEGIN_REQUEST = 1;
+ const ABORT_REQUEST = 2;
+ const END_REQUEST = 3;
+ const PARAMS = 4;
+ const STDIN = 5;
+ const STDOUT = 6;
+ const STDERR = 7;
+ const DATA = 8;
+ const GET_VALUES = 9;
+ const GET_VALUES_RESULT = 10;
+ const UNKNOWN_TYPE = 11;
+ const MAXTYPE = self::UNKNOWN_TYPE;
+
+ const RESPONDER = 1;
+ const AUTHORIZER = 2;
+ const FILTER = 3;
+
+ const REQUEST_COMPLETE = 0;
+ const CANT_MPX_CONN = 1;
+ const OVERLOADED = 2;
+ const UNKNOWN_ROLE = 3;
+
+ const MAX_CONNS = 'MAX_CONNS';
+ const MAX_REQS = 'MAX_REQS';
+ const MPXS_CONNS = 'MPXS_CONNS';
+
+ const HEADER_LEN = 8;
+
+ const REQ_STATE_WRITTEN = 1;
+ const REQ_STATE_OK = 2;
+ const REQ_STATE_ERR = 3;
+ const REQ_STATE_TIMED_OUT = 4;
+
+ /**
+ * Socket
+ * @var Resource
+ */
+ private $_sock = null;
+
+ /**
+ * Host
+ * @var String
+ */
+ private $_host = null;
+
+ /**
+ * Port
+ * @var Integer
+ */
+ private $_port = null;
+
+ /**
+ * Keep Alive
+ * @var Boolean
+ */
+ private $_keepAlive = false;
+
+ /**
+ * Outstanding request statuses keyed by request id
+ *
+ * Each request is an array with following form:
+ *
+ * array(
+ * 'state' => REQ_STATE_*
+ * 'response' => null | string
+ * )
+ *
+ * @var array
+ */
+ private $_requests = array();
+
+ /**
+ * Use persistent sockets to connect to backend
+ * @var Boolean
+ */
+ private $_persistentSocket = false;
+
+ /**
+ * Connect timeout in milliseconds
+ * @var Integer
+ */
+ private $_connectTimeout = 5000;
+
+ /**
+ * Read/Write timeout in milliseconds
+ * @var Integer
+ */
+ private $_readWriteTimeout = 5000;
+
+ /**
+ * Constructor
+ *
+ * @param String $host Host of the FastCGI application
+ * @param Integer $port Port of the FastCGI application
+ */
+ public function __construct($host, $port)
+ {
+ $this->_host = $host;
+ $this->_port = $port;
+ }
+
+ /**
+ * Define whether or not the FastCGI application should keep the connection
+ * alive at the end of a request
+ *
+ * @param Boolean $b true if the connection should stay alive, false otherwise
+ */
+ public function setKeepAlive($b)
+ {
+ $this->_keepAlive = (boolean)$b;
+ if (!$this->_keepAlive && $this->_sock) {
+ fclose($this->_sock);
+ }
+ }
+
+ /**
+ * Get the keep alive status
+ *
+ * @return Boolean true if the connection should stay alive, false otherwise
+ */
+ public function getKeepAlive()
+ {
+ return $this->_keepAlive;
+ }
+
+ /**
+ * Define whether or not PHP should attempt to re-use sockets opened by previous
+ * request for efficiency
+ *
+ * @param Boolean $b true if persistent socket should be used, false otherwise
+ */
+ public function setPersistentSocket($b)
+ {
+ $was_persistent = ($this->_sock && $this->_persistentSocket);
+ $this->_persistentSocket = (boolean)$b;
+ if (!$this->_persistentSocket && $was_persistent) {
+ fclose($this->_sock);
+ }
+ }
+
+ /**
+ * Get the pesistent socket status
+ *
+ * @return Boolean true if the socket should be persistent, false otherwise
+ */
+ public function getPersistentSocket()
+ {
+ return $this->_persistentSocket;
+ }
+
+
+ /**
+ * Set the connect timeout
+ *
+ * @param Integer number of milliseconds before connect will timeout
+ */
+ public function setConnectTimeout($timeoutMs)
+ {
+ $this->_connectTimeout = $timeoutMs;
+ }
+
+ /**
+ * Get the connect timeout
+ *
+ * @return Integer number of milliseconds before connect will timeout
+ */
+ public function getConnectTimeout()
+ {
+ return $this->_connectTimeout;
+ }
+
+ /**
+ * Set the read/write timeout
+ *
+ * @param Integer number of milliseconds before read or write call will timeout
+ */
+ public function setReadWriteTimeout($timeoutMs)
+ {
+ $this->_readWriteTimeout = $timeoutMs;
+ $this->set_ms_timeout($this->_readWriteTimeout);
+ }
+
+ /**
+ * Get the read timeout
+ *
+ * @return Integer number of milliseconds before read will timeout
+ */
+ public function getReadWriteTimeout()
+ {
+ return $this->_readWriteTimeout;
+ }
+
+ /**
+ * Helper to avoid duplicating milliseconds to secs/usecs in a few places
+ *
+ * @param Integer millisecond timeout
+ * @return Boolean
+ */
+ private function set_ms_timeout($timeoutMs) {
+ if (!$this->_sock) {
+ return false;
+ }
+ return stream_set_timeout($this->_sock, floor($timeoutMs / 1000), ($timeoutMs % 1000) * 1000);
+ }
+
+
+ /**
+ * Create a connection to the FastCGI application
+ */
+ private function connect()
+ {
+ if (!$this->_sock) {
+ if ($this->_persistentSocket) {
+ $this->_sock = pfsockopen($this->_host, $this->_port, $errno, $errstr, $this->_connectTimeout/1000);
+ } else {
+ $this->_sock = fsockopen($this->_host, $this->_port, $errno, $errstr, $this->_connectTimeout/1000);
+ }
+
+ if (!$this->_sock) {
+ throw new \Exception('Unable to connect to FastCGI application: ' . $errstr);
+ }
+
+ if (!$this->set_ms_timeout($this->_readWriteTimeout)) {
+ throw new \Exception('Unable to set timeout on socket');
+ }
+ }
+ }
+
+ /**
+ * Build a FastCGI packet
+ *
+ * @param Integer $type Type of the packet
+ * @param String $content Content of the packet
+ * @param Integer $requestId RequestId
+ */
+ private function buildPacket($type, $content, $requestId = 1)
+ {
+ $clen = strlen($content);
+ return chr(self::VERSION_1) /* version */
+ . chr($type) /* type */
+ . chr(($requestId >> 8) & 0xFF) /* requestIdB1 */
+ . chr($requestId & 0xFF) /* requestIdB0 */
+ . chr(($clen >> 8 ) & 0xFF) /* contentLengthB1 */
+ . chr($clen & 0xFF) /* contentLengthB0 */
+ . chr(0) /* paddingLength */
+ . chr(0) /* reserved */
+ . $content; /* content */
+ }
+
+ /**
+ * Build an FastCGI Name value pair
+ *
+ * @param String $name Name
+ * @param String $value Value
+ * @return String FastCGI Name value pair
+ */
+ private function buildNvpair($name, $value)
+ {
+ $nlen = strlen($name);
+ $vlen = strlen($value);
+ if ($nlen < 128) {
+ /* nameLengthB0 */
+ $nvpair = chr($nlen);
+ } else {
+ /* nameLengthB3 & nameLengthB2 & nameLengthB1 & nameLengthB0 */
+ $nvpair = chr(($nlen >> 24) | 0x80) . chr(($nlen >> 16) & 0xFF) . chr(($nlen >> 8) & 0xFF) . chr($nlen & 0xFF);
+ }
+ if ($vlen < 128) {
+ /* valueLengthB0 */
+ $nvpair .= chr($vlen);
+ } else {
+ /* valueLengthB3 & valueLengthB2 & valueLengthB1 & valueLengthB0 */
+ $nvpair .= chr(($vlen >> 24) | 0x80) . chr(($vlen >> 16) & 0xFF) . chr(($vlen >> 8) & 0xFF) . chr($vlen & 0xFF);
+ }
+ /* nameData & valueData */
+ return $nvpair . $name . $value;
+ }
+
+ /**
+ * Read a set of FastCGI Name value pairs
+ *
+ * @param String $data Data containing the set of FastCGI NVPair
+ * @return array of NVPair
+ */
+ private function readNvpair($data, $length = null)
+ {
+ $array = array();
+
+ if ($length === null) {
+ $length = strlen($data);
+ }
+
+ $p = 0;
+
+ while ($p != $length) {
+
+ $nlen = ord($data{$p++});
+ if ($nlen >= 128) {
+ $nlen = ($nlen & 0x7F << 24);
+ $nlen |= (ord($data{$p++}) << 16);
+ $nlen |= (ord($data{$p++}) << 8);
+ $nlen |= (ord($data{$p++}));
+ }
+ $vlen = ord($data{$p++});
+ if ($vlen >= 128) {
+ $vlen = ($nlen & 0x7F << 24);
+ $vlen |= (ord($data{$p++}) << 16);
+ $vlen |= (ord($data{$p++}) << 8);
+ $vlen |= (ord($data{$p++}));
+ }
+ $array[substr($data, $p, $nlen)] = substr($data, $p+$nlen, $vlen);
+ $p += ($nlen + $vlen);
+ }
+
+ return $array;
+ }
+
+ /**
+ * Decode a FastCGI Packet
+ *
+ * @param String $data String containing all the packet
+ * @return array
+ */
+ private function decodePacketHeader($data)
+ {
+ $ret = array();
+ $ret['version'] = ord($data{0});
+ $ret['type'] = ord($data{1});
+ $ret['requestId'] = (ord($data{2}) << 8) + ord($data{3});
+ $ret['contentLength'] = (ord($data{4}) << 8) + ord($data{5});
+ $ret['paddingLength'] = ord($data{6});
+ $ret['reserved'] = ord($data{7});
+ return $ret;
+ }
+
+ /**
+ * Read a FastCGI Packet
+ *
+ * @return array
+ */
+ private function readPacket()
+ {
+ if ($packet = fread($this->_sock, self::HEADER_LEN)) {
+ $resp = $this->decodePacketHeader($packet);
+ $resp['content'] = '';
+ if ($resp['contentLength']) {
+ $len = $resp['contentLength'];
+ while ($len && $buf=fread($this->_sock, $len)) {
+ $len -= strlen($buf);
+ $resp['content'] .= $buf;
+ }
+ }
+ if ($resp['paddingLength']) {
+ $buf = fread($this->_sock, $resp['paddingLength']);
+ }
+ return $resp;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Get Informations on the FastCGI application
+ *
+ * @param array $requestedInfo information to retrieve
+ * @return array
+ */
+ public function getValues(array $requestedInfo)
+ {
+ $this->connect();
+
+ $request = '';
+ foreach ($requestedInfo as $info) {
+ $request .= $this->buildNvpair($info, '');
+ }
+ fwrite($this->_sock, $this->buildPacket(self::GET_VALUES, $request, 0));
+
+ $resp = $this->readPacket();
+ if ($resp['type'] == self::GET_VALUES_RESULT) {
+ return $this->readNvpair($resp['content'], $resp['length']);
+ } else {
+ throw new \Exception('Unexpected response type, expecting GET_VALUES_RESULT');
+ }
+ }
+
+ /**
+ * Execute a request to the FastCGI application
+ *
+ * @param array $params Array of parameters
+ * @param String $stdin Content
+ * @return String
+ */
+ public function request(array $params, $stdin)
+ {
+ $id = $this->async_request($params, $stdin);
+ return $this->wait_for_response($id);
+ }
+
+ /**
+ * Execute a request to the FastCGI application asyncronously
+ *
+ * This sends request to application and returns the assigned ID for that request.
+ *
+ * You should keep this id for later use with wait_for_response(). Ids are chosen randomly
+ * rather than seqentially to guard against false-positives when using persistent sockets.
+ * In that case it is possible that a delayed response to a request made by a previous script
+ * invocation comes back on this socket and is mistaken for response to request made with same ID
+ * during this request.
+ *
+ * @param array $params Array of parameters
+ * @param String $stdin Content
+ * @return Integer
+ */
+ public function async_request(array $params, $stdin)
+ {
+ $this->connect();
+
+ // Pick random number between 1 and max 16 bit unsigned int 65535
+ $id = mt_rand(1, (1 << 16) - 1);
+
+ // Using persistent sockets implies you want them keept alive by server!
+ $keepAlive = intval($this->_keepAlive || $this->_persistentSocket);
+
+ $request = $this->buildPacket(self::BEGIN_REQUEST
+ ,chr(0) . chr(self::RESPONDER) . chr($keepAlive) . str_repeat(chr(0), 5)
+ ,$id
+ );
+
+ $paramsRequest = '';
+ foreach ($params as $key => $value) {
+ $paramsRequest .= $this->buildNvpair($key, $value, $id);
+ }
+ if ($paramsRequest) {
+ $request .= $this->buildPacket(self::PARAMS, $paramsRequest, $id);
+ }
+ $request .= $this->buildPacket(self::PARAMS, '', $id);
+
+ if ($stdin) {
+ $request .= $this->buildPacket(self::STDIN, $stdin, $id);
+ }
+ $request .= $this->buildPacket(self::STDIN, '', $id);
+
+ if (fwrite($this->_sock, $request) === false || fflush($this->_sock) === false) {
+
+ $info = stream_get_meta_data($this->_sock);
+
+ if ($info['timed_out']) {
+ throw new TimedOutException('Write timed out');
+ }
+
+ // Broken pipe, tear down so future requests might succeed
+ fclose($this->_sock);
+ throw new \Exception('Failed to write request to socket');
+ }
+
+ $this->_requests[$id] = array(
+ 'state' => self::REQ_STATE_WRITTEN,
+ 'response' => null
+ );
+
+ return $id;
+ }
+
+ /**
+ * Blocking call that waits for response to specific request
+ *
+ * @param Integer $requestId
+ * @param Integer $timeoutMs [optional] the number of milliseconds to wait. Defaults to the ReadWriteTimeout value set.
+ * @return string response body
+ */
+ public function wait_for_response($requestId, $timeoutMs = 0) {
+
+ if (!isset($this->_requests[$requestId])) {
+ throw new \Exception('Invalid request id given');
+ }
+
+ // If we already read the response during an earlier call for different id, just return it
+ if ($this->_requests[$requestId]['state'] == self::REQ_STATE_OK
+ || $this->_requests[$requestId]['state'] == self::REQ_STATE_ERR
+ ) {
+ return $this->_requests[$requestId]['response'];
+ }
+
+ if ($timeoutMs > 0) {
+ // Reset timeout on socket for now
+ $this->set_ms_timeout($timeoutMs);
+ } else {
+ $timeoutMs = $this->_readWriteTimeout;
+ }
+
+ // Need to manually check since we might do several reads none of which timeout themselves
+ // but still not get the response requested
+ $startTime = microtime(true);
+
+ do {
+ $resp = $this->readPacket();
+
+ if ($resp['type'] == self::STDOUT || $resp['type'] == self::STDERR) {
+ if ($resp['type'] == self::STDERR) {
+ $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_ERR;
+ }
+ $this->_requests[$resp['requestId']]['response'] .= $resp['content'];
+ }
+ if ($resp['type'] == self::END_REQUEST) {
+ $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_OK;
+ if ($resp['requestId'] == $requestId) {
+ break;
+ }
+ }
+ if (microtime(true) - $startTime >= ($timeoutMs * 1000)) {
+ // Reset
+ $this->set_ms_timeout($this->_readWriteTimeout);
+ throw new \Exception('Timed out');
+ }
+ } while ($resp);
+
+ if (!is_array($resp)) {
+ $info = stream_get_meta_data($this->_sock);
+
+ // We must reset timeout but it must be AFTER we get info
+ $this->set_ms_timeout($this->_readWriteTimeout);
+
+ if ($info['timed_out']) {
+ throw new TimedOutException('Read timed out');
+ }
+
+ if ($info['unread_bytes'] == 0
+ && $info['blocked']
+ && $info['eof']) {
+ throw new ForbiddenException('Not in white list. Check listen.allowed_clients.');
+ }
+
+ throw new \Exception('Read failed');
+ }
+
+ // Reset timeout
+ $this->set_ms_timeout($this->_readWriteTimeout);
+
+ switch (ord($resp['content']{4})) {
+ case self::CANT_MPX_CONN:
+ throw new \Exception('This app can\'t multiplex [CANT_MPX_CONN]');
+ break;
+ case self::OVERLOADED:
+ throw new \Exception('New request rejected; too busy [OVERLOADED]');
+ break;
+ case self::UNKNOWN_ROLE:
+ throw new \Exception('Role value not known [UNKNOWN_ROLE]');
+ break;
+ case self::REQUEST_COMPLETE:
+ return $this->_requests[$requestId]['response'];
+ }
+ }
+}
diff --git a/sapi/fpm/tests/include.inc b/sapi/fpm/tests/include.inc
index 983cbd3454..b195fad507 100644
--- a/sapi/fpm/tests/include.inc
+++ b/sapi/fpm/tests/include.inc
@@ -76,4 +76,36 @@ function run_fpm_till($needle, $config, $max = 10) /* {{{ */
}
/* }}} */
-?>
+function fpm_display_log($tail, $n=1, $ignore='systemd') {
+ while ($n) {
+ $a = fgets($tail);
+ if (empty($ignore) || !strpos($a, $ignore)) {
+ echo $a;
+ $n--;
+ }
+ }
+}
+
+function run_request($host, $port, $uri='/ping', $query='') {
+ require_once 'fcgi.inc';
+ $client = new Adoy\FastCGI\Client($host, $port);
+ $params = array(
+ 'GATEWAY_INTERFACE' => 'FastCGI/1.0',
+ 'REQUEST_METHOD' => 'GET',
+ 'SCRIPT_FILENAME' => $uri,
+ 'SCRIPT_NAME' => $uri,
+ 'QUERY_STRING' => $query,
+ 'REQUEST_URI' => $uri . ($query ? '?'.$query : ""),
+ 'DOCUMENT_URI' => $uri,
+ 'SERVER_SOFTWARE' => 'php/fcgiclient',
+ 'REMOTE_ADDR' => '127.0.0.1',
+ 'REMOTE_PORT' => '9985',
+ 'SERVER_ADDR' => '127.0.0.1',
+ 'SERVER_PORT' => '80',
+ 'SERVER_NAME' => php_uname('n'),
+ 'SERVER_PROTOCOL' => 'HTTP/1.1',
+ 'CONTENT_TYPE' => '',
+ 'CONTENT_LENGTH' => 0
+ );
+ return $client->request($params, false)."\n";
+}
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index a9f27fcea1..54b7ef9166 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -200,7 +200,12 @@ static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC )
static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen,
void * arg )
{
- int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
+#if PHP_MAJOR_VERSION >= 7
+ int filter_arg = (Z_ARR_P((zval *)arg) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV]))
+ ? PARSE_ENV : PARSE_SERVER;
+#else
+ int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
+#endif
char * new_val = (char *) pValue;
unsigned int new_val_len;
@@ -238,27 +243,45 @@ static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC
size_t alloc_size = sizeof(buf);
unsigned long nlen; /* ptrdiff_t is not portable */
- if (PG(http_globals)[TRACK_VARS_ENV] &&
- array_ptr != PG(http_globals)[TRACK_VARS_ENV] &&
- Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
- zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0
+#if PHP_MAJOR_VERSION >= 7
+ if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
+ Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) &&
+ zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_ENV])) > 0
) {
- zval_dtor(array_ptr);
- *array_ptr = *PG(http_globals)[TRACK_VARS_ENV];
- INIT_PZVAL(array_ptr);
- zval_copy_ctor(array_ptr);
+ zval_dtor(array_ptr);
+ ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_ENV]);
return;
- } else if (PG(http_globals)[TRACK_VARS_SERVER] &&
- array_ptr != PG(http_globals)[TRACK_VARS_SERVER] &&
- Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
- zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0
+ } else if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
+ Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_SERVER]) &&
+ zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])) > 0
) {
- zval_dtor(array_ptr);
- *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER];
- INIT_PZVAL(array_ptr);
- zval_copy_ctor(array_ptr);
+ zval_dtor(array_ptr);
+ ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_SERVER]);
return;
}
+#else
+ if (PG(http_globals)[TRACK_VARS_ENV] &&
+ array_ptr != PG(http_globals)[TRACK_VARS_ENV] &&
+ Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0
+ ) {
+ zval_dtor(array_ptr);
+ *array_ptr = *PG(http_globals)[TRACK_VARS_ENV];
+ INIT_PZVAL(array_ptr);
+ zval_copy_ctor(array_ptr);
+ return;
+ } else if (PG(http_globals)[TRACK_VARS_SERVER] &&
+ array_ptr != PG(http_globals)[TRACK_VARS_SERVER] &&
+ Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0
+ ) {
+ zval_dtor(array_ptr);
+ *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER];
+ INIT_PZVAL(array_ptr);
+ zval_copy_ctor(array_ptr);
+ return;
+ }
+#endif
for (env = environ; env != NULL && *env != NULL; env++) {
p = strchr(*env, '=');
@@ -592,6 +615,9 @@ static int lsapi_module_main(int show_source TSRMLS_DC)
static int alter_ini( const char * pKey, int keyLen, const char * pValue, int valLen,
void * arg )
{
+#if PHP_MAJOR_VERSION >= 7
+ zend_string * psKey;
+#endif
int type = ZEND_INI_PERDIR;
if ( '\001' == *pKey ) {
++pKey;
@@ -606,9 +632,19 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int va
engine = 0;
}
else
- zend_alter_ini_entry((char *)pKey, keyLen,
+ {
+#if PHP_MAJOR_VERSION >= 7
+ psKey = STR_INIT( pKey, keyLen, 1 );
+ zend_alter_ini_entry(psKey,
(char *)pValue, valLen,
type, PHP_INI_STAGE_ACTIVATE);
+ STR_RELEASE( psKey );
+#else
+ zend_alter_ini_entry((char *)pKey, keyLen,
+ (char *)pValue, valLen,
+ type, PHP_INI_STAGE_ACTIVATE);
+#endif
+ }
}
return 1;
}
@@ -749,6 +785,9 @@ static int cli_main( int argc, char * argv[] )
char ** argend= &argv[argc];
int ret = -1;
int c;
+#if PHP_MAJOR_VERSION >= 7
+ zend_string * psKey;
+#endif
lsapi_mode = 0; /* enter CLI mode */
#ifdef PHP_WIN32
@@ -763,12 +802,21 @@ static int cli_main( int argc, char * argv[] )
zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */
CG(in_compilation) = 0; /* not initialized but needed for several options */
+#if PHP_MAJOR_VERSION < 7
EG(uninitialized_zval_ptr) = NULL;
-
+#endif
for( ini = ini_defaults; *ini; ini+=2 ) {
+#if PHP_MAJOR_VERSION >= 7
+ psKey = STR_INIT( *ini, strlen( *ini ), 1 );
+ zend_alter_ini_entry( psKey,
+ (char *)*(ini+1), strlen( *(ini+1) ),
+ PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+ STR_RELEASE( psKey );
+#else
zend_alter_ini_entry( (char *)*ini, strlen( *ini )+1,
(char *)*(ini+1), strlen( *(ini+1) ),
PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+#endif
}
while (( p < argend )&&(**p == '-' )) {
@@ -1148,7 +1196,11 @@ zend_module_entry litespeed_module_entry = {
static int add_associate_array( const char * pKey, int keyLen, const char * pValue, int valLen,
void * arg )
{
- add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue);
+ add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue
+#if PHP_MAJOR_VERSION < 7
+ , 1
+#endif
+ );
return 1;
}
@@ -1202,7 +1254,11 @@ PHP_FUNCTION(litespeed_response_headers)
headerBuf[len] = 0;
if ( len ) {
while( isspace(*++p));
- add_assoc_string_ex(return_value, headerBuf, len+1, p);
+ add_assoc_string_ex(return_value, headerBuf, len+1, p
+#if PHP_MAJOR_VERSION < 7
+ , 1
+#endif
+ );
}
}
}
@@ -1217,15 +1273,25 @@ PHP_FUNCTION(litespeed_response_headers)
Fetch all loaded module names */
PHP_FUNCTION(apache_get_modules)
{
+ static const char * mod_names[] =
+ {
+ "mod_rewrite", "mod_mime", "mod_headers", "mod_expires", NULL
+ };
+ const char **name = mod_names;
/* TODO: */
if (ZEND_NUM_ARGS() > 0) {
WRONG_PARAM_COUNT;
}
array_init(return_value);
- add_next_index_string(return_value, "mod_rewrite");
- add_next_index_string(return_value, "mod_mime");
- add_next_index_string(return_value, "mod_headers");
- add_next_index_string(return_value, "mod_expires");
+ while( *name )
+ {
+ add_next_index_string(return_value, *name
+#if PHP_MAJOR_VERSION < 7
+ , 1
+#endif
+ );
+ ++name;
+ }
}
/* }}} */
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index cf63f6ab1c..daf0f37f14 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -2662,7 +2662,7 @@ static void lsapi_check_child_status( long tmCur )
}
if ( abs( g_prefork_server->m_iCurChildren - count ) > 1 )
{
- fprintf( stderr, "Children tracking is wrong: PID: %d, Cur Childen: %d, count: %d, idle: %d, dying: %d\n", getpid(),
+ fprintf( stderr, "Children tracking is wrong: PID: %d, Cur Children: %d, count: %d, idle: %d, dying: %d\n", getpid(),
g_prefork_server->m_iCurChildren, count, idle, dying );
}
diff --git a/sapi/nsapi/nsapi-readme.txt b/sapi/nsapi/nsapi-readme.txt
index 812507957e..6bf4afb83d 100644
--- a/sapi/nsapi/nsapi-readme.txt
+++ b/sapi/nsapi/nsapi-readme.txt
@@ -1,7 +1,7 @@
Configuration of your Netscape/iPlanet/Sun Webserver for PHP7
-----------------------------------------------------------------
-These instructions are targetted at Netscape Enterprise Web Server and
+These instructions are targeted at Netscape Enterprise Web Server and
SUN/Netscape Alliance iPlanet Web Server and the new Sun Java System Webserver.
On other web servers your milage may vary.
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index ec65a22f12..c624669785 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1571,7 +1571,7 @@ phpdbg_out:
#ifdef _WIN32
} __except(phpdbg_exception_handler_win32(xp = GetExceptionInformation())) {
- phpdbg_error("segfault", "", "Access violation (Segementation fault) encountered\ntrying to abort cleanly...");
+ phpdbg_error("segfault", "", "Access violation (Segmentation fault) encountered\ntrying to abort cleanly...");
}
phpdbg_out:
#endif
diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c
index f42fc659f1..c9ba377d95 100644
--- a/sapi/phpdbg/phpdbg_frame.c
+++ b/sapi/phpdbg/phpdbg_frame.c
@@ -37,7 +37,7 @@ void phpdbg_restore_frame(TSRMLS_D) /* {{{ */
/* move things back */
EG(current_execute_data) = PHPDBG_FRAME(execute_data);
- EG(scope) = PHPDBG_EX(scope);
+ EG(scope) = PHPDBG_EX(func)->op_array.scope;
} /* }}} */
void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */
@@ -79,7 +79,7 @@ void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */
PHPDBG_FRAME(execute_data) = EG(current_execute_data);
EG(current_execute_data) = execute_data;
- EG(scope) = PHPDBG_EX(scope);
+ EG(scope) = PHPDBG_EX(func)->op_array.scope;
}
phpdbg_notice("frame", "id=\"%d\"", "Switched to frame #%d", frame);
diff --git a/sapi/phpdbg/xml.md b/sapi/phpdbg/xml.md
index 7871b31376..56dcaaa1f7 100644
--- a/sapi/phpdbg/xml.md
+++ b/sapi/phpdbg/xml.md
@@ -225,7 +225,7 @@ frame
- internal: has value "internal" when being an internal function call (one cannot inspect that frame)
- being an error: (by type)
- - maxnum: tried to access a frame with a number heigher than existing (or &lt; 0)
+ - maxnum: tried to access a frame with a number higher than existing (or &lt; 0)
### attributes on &lt;arg> ###
@@ -378,7 +378,7 @@ exec
- command executing and compiling a given file
- &lt;exec type="unset" context="" />: indicates unsetting of the old context
- &lt;exec type="unsetops" />: indicates unsetting of the old compiled opcodes
- - &lt;exec type="unchanged" />: same execution context choosen again
+ - &lt;exec type="unchanged" />: same execution context chosen again
- &lt;exec type="set" context="" />: indicates setting of the new context
- errors by tag
- &lt;compile>
@@ -527,7 +527,7 @@ set
### breaks ###
-- generally enables / disables breakpoint functionality silently with no futher xml answer
+- generally enables / disables breakpoint functionality silently with no further xml answer
- if the boolean switch is omitted, it emits current state in a &lt;setbreaks active="" /> where active is on or off
### color ###
diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch
index 1a9ed29d60..1463d8fe0a 100644
--- a/sapi/thttpd/thttpd_patch
+++ b/sapi/thttpd/thttpd_patch
@@ -2059,7 +2059,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c
@@ -1519,7 +1697,7 @@
if ( c->bytes_sent >= c->bytes_to_send )
{
- /* This conection is finished! */
+ /* This connection is finished! */
- clear_connection( c, tvP );
+ clear_connection( c, tvP, 1 );
return;
diff --git a/scripts/apache/apconf-conv.sh b/scripts/apache/apconf-conv.sh
deleted file mode 100755
index 6126bdc27d..0000000000
--- a/scripts/apache/apconf-conv.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = "" ]; then
- echo "Usage: $0 /somewhere/httpd.conf"
- exit 1
-fi
-
-if [ ! -w $1 ]; then
- echo "You cannot write to $1"
- exit 1
-fi
-
-TMPFILE=tmpfile.$$
-
-awk -f conffix.awk <$1 >$TMPFILE
-
-if [ "$?" != 0 ]; then
- exit 1
-fi
-
-mv -f $1 $1.orig
-mv -f $TMPFILE $1
-exit 0
-
diff --git a/scripts/apache/aphtaccess-conv.sh b/scripts/apache/aphtaccess-conv.sh
deleted file mode 100755
index 1af59d2843..0000000000
--- a/scripts/apache/aphtaccess-conv.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = "" ]; then
- echo "Usage: $0 /somewhere/.htaccess"
- exit 1
-fi
-
-if [ ! -w $1 ]; then
- echo "You cannot write to $1"
- exit 1
-fi
-
-TMPFILE=tmpfile.$$
-
-awk -f htaccessfix.awk <$1 >$TMPFILE
-
-if [ "$?" != 0 ]; then
- exit 1
-fi
-
-mv -f $1 $1.orig
-mv -f $TMPFILE $1
-exit 0
-
diff --git a/scripts/apache/conffix.awk b/scripts/apache/conffix.awk
deleted file mode 100644
index 88be6fade7..0000000000
--- a/scripts/apache/conffix.awk
+++ /dev/null
@@ -1,23 +0,0 @@
-# $Id$
-
-/^[ \t]*php3_*/ {
- phpcommand=substr($1,6)
- phpvalue=tolower($2)
- print "<IfModule mod_php3.c>"
- print $0
- print "</IfModule>"
- print "<IfModule mod_php4.c>"
- if (phpvalue=="on") {
- print "php_admin_flag " phpcommand " on"
- } else if (phpvalue=="off") {
- print "php_admin_flag " phpcommand " off"
- } else {
- print "php_admin_value " phpcommand " " substr($0,index($0,$1)+length($1)+1)
- }
- print "</IfModule>"
-}
-
-! /^[ \t]*php3_*/ {
- print $0
-}
-
diff --git a/scripts/apache/htaccessfix.awk b/scripts/apache/htaccessfix.awk
deleted file mode 100644
index 3c784cd335..0000000000
--- a/scripts/apache/htaccessfix.awk
+++ /dev/null
@@ -1,23 +0,0 @@
-# $Id$
-
-/^[ \t]*php3_*/ {
- phpcommand=substr($1,6)
- phpvalue=tolower($2)
- print "<IfModule mod_php3.c>"
- print $0
- print "</IfModule>"
- print "<IfModule mod_php4.c>"
- if (phpvalue=="on") {
- print "php_flag " phpcommand " on"
- } else if (phpvalue=="off") {
- print "php_flag " phpcommand " off"
- } else {
- print "php_value " phpcommand " " substr($0,index($0,$1)+length($1)+1)
- }
- print "</IfModule>"
-}
-
-! /^[ \t]*php3_*/ {
- print $0
-}
-
diff --git a/scripts/dev/generate-phpt.phar b/scripts/dev/generate-phpt.phar
index c6268c0af3..3b2137ade6 100644
--- a/scripts/dev/generate-phpt.phar
+++ b/scripts/dev/generate-phpt.phar
Binary files differ
diff --git a/server-tests-config.php b/server-tests-config.php
index a4fa88a5b2..5961deea98 100755
--- a/server-tests-config.php
+++ b/server-tests-config.php
@@ -37,11 +37,11 @@ $conf = array(
'TEST_WEB_BASE_URL' => NULL,
/* if set, copy phpt files into this directory,
- which should be accessable via an http server. The
+ which should be accessible via an http server. The
TEST_WEB_BASE_URL setting should be the base url
to access this path. If this is not used,
TEST_WEB_BASE_URL should be the base url pointing
- to TEST_PHP_SRCDIR, which should then be accessable via
+ to TEST_PHP_SRCDIR, which should then be accessible via
an http server.
An example would be:
diff --git a/server-tests.php b/server-tests.php
index 8666895a96..3c5e36532a 100755
--- a/server-tests.php
+++ b/server-tests.php
@@ -961,7 +961,7 @@ class testHarness {
if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
/*
* Collect information about the host system for our report
- * Fetch phpinfo() output so that we can see the PHP enviroment
+ * Fetch phpinfo() output so that we can see the PHP environment
* Make an archive of all the failed tests
* Send an email
*/
diff --git a/tests/classes/constants_error_004.phpt b/tests/classes/constants_error_004.phpt
index 03e67258a6..3f34473dad 100644
--- a/tests/classes/constants_error_004.phpt
+++ b/tests/classes/constants_error_004.phpt
@@ -1,5 +1,5 @@
--TEST--
-Class constant whose initial value refereces a non-existent class
+Class constant whose initial value references a non-existent class
--FILE--
<?php
class C
diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt
index 7c6ec780ed..6cad4f14c2 100644
--- a/tests/lang/bug20175.phpt
+++ b/tests/lang/bug20175.phpt
@@ -35,7 +35,7 @@ function foo_static() {
/* Part 2:
* Storing a reference to the result of a function in a static variable.
* Same as Part 1 but:
- * The return statment transports a copy of the value to return. In other
+ * The return statement transports a copy of the value to return. In other
* words the return value of bar_global() is a temporary variable only valid
* after the function call bar_global() is done in current local scope.
*/
diff --git a/tests/lang/operators/coalesce.phpt b/tests/lang/operators/coalesce.phpt
index 2ee54c5276..4486f30485 100644
--- a/tests/lang/operators/coalesce.phpt
+++ b/tests/lang/operators/coalesce.phpt
@@ -24,7 +24,7 @@ function foobar() {
return ['a'];
}
-var_dump($nonexistant_variable ?? 3);
+var_dump($nonexistent_variable ?? 3);
echo PHP_EOL;
var_dump($var ?? 3);
var_dump($var2 ?? 3);
diff --git a/win32/build/Makefile b/win32/build/Makefile
index 90f02d2494..c24bd70ba6 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -90,7 +90,7 @@ $(PHPDLL_RES): 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) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS)
- @"$(LINK)" $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS)
+ @"$(LINK)" $(PHP_GLOBAL_OBJS_RESP) $(STATIC_EXT_OBJS_RESP) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS)
-@$(_VC_MANIFEST_EMBED_DLL)
$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL)
@@ -158,19 +158,14 @@ build-dist: $(BUILD_DIR)\deplister.exe
$(BUILD_DIR)\php.exe -d date.timezone=UTC -n -dphar.readonly=0 win32/build/mkdist.php "$(BUILD_DIR)" "$(PHP_BUILD)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)"
cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
-$(ZIP) -9 -q -r ..\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip .
- cd ..\..
cd $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)
-$(ZIP) -9 -q -r ..\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip .
- cd ..\..
cd $(BUILD_DIR)\php-test-pack-$(PHP_VERSION_STRING)
-$(ZIP) -9 -q -r ..\php-test-pack-$(PHP_VERSION_STRING).zip .
- cd ..\..
cd $(BUILD_DIR)
-$(ZIP) -9 -q php-debug-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip *.pdb
- cd
- cd
-$(ZIP) -9 -q -r php-devel-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip $(BUILD_DIR_DEV_NAME)
- cd ..\..
+ cd $(BUILD_DIR)
dist: all build-dist
snap: build-snap build-devel build-dist
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 7187eacca1..7ca0293f3f 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -3,7 +3,9 @@
// "Master" config file; think of it as a configure.in
// equivalent.
-ARG_WITH("toolset", "Toolset to use for the compilation, supported: vs, clang, icc", "vs");
+ARG_WITH("toolset", "Toolset to use for the compilation, give: vs, clang, icc. " +
+ "The only recommended and supported toolset for production use " +
+ "is Visual Studio. Use others at your own risk.", "vs");
toolset_option_handle();
ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin');
@@ -12,31 +14,14 @@ toolset_setup_compiler();
// do we use x64 or 80x86 version of compiler?
X64 = toolset_is_64();
-if (X64) {
- STDOUT.WriteLine(" Detected 64-bit compiler");
-} else {
- STDOUT.WriteLine(" Detected 32-bit compiler");
-}
-AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");
-DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86');
+toolset_setup_arch();
toolset_setup_linker();
toolset_setup_project_tools();
// stick objects somewhere outside of the source tree
ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');
-if (PHP_OBJECT_OUT_DIR.length) {
- PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR);
- if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) {
- ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist');
- }
- PHP_OBJECT_OUT_DIR += '\\';
-} else if (X64) {
- if (!FSO.FolderExists("x64")) {
- FSO.CreateFolder("x64");
- }
- PHP_OBJECT_OUT_DIR = 'x64\\';
-}
+object_out_dir_option_handle();
ARG_ENABLE('debug', 'Compile with debugging symbols', "no");
ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');
@@ -91,61 +76,12 @@ if (VS_TOOLSET && VCVERS >= 1500 && PHP_MP != 'disable') {
toolset_setup_common_ldlags();
// General libs
-// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib
-DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib");
+toolset_setup_common_libs();
// Set some debug/release specific options
-if (PHP_DEBUG == "yes") {
- ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +
- (X64?"/Zi":"/ZI"));
- ADD_FLAG("LDFLAGS", "/debug");
- // Avoid problems when linking to release libraries that use the release
- // version of the libc
- ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
-} else {
- // Generate external debug files when --enable-debug-pack is specified
- if (PHP_DEBUG_PACK == "yes") {
- ADD_FLAG("CFLAGS", "/Zi");
- ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
- }
- // Equivalent to Release_TSInline build -> best optimization
- ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");
+toolset_setup_build_mode();
- // if you have VS.Net /GS hardens the binary against buffer overruns
- // ADD_FLAG("CFLAGS", "/GS");
-}
-
-if (PHP_ZTS == "yes") {
- ADD_FLAG("CFLAGS", "/D ZTS=1");
- ADD_FLAG("ZTS", "1");
-} else {
- ADD_FLAG("ZTS", "0");
-}
-
-DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");
-
-
-// we want msvcrt in the PHP DLL
-ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
-
-// set up the build dir and DLL name
-if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");
- DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib");
-} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug");
- DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib");
-} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS");
- DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib");
-} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release");
- DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib");
-}
+setup_zts_stuff();
// CFLAGS, LDFLAGS and BUILD_DIR are defined
// Add compiler and link flags if PGO options are selected
@@ -161,32 +97,7 @@ else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
// Find the php_build dir - it contains headers and libraries
// that we need
ARG_WITH('php-build', 'Path to where you extracted the development libraries (http://wiki.php.net/internals/windows/libs). Assumes that it is a sibling of this source dir (..\\deps) if not specified', 'no');
-
-if (PHP_PHP_BUILD == 'no') {
- if (FSO.FolderExists("..\\deps")) {
- PHP_PHP_BUILD = "..\\deps";
- } else {
- if (FSO.FolderExists("..\\php_build")) {
- PHP_PHP_BUILD = "..\\php_build";
- } else {
- if (X64) {
- if (FSO.FolderExists("..\\win64build")) {
- PHP_PHP_BUILD = "..\\win64build";
- } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) {
- PHP_PHP_BUILD = "..\\php-win64-dev\\php_build";
- }
- } else {
- if (FSO.FolderExists("..\\win32build")) {
- PHP_PHP_BUILD = "..\\win32build";
- } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) {
- PHP_PHP_BUILD = "..\\php-win32-dev\\php_build";
- }
- }
- }
- }
- PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD);
-}
-DEFINE("PHP_BUILD", PHP_PHP_BUILD);
+php_build_option_handle();
ARG_WITH('extra-includes', 'Extra include path to use when building everything', '');
ARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');
@@ -196,46 +107,7 @@ var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib";
ADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" ');
ADD_FLAG("LDFLAGS", '/libpath:"' + php_usual_lib_suspects + '" ');
-
-// Poke around for some headers
-function probe_basic_headers()
-{
- var p;
-
- if (PHP_PHP_BUILD != "no") {
- php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";
- php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";
- }
-}
-
-function add_extra_dirs()
-{
- var path, i, f;
-
- if (PHP_EXTRA_INCLUDES.length) {
- path = PHP_EXTRA_INCLUDES.split(';');
- for (i = 0; i < path.length; i++) {
- f = FSO.GetAbsolutePathName(path[i]);
- if (FSO.FolderExists(f)) {
- ADD_FLAG("CFLAGS", '/I "' + f + '" ');
- }
- }
- }
- if (PHP_EXTRA_LIBS.length) {
- path = PHP_EXTRA_LIBS.split(';');
- for (i = 0; i < path.length; i++) {
- f = FSO.GetAbsolutePathName(path[i]);
- if (FSO.FolderExists(f)) {
- if (VS_TOOLSET && VCVERS <= 1200 && f.indexOf(" ") >= 0) {
- ADD_FLAG("LDFLAGS", '/libpath:"\\"' + f + '\\"" ');
- } else {
- ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" ');
- }
- }
- }
- }
-
-}
+ADD_FLAG("ARFLAGS", '/libpath:"' + php_usual_lib_suspects + '" ');
probe_basic_headers();
add_extra_dirs();
@@ -275,7 +147,7 @@ ADD_SOURCES("win32", "inet.c fnmatch.c sockets.c");
if (VS_TOOLSET && VCVERS <= 1300) {
ADD_SOURCES("win32", "strtoi64.c");
}
-if (VS_TOOLSET && VCVERS >= 1400 || ICC_TOOLSET) {
+if (VS_TOOLSET && VCVERS >= 1400 || !VS_TOOLSET) {
AC_DEFINE('HAVE_STRNLEN', 1);
}
@@ -368,3 +240,11 @@ if (PHP_ANALYZER == "vs") {
PHP_ANALYZER = "no"
}
+if (CLANG_TOOLSET) {
+ ARG_WITH("uncritical-warn-choke", "Disable some uncritical warnings", "yes");
+ if (PHP_UNCRITICAL_WARN_CHOKE != "no") {
+ ADD_FLAG("CFLAGS", "-Wno-ignored-attributes -Wno-deprecated-declarations -Wno-missing-braces \
+ -Wno-logical-op-parentheses -Wno-msvc-include -Wno-invalid-source-encoding -Wno-unknown-pragmas");
+ }
+}
+
diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in
index 5a7f31d5d4..a340af0e60 100644
--- a/win32/build/config.w32.phpize.in
+++ b/win32/build/config.w32.phpize.in
@@ -3,7 +3,9 @@
// "Master" config file; think of it as a configure.in
// equivalent.
-ARG_WITH("toolset", "Toolset to use for the compilation, supported: vs, clang, icc", "vs");
+ARG_WITH("toolset", "Toolset to use for the compilation, give: vs, clang, icc. " +
+ "The only recommended and supported toolset for production use " +
+ "is Visual Studio. Use others at your own risk.", "vs");
toolset_option_handle()
var PHP_CYGWIN="notset";
@@ -12,31 +14,14 @@ toolset_setup_compiler();
// do we use x64 or 80x86 version of compiler?
X64 = toolset_is_64();
-if (X64) {
- STDOUT.WriteLine(" Detected 64-bit compiler");
-} else {
- STDOUT.WriteLine(" Detected 32-bit compiler");
-}
-AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");
-DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86');
+toolset_setup_arch();
toolset_setup_linker();
toolset_setup_project_tools();
// stick objects somewhere outside of the source tree
ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');
-if (PHP_OBJECT_OUT_DIR.length) {
- PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR);
- if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) {
- ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist');
- }
- PHP_OBJECT_OUT_DIR += '\\';
-} else if (X64) {
- if (!FSO.FolderExists("x64")) {
- FSO.CreateFolder("x64");
- }
- PHP_OBJECT_OUT_DIR = 'x64\\';
-}
+object_out_dir_option_handle();
ARG_ENABLE('debug', 'Compile with debugging symbols', "no");
ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');
@@ -81,66 +66,12 @@ ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no");
toolset_setup_common_ldlags();
// General libs
-// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib
-DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib");
+toolset_setup_common_libs();
// Set some debug/release specific options
-if (PHP_DEBUG == "yes") {
- ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +
- (X64?"/Zi":"/ZI"));
- ADD_FLAG("LDFLAGS", "/debug");
- // Avoid problems when linking to release libraries that use the release
- // version of the libc
- ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
-} else {
- // Generate external debug files when --enable-debug-pack is specified
- if (PHP_DEBUG_PACK == "yes") {
- ADD_FLAG("CFLAGS", "/Zi");
- ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
- }
- // Equivalent to Release_TSInline build -> best optimization
- ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");
-
- // if you have VS.Net /GS hardens the binary against buffer overruns
- // ADD_FLAG("CFLAGS", "/GS");
-}
-
-if (PHP_ZTS == "yes") {
- ADD_FLAG("CFLAGS", "/D ZTS=1");
-}
-
-DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");
+toolset_setup_build_mode();
-
-// we want msvcrt in the PHP DLL
-ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
-
-// set up the build dir and DLL name
-if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");
- if (!MODE_PHPIZE) {
- DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib");
- }
-} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug");
- if (!MODE_PHPIZE) {
- DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib");
- }
-} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS");
- if (!MODE_PHPIZE) {
- DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib");
- }
-} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {
- DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release");
- if (!MODE_PHPIZE) {
- DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll");
- DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib");
- }
-}
+setup_zts_stuff();
if (MODE_PHPIZE) {
DEFINE("PHPDLL", PHP_DLL);
@@ -150,32 +81,7 @@ if (MODE_PHPIZE) {
// Find the php_build dir - it contains headers and libraries
// that we need
ARG_WITH('php-build', 'Path to where you extracted the development libraries (http://wiki.php.net/internals/windows/libs). Assumes that it is a sibling of this source dir (..\\deps) if not specified', 'no');
-
-if (PHP_PHP_BUILD == 'no') {
- if (FSO.FolderExists("..\\deps")) {
- PHP_PHP_BUILD = "..\\deps";
- } else {
- if (FSO.FolderExists("..\\php_build")) {
- PHP_PHP_BUILD = "..\\php_build";
- } else {
- if (X64) {
- if (FSO.FolderExists("..\\win64build")) {
- PHP_PHP_BUILD = "..\\win64build";
- } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) {
- PHP_PHP_BUILD = "..\\php-win64-dev\\php_build";
- }
- } else {
- if (FSO.FolderExists("..\\win32build")) {
- PHP_PHP_BUILD = "..\\win32build";
- } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) {
- PHP_PHP_BUILD = "..\\php-win32-dev\\php_build";
- }
- }
- }
- }
- PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD);
-}
-DEFINE("PHP_BUILD", PHP_PHP_BUILD);
+php_build_option_handle();
ARG_WITH('extra-includes', 'Extra include path to use when building everything', '');
ARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');
@@ -185,46 +91,7 @@ var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib";
ADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" ');
ADD_FLAG("LDFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');
-
-// Poke around for some headers
-function probe_basic_headers()
-{
- var p;
-
- if (PHP_PHP_BUILD != "no") {
- php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";
- php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";
- }
-}
-
-function add_extra_dirs()
-{
- var path, i, f;
-
- if (PHP_EXTRA_INCLUDES.length) {
- path = PHP_EXTRA_INCLUDES.split(';');
- for (i = 0; i < path.length; i++) {
- f = FSO.GetAbsolutePathName(path[i]);
- if (FSO.FolderExists(f)) {
- ADD_FLAG("CFLAGS", '/I "' + f + '" ');
- }
- }
- }
- if (PHP_EXTRA_LIBS.length) {
- path = PHP_EXTRA_LIBS.split(';');
- for (i = 0; i < path.length; i++) {
- f = FSO.GetAbsolutePathName(path[i]);
- if (FSO.FolderExists(f)) {
- if (VCVERS <= 1200 && f.indexOf(" ") >= 0) {
- ADD_FLAG("LDFLAGS", '/libpath:"\\"' + f + '\\"" ');
- } else {
- ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" ');
- }
- }
- }
- }
-
-}
+ADD_FLAG("ARFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');
probe_basic_headers();
add_extra_dirs();
@@ -235,13 +102,12 @@ STDOUT.WriteBlankLines(1);
STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));
STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB'));
-
/* XXX inspect this for other toolsets */
if (VS_TOOLSET && VCVERS == 1200) {
AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
}
-if (ICC_TOOLSET || VS_TOOLSET && VCVERS >= 1400) {
+if (!VS_TOOLSET || VS_TOOLSET && VCVERS >= 1400) {
AC_DEFINE('HAVE_STRNLEN', 1);
}
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 0f07e18120..7d02f99ad6 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -63,8 +63,7 @@ VC_VERSIONS[1500] = 'MSVC9 (Visual C++ 2008)';
VC_VERSIONS[1600] = 'MSVC10 (Visual C++ 2010)';
VC_VERSIONS[1700] = 'MSVC11 (Visual C++ 2012)';
VC_VERSIONS[1800] = 'MSVC12 (Visual C++ 2013)';
-/* XXX update after the final rename */
-VC_VERSIONS[1900] = 'MSVC14 (Visual C++ CTP14)';
+VC_VERSIONS[1900] = 'MSVC14 (Visual C++ 2015)';
var VC_VERSIONS_SHORT = new Array();
VC_VERSIONS_SHORT[1200] = 'VC6';
@@ -717,6 +716,7 @@ function CHECK_LIB(libnames, target, path_to_check, common_name)
var libdir = FSO.GetParentFolderName(location);
libname = FSO.GetFileName(location);
ADD_FLAG("LDFLAGS" + target, '/libpath:"' + libdir + '" ');
+ ADD_FLAG("ARFLAGS" + target, '/libpath:"' + libdir + '" ');
ADD_FLAG("LIBS" + target, libname);
STDOUT.WriteLine(location);
@@ -786,6 +786,7 @@ function OLD_CHECK_LIB(libnames, target, path_to_check)
if (typeof(p) == "string") {
ADD_FLAG("LDFLAGS" + target, '/libpath:"' + p + '" ');
+ ADD_FLAG("ARFLAGS" + target, '/libpath:"' + p + '" ');
ADD_FLAG("LIBS" + target, libname);
have = 1;
} else if (p == true) {
@@ -1097,7 +1098,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
ldflags = "/dll $(LDFLAGS)";
manifest = "-@$(_VC_MANIFEST_EMBED_DLL)";
} else if (makefiletarget.match(new RegExp("\\.lib$"))) {
- ldflags = "$(LDFLAGS)";
+ ldflags = "$(ARFLAGS)";
ld = "$(MAKE_LIB)";
} else {
ldflags = "$(LDFLAGS)";
@@ -1120,17 +1121,17 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
if (MODE_PHPIZE) {
if (ld) {
- MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
+ MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS_RESP) $(PHPLIB) $(ARFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
} else {
ld = '@"$(LINK)"';
- MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
+ MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS_RESP) $(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
}
} else {
if (ld) {
- MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
+ MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(ARFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
} else {
ld = '@"$(LINK)"';
- MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
+ MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
}
}
@@ -1316,10 +1317,10 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
MFO.WriteBlankLines(1);
if (MODE_PHPIZE) {
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
- MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
+ MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS_RESP) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
} else {
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
- MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
+ MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
}
MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)");
MFO.WriteBlankLines(1);
@@ -1336,6 +1337,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')');
} else {
ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)");
+ ADD_FLAG("STATIC_EXT_OBJS_RESP", "$(" + EXT + "_GLOBAL_OBJS_RESP)");
ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")");
ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")");
ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")");
@@ -1394,9 +1396,20 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
sym = target.toUpperCase() + "_GLOBAL_OBJS";
flags = "CFLAGS_" + target.toUpperCase() + '_OBJ';
+ var bd = get_define('BUILD_DIR');
+ var respd = bd + '\\resp';
+ if (!FSO.FolderExists(respd)) {
+ FSO.CreateFolder(respd);
+ }
+ var obj_lst_fn = respd + '\\' + sym + '.txt';
+ var resp = "";
+
if (configure_subst.Exists(sym)) {
tv = configure_subst.Item(sym);
} else {
+ if (FSO.FileExists(obj_lst_fn)) {
+ FSO.DeleteFile(obj_lst_fn, true);
+ }
tv = "";
}
@@ -1439,12 +1452,16 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
sub_build += d;
- DEFINE(bd_flags_name, " /Fp" + sub_build + " /FR" + sub_build + " ");
+ DEFINE(bd_flags_name, "/Fp" + sub_build + " /FR" + sub_build + " ");
+ if (VS_TOOLSET) {
+ ADD_FLAG(bd_flags_name, "/Fd" + sub_build);
+ }
for (i in file_list) {
src = file_list[i];
obj = src.replace(re, ".obj");
tv += " " + sub_build + obj;
+ resp += " " + sub_build.replace('$(BUILD_DIR)', bd) + obj;
if (!PHP_MP_DISABLED) {
if (i > 0) {
@@ -1471,6 +1488,21 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
}
DEFINE(sym, tv);
+
+ /* Generate the response file and define it to the Makefile. This can be
+ useful when getting the "command line too long" linker errors. */
+ var obj_lst_fh = null;
+ if (!FSO.FileExists(obj_lst_fn)) {
+ obj_lst_fh = FSO.CreateTextFile(obj_lst_fn);
+ //STDOUT.WriteLine("Creating " + obj_lst_fn);
+ } else {
+ //STDOUT.WriteLine("Appending to " + obj_lst_fn);
+ obj_lst_fh = FSO.OpenTextFile(obj_lst_fn, 8);
+ }
+
+ obj_lst_fh.Write(" " + resp);
+ obj_lst_fh.Close();
+ DEFINE(sym + "_RESP", '@"' + obj_lst_fn + '"');
}
function REMOVE_TARGET(dllname, flag)
@@ -1967,8 +1999,9 @@ function generate_makefile()
// that is part of the build dir flags (CFLAGS_BD_XXX) from being
// seen as a line continuation character
MF.WriteLine(keys[i] + "=" +
- //word_wrap_and_indent(1, configure_subst.Item(keys[i]), ' \\', '\t') + " "
- configure_subst.Item(keys[i]) + " "
+ /* \s+\/ eliminates extra whitespace caused when using \ for string continuation,
+ whereby \/ is the start of the next compiler switch */
+ trim(configure_subst.Item(keys[i])).replace(/\s+\//gm, " /") + " "
);
MF.WriteBlankLines(1);
}
@@ -2035,6 +2068,7 @@ function ADD_FLAG(name, flags, target)
if (target != null) {
name = target.toUpperCase() + "_" + name;
}
+ flags = trim(flags);
if (configure_subst.Exists(name)) {
var curr_flags = configure_subst.Item(name);
@@ -2499,6 +2533,17 @@ function toolset_is_64()
ERROR("Unsupported toolset");
}
+function toolset_setup_arch()
+{
+ if (X64) {
+ STDOUT.WriteLine(" Detected 64-bit compiler");
+ } else {
+ STDOUT.WriteLine(" Detected 32-bit compiler");
+ }
+ AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");
+ DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86');
+}
+
function toolset_setup_linker()
{
@@ -2562,6 +2607,9 @@ function toolset_setup_common_cflags()
ADD_FLAG('CFLAGS', '-m32');
}
ADD_FLAG("CFLAGS", " /fallback ");
+
+ var vc_ver = probe_binary(PATH_PROG('cl', null));
+ ADD_FLAG("CFLAGS", "-fms-compatibility-version=" + vc_ver);
}
}
@@ -2583,5 +2631,176 @@ function toolset_setup_common_ldlags()
} else {
DEFINE("LDFLAGS", "/nologo ");
}
+
+ // we want msvcrt in the PHP DLL
+ ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
+}
+
+function toolset_setup_common_libs()
+{
+ // urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib
+ DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib");
+}
+
+function toolset_setup_build_mode()
+{
+ if (PHP_DEBUG == "yes") {
+ ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +
+ (X64?"/Zi":"/ZI"));
+ ADD_FLAG("LDFLAGS", "/debug");
+ // Avoid problems when linking to release libraries that use the release
+ // version of the libc
+ ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
+ } else {
+ // Generate external debug files when --enable-debug-pack is specified
+ if (PHP_DEBUG_PACK == "yes") {
+ ADD_FLAG("CFLAGS", "/Zi");
+ ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
+ }
+ // Equivalent to Release_TSInline build -> best optimization
+ ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");
+
+ // if you have VS.Net /GS hardens the binary against buffer overruns
+ // ADD_FLAG("CFLAGS", "/GS");
+ }
+}
+
+function object_out_dir_option_handle()
+{
+ if (PHP_OBJECT_OUT_DIR.length) {
+ PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR);
+ if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) {
+ ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist');
+ }
+ PHP_OBJECT_OUT_DIR += '\\';
+ } else {
+ PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(".") + '\\';
+
+ if (X64) {
+ PHP_OBJECT_OUT_DIR += 'x64\\';
+ if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) {
+ FSO.CreateFolder(PHP_OBJECT_OUT_DIR);
+ }
+ }
+ }
+}
+
+function setup_zts_stuff()
+{
+ if (PHP_ZTS == "yes") {
+ ADD_FLAG("CFLAGS", "/D ZTS=1");
+ ADD_FLAG("ZTS", "1");
+ } else {
+ ADD_FLAG("ZTS", "0");
+ }
+
+ DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");
+
+ // set up the build dir and DLL name
+ if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");
+ if (!MODE_PHPIZE) {
+ DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll");
+ DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib");
+ }
+ } else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug");
+ if (!MODE_PHPIZE) {
+ DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll");
+ DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib");
+ }
+ } else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS");
+ if (!MODE_PHPIZE) {
+ DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll");
+ DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib");
+ }
+ } else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release");
+ if (!MODE_PHPIZE) {
+ DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll");
+ DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib");
+ }
+ }
+
+ if (!FSO.FolderExists(get_define('BUILD_DIR'))) {
+ FSO.CreateFolder(get_define('BUILD_DIR'));
+ }
+}
+
+function php_build_option_handle()
+{
+ if (PHP_PHP_BUILD == 'no') {
+ if (FSO.FolderExists("..\\deps")) {
+ PHP_PHP_BUILD = "..\\deps";
+ } else {
+ if (FSO.FolderExists("..\\php_build")) {
+ PHP_PHP_BUILD = "..\\php_build";
+ } else {
+ if (X64) {
+ if (FSO.FolderExists("..\\win64build")) {
+ PHP_PHP_BUILD = "..\\win64build";
+ } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) {
+ PHP_PHP_BUILD = "..\\php-win64-dev\\php_build";
+ }
+ } else {
+ if (FSO.FolderExists("..\\win32build")) {
+ PHP_PHP_BUILD = "..\\win32build";
+ } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) {
+ PHP_PHP_BUILD = "..\\php-win32-dev\\php_build";
+ }
+ }
+ }
+ }
+ PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD);
+ }
+ DEFINE("PHP_BUILD", PHP_PHP_BUILD);
+}
+
+// Poke around for some headers
+function probe_basic_headers()
+{
+ var p;
+
+ if (PHP_PHP_BUILD != "no") {
+ php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";
+ php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";
+ }
+}
+
+function add_extra_dirs()
+{
+ var path, i, f;
+
+ if (PHP_EXTRA_INCLUDES.length) {
+ path = PHP_EXTRA_INCLUDES.split(';');
+ for (i = 0; i < path.length; i++) {
+ f = FSO.GetAbsolutePathName(path[i]);
+ if (FSO.FolderExists(f)) {
+ ADD_FLAG("CFLAGS", '/I "' + f + '" ');
+ }
+ }
+ }
+ if (PHP_EXTRA_LIBS.length) {
+ path = PHP_EXTRA_LIBS.split(';');
+ for (i = 0; i < path.length; i++) {
+ f = FSO.GetAbsolutePathName(path[i]);
+ if (FSO.FolderExists(f)) {
+ if (VS_TOOLSET && VCVERS <= 1200 && f.indexOf(" ") >= 0) {
+ ADD_FLAG("LDFLAGS", '/libpath:"\\"' + f + '\\"" ');
+ ADD_FLAG("ARFLAGS", '/libpath:"\\"' + f + '\\"" ');
+ } else {
+ ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" ');
+ ADD_FLAG("ARFLAGS", '/libpath:"' + f + '" ');
+ }
+ }
+ }
+ }
+
+}
+
+function trim(s)
+{
+ return s.replace(/^\s+/, "").replace(/\s+$/, "");
}
diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt
index 0ea0067a62..091c3f3282 100644
--- a/win32/build/libs_version.txt
+++ b/win32/build/libs_version.txt
@@ -1,9 +1,9 @@
bz2-1.0.6
cclient-2007f
freetype-2.5.3
-icu-53.1
+icu-54.1
jpeglib-9a
-libcurl-7.36.0
+libcurl-7.39.0
libiconv-1.14
libmcrypt-2.5.8
libmpir-2.6.0
@@ -13,4 +13,4 @@ libssh2-1.4.3
libtidy-20090406
libxslt-1.1.27
libxml-2.9.1
-openssl-1.0.1h
+openssl-1.0.1i
diff --git a/win32/glob.h b/win32/glob.h
index 63b8fc2f67..24ae69467c 100644
--- a/win32/glob.h
+++ b/win32/glob.h
@@ -47,7 +47,8 @@
# include <sys/cdefs.h>
#endif
-zend_stat_t;
+#include "Zend/zend_stream.h"
+
typedef struct {
int gl_pathc; /* Count of total paths so far. */
int gl_matchc; /* Count of paths matching pattern. */
diff --git a/win32/sendmail.c b/win32/sendmail.c
index aaeeea3aa5..a88323722d 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -3,7 +3,7 @@
*
* This file is rewriten specificly for PHPFI. Some functionality
* has been removed (MIME and file attachments). This code was
- * modified from code based on code writen by Jarle Aase.
+ * modified from code based on code written by Jarle Aase.
*
* This class is based on the original code by Jarle Aase, see bellow:
* wSendmail.cpp It has been striped of some functionality to match
@@ -572,7 +572,7 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char
pos1 = pointer IN headers where the Bcc starts
'4' = Length of the characters 'bcc:'
Because we've added +4 above for parsing the Emails
- we've to substract them here. */
+ we've to subtract them here. */
memcpy(stripped_header, headers, pos1 - headers - 4);
if (pos1 != pos2) {
/* if pos1 != pos2 , pos2 points to the rest of the headers.
diff --git a/win32/winutil.c b/win32/winutil.c
index eab3df9cda..f13a785212 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -79,10 +79,7 @@ void php_win32_free_rng_lock()
PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ */
- unsigned int has_contextg = 0;
-
BOOL ret;
- size_t i = 0;
#ifdef ZTS
tsrm_mutex_lock(php_lock_win32_cryptoctx);
diff --git a/win32/winutil.h b/win32/winutil.h
index 74d72062c4..f29b593c8d 100644
--- a/win32/winutil.h
+++ b/win32/winutil.h
@@ -20,7 +20,7 @@ PHPAPI char *php_win32_error_to_msg(HRESULT error);
#define php_win_err() php_win32_error_to_msg(GetLastError())
int php_win32_check_trailing_space(const char * path, const int path_len);
-PHPAPI php_win32_get_random_bytes(unsigned char *buf, size_t size);
+PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size);
#ifdef ZTS
void php_win32_init_rng_lock();