summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gdbinit25
-rw-r--r--NEWS5
-rw-r--r--README.PARAMETER_PARSING_API62
-rw-r--r--TSRM/TSRM.h2
-rw-r--r--TSRM/tsrm_nw.c2
-rw-r--r--TSRM/tsrm_nw.h2
-rw-r--r--TSRM/tsrm_win32.c2
-rw-r--r--TSRM/tsrm_win32.h2
-rw-r--r--UPGRADING4
-rw-r--r--Zend/Zend.dsp4
-rw-r--r--Zend/ZendTS.dsp4
-rw-r--r--Zend/tests/034.phpt4
-rw-r--r--Zend/tests/bug67985.phpt16
-rw-r--r--Zend/tests/concat_002.phpt24
-rw-r--r--Zend/tests/gc_033.phpt28
-rw-r--r--Zend/zend.c96
-rw-r--r--Zend/zend.h615
-rw-r--r--Zend/zend_API.c20
-rw-r--r--Zend/zend_API.h4
-rw-r--r--Zend/zend_alloc.c200
-rw-r--r--Zend/zend_alloc.h12
-rw-r--r--Zend/zend_arena.h10
-rw-r--r--Zend/zend_ast.c32
-rw-r--r--Zend/zend_ast.h24
-rw-r--r--Zend/zend_builtin_functions.c104
-rw-r--r--Zend/zend_closures.c2
-rw-r--r--Zend/zend_compile.c1683
-rw-r--r--Zend/zend_compile.h45
-rw-r--r--Zend/zend_constants.c2
-rw-r--r--Zend/zend_exceptions.c8
-rw-r--r--Zend/zend_exceptions.h4
-rw-r--r--Zend/zend_execute.c402
-rw-r--r--Zend/zend_execute.h22
-rw-r--r--Zend/zend_execute_API.c16
-rw-r--r--Zend/zend_extensions.c2
-rw-r--r--Zend/zend_gc.c26
-rw-r--r--Zend/zend_gc.h1
-rw-r--r--Zend/zend_globals.h2
-rw-r--r--Zend/zend_hash.c389
-rw-r--r--Zend/zend_hash.h164
-rw-r--r--Zend/zend_inheritance.c1581
-rw-r--r--Zend/zend_inheritance.h46
-rw-r--r--Zend/zend_ini.c198
-rw-r--r--Zend/zend_ini.h45
-rw-r--r--Zend/zend_ini_parser.y12
-rw-r--r--Zend/zend_ini_scanner.c3661
-rw-r--r--Zend/zend_ini_scanner.h1
-rw-r--r--Zend/zend_ini_scanner.l61
-rw-r--r--Zend/zend_interfaces.c11
-rw-r--r--Zend/zend_interfaces.h8
-rw-r--r--Zend/zend_iterators.c26
-rw-r--r--Zend/zend_iterators.h9
-rw-r--r--Zend/zend_language_scanner.c730
-rw-r--r--Zend/zend_language_scanner.l30
-rw-r--r--Zend/zend_llist.c38
-rw-r--r--Zend/zend_llist.h2
-rw-r--r--Zend/zend_long.h15
-rw-r--r--Zend/zend_multiply.h138
-rw-r--r--Zend/zend_object_handlers.c20
-rw-r--r--Zend/zend_object_handlers.h2
-rw-r--r--Zend/zend_objects.c2
-rw-r--r--Zend/zend_opcode.c5
-rw-r--r--Zend/zend_operators.c233
-rw-r--r--Zend/zend_operators.h182
-rw-r--r--Zend/zend_portability.h399
-rw-r--r--Zend/zend_ptr_stack.h2
-rw-r--r--Zend/zend_stream.h6
-rw-r--r--Zend/zend_string.c2
-rw-r--r--Zend/zend_string.h16
-rw-r--r--Zend/zend_ts_hash.c4
-rw-r--r--Zend/zend_ts_hash.h12
-rw-r--r--Zend/zend_types.h239
-rw-r--r--Zend/zend_variables.h8
-rw-r--r--Zend/zend_virtual_cwd.c2
-rw-r--r--Zend/zend_virtual_cwd.h10
-rw-r--r--Zend/zend_vm_def.h586
-rw-r--r--Zend/zend_vm_execute.h2145
-rw-r--r--Zend/zend_vm_opcodes.c4
-rw-r--r--Zend/zend_vm_opcodes.h2
-rw-r--r--build/build.mk2
-rw-r--r--build/build2.mk2
-rwxr-xr-xbuild/buildcheck.sh2
-rw-r--r--build/mkdep.awk2
-rw-r--r--configure.in43
-rw-r--r--ext/bcmath/bcmath.c2
-rw-r--r--ext/bcmath/php_bcmath.h2
-rw-r--r--ext/bz2/bz2.c8
-rw-r--r--ext/bz2/bz2_filter.c14
-rw-r--r--ext/bz2/php_bz2.h2
-rw-r--r--ext/calendar/cal_unix.c2
-rw-r--r--ext/calendar/calendar.c2
-rw-r--r--ext/calendar/easter.c2
-rw-r--r--ext/com_dotnet/com_com.c2
-rw-r--r--ext/com_dotnet/com_dotnet.c2
-rw-r--r--ext/com_dotnet/com_extension.c4
-rw-r--r--ext/com_dotnet/com_handlers.c2
-rw-r--r--ext/com_dotnet/com_iterator.c2
-rw-r--r--ext/com_dotnet/com_misc.c2
-rw-r--r--ext/com_dotnet/com_olechar.c2
-rw-r--r--ext/com_dotnet/com_persist.c2
-rw-r--r--ext/com_dotnet/com_saproxy.c2
-rw-r--r--ext/com_dotnet/com_typeinfo.c2
-rw-r--r--ext/com_dotnet/com_variant.c2
-rw-r--r--ext/com_dotnet/com_wrapper.c6
-rw-r--r--ext/com_dotnet/php_com_dotnet.h2
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h4
-rw-r--r--ext/ctype/ctype.c2
-rw-r--r--ext/ctype/php_ctype.h2
-rw-r--r--ext/curl/curl_file.c2
-rw-r--r--ext/curl/interface.c12
-rw-r--r--ext/curl/multi.c2
-rw-r--r--ext/curl/php_curl.h2
-rw-r--r--ext/curl/share.c2
-rw-r--r--ext/curl/tests/check_win_config.phpt2
-rw-r--r--ext/date/lib/astro.c2
-rw-r--r--ext/date/lib/dow.c2
-rw-r--r--ext/date/lib/interval.c2
-rw-r--r--ext/date/lib/parse_date.c2
-rw-r--r--ext/date/lib/parse_date.re2
-rw-r--r--ext/date/lib/parse_iso_intervals.c2
-rw-r--r--ext/date/lib/parse_iso_intervals.re2
-rw-r--r--ext/date/lib/parse_tz.c2
-rw-r--r--ext/date/lib/timelib.c5
-rw-r--r--ext/date/lib/timelib.h2
-rw-r--r--ext/date/lib/timelib_structs.h6
-rw-r--r--ext/date/lib/timezonedb.h1319
-rw-r--r--ext/date/lib/tm2unixtime.c2
-rw-r--r--ext/date/lib/unixtime2tm.c2
-rw-r--r--ext/date/php_date.c16
-rw-r--r--ext/date/php_date.h2
-rw-r--r--ext/dba/dba.c12
-rw-r--r--ext/dba/dba_cdb.c2
-rw-r--r--ext/dba/dba_db1.c2
-rw-r--r--ext/dba/dba_db2.c2
-rw-r--r--ext/dba/dba_db3.c2
-rw-r--r--ext/dba/dba_db4.c2
-rw-r--r--ext/dba/dba_dbm.c2
-rw-r--r--ext/dba/dba_flatfile.c2
-rw-r--r--ext/dba/dba_gdbm.c2
-rw-r--r--ext/dba/dba_inifile.c2
-rw-r--r--ext/dba/dba_ndbm.c2
-rw-r--r--ext/dba/dba_qdbm.c2
-rw-r--r--ext/dba/dba_tcadb.c2
-rw-r--r--ext/dba/libcdb/cdb.c2
-rw-r--r--ext/dba/libcdb/cdb.h2
-rw-r--r--ext/dba/libcdb/cdb_make.c2
-rw-r--r--ext/dba/libcdb/cdb_make.h2
-rw-r--r--ext/dba/libcdb/uint32.c2
-rw-r--r--ext/dba/libcdb/uint32.h2
-rw-r--r--ext/dba/libflatfile/flatfile.c2
-rw-r--r--ext/dba/libflatfile/flatfile.h2
-rw-r--r--ext/dba/libinifile/inifile.c2
-rw-r--r--ext/dba/libinifile/inifile.h2
-rw-r--r--ext/dba/php_dba.h2
-rw-r--r--ext/dba/php_tcadb.h2
-rw-r--r--ext/dom/attr.c8
-rw-r--r--ext/dom/cdatasection.c2
-rw-r--r--ext/dom/characterdata.c14
-rw-r--r--ext/dom/comment.c2
-rw-r--r--ext/dom/document.c30
-rw-r--r--ext/dom/documentfragment.c4
-rw-r--r--ext/dom/documenttype.c4
-rw-r--r--ext/dom/dom_ce.h2
-rw-r--r--ext/dom/dom_fe.h2
-rw-r--r--ext/dom/dom_iterators.c8
-rw-r--r--ext/dom/dom_properties.h2
-rw-r--r--ext/dom/domconfiguration.c2
-rw-r--r--ext/dom/domerror.c2
-rw-r--r--ext/dom/domerrorhandler.c2
-rw-r--r--ext/dom/domexception.c2
-rw-r--r--ext/dom/domimplementation.c22
-rw-r--r--ext/dom/domimplementationlist.c2
-rw-r--r--ext/dom/domimplementationsource.c2
-rw-r--r--ext/dom/domlocator.c2
-rw-r--r--ext/dom/domstringlist.c2
-rw-r--r--ext/dom/element.c4
-rw-r--r--ext/dom/entity.c4
-rw-r--r--ext/dom/entityreference.c4
-rw-r--r--ext/dom/namednodemap.c14
-rw-r--r--ext/dom/namelist.c2
-rw-r--r--ext/dom/node.c66
-rw-r--r--ext/dom/nodelist.c8
-rw-r--r--ext/dom/notation.c2
-rw-r--r--ext/dom/php_dom.c2
-rw-r--r--ext/dom/php_dom.h2
-rw-r--r--ext/dom/processinginstruction.c6
-rw-r--r--ext/dom/string_extend.c2
-rw-r--r--ext/dom/tests/node_textcontent.phpt29
-rw-r--r--ext/dom/text.c4
-rw-r--r--ext/dom/typeinfo.c2
-rw-r--r--ext/dom/userdatahandler.c2
-rw-r--r--ext/dom/xml_common.h5
-rw-r--r--ext/dom/xpath.c16
-rw-r--r--ext/enchant/enchant.c2
-rw-r--r--ext/ereg/ereg.c2
-rw-r--r--ext/ereg/php_ereg.h2
-rw-r--r--ext/ereg/php_regex.h2
-rw-r--r--ext/exif/exif.c16
-rw-r--r--ext/exif/php_exif.h2
-rw-r--r--ext/fileinfo/fileinfo.c2
-rw-r--r--ext/fileinfo/libmagic/softmagic.c2
-rw-r--r--ext/fileinfo/php_fileinfo.h2
-rw-r--r--ext/filter/callback_filter.c2
-rw-r--r--ext/filter/filter.c6
-rw-r--r--ext/filter/filter_private.h2
-rw-r--r--ext/filter/logical_filters.c2
-rw-r--r--ext/filter/php_filter.h2
-rw-r--r--ext/filter/sanitizing_filters.c12
-rw-r--r--ext/ftp/ftp.c2
-rw-r--r--ext/ftp/ftp.h2
-rw-r--r--ext/ftp/php_ftp.c4
-rw-r--r--ext/ftp/php_ftp.h2
-rw-r--r--ext/gd/gd.c2
-rw-r--r--ext/gd/gd_ctx.c2
-rw-r--r--ext/gd/libgd/xbm.c2
-rw-r--r--ext/gd/php_gd.h2
-rw-r--r--ext/gd/tests/bug48801_1.phpt4
-rw-r--r--ext/gettext/gettext.c2
-rw-r--r--ext/gettext/php_gettext.h2
-rw-r--r--ext/gmp/gmp.c227
-rw-r--r--ext/gmp/php_gmp.h13
-rw-r--r--ext/gmp/tests/001.phpt21
-rw-r--r--ext/gmp/tests/bug50175.phpt18
-rw-r--r--ext/gmp/tests/gmp_abs.phpt (renamed from ext/gmp/tests/013.phpt)0
-rw-r--r--ext/gmp/tests/gmp_and.phpt (renamed from ext/gmp/tests/029.phpt)0
-rw-r--r--ext/gmp/tests/gmp_clrbit.phpt (renamed from ext/gmp/tests/034.phpt)0
-rw-r--r--ext/gmp/tests/gmp_cmp.phpt (renamed from ext/gmp/tests/026.phpt)0
-rw-r--r--ext/gmp/tests/gmp_com.phpt (renamed from ext/gmp/tests/031.phpt)0
-rw-r--r--ext/gmp/tests/gmp_div_q.phpt (renamed from ext/gmp/tests/009.phpt)0
-rw-r--r--ext/gmp/tests/gmp_div_qr.phpt (renamed from ext/gmp/tests/007.phpt)17
-rw-r--r--ext/gmp/tests/gmp_div_r.phpt (renamed from ext/gmp/tests/008.phpt)0
-rw-r--r--ext/gmp/tests/gmp_divexact.phpt (renamed from ext/gmp/tests/011.phpt)0
-rw-r--r--ext/gmp/tests/gmp_export.phpt80
-rw-r--r--ext/gmp/tests/gmp_fact.phpt (renamed from ext/gmp/tests/014.phpt)0
-rw-r--r--ext/gmp/tests/gmp_gcd.phpt (renamed from ext/gmp/tests/021.phpt)0
-rw-r--r--ext/gmp/tests/gmp_gcdext.phpt (renamed from ext/gmp/tests/022.phpt)0
-rw-r--r--ext/gmp/tests/gmp_hamdist.phpt (renamed from ext/gmp/tests/036.phpt)0
-rw-r--r--ext/gmp/tests/gmp_import.phpt91
-rw-r--r--ext/gmp/tests/gmp_init.phpt (renamed from ext/gmp/tests/040.phpt)0
-rw-r--r--ext/gmp/tests/gmp_intval.phpt (renamed from ext/gmp/tests/004.phpt)0
-rw-r--r--ext/gmp/tests/gmp_invert.phpt (renamed from ext/gmp/tests/023.phpt)0
-rw-r--r--ext/gmp/tests/gmp_jacobi.phpt (renamed from ext/gmp/tests/024.phpt)0
-rw-r--r--ext/gmp/tests/gmp_legendre.phpt (renamed from ext/gmp/tests/025.phpt)0
-rw-r--r--ext/gmp/tests/gmp_mod.phpt (renamed from ext/gmp/tests/010.phpt)0
-rw-r--r--ext/gmp/tests/gmp_neg.phpt (renamed from ext/gmp/tests/012.phpt)0
-rw-r--r--ext/gmp/tests/gmp_or.phpt (renamed from ext/gmp/tests/030.phpt)0
-rw-r--r--ext/gmp/tests/gmp_perfect_square.phpt (renamed from ext/gmp/tests/019.phpt)0
-rw-r--r--ext/gmp/tests/gmp_php_int_max.phpt29
-rw-r--r--ext/gmp/tests/gmp_popcount.phpt (renamed from ext/gmp/tests/035.phpt)0
-rw-r--r--ext/gmp/tests/gmp_pow.phpt (renamed from ext/gmp/tests/015.phpt)0
-rw-r--r--ext/gmp/tests/gmp_pown.phpt (renamed from ext/gmp/tests/016.phpt)9
-rw-r--r--ext/gmp/tests/gmp_prob_prime.phpt (renamed from ext/gmp/tests/020.phpt)0
-rw-r--r--ext/gmp/tests/gmp_random.phpt (renamed from ext/gmp/tests/028.phpt)0
-rw-r--r--ext/gmp/tests/gmp_remroot.phpt (renamed from ext/gmp/tests/041.phpt)49
-rw-r--r--ext/gmp/tests/gmp_root.phpt58
-rw-r--r--ext/gmp/tests/gmp_scan0.phpt (renamed from ext/gmp/tests/037.phpt)0
-rw-r--r--ext/gmp/tests/gmp_scan1.phpt (renamed from ext/gmp/tests/038.phpt)0
-rw-r--r--ext/gmp/tests/gmp_setbit.phpt (renamed from ext/gmp/tests/033.phpt)0
-rw-r--r--ext/gmp/tests/gmp_sign.phpt (renamed from ext/gmp/tests/027.phpt)0
-rw-r--r--ext/gmp/tests/gmp_sqrt.phpt (renamed from ext/gmp/tests/017.phpt)0
-rw-r--r--ext/gmp/tests/gmp_sqrtrem.phpt (renamed from ext/gmp/tests/018.phpt)0
-rw-r--r--ext/gmp/tests/gmp_strval.phpt (renamed from ext/gmp/tests/005.phpt)0
-rw-r--r--ext/gmp/tests/gmp_sub.phpt (renamed from ext/gmp/tests/006.phpt)0
-rw-r--r--ext/gmp/tests/gmp_testbit.phpt (renamed from ext/gmp/tests/039.phpt)5
-rw-r--r--ext/gmp/tests/gmp_xor.phpt (renamed from ext/gmp/tests/032.phpt)0
-rw-r--r--ext/gmp/tests/overloading.phpt60
-rw-r--r--ext/hash/hash.c14
-rw-r--r--ext/hash/hash_adler32.c2
-rw-r--r--ext/hash/hash_crc32.c2
-rw-r--r--ext/hash/hash_fnv.c2
-rw-r--r--ext/hash/hash_gost.c6
-rw-r--r--ext/hash/hash_haval.c18
-rw-r--r--ext/hash/hash_joaat.c2
-rw-r--r--ext/hash/hash_md.c8
-rw-r--r--ext/hash/hash_ripemd.c18
-rw-r--r--ext/hash/hash_sha.c18
-rw-r--r--ext/hash/hash_snefru.c6
-rw-r--r--ext/hash/hash_tiger.c12
-rw-r--r--ext/hash/hash_whirlpool.c8
-rw-r--r--ext/hash/php_hash.h2
-rw-r--r--ext/hash/php_hash_adler32.h2
-rw-r--r--ext/hash/php_hash_crc32.h2
-rw-r--r--ext/hash/php_hash_crc32_tables.h2
-rw-r--r--ext/hash/php_hash_fnv.h2
-rw-r--r--ext/hash/php_hash_gost.h2
-rw-r--r--ext/hash/php_hash_haval.h2
-rw-r--r--ext/hash/php_hash_joaat.h2
-rw-r--r--ext/hash/php_hash_md.h2
-rw-r--r--ext/hash/php_hash_ripemd.h2
-rw-r--r--ext/hash/php_hash_sha.h2
-rw-r--r--ext/hash/php_hash_snefru.h2
-rw-r--r--ext/hash/php_hash_snefru_tables.h2
-rw-r--r--ext/hash/php_hash_tiger.h2
-rw-r--r--ext/hash/php_hash_tiger_tables.h2
-rw-r--r--ext/hash/php_hash_whirlpool.h2
-rw-r--r--ext/hash/php_hash_whirlpool_tables.h2
-rw-r--r--ext/iconv/iconv.c51
-rw-r--r--ext/iconv/php_iconv.h2
-rw-r--r--ext/imap/php_imap.c2
-rw-r--r--ext/imap/php_imap.h2
-rw-r--r--ext/interbase/ibase_blobs.c2
-rw-r--r--ext/interbase/ibase_events.c2
-rw-r--r--ext/interbase/ibase_query.c2
-rw-r--r--ext/interbase/ibase_service.c2
-rw-r--r--ext/interbase/interbase.c2
-rw-r--r--ext/interbase/php_ibase_includes.h2
-rw-r--r--ext/interbase/php_ibase_udf.c2
-rw-r--r--ext/interbase/php_interbase.h2
-rw-r--r--ext/intl/breakiterator/breakiterator_class.cpp2
-rw-r--r--ext/intl/breakiterator/breakiterator_class.h2
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.cpp2
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.h2
-rw-r--r--ext/intl/breakiterator/breakiterator_methods.cpp2
-rw-r--r--ext/intl/breakiterator/breakiterator_methods.h2
-rw-r--r--ext/intl/breakiterator/codepointiterator_internal.cpp2
-rw-r--r--ext/intl/breakiterator/codepointiterator_internal.h2
-rw-r--r--ext/intl/breakiterator/codepointiterator_methods.cpp2
-rw-r--r--ext/intl/breakiterator/codepointiterator_methods.h2
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp2
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.h2
-rw-r--r--ext/intl/calendar/calendar_class.cpp2
-rw-r--r--ext/intl/calendar/calendar_class.h2
-rw-r--r--ext/intl/calendar/calendar_methods.cpp2
-rw-r--r--ext/intl/calendar/calendar_methods.h2
-rw-r--r--ext/intl/calendar/gregoriancalendar_methods.cpp2
-rw-r--r--ext/intl/calendar/gregoriancalendar_methods.h2
-rw-r--r--ext/intl/collator/collator.c2
-rw-r--r--ext/intl/collator/collator.h2
-rw-r--r--ext/intl/collator/collator_attr.c2
-rw-r--r--ext/intl/collator/collator_attr.h2
-rw-r--r--ext/intl/collator/collator_class.c2
-rw-r--r--ext/intl/collator/collator_class.h2
-rw-r--r--ext/intl/collator/collator_compare.c2
-rw-r--r--ext/intl/collator/collator_compare.h2
-rw-r--r--ext/intl/collator/collator_convert.c2
-rw-r--r--ext/intl/collator/collator_convert.h2
-rw-r--r--ext/intl/collator/collator_create.c2
-rw-r--r--ext/intl/collator/collator_create.h2
-rw-r--r--ext/intl/collator/collator_error.c2
-rw-r--r--ext/intl/collator/collator_error.h2
-rw-r--r--ext/intl/collator/collator_is_numeric.c2
-rw-r--r--ext/intl/collator/collator_is_numeric.h2
-rw-r--r--ext/intl/collator/collator_locale.c2
-rw-r--r--ext/intl/collator/collator_locale.h2
-rw-r--r--ext/intl/collator/collator_sort.c2
-rw-r--r--ext/intl/collator/collator_sort.h2
-rw-r--r--ext/intl/common/common_date.cpp2
-rw-r--r--ext/intl/common/common_date.h2
-rw-r--r--ext/intl/common/common_enum.cpp2
-rw-r--r--ext/intl/common/common_enum.h2
-rw-r--r--ext/intl/common/common_error.c2
-rw-r--r--ext/intl/common/common_error.h2
-rw-r--r--ext/intl/converter/converter.c2
-rw-r--r--ext/intl/converter/converter.h2
-rw-r--r--ext/intl/dateformat/dateformat.c2
-rw-r--r--ext/intl/dateformat/dateformat.h2
-rw-r--r--ext/intl/dateformat/dateformat_attr.c2
-rw-r--r--ext/intl/dateformat/dateformat_attr.h2
-rw-r--r--ext/intl/dateformat/dateformat_attrcpp.cpp2
-rw-r--r--ext/intl/dateformat/dateformat_attrcpp.h2
-rw-r--r--ext/intl/dateformat/dateformat_class.c2
-rw-r--r--ext/intl/dateformat/dateformat_class.h2
-rw-r--r--ext/intl/dateformat/dateformat_create.cpp2
-rw-r--r--ext/intl/dateformat/dateformat_create.h2
-rw-r--r--ext/intl/dateformat/dateformat_data.c2
-rw-r--r--ext/intl/dateformat/dateformat_data.h2
-rw-r--r--ext/intl/dateformat/dateformat_format.c2
-rw-r--r--ext/intl/dateformat/dateformat_format.h2
-rw-r--r--ext/intl/dateformat/dateformat_format_object.cpp2
-rw-r--r--ext/intl/dateformat/dateformat_format_object.h2
-rw-r--r--ext/intl/dateformat/dateformat_helpers.cpp2
-rw-r--r--ext/intl/dateformat/dateformat_helpers.h2
-rw-r--r--ext/intl/dateformat/dateformat_parse.c2
-rw-r--r--ext/intl/dateformat/dateformat_parse.h2
-rw-r--r--ext/intl/formatter/formatter.c2
-rw-r--r--ext/intl/formatter/formatter.h2
-rw-r--r--ext/intl/formatter/formatter_attr.c2
-rw-r--r--ext/intl/formatter/formatter_attr.h2
-rw-r--r--ext/intl/formatter/formatter_class.c2
-rw-r--r--ext/intl/formatter/formatter_class.h2
-rw-r--r--ext/intl/formatter/formatter_data.c2
-rw-r--r--ext/intl/formatter/formatter_data.h2
-rw-r--r--ext/intl/formatter/formatter_format.c2
-rw-r--r--ext/intl/formatter/formatter_format.h2
-rw-r--r--ext/intl/formatter/formatter_main.c2
-rw-r--r--ext/intl/formatter/formatter_main.h2
-rw-r--r--ext/intl/formatter/formatter_parse.c2
-rw-r--r--ext/intl/formatter/formatter_parse.h2
-rw-r--r--ext/intl/grapheme/grapheme.h2
-rw-r--r--ext/intl/grapheme/grapheme_util.c2
-rw-r--r--ext/intl/grapheme/grapheme_util.h2
-rw-r--r--ext/intl/idn/idn.c4
-rw-r--r--ext/intl/idn/idn.h2
-rw-r--r--ext/intl/intl_common.h2
-rw-r--r--ext/intl/intl_convert.c2
-rw-r--r--ext/intl/intl_convert.h2
-rw-r--r--ext/intl/intl_convertcpp.cpp2
-rw-r--r--ext/intl/intl_convertcpp.h2
-rw-r--r--ext/intl/intl_cppshims.h2
-rw-r--r--ext/intl/intl_data.h2
-rw-r--r--ext/intl/intl_error.c2
-rw-r--r--ext/intl/intl_error.h2
-rw-r--r--ext/intl/locale/locale.c2
-rw-r--r--ext/intl/locale/locale.h2
-rw-r--r--ext/intl/locale/locale_class.c2
-rw-r--r--ext/intl/locale/locale_class.h2
-rw-r--r--ext/intl/locale/locale_methods.c20
-rw-r--r--ext/intl/locale/locale_methods.h2
-rw-r--r--ext/intl/msgformat/msgformat.c2
-rw-r--r--ext/intl/msgformat/msgformat.h2
-rw-r--r--ext/intl/msgformat/msgformat_attr.c2
-rw-r--r--ext/intl/msgformat/msgformat_attr.h2
-rw-r--r--ext/intl/msgformat/msgformat_class.c2
-rw-r--r--ext/intl/msgformat/msgformat_class.h2
-rw-r--r--ext/intl/msgformat/msgformat_data.c2
-rw-r--r--ext/intl/msgformat/msgformat_data.h2
-rw-r--r--ext/intl/msgformat/msgformat_format.c2
-rw-r--r--ext/intl/msgformat/msgformat_format.h2
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp2
-rw-r--r--ext/intl/msgformat/msgformat_helpers.h2
-rw-r--r--ext/intl/msgformat/msgformat_parse.c2
-rw-r--r--ext/intl/msgformat/msgformat_parse.h2
-rw-r--r--ext/intl/normalizer/normalizer.c2
-rw-r--r--ext/intl/normalizer/normalizer.h2
-rw-r--r--ext/intl/normalizer/normalizer_class.c2
-rw-r--r--ext/intl/normalizer/normalizer_class.h2
-rw-r--r--ext/intl/normalizer/normalizer_normalize.h2
-rw-r--r--ext/intl/php_intl.c2
-rw-r--r--ext/intl/php_intl.h2
-rw-r--r--ext/intl/resourcebundle/resourcebundle.c2
-rw-r--r--ext/intl/resourcebundle/resourcebundle.h2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.h2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.c2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.h2
-rw-r--r--ext/intl/spoofchecker/spoofchecker.c2
-rw-r--r--ext/intl/spoofchecker/spoofchecker.h2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.c2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.h2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_create.c2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_create.h2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_main.c2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_main.h2
-rw-r--r--ext/intl/timezone/timezone_class.cpp2
-rw-r--r--ext/intl/timezone/timezone_class.h2
-rw-r--r--ext/intl/timezone/timezone_methods.cpp2
-rw-r--r--ext/intl/timezone/timezone_methods.h2
-rw-r--r--ext/intl/transliterator/transliterator.c2
-rw-r--r--ext/intl/transliterator/transliterator.h2
-rw-r--r--ext/intl/transliterator/transliterator_class.c2
-rw-r--r--ext/intl/transliterator/transliterator_class.h2
-rw-r--r--ext/intl/transliterator/transliterator_methods.c2
-rw-r--r--ext/intl/transliterator/transliterator_methods.h2
-rw-r--r--ext/json/json.c6
-rw-r--r--ext/json/php_json.h2
-rw-r--r--ext/json/utf8_decode.h2
-rw-r--r--ext/ldap/ldap.c2
-rw-r--r--ext/ldap/php_ldap.h2
-rw-r--r--ext/libxml/libxml.c18
-rw-r--r--ext/libxml/php_libxml.h2
-rw-r--r--ext/mbstring/mb_gpc.c2
-rw-r--r--ext/mbstring/mb_gpc.h10
-rw-r--r--ext/mbstring/mbstring.c46
-rw-r--r--ext/mbstring/mbstring.h2
-rw-r--r--ext/mbstring/php_mbregex.c8
-rw-r--r--ext/mbstring/php_mbregex.h2
-rw-r--r--ext/mbstring/php_unicode.c2
-rw-r--r--ext/mbstring/php_unicode.h2
-rw-r--r--ext/mbstring/tests/zend_multibyte-02.phpt3
-rw-r--r--ext/mbstring/tests/zend_multibyte-06.phpt2
-rw-r--r--ext/mbstring/tests/zend_multibyte-07.phpt3
-rw-r--r--ext/mbstring/tests/zend_multibyte-09.phpt3
-rw-r--r--ext/mcrypt/mcrypt.c2
-rw-r--r--ext/mcrypt/mcrypt_filter.c2
-rw-r--r--ext/mcrypt/php_mcrypt.h2
-rw-r--r--ext/mcrypt/php_mcrypt_filter.h2
-rw-r--r--ext/mssql/php_mssql.c2
-rw-r--r--ext/mssql/php_mssql.h2
-rw-r--r--ext/mysql/mysql_mysqlnd.h2
-rw-r--r--ext/mysql/php_mysql.c4
-rw-r--r--ext/mysql/php_mysql.h2
-rw-r--r--ext/mysql/php_mysql_structs.h2
-rw-r--r--ext/mysqli/mysqli.c2
-rw-r--r--ext/mysqli/mysqli_api.c2
-rw-r--r--ext/mysqli/mysqli_driver.c2
-rw-r--r--ext/mysqli/mysqli_embedded.c2
-rw-r--r--ext/mysqli/mysqli_exception.c2
-rw-r--r--ext/mysqli/mysqli_fe.c2
-rw-r--r--ext/mysqli/mysqli_fe.h2
-rw-r--r--ext/mysqli/mysqli_libmysql.h2
-rw-r--r--ext/mysqli/mysqli_mysqlnd.h2
-rw-r--r--ext/mysqli/mysqli_nonapi.c2
-rw-r--r--ext/mysqli/mysqli_priv.h2
-rw-r--r--ext/mysqli/mysqli_prop.c8
-rw-r--r--ext/mysqli/mysqli_report.c2
-rw-r--r--ext/mysqli/mysqli_result_iterator.c2
-rw-r--r--ext/mysqli/mysqli_warning.c2
-rw-r--r--ext/mysqli/php_mysqli.h2
-rw-r--r--ext/mysqli/php_mysqli_structs.h2
-rw-r--r--ext/mysqlnd/mysqlnd.c10
-rw-r--r--ext/mysqlnd/mysqlnd.h6
-rw-r--r--ext/mysqlnd/mysqlnd_alloc.c2
-rw-r--r--ext/mysqlnd/mysqlnd_alloc.h2
-rw-r--r--ext/mysqlnd/mysqlnd_auth.c2
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.c2
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.h2
-rw-r--r--ext/mysqlnd/mysqlnd_charset.c2
-rw-r--r--ext/mysqlnd/mysqlnd_charset.h2
-rw-r--r--ext/mysqlnd/mysqlnd_debug.c2
-rw-r--r--ext/mysqlnd/mysqlnd_debug.h2
-rw-r--r--ext/mysqlnd/mysqlnd_driver.c2
-rw-r--r--ext/mysqlnd/mysqlnd_enum_n_def.h2
-rw-r--r--ext/mysqlnd/mysqlnd_ext_plugin.c2
-rw-r--r--ext/mysqlnd/mysqlnd_ext_plugin.h2
-rw-r--r--ext/mysqlnd/mysqlnd_libmysql_compat.h2
-rw-r--r--ext/mysqlnd/mysqlnd_loaddata.c2
-rw-r--r--ext/mysqlnd/mysqlnd_net.c2
-rw-r--r--ext/mysqlnd/mysqlnd_net.h2
-rw-r--r--ext/mysqlnd/mysqlnd_plugin.c2
-rw-r--r--ext/mysqlnd/mysqlnd_priv.h2
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c8
-rw-r--r--ext/mysqlnd/mysqlnd_ps_codec.c14
-rw-r--r--ext/mysqlnd/mysqlnd_result.c2
-rw-r--r--ext/mysqlnd/mysqlnd_result.h2
-rw-r--r--ext/mysqlnd/mysqlnd_result_meta.c4
-rw-r--r--ext/mysqlnd/mysqlnd_result_meta.h2
-rw-r--r--ext/mysqlnd/mysqlnd_reverse_api.c2
-rw-r--r--ext/mysqlnd/mysqlnd_reverse_api.h2
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.c2
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.h2
-rw-r--r--ext/mysqlnd/mysqlnd_structs.h38
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c6
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.h10
-rw-r--r--ext/mysqlnd/php_mysqlnd.c4
-rw-r--r--ext/mysqlnd/php_mysqlnd.h2
-rw-r--r--ext/oci8/oci8.c86
-rw-r--r--ext/oci8/oci8_collection.c36
-rw-r--r--ext/oci8/oci8_interface.c409
-rw-r--r--ext/oci8/oci8_lob.c28
-rw-r--r--ext/oci8/oci8_statement.c194
-rw-r--r--ext/oci8/php_oci8.h2
-rw-r--r--ext/oci8/php_oci8_int.h80
-rw-r--r--ext/odbc/birdstep.c2
-rw-r--r--ext/odbc/php_birdstep.h2
-rw-r--r--ext/odbc/php_odbc.c26
-rw-r--r--ext/odbc/php_odbc.h2
-rw-r--r--ext/odbc/php_odbc_includes.h2
-rw-r--r--ext/opcache/Optimizer/block_pass.c23
-rw-r--r--ext/opcache/Optimizer/compact_literals.c6
-rw-r--r--ext/opcache/Optimizer/nop_removal.c1
-rw-r--r--ext/opcache/Optimizer/pass1_5.c1
-rw-r--r--ext/opcache/Optimizer/pass3.c1
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c2
-rw-r--r--ext/opcache/ZendAccelerator.c136
-rw-r--r--ext/opcache/zend_accelerator_module.c31
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.c6
-rw-r--r--ext/opcache/zend_persist.c3
-rw-r--r--ext/opcache/zend_persist_calc.c2
-rwxr-xr-xext/openssl/openssl.c16
-rw-r--r--ext/openssl/php_openssl.h2
-rw-r--r--ext/openssl/xp_ssl.c28
-rw-r--r--ext/pcntl/pcntl.c2
-rw-r--r--ext/pcntl/php_pcntl.h2
-rw-r--r--ext/pcntl/php_signal.c2
-rw-r--r--ext/pcntl/php_signal.h2
-rw-r--r--ext/pcre/php_pcre.c6
-rw-r--r--ext/pcre/php_pcre.h2
-rw-r--r--ext/pdo/pdo.c4
-rw-r--r--ext/pdo/pdo_dbh.c8
-rw-r--r--ext/pdo/pdo_sql_parser.c4
-rw-r--r--ext/pdo/pdo_sql_parser.re2
-rw-r--r--ext/pdo/pdo_sqlstate.c2
-rw-r--r--ext/pdo/pdo_stmt.c8
-rw-r--r--ext/pdo/php_pdo.h2
-rw-r--r--ext/pdo/php_pdo_driver.h17
-rw-r--r--ext/pdo/php_pdo_error.h2
-rw-r--r--ext/pdo/php_pdo_int.h2
-rw-r--r--ext/pdo_dblib/dblib_driver.c2
-rw-r--r--ext/pdo_dblib/dblib_stmt.c2
-rw-r--r--ext/pdo_dblib/pdo_dblib.c2
-rw-r--r--ext/pdo_dblib/php_pdo_dblib.h2
-rw-r--r--ext/pdo_dblib/php_pdo_dblib_int.h2
-rw-r--r--ext/pdo_firebird/firebird_driver.c2
-rw-r--r--ext/pdo_firebird/firebird_statement.c2
-rw-r--r--ext/pdo_firebird/pdo_firebird.c2
-rw-r--r--ext/pdo_firebird/php_pdo_firebird.h2
-rw-r--r--ext/pdo_firebird/php_pdo_firebird_int.h2
-rw-r--r--ext/pdo_mysql/mysql_driver.c2
-rw-r--r--ext/pdo_mysql/mysql_statement.c2
-rw-r--r--ext/pdo_mysql/pdo_mysql.c2
-rw-r--r--ext/pdo_mysql/php_pdo_mysql.h2
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_int.h2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt2
-rw-r--r--ext/pdo_oci/oci_driver.c2
-rw-r--r--ext/pdo_oci/oci_statement.c2
-rw-r--r--ext/pdo_oci/pdo_oci.c2
-rw-r--r--ext/pdo_oci/php_pdo_oci.h2
-rw-r--r--ext/pdo_oci/php_pdo_oci_int.h2
-rw-r--r--ext/pdo_odbc/odbc_driver.c2
-rw-r--r--ext/pdo_odbc/odbc_stmt.c2
-rw-r--r--ext/pdo_odbc/pdo_odbc.c2
-rw-r--r--ext/pdo_odbc/php_pdo_odbc.h2
-rw-r--r--ext/pdo_odbc/php_pdo_odbc_int.h2
-rw-r--r--ext/pdo_pgsql/pdo_pgsql.c2
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c2
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c2
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql.h2
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql_int.h2
-rw-r--r--ext/pdo_pgsql/tests/getnotify.phpt6
-rw-r--r--ext/pdo_sqlite/pdo_sqlite.c2
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite.h2
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite_int.h2
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c2
-rw-r--r--ext/pdo_sqlite/sqlite_statement.c2
-rw-r--r--ext/pgsql/pgsql.c30
-rw-r--r--ext/pgsql/php_pgsql.h2
-rw-r--r--ext/phar/phar.c20
-rwxr-xr-xext/phar/phar_object.c17
-rw-r--r--ext/phar/tar.c2
-rw-r--r--ext/phar/zip.c4
-rw-r--r--ext/posix/php_posix.h2
-rw-r--r--ext/posix/posix.c2
-rw-r--r--ext/pspell/php_pspell.h2
-rw-r--r--ext/pspell/pspell.c2
-rw-r--r--ext/readline/php_readline.h2
-rw-r--r--ext/readline/readline.c2
-rw-r--r--ext/readline/readline_cli.c10
-rw-r--r--ext/readline/readline_cli.h2
-rw-r--r--ext/recode/php_recode.h2
-rw-r--r--ext/recode/recode.c2
-rw-r--r--ext/reflection/php_reflection.c85
-rw-r--r--ext/reflection/php_reflection.h2
-rw-r--r--ext/session/mod_files.c4
-rw-r--r--ext/session/mod_files.h2
-rw-r--r--ext/session/mod_mm.c2
-rw-r--r--ext/session/mod_mm.h2
-rw-r--r--ext/session/mod_user.c4
-rw-r--r--ext/session/mod_user.h2
-rw-r--r--ext/session/mod_user_class.c4
-rw-r--r--ext/session/php_session.h2
-rw-r--r--ext/session/session.c110
-rw-r--r--ext/session/tests/bug67972.phpt10
-rw-r--r--ext/shmop/php_shmop.h2
-rw-r--r--ext/simplexml/php_simplexml.h2
-rw-r--r--ext/simplexml/php_simplexml_exports.h2
-rw-r--r--ext/simplexml/simplexml.c2
-rw-r--r--ext/simplexml/sxe.c2
-rw-r--r--ext/simplexml/sxe.h2
-rw-r--r--ext/snmp/php_snmp.h2
-rw-r--r--ext/snmp/snmp.c2
-rw-r--r--ext/soap/php_encoding.c15
-rw-r--r--ext/soap/php_encoding.h2
-rw-r--r--ext/soap/php_http.c86
-rw-r--r--ext/soap/php_http.h2
-rw-r--r--ext/soap/php_packet_soap.c2
-rw-r--r--ext/soap/php_packet_soap.h2
-rw-r--r--ext/soap/php_schema.c2
-rw-r--r--ext/soap/php_schema.h2
-rw-r--r--ext/soap/php_sdl.c18
-rw-r--r--ext/soap/php_sdl.h2
-rw-r--r--ext/soap/php_soap.h2
-rw-r--r--ext/soap/php_xml.c2
-rw-r--r--ext/soap/php_xml.h2
-rw-r--r--ext/soap/soap.c18
-rw-r--r--ext/sockets/conversions.c94
-rw-r--r--ext/sockets/multicast.c2
-rw-r--r--ext/sockets/multicast.h2
-rw-r--r--ext/sockets/php_sockets.h2
-rw-r--r--ext/sockets/sendrecvmsg.c2
-rw-r--r--ext/sockets/sockets.c10
-rw-r--r--ext/sockets/unix_socket_constants.h2
-rw-r--r--ext/sockets/win32_socket_constants.h2
-rw-r--r--ext/sockets/windows_common.h2
-rw-r--r--ext/spl/php_spl.c2
-rw-r--r--ext/spl/php_spl.h4
-rw-r--r--ext/spl/spl_array.c2
-rw-r--r--ext/spl/spl_array.h2
-rw-r--r--ext/spl/spl_directory.c11
-rw-r--r--ext/spl/spl_directory.h2
-rw-r--r--ext/spl/spl_dllist.c4
-rw-r--r--ext/spl/spl_dllist.h2
-rw-r--r--ext/spl/spl_engine.c2
-rw-r--r--ext/spl/spl_engine.h2
-rw-r--r--ext/spl/spl_exceptions.c2
-rw-r--r--ext/spl/spl_exceptions.h2
-rw-r--r--ext/spl/spl_fixedarray.c2
-rw-r--r--ext/spl/spl_fixedarray.h2
-rw-r--r--ext/spl/spl_functions.c5
-rw-r--r--ext/spl/spl_functions.h2
-rw-r--r--ext/spl/spl_heap.c2
-rw-r--r--ext/spl/spl_heap.h2
-rw-r--r--ext/spl/spl_iterators.c4
-rw-r--r--ext/spl/spl_iterators.h10
-rw-r--r--ext/spl/spl_observer.c2
-rw-r--r--ext/spl/spl_observer.h2
-rw-r--r--ext/sqlite3/php_sqlite3.h2
-rw-r--r--ext/sqlite3/php_sqlite3_structs.h2
-rw-r--r--ext/sqlite3/sqlite3.c2
-rw-r--r--ext/standard/array.c37
-rw-r--r--ext/standard/assert.c22
-rw-r--r--ext/standard/base64.c6
-rw-r--r--ext/standard/base64.h2
-rw-r--r--ext/standard/basic_functions.c54
-rw-r--r--ext/standard/basic_functions.h2
-rw-r--r--ext/standard/browscap.c4
-rw-r--r--ext/standard/crc32.c2
-rw-r--r--ext/standard/crc32.h2
-rw-r--r--ext/standard/credits.c2
-rw-r--r--ext/standard/credits.h2
-rw-r--r--ext/standard/crypt.c6
-rw-r--r--ext/standard/crypt_sha256.c17
-rw-r--r--ext/standard/crypt_sha512.c16
-rw-r--r--ext/standard/css.c2
-rw-r--r--ext/standard/css.h2
-rw-r--r--ext/standard/cyr_convert.c2
-rw-r--r--ext/standard/cyr_convert.h2
-rw-r--r--ext/standard/datetime.c2
-rw-r--r--ext/standard/datetime.h2
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/dl.c2
-rw-r--r--ext/standard/dl.h2
-rw-r--r--ext/standard/dns.c2
-rw-r--r--ext/standard/dns_win32.c2
-rw-r--r--ext/standard/exec.c2
-rw-r--r--ext/standard/exec.h2
-rw-r--r--ext/standard/file.c24
-rw-r--r--ext/standard/file.h2
-rw-r--r--ext/standard/filestat.c20
-rw-r--r--ext/standard/filters.c24
-rw-r--r--ext/standard/flock_compat.c2
-rw-r--r--ext/standard/flock_compat.h2
-rw-r--r--ext/standard/formatted_print.c2
-rw-r--r--ext/standard/fsock.c2
-rw-r--r--ext/standard/fsock.h2
-rw-r--r--ext/standard/ftok.c2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c4
-rw-r--r--ext/standard/head.c2
-rw-r--r--ext/standard/head.h2
-rw-r--r--ext/standard/html.c6
-rw-r--r--ext/standard/html.h2
-rw-r--r--ext/standard/html_tables.h267
-rw-r--r--ext/standard/html_tables/html_table_gen.php23
-rw-r--r--ext/standard/http.c4
-rw-r--r--ext/standard/http_fopen_wrapper.c4
-rw-r--r--ext/standard/image.c8
-rw-r--r--ext/standard/incomplete_class.c2
-rw-r--r--ext/standard/info.c8
-rw-r--r--ext/standard/info.h2
-rw-r--r--ext/standard/iptc.c2
-rw-r--r--ext/standard/lcg.c2
-rw-r--r--ext/standard/levenshtein.c2
-rw-r--r--ext/standard/link.c2
-rw-r--r--ext/standard/link_win32.c2
-rw-r--r--ext/standard/mail.c2
-rw-r--r--ext/standard/math.c19
-rw-r--r--ext/standard/md5.c16
-rw-r--r--ext/standard/md5.h2
-rw-r--r--ext/standard/metaphone.c2
-rw-r--r--ext/standard/microtime.c2
-rw-r--r--ext/standard/microtime.h2
-rw-r--r--ext/standard/pack.c2
-rw-r--r--ext/standard/pack.h2
-rw-r--r--ext/standard/pageinfo.c2
-rw-r--r--ext/standard/pageinfo.h2
-rw-r--r--ext/standard/password.c20
-rw-r--r--ext/standard/php_array.h2
-rw-r--r--ext/standard/php_assert.h2
-rw-r--r--ext/standard/php_browscap.h2
-rw-r--r--ext/standard/php_crypt.h2
-rw-r--r--ext/standard/php_crypt_r.c6
-rw-r--r--ext/standard/php_crypt_r.h2
-rw-r--r--ext/standard/php_dir.h2
-rw-r--r--ext/standard/php_dns.h2
-rw-r--r--ext/standard/php_ext_syslog.h2
-rw-r--r--ext/standard/php_filestat.h2
-rw-r--r--ext/standard/php_fopen_wrapper.c2
-rw-r--r--ext/standard/php_fopen_wrappers.h2
-rw-r--r--ext/standard/php_ftok.h2
-rw-r--r--ext/standard/php_http.h2
-rw-r--r--ext/standard/php_image.h2
-rw-r--r--ext/standard/php_incomplete_class.h2
-rw-r--r--ext/standard/php_iptc.h2
-rw-r--r--ext/standard/php_lcg.h2
-rw-r--r--ext/standard/php_link.h2
-rw-r--r--ext/standard/php_mail.h2
-rw-r--r--ext/standard/php_math.h2
-rw-r--r--ext/standard/php_metaphone.h2
-rw-r--r--ext/standard/php_password.h2
-rw-r--r--ext/standard/php_rand.h2
-rw-r--r--ext/standard/php_smart_str.h169
-rw-r--r--ext/standard/php_smart_str_public.h2
-rw-r--r--ext/standard/php_smart_string.h26
-rw-r--r--ext/standard/php_smart_string_public.h2
-rw-r--r--ext/standard/php_standard.h2
-rw-r--r--ext/standard/php_string.h13
-rw-r--r--ext/standard/php_type.h2
-rw-r--r--ext/standard/php_uuencode.h2
-rw-r--r--ext/standard/php_var.h2
-rw-r--r--ext/standard/php_versioning.h2
-rw-r--r--ext/standard/proc_open.c2
-rw-r--r--ext/standard/proc_open.h2
-rw-r--r--ext/standard/quot_print.c2
-rw-r--r--ext/standard/quot_print.h2
-rw-r--r--ext/standard/rand.c2
-rw-r--r--ext/standard/scanf.c2
-rw-r--r--ext/standard/scanf.h2
-rw-r--r--ext/standard/sha1.c2
-rw-r--r--ext/standard/sha1.h2
-rw-r--r--ext/standard/soundex.c2
-rw-r--r--ext/standard/streamsfuncs.c2
-rw-r--r--ext/standard/streamsfuncs.h2
-rw-r--r--ext/standard/string.c67
-rw-r--r--ext/standard/strnatcmp.c5
-rw-r--r--ext/standard/syslog.c2
-rw-r--r--ext/standard/tests/file/bug65701.phpt4
-rw-r--r--ext/standard/tests/file/pathinfo_basic1-win32.phpt24
-rw-r--r--ext/standard/tests/file/pathinfo_basic2-win32.phpt10
-rw-r--r--ext/standard/tests/general_functions/parse_ini_string_003.phpt40
-rw-r--r--ext/standard/tests/strings/strnatcasecmp_variation1.phpt4
-rw-r--r--ext/standard/tests/versioning/phpversion.phpt12
-rw-r--r--ext/standard/type.c2
-rw-r--r--ext/standard/uniqid.c2
-rw-r--r--ext/standard/uniqid.h2
-rw-r--r--ext/standard/url.c2
-rw-r--r--ext/standard/url.h2
-rw-r--r--ext/standard/url_scanner_ex.c4
-rw-r--r--ext/standard/url_scanner_ex.h2
-rw-r--r--ext/standard/url_scanner_ex.re4
-rw-r--r--ext/standard/user_filters.c2
-rw-r--r--ext/standard/uuencode.c2
-rw-r--r--ext/standard/var.c45
-rw-r--r--ext/standard/var_unserializer.c6
-rw-r--r--ext/standard/var_unserializer.re6
-rw-r--r--ext/standard/versioning.c2
-rw-r--r--ext/sybase_ct/php_sybase_ct.c2
-rw-r--r--ext/sybase_ct/php_sybase_ct.h2
-rw-r--r--ext/sysvmsg/php_sysvmsg.h2
-rw-r--r--ext/sysvmsg/sysvmsg.c2
-rw-r--r--ext/sysvsem/php_sysvsem.h2
-rw-r--r--ext/sysvsem/sysvsem.c20
-rw-r--r--ext/sysvsem/tests/nowait.phpt103
-rw-r--r--ext/sysvsem/tests/sysv.phpt4
-rw-r--r--ext/sysvshm/php_sysvshm.h2
-rw-r--r--ext/sysvshm/sysvshm.c2
-rw-r--r--ext/tidy/php_tidy.h2
-rw-r--r--ext/tidy/tidy.c12
-rw-r--r--ext/tokenizer/php_tokenizer.h2
-rw-r--r--ext/tokenizer/tokenizer.c4
-rw-r--r--ext/tokenizer/tokenizer_data.c2
-rwxr-xr-xext/tokenizer/tokenizer_data_gen.sh2
-rw-r--r--ext/wddx/php_wddx.h2
-rw-r--r--ext/wddx/php_wddx_api.h2
-rw-r--r--ext/wddx/wddx.c15
-rw-r--r--ext/xml/compat.c19
-rw-r--r--ext/xml/expat_compat.h2
-rw-r--r--ext/xml/php_xml.h6
-rw-r--r--ext/xml/xml.c10
-rw-r--r--ext/xmlreader/php_xmlreader.c2
-rw-r--r--ext/xmlreader/php_xmlreader.h2
-rw-r--r--ext/xmlrpc/php_xmlrpc.h2
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c6
-rw-r--r--ext/xmlwriter/php_xmlwriter.c2
-rw-r--r--ext/xmlwriter/php_xmlwriter.h2
-rw-r--r--ext/xsl/php_xsl.c2
-rw-r--r--ext/xsl/php_xsl.h2
-rw-r--r--ext/xsl/xsl_fe.h2
-rw-r--r--ext/xsl/xsltprocessor.c4
-rw-r--r--ext/zip/lib/config.h2
-rw-r--r--ext/zip/lib/zip_set_name.c2
-rw-r--r--ext/zip/php_zip.c12
-rw-r--r--ext/zip/php_zip.h4
-rw-r--r--ext/zip/zip_stream.c2
-rw-r--r--ext/zlib/php_zlib.h4
-rw-r--r--ext/zlib/zlib.c39
-rw-r--r--ext/zlib/zlib_filter.c4
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c8
-rw-r--r--header2
-rw-r--r--main/SAPI.c8
-rw-r--r--main/SAPI.h2
-rw-r--r--main/build-defs.h.in2
-rw-r--r--main/fopen_wrappers.c28
-rw-r--r--main/fopen_wrappers.h2
-rw-r--r--main/getopt.c2
-rw-r--r--main/internal_functions.c.in2
-rw-r--r--main/internal_functions_nw.c2
-rw-r--r--main/internal_functions_win32.c2
-rw-r--r--main/main.c63
-rw-r--r--main/network.c2
-rw-r--r--main/output.c2
-rw-r--r--main/php.h16
-rw-r--r--main/php_compat.h2
-rw-r--r--main/php_content_types.c2
-rw-r--r--main/php_content_types.h2
-rw-r--r--main/php_getopt.h2
-rw-r--r--main/php_globals.h2
-rw-r--r--main/php_ini.c28
-rw-r--r--main/php_ini.h3
-rw-r--r--main/php_main.h2
-rw-r--r--main/php_memory_streams.h2
-rw-r--r--main/php_network.h2
-rw-r--r--main/php_open_temporary_file.c2
-rw-r--r--main/php_open_temporary_file.h2
-rw-r--r--main/php_output.h4
-rw-r--r--main/php_reentrancy.h2
-rw-r--r--main/php_scandir.c2
-rw-r--r--main/php_scandir.h2
-rw-r--r--main/php_sprintf.c2
-rw-r--r--main/php_stdint.h2
-rw-r--r--main/php_streams.h10
-rw-r--r--main/php_syslog.h2
-rw-r--r--main/php_ticks.c2
-rw-r--r--main/php_ticks.h2
-rw-r--r--main/php_variables.c14
-rw-r--r--main/php_variables.h2
-rw-r--r--main/reentrancy.c2
-rw-r--r--main/rfc1867.c2
-rw-r--r--main/rfc1867.h2
-rw-r--r--main/snprintf.c2
-rw-r--r--main/snprintf.h4
-rw-r--r--main/spprintf.c2
-rw-r--r--main/spprintf.h6
-rw-r--r--main/streams/cast.c2
-rw-r--r--main/streams/filter.c2
-rw-r--r--main/streams/glob_wrapper.c2
-rw-r--r--main/streams/memory.c2
-rw-r--r--main/streams/mmap.c2
-rw-r--r--main/streams/php_stream_context.h2
-rw-r--r--main/streams/php_stream_filter_api.h2
-rw-r--r--main/streams/php_stream_glob_wrapper.h2
-rw-r--r--main/streams/php_stream_mmap.h2
-rw-r--r--main/streams/php_stream_plain_wrapper.h2
-rw-r--r--main/streams/php_stream_transport.h20
-rw-r--r--main/streams/php_stream_userspace.h2
-rw-r--r--main/streams/php_streams_int.h2
-rw-r--r--main/streams/plain_wrapper.c4
-rw-r--r--main/streams/streams.c2
-rw-r--r--main/streams/transports.c2
-rw-r--r--main/streams/userspace.c2
-rw-r--r--main/streams/xp_socket.c2
-rw-r--r--main/strlcat.c2
-rw-r--r--main/strlcpy.c2
-rw-r--r--main/win32_internal_function_disabled.h2
-rw-r--r--main/win95nt.h2
-rw-r--r--netware/start.c2
-rwxr-xr-xrun-tests.php9
-rw-r--r--sapi/aolserver/aolserver.c2
-rw-r--r--sapi/apache/libpre.c2
-rw-r--r--sapi/apache/mod_php7.c4
-rw-r--r--sapi/apache/mod_php7.h2
-rw-r--r--sapi/apache/php_apache.c2
-rw-r--r--sapi/apache/php_apache_http.h2
-rw-r--r--sapi/apache/sapi_apache.c2
-rw-r--r--sapi/apache2filter/apache_config.c2
-rw-r--r--sapi/apache2filter/php_apache.h2
-rw-r--r--sapi/apache2filter/php_functions.c2
-rw-r--r--sapi/apache2filter/sapi_apache2.c2
-rw-r--r--sapi/apache2handler/apache_config.c4
-rw-r--r--sapi/apache2handler/mod_php7.c2
-rw-r--r--sapi/apache2handler/php_apache.h2
-rw-r--r--sapi/apache2handler/php_functions.c2
-rw-r--r--sapi/apache2handler/sapi_apache2.c8
-rw-r--r--sapi/apache_hooks/mod_php7.h2
-rw-r--r--sapi/apache_hooks/php_apache.c2
-rw-r--r--sapi/apache_hooks/sapi_apache.c2
-rw-r--r--sapi/caudium/caudium.c2
-rw-r--r--sapi/cgi/cgi_main.c43
-rw-r--r--sapi/cgi/fastcgi.c6
-rw-r--r--sapi/cgi/fastcgi.h2
-rw-r--r--sapi/cli/cli.h2
-rw-r--r--sapi/cli/generate_mime_type_map.php2
-rw-r--r--sapi/cli/mime_type_map.h2
-rw-r--r--sapi/cli/php_cli.c6
-rw-r--r--sapi/cli/php_cli_process_title.c2
-rw-r--r--sapi/cli/php_cli_process_title.h2
-rw-r--r--sapi/cli/php_cli_server.c16
-rw-r--r--sapi/cli/php_cli_server.h2
-rw-r--r--sapi/cli/ps_title.c2
-rw-r--r--sapi/cli/ps_title.h2
-rw-r--r--sapi/continuity/capi.c2
-rw-r--r--sapi/embed/php_embed.c2
-rw-r--r--sapi/embed/php_embed.h2
-rw-r--r--sapi/fpm/fpm/events/devpoll.c2
-rw-r--r--sapi/fpm/fpm/events/devpoll.h2
-rw-r--r--sapi/fpm/fpm/events/epoll.c2
-rw-r--r--sapi/fpm/fpm/events/epoll.h2
-rw-r--r--sapi/fpm/fpm/events/kqueue.c2
-rw-r--r--sapi/fpm/fpm/events/kqueue.h2
-rw-r--r--sapi/fpm/fpm/events/poll.c2
-rw-r--r--sapi/fpm/fpm/events/poll.h2
-rw-r--r--sapi/fpm/fpm/events/port.c2
-rw-r--r--sapi/fpm/fpm/events/port.h2
-rw-r--r--sapi/fpm/fpm/events/select.c2
-rw-r--r--sapi/fpm/fpm/events/select.h2
-rw-r--r--sapi/fpm/fpm/fastcgi.c4
-rw-r--r--sapi/fpm/fpm/fastcgi.h2
-rw-r--r--sapi/fpm/fpm/fpm_main.c13
-rw-r--r--sapi/fpm/fpm/fpm_php.c11
-rw-r--r--sapi/isapi/php7isapi.c2
-rw-r--r--sapi/litespeed/lsapi_main.c71
-rw-r--r--sapi/litespeed/lsapidef.h2
-rw-r--r--sapi/litespeed/lsapilib.c8
-rw-r--r--sapi/litespeed/lsapilib.h2
-rw-r--r--sapi/milter/php_milter.c2
-rw-r--r--sapi/nsapi/nsapi.c2
-rw-r--r--sapi/phpdbg/.travis.yml1
-rw-r--r--sapi/phpdbg/README.md2
-rw-r--r--sapi/phpdbg/phpdbg.c12
-rw-r--r--sapi/phpdbg/phpdbg.h2
-rw-r--r--sapi/phpdbg/phpdbg_bp.c2
-rw-r--r--sapi/phpdbg/phpdbg_bp.h2
-rw-r--r--sapi/phpdbg/phpdbg_break.c2
-rw-r--r--sapi/phpdbg/phpdbg_break.h2
-rw-r--r--sapi/phpdbg/phpdbg_btree.c2
-rw-r--r--sapi/phpdbg/phpdbg_btree.h2
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c2
-rw-r--r--sapi/phpdbg/phpdbg_cmd.h2
-rw-r--r--sapi/phpdbg/phpdbg_frame.c2
-rw-r--r--sapi/phpdbg/phpdbg_frame.h2
-rw-r--r--sapi/phpdbg/phpdbg_help.c2
-rw-r--r--sapi/phpdbg/phpdbg_help.h2
-rw-r--r--sapi/phpdbg/phpdbg_info.c2
-rw-r--r--sapi/phpdbg/phpdbg_info.h2
-rw-r--r--sapi/phpdbg/phpdbg_lexer.h2
-rw-r--r--sapi/phpdbg/phpdbg_list.c2
-rw-r--r--sapi/phpdbg/phpdbg_list.h2
-rw-r--r--sapi/phpdbg/phpdbg_opcode.c11
-rw-r--r--sapi/phpdbg/phpdbg_opcode.h2
-rw-r--r--sapi/phpdbg/phpdbg_print.c2
-rw-r--r--sapi/phpdbg/phpdbg_print.h2
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c2
-rw-r--r--sapi/phpdbg/phpdbg_prompt.h2
-rw-r--r--sapi/phpdbg/phpdbg_set.c2
-rw-r--r--sapi/phpdbg/phpdbg_set.h2
-rw-r--r--sapi/phpdbg/phpdbg_utils.c2
-rw-r--r--sapi/phpdbg/phpdbg_utils.h2
-rw-r--r--sapi/phpdbg/phpdbg_watch.c2
-rw-r--r--sapi/phpdbg/phpdbg_watch.h2
-rw-r--r--sapi/phpdbg/phpdbg_win.c2
-rw-r--r--sapi/phpdbg/phpdbg_win.h2
-rw-r--r--sapi/phttpd/php_phttpd.h2
-rw-r--r--sapi/phttpd/phttpd.c2
-rw-r--r--sapi/pi3web/pi3web_sapi.c2
-rw-r--r--sapi/roxen/roxen.c2
-rw-r--r--sapi/thttpd/php_thttpd.h2
-rw-r--r--sapi/thttpd/thttpd.c10
-rw-r--r--sapi/tux/php_tux.c2
-rw-r--r--sapi/webjames/php_webjames.h2
-rw-r--r--sapi/webjames/webjames.c2
-rw-r--r--scripts/dev/check_parameters.php2
-rwxr-xr-xscripts/dev/search_underscores.php2
-rwxr-xr-xserver-tests.php2
-rw-r--r--tests/lang/operators/preinc_variationStr.phpt61
-rw-r--r--win32/build/Makefile2
-rw-r--r--win32/build/buildconf.js2
-rw-r--r--win32/build/config.w323
-rw-r--r--win32/build/config.w32.h.in5
-rw-r--r--win32/build/confutils.js10
-rw-r--r--win32/build/deplister.c2
-rw-r--r--win32/build/phpize.js.in2
-rw-r--r--win32/globals.c2
-rw-r--r--win32/grp.h2
-rw-r--r--win32/php_win32_globals.h2
-rw-r--r--win32/registry.c2
-rw-r--r--win32/select.c2
-rw-r--r--win32/select.h2
-rw-r--r--win32/sockets.c2
-rw-r--r--win32/sockets.h2
-rw-r--r--win32/syslog.h2
-rw-r--r--win32/winutil.c2
-rw-r--r--win32/winutil.h2
1070 files changed, 11818 insertions, 10629 deletions
diff --git a/.gdbinit b/.gdbinit
index c1ef530f8e..98bb173a5a 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -638,3 +638,28 @@ document zmemcheck
usage: zmemcheck [ptr].
if ptr is 0, all blocks will be listed.
end
+
+define lookup_root
+ set $found = 0
+ if gc_globals->roots
+ set $current = gc_globals->roots->next
+ printf "looking ref %p in roots\n", $arg0
+ while $current != &gc_globals->roots
+ if $current->ref == $arg0
+ set $found = $current
+ break
+ end
+ set $current = $current->next
+ end
+ if $found != 0
+ printf "found root %p\n", $found
+ else
+ printf "not found\n"
+ end
+ end
+end
+
+document lookup_root
+ lookup a refcounted in root
+ usage: lookup_root [ptr].
+end
diff --git a/NEWS b/NEWS
index 47845119d9..c348efe9b4 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ PHP NEWS
- Core:
. Added PHP_INT_MIN constant. (Andrea)
. Added Closure::apply() method. (Andrea)
+ . Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
+ . Fixed #67959 (Segfault when calling phpversion('spl')). (Florian)
- Reflection
. Fixed inheritance chain of Reflector interface (Tjerk)
@@ -39,4 +41,7 @@ PHP NEWS
. Implemented #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags
nor curruption state). (Julien)
+- DOM:
+ . Made DOMNode::textContent writeable. (Tjerk)
+
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API
index 446b5811e5..46e190efc1 100644
--- a/README.PARAMETER_PARSING_API
+++ b/README.PARAMETER_PARSING_API
@@ -50,7 +50,7 @@ Type specifiers
instance of that class.
a - array (zval*)
- A - array or object (zval *)
+ A - array or object (zval*)
b - boolean (zend_bool)
C - class (zend_class_entry*)
d - double (double)
@@ -58,15 +58,16 @@ Type specifiers
zend_fcall_info and zend_fcall_info_cache)
h - array (returned as HashTable*)
H - array or HASH_OF(object) (returned as HashTable*)
- l - long (long)
- L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long)
+ l - long (zend_long)
+ L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (zend_long)
o - object of any type (zval*)
O - object of specific type given by class entry (zval*, zend_class_entry)
- p - valid path (string without null bytes in the middle) and its length (char*, int)
+ p - valid path (string without null bytes in the middle) and its length (char*, size_t)
+ P - valid path (string without null bytes in the middle) as zend_string (zend_string)
r - resource (zval*)
- s - string (with possible null bytes) and its length (char*, int)
+ s - string (with possible null bytes) and its length (char*, size_t)
+ S - string (with possible null bytes) as zend_string (zend_string)
z - the actual zval (zval*)
- Z - the actual zval (zval**)
* - variable arguments list (0 or more)
+ - variable arguments list (1 or more)
@@ -80,28 +81,26 @@ Type specifiers
passed and the output for such type is a pointer, then the output
pointer is set to a native NULL pointer.
For 'b', 'l' and 'd', an extra argument of type zend_bool* must be
- passed after the corresponding bool*, long* or double* arguments,
- respectively. A non-zero value will be written to the zend_bool iif a
+ passed after the corresponding bool*, zend_long* or double* arguments,
+ respectively. A non-zero value will be written to the zend_bool if a
PHP NULL is passed.
Note on 64bit compatibility
---------------------------
-Please do not forget that int and long are two different things on 64bit
-OSes (int is 4 bytes and long is 8 bytes), so make sure you pass longs to "l"
-and ints to strings length (i.e. for "s" you need to pass char * and int),
+Please note that since version 7 PHP uses zend_long as integer type and
+zend_string with size_t as length, so make sure you pass zend_longs to "l"
+and size_t to strings length (i.e. for "s" you need to pass char * and int),
not the other way round!
-Remember: "l" is the only case when you need to pass long (and that's why
-it's "l", not "i" btw).
-Both mistakes cause memory corruptions and segfaults on 64bit OSes:
+Both mistakes might cause memory corruptions and segfaults:
1)
char *str;
- long str_len; /* XXX THIS IS WRONG!! Use int instead. */
+ long str_len; /* XXX THIS IS WRONG!! Use size_t instead. */
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len)
2)
- int num; /* XXX THIS IS WRONG!! Use long instead. */
+ int num; /* XXX THIS IS WRONG!! Use zend_long instead. */
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num)
If you're in doubt, use check_parameters.php script to the parameters
@@ -113,9 +112,9 @@ and their types (it can be found in ./scripts/dev/ directory of PHP sources):
Examples
--------
/* Gets a long, a string and its length, and a zval */
-long l;
+zend_long l;
char *s;
-int s_len;
+size_t s_len;
zval *param;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
&l, &s, &s_len, &param) == FAILURE) {
@@ -151,16 +150,16 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!",
}
/* Get either a set of 3 longs or a string. */
-long l1, l2, l3;
+zend_long l1, l2, l3;
char *s;
/*
- * The function expects a pointer to a integer in this case, not a long
+ * The function expects a pointer to a size_t in this case, not a long
* or any other type. If you specify a type which is larger
- * than a 'int', the upper bits might not be initialized
+ * than a 'size_t', the upper bits might not be initialized
* properly, leading to random crashes on platforms like
* Tru64 or Linux/Alpha.
*/
-int length;
+size_t length;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"lll", &l1, &l2, &l3) == SUCCESS) {
@@ -178,7 +177,7 @@ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
/* Function that accepts only varargs (0 or more) */
int i, num_varargs;
-zval ***varargs = NULL;
+zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &varargs, &num_varargs) == FAILURE) {
@@ -197,9 +196,9 @@ if (varargs) {
/* Function that accepts a string, followed by varargs (1 or more) */
char *str;
-int str_len;
+size_t str_len;
int i, num_varargs;
-zval ***varargs = NULL;
+zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
return;
@@ -209,16 +208,11 @@ for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
-if (varargs) {
- efree(varargs);
-}
-
-
/* Function that takes an array, followed by varargs, and ending with a long */
-long num;
+zend_long num;
zval *array;
int i, num_varargs;
-zval ***varargs = NULL;
+zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
return;
@@ -227,7 +221,3 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &n
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
-
-if (varargs) {
- efree(varargs);
-}
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index 82e272db5b..b232429d4d 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -64,7 +64,7 @@ typedef int ts_rsrc_id;
/* Define THREAD_T and MUTEX_T */
#ifdef TSRM_WIN32
-# define THREAD_T UINT_PTR
+# define THREAD_T DWORD
# define MUTEX_T CRITICAL_SECTION *
#elif defined(GNUPTH)
# define THREAD_T pth_t
diff --git a/TSRM/tsrm_nw.c b/TSRM/tsrm_nw.c
index 8d591c0746..8defc4ed94 100644
--- a/TSRM/tsrm_nw.c
+++ b/TSRM/tsrm_nw.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/TSRM/tsrm_nw.h b/TSRM/tsrm_nw.h
index ba03744a30..02ac4be098 100644
--- a/TSRM/tsrm_nw.h
+++ b/TSRM/tsrm_nw.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 0b8228aafb..b6ac4231ee 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h
index dc5a3999dd..5933b54ddf 100644
--- a/TSRM/tsrm_win32.h
+++ b/TSRM/tsrm_win32.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/UPGRADING b/UPGRADING
index a27649ecf0..7468ab6daf 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -52,6 +52,10 @@ PHP X.Y UPGRADE NOTES
5. Changed Functions
========================================
+- parse_ini_file():
+- parse_ini_string():
+ Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
+
========================================
6. New Functions
diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp
index 98d368fb16..c1b3f2a9f7 100644
--- a/Zend/Zend.dsp
+++ b/Zend/Zend.dsp
@@ -179,6 +179,10 @@ SOURCE=.\zend_indent.c
# End Source File
# Begin Source File
+SOURCE=.\zend_inheritance.c
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_ini.c
# End Source File
# Begin Source File
diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp
index 21210f1087..4c6ef92465 100644
--- a/Zend/ZendTS.dsp
+++ b/Zend/ZendTS.dsp
@@ -205,6 +205,10 @@ SOURCE=.\zend_indent.c
# End Source File
# Begin Source File
+SOURCE=.\zend_inheritance.c
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_ini.c
# End Source File
# Begin Source File
diff --git a/Zend/tests/034.phpt b/Zend/tests/034.phpt
index 6e46f2645e..0bcfa23f19 100644
--- a/Zend/tests/034.phpt
+++ b/Zend/tests/034.phpt
@@ -22,5 +22,5 @@ switch (1) {
}
?>
---EXPECT--
-3
+--EXPECTF--
+Fatal error: Switch statements may only contain one default clause in %s on line 13
diff --git a/Zend/tests/bug67985.phpt b/Zend/tests/bug67985.phpt
new file mode 100644
index 0000000000..6f032643f4
--- /dev/null
+++ b/Zend/tests/bug67985.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #67985 - Last used array index not copied to new array at assignment
+--FILE--
+<?php
+
+$a = ['zero', 'one', 'two'];
+unset($a[2]);
+$b = $a;
+$a[] = 'three';
+$b[] = 'three';
+
+var_dump($a === $b);
+
+?>
+--EXPECT--
+bool(true)
diff --git a/Zend/tests/concat_002.phpt b/Zend/tests/concat_002.phpt
new file mode 100644
index 0000000000..3cb182ee7d
--- /dev/null
+++ b/Zend/tests/concat_002.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Stress test $x .= $x
+--FILE--
+<?php
+
+/*
+ * Test case for a concat_function() change that broke a test outside of Zend
+ *
+ * @see https://github.com/php/php-src/commit/29397f8fd2b4bc8d95e18448ca2d27a62241a407
+**/
+
+$result = 'f';
+
+for ($i = 0; $i < 25; ++$i) {
+ $result .= $result;
+}
+
+var_dump(strlen($result));
+echo "Done\n";
+?>
+--EXPECT--
+int(33554432)
+Done
+
diff --git a/Zend/tests/gc_033.phpt b/Zend/tests/gc_033.phpt
new file mode 100644
index 0000000000..bcd1541254
--- /dev/null
+++ b/Zend/tests/gc_033.phpt
@@ -0,0 +1,28 @@
+--TEST--
+GC 033: Crash in GC while run with phpspec
+--FILE--
+<?php
+$a = new stdClass();
+$a->a = array();
+$a->a[0] = new Stdclass();
+$a->a[0]->a = $a;
+$a->a[1] = &$a->a;
+
+/* remove the self-reference array out of roots */
+gc_collect_cycles();
+
+/* do unset */
+unset($a);
+
+/* let's full the gc roots */
+for ($i=0; $i<9999; $i++) {
+ $b = range(0, 1);
+ $b[0] = &$b;
+ unset($b);
+}
+
+/* then $a will be freed, but $a->a[0] is not. reference to a freed $a */
+var_dump(gc_collect_cycles());
+?>
+--EXPECT--
+int(20001)
diff --git a/Zend/zend.c b/Zend/zend.c
index 590f302579..9e414f9027 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -62,14 +62,14 @@ ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRML
void (*zend_on_timeout)(int seconds TSRMLS_DC);
static void (*zend_message_dispatcher_p)(zend_long message, const void *data TSRMLS_DC);
-static int (*zend_get_configuration_directive_p)(const char *name, uint name_length, zval *contents);
+static zval *(*zend_get_configuration_directive_p)(zend_string *name);
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
{
if (!new_value) {
EG(error_reporting) = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED;
} else {
- EG(error_reporting) = atoi(new_value);
+ EG(error_reporting) = atoi(new_value->val);
}
return SUCCESS;
}
@@ -77,7 +77,7 @@ static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
{
- OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
if (GC_G(gc_enabled)) {
gc_init(TSRMLS_C);
@@ -95,7 +95,7 @@ static ZEND_INI_MH(OnUpdateScriptEncoding) /* {{{ */
if (!zend_multibyte_get_functions(TSRMLS_C)) {
return SUCCESS;
}
- return zend_multibyte_set_script_encoding_by_string(new_value, new_value_length TSRMLS_CC);
+ return zend_multibyte_set_script_encoding_by_string(new_value->val, new_value->len TSRMLS_CC);
}
/* }}} */
@@ -156,8 +156,8 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
if (string_key) {
if (is_object) {
const char *prop_name, *class_name;
- int prop_len;
- int mangled = zend_unmangle_property_name_ex(string_key->val, string_key->len, &class_name, &prop_name, &prop_len);
+ size_t prop_len;
+ int mangled = zend_unmangle_property_name_ex(string_key, &class_name, &prop_name, &prop_len);
ZEND_WRITE_EX(prop_name, prop_len);
if (class_name && mangled == SUCCESS) {
@@ -278,7 +278,7 @@ again:
case IS_REFERENCE:
expr = Z_REFVAL_P(expr);
if (Z_TYPE_P(expr) == IS_STRING) {
- ZVAL_STR(expr_copy, zend_string_copy(Z_STR_P(expr)));
+ ZVAL_STR_COPY(expr_copy, Z_STR_P(expr));
return 1;
}
goto again;
@@ -509,11 +509,20 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table);
if (compiler_globals->last_static_member) {
- compiler_globals->static_members_table = calloc(compiler_globals->last_static_member, sizeof(zval**));
+ compiler_globals->static_members_table = calloc(compiler_globals->last_static_member, sizeof(zval*));
} else {
compiler_globals->static_members_table = NULL;
}
compiler_globals->script_encoding_list = NULL;
+
+#ifdef ZTS
+ compiler_globals->empty_string = zend_string_alloc(sizeof("")-1, 1);
+ compiler_globals->empty_string->val[0] = '\000';
+ zend_string_hash_val(compiler_globals->empty_string);
+ compiler_globals->empty_string->gc.u.v.flags |= IS_STR_INTERNED;
+
+ memset(compiler_globals->one_char_string, 0, sizeof(compiler_globals->one_char_string));
+#endif
}
/* }}} */
@@ -538,6 +547,10 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS
pefree((char*)compiler_globals->script_encoding_list, 1);
}
compiler_globals->last_static_member = 0;
+
+#ifdef ZTS
+ zend_string_release(compiler_globals->empty_string);
+#endif
}
/* }}} */
@@ -812,10 +825,35 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
zend_shutdown_timeout_thread();
#endif
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
+ if (EG(active))
+ {
+ /*
+ * The order of destruction is important here.
+ * See bugs #65463 and 66036.
+ */
+ zend_function *func;
+ zend_class_entry *ce;
+
+ ZEND_HASH_REVERSE_FOREACH_PTR(GLOBAL_FUNCTION_TABLE, func) {
+ if (func->type == ZEND_USER_FUNCTION) {
+ zend_cleanup_op_array_data((zend_op_array *) func);
+ }
+ } ZEND_HASH_FOREACH_END();
+ ZEND_HASH_REVERSE_FOREACH_PTR(GLOBAL_CLASS_TABLE, ce) {
+ if (ce->type == ZEND_USER_CLASS) {
+ zend_cleanup_user_class_data(ce TSRMLS_CC);
+ } else {
+ break;
+ }
+ } ZEND_HASH_FOREACH_END();
+ zend_cleanup_internal_classes(TSRMLS_C);
+ zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
+ zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
+ }
zend_destroy_modules();
- virtual_cwd_deactivate(TSRMLS_C);
- virtual_cwd_shutdown();
+ virtual_cwd_deactivate(TSRMLS_C);
+ virtual_cwd_shutdown();
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
zend_hash_destroy(GLOBAL_CLASS_TABLE);
@@ -979,12 +1017,12 @@ ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS
/* }}} */
END_EXTERN_C()
-ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents) /* {{{ */
+ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
{
if (zend_get_configuration_directive_p) {
- return zend_get_configuration_directive_p(name, name_length, contents);
+ return zend_get_configuration_directive_p(name);
} else {
- return FAILURE;
+ return NULL;
}
}
/* }}} */
@@ -1006,11 +1044,17 @@ ZEND_API int zend_get_configuration_directive(const char *name, uint name_length
} \
} while (0)
+#if !defined(ZEND_WIN32) && !defined(DARWIN)
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
+#else
+static void zend_error_va_list(int type, const char *format, va_list args)
+#endif
{
char *str;
int len;
+#if !defined(ZEND_WIN32) && !defined(DARWIN)
va_list args;
+#endif
va_list usr_copy;
zval params[5];
zval retval;
@@ -1113,7 +1157,9 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
}
#endif /* HAVE_DTRACE */
+#if !defined(ZEND_WIN32) && !defined(DARWIN)
va_start(args, format);
+#endif
/* if we don't have a user defined error handler */
if (Z_TYPE(EG(user_error_handler)) == IS_UNDEF
@@ -1224,7 +1270,9 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
break;
}
+#if !defined(ZEND_WIN32) && !defined(DARWIN)
va_end(args);
+#endif
if (type == E_PARSE) {
/* eval() errors do not affect exit_status */
@@ -1239,8 +1287,27 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
}
/* }}} */
-#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)
+#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__))
void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn));
+#elif defined(ZEND_WIN32) || defined(DARWIN)
+ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
+{
+ va_list va;
+
+ va_start(va, format);
+ zend_error_va_list(type, format, va);
+ va_end(va);
+}
+
+ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...)
+{
+ va_list va;
+
+ va_start(va, format);
+ zend_error_va_list(type, format, va);
+ va_end(va);
+}
+/* }}} */
#endif
ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
@@ -1357,6 +1424,7 @@ void free_estring(char **str_p) /* {{{ */
{
efree(*str_p);
}
+/* }}} */
void free_string_zval(zval *zv) /* {{{ */
{
diff --git a/Zend/zend.h b/Zend/zend.h
index 51de769704..517d419665 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -26,273 +26,32 @@
#define ZEND_ENGINE_2
-#ifdef __cplusplus
-#define BEGIN_EXTERN_C() extern "C" {
-#define END_EXTERN_C() }
-#else
-#define BEGIN_EXTERN_C()
-#define END_EXTERN_C()
-#endif
-
-/*
- * general definitions
- */
-
-#ifdef ZEND_WIN32
-# include "zend_config.w32.h"
-# define ZEND_PATHS_SEPARATOR ';'
-#elif defined(NETWARE)
-# include <zend_config.h>
-# define ZEND_PATHS_SEPARATOR ';'
-#elif defined(__riscos__)
-# include <zend_config.h>
-# define ZEND_PATHS_SEPARATOR ';'
-#else
-# include <zend_config.h>
-# define ZEND_PATHS_SEPARATOR ':'
-#endif
-
-/* Only use this macro if you know for sure that all of the switches values
- are covered by its case statements */
-#if ZEND_DEBUG
-# define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_ASSERT(0); break;
-#elif defined(ZEND_WIN32)
-# define EMPTY_SWITCH_DEFAULT_CASE() default: __assume(0); break;
-#else
-# define EMPTY_SWITCH_DEFAULT_CASE()
-#endif
-
-/* all HAVE_XXX test have to be after the include of zend_config above */
-
-#include <stdio.h>
-#include <assert.h>
-
-#ifdef HAVE_UNIX_H
-# include <unix.h>
-#endif
-
-#ifdef HAVE_STDARG_H
-# include <stdarg.h>
-#endif
-
-#ifdef HAVE_DLFCN_H
-# include <dlfcn.h>
-#endif
-
-#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
-
-# ifndef RTLD_LAZY
-# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
-# endif
-
-# ifndef RTLD_GLOBAL
-# define RTLD_GLOBAL 0
-# endif
-
-# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
-# elif defined(RTLD_DEEPBIND)
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
-# else
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
-# endif
-# define DL_UNLOAD dlclose
-# if defined(DLSYM_NEEDS_UNDERSCORE)
-# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" s)
-# else
-# define DL_FETCH_SYMBOL dlsym
-# endif
-# define DL_ERROR dlerror
-# define DL_HANDLE void *
-# define ZEND_EXTENSIONS_SUPPORT 1
-#elif defined(ZEND_WIN32)
-# define DL_LOAD(libname) LoadLibrary(libname)
-# define DL_FETCH_SYMBOL GetProcAddress
-# define DL_UNLOAD FreeLibrary
-# define DL_HANDLE HMODULE
-# define ZEND_EXTENSIONS_SUPPORT 1
-#else
-# define DL_HANDLE void *
-# define ZEND_EXTENSIONS_SUPPORT 0
-#endif
-
-#if HAVE_ALLOCA_H && !defined(_ALLOCA_H)
-# include <alloca.h>
-#endif
-
-/* AIX requires this to be the first thing in the file. */
-#ifndef __GNUC__
-# ifndef HAVE_ALLOCA_H
-# ifdef _AIX
-#pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-/* Compatibility with non-clang compilers */
-#ifndef __has_attribute
-# define __has_attribute(x) 0
-#endif
-
-/* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */
-#ifdef __GNUC__
-# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#else
-# define ZEND_GCC_VERSION 0
-#endif
-
-#if ZEND_GCC_VERSION >= 2096
-# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-#else
-# define ZEND_ATTRIBUTE_MALLOC
-#endif
-
-#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size)
-# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X)))
-# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y)))
-#else
-# define ZEND_ATTRIBUTE_ALLOC_SIZE(X)
-# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y)
-#endif
-
-#if ZEND_GCC_VERSION >= 2007
-# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
-#else
-# define ZEND_ATTRIBUTE_FORMAT(type, idx, first)
-#endif
-
-#if ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)
-# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
-#else
-# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first)
-#endif
-
-#if ZEND_GCC_VERSION >= 3001
-# define ZEND_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
-#elif defined(ZEND_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1300
-# define ZEND_ATTRIBUTE_DEPRECATED __declspec(deprecated)
-#else
-# define ZEND_ATTRIBUTE_DEPRECATED
-#endif
-
-#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003
-# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused))
-# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
-#else
-# define ZEND_ATTRIBUTE_UNUSED
-# define ZEND_ATTRIBUTE_UNUSED_LABEL
-#endif
-
-#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)
-# define ZEND_FASTCALL __attribute__((fastcall))
-#elif defined(_MSC_VER) && defined(_M_IX86)
-# define ZEND_FASTCALL __fastcall
-#else
-# define ZEND_FASTCALL
-#endif
-
-#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
-#else
-# define __restrict__
-#endif
-#define restrict __restrict__
-
-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
-# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
-# define ALLOCA_FLAG(name) \
- zend_bool name;
-# define SET_ALLOCA_FLAG(name) \
- name = 1
-# define do_alloca_ex(size, limit, use_heap) \
- ((use_heap = (UNEXPECTED((size) > (limit)))) ? emalloc(size) : alloca(size))
-# define do_alloca(size, use_heap) \
- do_alloca_ex(size, ZEND_ALLOCA_MAX_SIZE, use_heap)
-# define free_alloca(p, use_heap) \
- do { if (UNEXPECTED(use_heap)) efree(p); } while (0)
-#else
-# define ALLOCA_FLAG(name)
-# define SET_ALLOCA_FLAG(name)
-# define do_alloca(p, use_heap) emalloc(p)
-# define free_alloca(p, use_heap) efree(p)
-#endif
-
-#if ZEND_DEBUG
-#define ZEND_FILE_LINE_D const char *__zend_filename, const uint __zend_lineno
-#define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D
-#define ZEND_FILE_LINE_ORIG_D const char *__zend_orig_filename, const uint __zend_orig_lineno
-#define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D
-#define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno
-#define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C
-#define ZEND_FILE_LINE_C __FILE__, __LINE__
-#define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C
-#define ZEND_FILE_LINE_EMPTY_C NULL, 0
-#define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C
-#define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno
-#define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C
-#define ZEND_ASSERT(c) assert(c)
-#else
-#define ZEND_FILE_LINE_D
-#define ZEND_FILE_LINE_DC
-#define ZEND_FILE_LINE_ORIG_D
-#define ZEND_FILE_LINE_ORIG_DC
-#define ZEND_FILE_LINE_RELAY_C
-#define ZEND_FILE_LINE_RELAY_CC
-#define ZEND_FILE_LINE_C
-#define ZEND_FILE_LINE_CC
-#define ZEND_FILE_LINE_EMPTY_C
-#define ZEND_FILE_LINE_EMPTY_CC
-#define ZEND_FILE_LINE_ORIG_RELAY_C
-#define ZEND_FILE_LINE_ORIG_RELAY_CC
-#define ZEND_ASSERT(c)
-#endif /* ZEND_DEBUG */
-
-#ifdef ZTS
-#define ZTS_V 1
-#else
-#define ZTS_V 0
-#endif
+#define ZEND_MAX_RESERVED_RESOURCES 4
+#include "zend_types.h"
#include "zend_errors.h"
#include "zend_alloc.h"
+#include "zend_hash.h"
+#include "zend_llist.h"
+#include "zend_string.h"
+#include "zend_ast.h"
+#include "zend_gc.h"
+#include "zend_variables.h"
+#include "zend_iterators.h"
+#include "zend_stream.h"
-#include "zend_types.h"
-
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef LONG_MAX
-#define LONG_MAX 2147483647L
-#endif
-
-#ifndef LONG_MIN
-#define LONG_MIN (- LONG_MAX - 1)
+#ifdef ZEND_SIGNALS
+# include "zend_signal.h"
#endif
-#if SIZEOF_ZEND_LONG == 4
-#define MAX_LENGTH_OF_LONG 11
-static const char long_min_digits[] = "2147483648";
-#elif SIZEOF_ZEND_LONG == 8
-#define MAX_LENGTH_OF_LONG 20
-static const char long_min_digits[] = "9223372036854775808";
+#ifndef ZEND_SIGNALS
+# define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); }
+# define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); }
#else
-#error "Unknown SIZEOF_ZEND_LONG"
+# define HANDLE_BLOCK_INTERRUPTIONS() ZEND_SIGNAL_BLOCK_INTERRUPUTIONS()
+# define HANDLE_UNBLOCK_INTERRUPTIONS() ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS()
#endif
-#define MAX_LENGTH_OF_DOUBLE 32
-
-typedef enum {
- SUCCESS = 0,
- FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */
-} ZEND_RESULT_CODE;
-
-#include "zend_hash.h"
-#include "zend_llist.h"
-
#define INTERNAL_FUNCTION_PARAMETERS uint32_t param_count, zval *return_value TSRMLS_DC
#define INTERNAL_FUNCTION_PARAM_PASSTHRU param_count, return_value TSRMLS_CC
@@ -302,159 +61,42 @@ typedef enum {
!ZEND_USER_CODE(EG(current_execute_data)->prev_execute_data->func->common.type) || \
!(EG(current_execute_data)->prev_execute_data->opline->result_type & EXT_TYPE_UNUSED))
-#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)
-# define ZEND_NORETURN __attribute__((noreturn))
-void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((noreturn));
+#ifdef HAVE_NORETURN
+# if defined(ZEND_WIN32)
+ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
+# else
+void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN;
+# endif
#else
-# define ZEND_NORETURN
-# define zend_error_noreturn zend_error
+# define zend_error_noreturn zend_error
#endif
-#include "zend_object_handlers.h"
-
/* overloaded elements data types */
#define OE_IS_ARRAY (1<<0)
#define OE_IS_OBJECT (1<<1)
#define OE_IS_METHOD (1<<2)
-#define Z_REFCOUNT_P(pz) zval_refcount_p(pz)
-#define Z_SET_REFCOUNT_P(pz, rc) zval_set_refcount_p(pz, rc)
-#define Z_ADDREF_P(pz) zval_addref_p(pz)
-#define Z_DELREF_P(pz) zval_delref_p(pz)
-
-#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z))
-#define Z_SET_REFCOUNT(z, rc) Z_SET_REFCOUNT_P(&(z), rc)
-#define Z_ADDREF(z) Z_ADDREF_P(&(z))
-#define Z_DELREF(z) Z_DELREF_P(&(z))
-
-#define Z_TRY_ADDREF_P(pz) do { \
- if (Z_REFCOUNTED_P((pz))) { \
- Z_ADDREF_P((pz)); \
- } \
-} while (0)
-
-#define Z_TRY_DELREF_P(pz) do { \
- if (Z_REFCOUNTED_P((pz))) { \
- Z_DELREF_P((pz)); \
- } \
-} while (0)
-
-#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z))
-#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z))
-
-#if ZEND_DEBUG
-#define zend_always_inline inline
-#define zend_never_inline
-#else
-#if defined(__GNUC__)
-#if __GNUC__ >= 3
-#define zend_always_inline inline __attribute__((always_inline))
-#define zend_never_inline __attribute__((noinline))
-#else
-#define zend_always_inline inline
-#define zend_never_inline
-#endif
-#elif defined(_MSC_VER)
-#define zend_always_inline __forceinline
-#define zend_never_inline
-#else
-#define zend_always_inline inline
-#define zend_never_inline
-#endif
-#endif /* ZEND_DEBUG */
-
-#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
-# define EXPECTED(condition) __builtin_expect(!(!(condition)), 1)
-# define UNEXPECTED(condition) __builtin_expect(!(!(condition)), 0)
-#else
-# define EXPECTED(condition) (condition)
-# define UNEXPECTED(condition) (condition)
-#endif
-
-#ifndef XtOffsetOf
-# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
-# ifdef __STDC__
-# define XtOffset(p_type, field) _Offsetof(p_type, field)
-# else
-# ifdef CRAY2
-# define XtOffset(p_type, field) \
- (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
-
-# else /* !CRAY2 */
-
-# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
-
-# endif /* !CRAY2 */
-# endif /* __STDC__ */
-# else /* ! (CRAY || __arm) */
-
-# define XtOffset(p_type, field) \
- ((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
-
-# endif /* !CRAY */
-
-# ifdef offsetof
-# define XtOffsetOf(s_type, field) offsetof(s_type, field)
-# else
-# define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
-# endif
-
-#endif
-
-#include "zend_string.h"
-#include "zend_ast.h"
-
-static zend_always_inline uint32_t zval_refcount_p(zval* pz) {
- ZEND_ASSERT(Z_REFCOUNTED_P(pz) || Z_IMMUTABLE_P(pz));
- return GC_REFCOUNT(Z_COUNTED_P(pz));
-}
-
-static zend_always_inline uint32_t zval_set_refcount_p(zval* pz, uint32_t rc) {
- ZEND_ASSERT(Z_REFCOUNTED_P(pz));
- return GC_REFCOUNT(Z_COUNTED_P(pz)) = rc;
-}
-
-static zend_always_inline uint32_t zval_addref_p(zval* pz) {
- ZEND_ASSERT(Z_REFCOUNTED_P(pz));
- return ++GC_REFCOUNT(Z_COUNTED_P(pz));
-}
-
-static zend_always_inline uint32_t zval_delref_p(zval* pz) {
- ZEND_ASSERT(Z_REFCOUNTED_P(pz));
- return --GC_REFCOUNT(Z_COUNTED_P(pz));
-}
-
-/* excpt.h on Digital Unix 4.0 defines function_table */
-#undef function_table
-
-/* A lot of stuff needs shifiting around in order to include zend_compile.h here */
-union _zend_function;
-
-#include "zend_iterators.h"
-
struct _zend_serialize_data;
struct _zend_unserialize_data;
typedef struct _zend_serialize_data zend_serialize_data;
typedef struct _zend_unserialize_data zend_unserialize_data;
-struct _zend_trait_method_reference {
+typedef struct _zend_trait_method_reference {
zend_string *method_name;
zend_class_entry *ce;
zend_string *class_name;
-};
-typedef struct _zend_trait_method_reference zend_trait_method_reference;
+} zend_trait_method_reference;
-struct _zend_trait_precedence {
+typedef struct _zend_trait_precedence {
zend_trait_method_reference *trait_method;
union {
zend_class_entry *ce;
zend_string *class_name;
} *exclude_from_classes;
-};
-typedef struct _zend_trait_precedence zend_trait_precedence;
+} zend_trait_precedence;
-struct _zend_trait_alias {
+typedef struct _zend_trait_alias {
zend_trait_method_reference *trait_method;
/**
@@ -466,8 +108,7 @@ struct _zend_trait_alias {
* modifiers to be set on trait method
*/
uint32_t modifiers;
-};
-typedef struct _zend_trait_alias zend_trait_alias;
+} zend_trait_alias;
struct _zend_class_entry {
char type;
@@ -508,8 +149,8 @@ struct _zend_class_entry {
union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method TSRMLS_DC);
/* serializer callbacks */
- int (*serialize)(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);
- int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);
+ int (*serialize)(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
+ int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
uint32_t num_interfaces;
uint32_t num_traits;
@@ -533,7 +174,6 @@ struct _zend_class_entry {
} info;
};
-#include "zend_stream.h"
typedef struct _zend_utility_functions {
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
@@ -542,7 +182,7 @@ typedef struct _zend_utility_functions {
void (*message_handler)(zend_long message, const void *data TSRMLS_DC);
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
- int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
+ zval *(*get_configuration_directive)(zend_string *name);
void (*ticks_function)(int ticks TSRMLS_DC);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
@@ -560,39 +200,8 @@ typedef struct _zend_utility_values {
typedef int (*zend_write_func_t)(const char *str, uint str_length);
-#undef MIN
-#undef MAX
-#define MAX(a, b) (((a)>(b))?(a):(b))
-#define MIN(a, b) (((a)<(b))?(a):(b))
-#define ZEND_STRL(str) (str), (sizeof(str)-1)
-#define ZEND_STRS(str) (str), (sizeof(str))
-#define ZEND_NORMALIZE_BOOL(n) \
- ((n) ? (((n)>0) ? 1 : -1) : 0)
-#define ZEND_TRUTH(x) ((x) ? 1 : 0)
-#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
-
-int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC);
-void zend_shutdown(TSRMLS_D);
-void zend_register_standard_ini_entries(TSRMLS_D);
-void zend_post_startup(TSRMLS_D);
-void zend_set_utility_values(zend_utility_values *utility_values);
-
-BEGIN_EXTERN_C()
-ZEND_API void _zend_bailout(char *filename, uint lineno);
-END_EXTERN_C()
-
#define zend_bailout() _zend_bailout(__FILE__, __LINE__)
-#ifdef HAVE_SIGSETJMP
-# define SETJMP(a) sigsetjmp(a, 0)
-# define LONGJMP(a,b) siglongjmp(a, b)
-# define JMP_BUF sigjmp_buf
-#else
-# define SETJMP(a) setjmp(a)
-# define LONGJMP(a,b) longjmp(a, b)
-# define JMP_BUF jmp_buf
-#endif
-
#define zend_try \
{ \
JMP_BUF *__orig_bailout = EG(bailout); \
@@ -610,6 +219,14 @@ END_EXTERN_C()
#define zend_first_try EG(bailout)=NULL; zend_try
BEGIN_EXTERN_C()
+int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC);
+void zend_shutdown(TSRMLS_D);
+void zend_register_standard_ini_entries(TSRMLS_D);
+void zend_post_startup(TSRMLS_D);
+void zend_set_utility_values(zend_utility_values *utility_values);
+
+ZEND_API void _zend_bailout(char *filename, uint lineno);
+
ZEND_API char *get_zend_version(void);
ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC);
ZEND_API int zend_print_zval(zval *expr, int indent TSRMLS_DC);
@@ -618,24 +235,14 @@ ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-END_EXTERN_C()
-BEGIN_EXTERN_C()
ZEND_API void zend_activate(TSRMLS_D);
ZEND_API void zend_deactivate(TSRMLS_D);
ZEND_API void zend_call_destructors(TSRMLS_D);
ZEND_API void zend_activate_modules(TSRMLS_D);
ZEND_API void zend_deactivate_modules(TSRMLS_D);
ZEND_API void zend_post_deactivate_modules(TSRMLS_D);
-END_EXTERN_C()
-
-#if ZEND_DEBUG
-#define Z_DBG(expr) (expr)
-#else
-#define Z_DBG(expr)
-#endif
-BEGIN_EXTERN_C()
ZEND_API void free_estring(char **str_p);
ZEND_API void free_string_zval(zval *zv);
END_EXTERN_C()
@@ -676,20 +283,10 @@ END_EXTERN_C()
#define ZEND_UV(name) (zend_uv.name)
-#ifndef ZEND_SIGNALS
-#define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); }
-#define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); }
-#else
-#include "zend_signal.h"
-
-#define HANDLE_BLOCK_INTERRUPTIONS() ZEND_SIGNAL_BLOCK_INTERRUPUTIONS()
-#define HANDLE_UNBLOCK_INTERRUPTIONS() ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS()
-#endif
-
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC);
-ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
+ZEND_API zval *zend_get_configuration_directive(zend_string *name);
END_EXTERN_C()
/* Messages for applications of Zend */
@@ -701,131 +298,6 @@ END_EXTERN_C()
#define ZMSG_LOG_SCRIPT_NAME 6L
#define ZMSG_MEMORY_LEAKS_GRAND_TOTAL 7L
-#define ZVAL_COPY_VALUE(z, v) \
- do { \
- zval *_z1 = (z); \
- zval *_z2 = (v); \
- (_z1)->value = (_z2)->value; \
- Z_TYPE_INFO_P(_z1) = Z_TYPE_INFO_P(_z2); \
- } while (0)
-
-#define ZVAL_COPY(z, v) \
- do { \
- zval *__z1 = (z); \
- zval *__z2 = (v); \
- ZVAL_COPY_VALUE(__z1, __z2); \
- if (Z_OPT_REFCOUNTED_P(__z1)) { \
- Z_ADDREF_P(__z1); \
- } \
- } while (0)
-
-#define ZVAL_DUP(z, v) \
- do { \
- zval *__z1 = (z); \
- zval *__z2 = (v); \
- ZVAL_COPY_VALUE(__z1, __z2); \
- zval_opt_copy_ctor(__z1); \
- } while (0)
-
-#define ZVAL_DEREF(z) do { \
- if (UNEXPECTED(Z_ISREF_P(z))) { \
- (z) = Z_REFVAL_P(z); \
- } \
- } while (0)
-
-#define ZVAL_MAKE_REF(zv) do { \
- zval *__zv = (zv); \
- if (!Z_ISREF_P(__zv)) { \
- ZVAL_NEW_REF(__zv, __zv); \
- } \
- } while (0)
-
-#define ZVAL_UNREF(z) do { \
- zval *_z = (z); \
- zend_reference *ref; \
- ZEND_ASSERT(Z_ISREF_P(_z)); \
- ref = Z_REF_P(_z); \
- ZVAL_COPY_VALUE(_z, &ref->val); \
- efree_size(ref, sizeof(zend_reference)); \
- } while (0)
-
-#define SEPARATE_STRING(zv) do { \
- zval *_zv = (zv); \
- if (Z_REFCOUNTED_P(_zv) && \
- Z_REFCOUNT_P(_zv) > 1) { \
- Z_DELREF_P(_zv); \
- zval_copy_ctor_func(_zv); \
- } \
- } while (0)
-
-#define SEPARATE_ARRAY(zv) do { \
- zval *_zv = (zv); \
- if (Z_REFCOUNT_P(_zv) > 1) { \
- if (!Z_IMMUTABLE_P(_zv)) { \
- Z_DELREF_P(_zv); \
- } \
- zval_copy_ctor_func(_zv); \
- } \
- } while (0)
-
-#define SEPARATE_ZVAL_NOREF(zv) do { \
- zval *_zv = (zv); \
- if (Z_COPYABLE_P(_zv) || \
- Z_IMMUTABLE_P(_zv)) { \
- if (Z_REFCOUNT_P(_zv) > 1) { \
- if (!Z_IMMUTABLE_P(_zv)) { \
- Z_DELREF_P(_zv); \
- } \
- zval_copy_ctor_func(_zv); \
- } \
- } \
- } while (0)
-
-#define SEPARATE_ZVAL(zv) do { \
- zval *_zv = (zv); \
- if (Z_REFCOUNTED_P(_zv) || \
- Z_IMMUTABLE_P(_zv)) { \
- if (Z_REFCOUNT_P(_zv) > 1) { \
- if (Z_COPYABLE_P(_zv) || \
- Z_IMMUTABLE_P(_zv)) { \
- if (!Z_IMMUTABLE_P(_zv)) { \
- Z_DELREF_P(_zv); \
- } \
- zval_copy_ctor_func(_zv); \
- } else if (Z_ISREF_P(_zv)) { \
- Z_DELREF_P(_zv); \
- ZVAL_DUP(_zv, Z_REFVAL_P(_zv)); \
- } \
- } \
- } \
- } while (0)
-
-#define SEPARATE_ZVAL_IF_NOT_REF(zv) do { \
- zval *_zv = (zv); \
- if (Z_COPYABLE_P(_zv) || \
- Z_IMMUTABLE_P(_zv)) { \
- if (Z_REFCOUNT_P(_zv) > 1) { \
- if (!Z_IMMUTABLE_P(_zv)) { \
- Z_DELREF_P(_zv); \
- } \
- zval_copy_ctor_func(_zv); \
- } \
- } \
- } while (0)
-
-#define SEPARATE_ARG_IF_REF(varptr) do { \
- ZVAL_DEREF(varptr); \
- if (Z_REFCOUNTED_P(varptr)) { \
- Z_ADDREF_P(varptr); \
- } \
- } while (0)
-
-#define ZEND_MAX_RESERVED_RESOURCES 4
-
-#include "zend_gc.h"
-#include "zend_operators.h"
-#include "zend_variables.h"
-
typedef enum {
EH_NORMAL = 0,
EH_SUPPRESS,
@@ -845,6 +317,9 @@ ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC);
#define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0)
#define DEBUG_BACKTRACE_IGNORE_ARGS (1<<1)
+#include "zend_object_handlers.h"
+#include "zend_operators.h"
+
#endif /* ZEND_H */
/*
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 05d49b8f59..41adbeba8f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -27,6 +27,7 @@
#include "zend_constants.h"
#include "zend_exceptions.h"
#include "zend_closures.h"
+#include "zend_inheritance.h"
#ifdef HAVE_STDARG_H
#include <stdarg.h>
@@ -1144,9 +1145,8 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC)
if (key) {
zval member;
- ZVAL_STR(&member, zend_string_copy(key));
+ ZVAL_STR(&member, key);
obj_ht->write_property(obj, &member, value, NULL TSRMLS_CC);
- zval_ptr_dtor(&member);
}
} ZEND_HASH_FOREACH_END();
EG(scope) = old_scope;
@@ -1268,13 +1268,12 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
{
object->properties = properties;
if (object->ce->default_properties_count) {
- zval *prop, tmp;
+ zval *prop;
zend_string *key;
zend_property_info *property_info;
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
- ZVAL_STR(&tmp, key);
- property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
if (property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0 &&
property_info->offset >= 0) {
@@ -1293,8 +1292,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties
zend_property_info *property_info;
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
- ZVAL_STR(&tmp, key);
- property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
if (property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0 &&
property_info->offset >= 0) {
@@ -1303,7 +1301,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties
zval_add_ref(&object->properties_table[property_info->offset]);
if (object->properties) {
ZVAL_INDIRECT(&tmp, &object->properties_table[property_info->offset]);
- prop = zend_hash_update(object->properties, key, &tmp);
+ zend_hash_update(object->properties, key, &tmp);
}
} else {
if (!object->properties) {
@@ -2280,7 +2278,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
/* If types of arguments have to be checked */
if (reg_function->common.arg_info && reg_function->common.num_args) {
- int i;
+ uint32_t i;
for (i = 0; i < reg_function->common.num_args; i++) {
if (reg_function->common.arg_info[i].class_name ||
reg_function->common.arg_info[i].type_hint) {
@@ -3450,7 +3448,7 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_i
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem) /* {{{ */
{
if (fci->params) {
- int i;
+ uint32_t i;
for (i = 0; i < fci->param_count; i++) {
zval_ptr_dtor(&fci->params[i]);
@@ -3484,7 +3482,7 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count
ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args TSRMLS_DC) /* {{{ */
{
zval *arg, *params;
- int n = 1;
+ uint32_t n = 1;
zend_fcall_info_args_clear(fci, !args);
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 616934fcd2..657d1d04de 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -46,10 +46,10 @@ typedef struct _zend_fcall_info {
zval function_name;
zend_array *symbol_table;
zval *retval;
- uint32_t param_count;
zval *params;
zend_object *object;
zend_bool no_separation;
+ uint32_t param_count;
} zend_fcall_info;
typedef struct _zend_fcall_info_cache {
@@ -1193,7 +1193,7 @@ static zend_always_inline int _z_param_string(zval *arg, char **dest, size_t *de
static zend_always_inline int _z_param_path_str(zval *arg, zend_string **dest, int check_null TSRMLS_DC)
{
if (!_z_param_str(arg, dest, check_null TSRMLS_CC) ||
- (check_null && UNEXPECTED(!(*dest)->val)) ||
+ (check_null && UNEXPECTED(!(*dest)->val[0])) ||
UNEXPECTED(CHECK_NULL_PATH((*dest)->val, (*dest)->len))) {
return 0;
}
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 9467059aa9..ac403617a6 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -57,6 +57,7 @@
#include "zend_alloc.h"
#include "zend_globals.h"
#include "zend_operators.h"
+#include "zend_multiply.h"
#ifdef HAVE_SIGNAL_H
# include <signal.h>
@@ -372,6 +373,30 @@ static ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
exit(1);
}
+#ifdef _WIN32
+void
+stderr_last_error(char *msg)
+{
+ LPSTR buf = NULL;
+ DWORD err = GetLastError();
+
+ if (!FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPSTR)&buf,
+ 0, NULL)) {
+ fprintf(stderr, "\n%s: [0x%08x]\n", msg, err);
+ }
+ else {
+ fprintf(stderr, "\n%s: [0x%08x] %s\n", msg, err, buf);
+ }
+}
+#endif
+
/*****************/
/* OS Allocation */
/*****************/
@@ -408,7 +433,7 @@ static void *zend_mm_mmap(size_t size)
if (ptr == NULL) {
#if ZEND_MM_ERROR
- fprintf(stderr, "\nVirtualAlloc() failed: [%d]\n", GetLastError());
+ stderr_last_error("VirtualAlloc() failed");
#endif
return NULL;
}
@@ -431,7 +456,7 @@ static void zend_mm_munmap(void *addr, size_t size)
#ifdef _WIN32
if (VirtualFree(addr, 0, MEM_RELEASE) == 0) {
#if ZEND_MM_ERROR
- fprintf(stderr, "\nVirtualFree() failed: [%d]\n", GetLastError());
+ stderr_last_error("VirtualFree() failed");
#endif
}
#else
@@ -452,6 +477,19 @@ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
{
#if defined(__GNUC__)
return __builtin_ctzl(~bitset);
+#elif defined(_WIN32)
+ unsigned long index;
+
+#if defined(_WIN64)
+ if (!BitScanForward64(&index, ~bitset)) {
+#else
+ if (!BitScanForward(&index, ~bitset)) {
+#endif
+ /* undefined behavior */
+ return 32;
+ }
+
+ return (int)index;
#else
int n;
@@ -476,6 +514,19 @@ static zend_always_inline int zend_mm_bitset_ntz(zend_mm_bitset bitset)
{
#if defined(__GNUC__)
return __builtin_ctzl(bitset);
+#elif defined(_WIN32)
+ unsigned long index;
+
+#if defined(_WIN64)
+ if (!BitScanForward64(&index, bitset)) {
+#else
+ if (!BitScanForward(&index, bitset)) {
+#endif
+ /* undefined behavior */
+ return 32;
+ }
+
+ return (int)index;
#else
int n;
@@ -882,6 +933,13 @@ not_found:
chunk = (zend_mm_chunk*)zend_mm_chunk_alloc(ZEND_MM_CHUNK_SIZE, ZEND_MM_CHUNK_SIZE);
if (UNEXPECTED(chunk == NULL)) {
/* insufficient memory */
+#if !ZEND_MM_LIMIT
+ zend_mm_safe_error(heap, "Out of memory");
+#elif ZEND_DEBUG
+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %lu bytes)", heap->real_size, __zend_filename, __zend_lineno, size);
+#else
+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %lu bytes)", heap->real_size, ZEND_MM_PAGE_SIZE * pages_count);
+#endif
return NULL;
}
#if ZEND_MM_STAT
@@ -986,14 +1044,22 @@ static zend_always_inline void zend_mm_free_large(zend_mm_heap *heap, zend_mm_ch
/* Small Runs */
/**************/
-/* higher set bit number (0->0, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 etc) */
+/* higher set bit number (0->N/A, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 etc) */
static zend_always_inline int zend_mm_small_size_to_bit(int size)
{
#if defined(__GNUC__)
return (__builtin_clz(size) ^ 0x1f) + 1;
+#elif defined(_WIN32)
+ unsigned long index;
+
+ if (!BitScanReverse(&index, (unsigned long)size)) {
+ /* undefined behavior */
+ return 64;
+ }
+
+ return (((31 - (int)index) ^ 0x1f) + 1);
#else
int n = 16;
- if (size == 0) return 0;
if (size <= 0x00ff) {n -= 8; size = size << 8;}
if (size <= 0x0fff) {n -= 4; size = size << 4;}
if (size <= 0x3fff) {n -= 2; size = size << 2;}
@@ -1546,6 +1612,13 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
ptr = zend_mm_chunk_alloc(new_size, ZEND_MM_CHUNK_SIZE);
if (UNEXPECTED(ptr == NULL)) {
/* insufficient memory */
+#if !ZEND_MM_LIMIT
+ zend_mm_safe_error(heap, "Out of memory");
+#elif ZEND_DEBUG
+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %lu bytes)", heap->real_size, __zend_filename, __zend_lineno, size);
+#else
+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %lu bytes)", heap->real_size, size);
+#endif
return NULL;
}
#if ZEND_DEBUG
@@ -1598,8 +1671,12 @@ zend_mm_heap *zend_mm_init(void)
if (UNEXPECTED(chunk == NULL)) {
#if ZEND_MM_ERROR
+#ifdef _WIN32
+ stderr_last_error("Can't initialize heap");
+#else
fprintf(stderr, "\nCan't initialize heap: [%d] %s\n", errno, strerror(errno));
#endif
+#endif
return NULL;
}
heap = &chunk->heap_slot;
@@ -2080,124 +2157,17 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE
return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
-#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
-
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
+static zend_always_inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
- size_t res = nmemb;
- zend_ulong overflow = 0;
-
- __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
- : "=&a"(res), "=&d" (overflow)
- : "%0"(res),
- "rm"(size),
- "rm"(offset));
+ int overflow;
+ size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
if (UNEXPECTED(overflow)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
return 0;
}
- return res;
-}
-
-#elif defined(__GNUC__) && defined(__x86_64__)
-
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
-{
- size_t res = nmemb;
- zend_ulong overflow = 0;
-
-#ifdef __ILP32__ /* x32 */
-# define LP_SUFF "l"
-#else /* amd64 */
-# define LP_SUFF "q"
-#endif
-
- __asm__ ("mul" LP_SUFF " %3\n\t"
- "add %4,%0\n\t"
- "adc $0,%1"
- : "=&a"(res), "=&d" (overflow)
- : "%0"(res),
- "rm"(size),
- "rm"(offset));
-
-#undef LP_SUFF
- if (UNEXPECTED(overflow)) {
- zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
- return 0;
- }
- return res;
-}
-
-#elif defined(__GNUC__) && defined(__arm__)
-
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
-{
- size_t res;
- zend_ulong overflow;
-
- __asm__ ("umlal %0,%1,%2,%3"
- : "=r"(res), "=r"(overflow)
- : "r"(nmemb),
- "r"(size),
- "0"(offset),
- "1"(0));
-
- if (UNEXPECTED(overflow)) {
- zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
- return 0;
- }
- return res;
-}
-
-#elif defined(__GNUC__) && defined(__aarch64__)
-
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
-{
- size_t res;
- zend_ulong overflow;
-
- __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr"
- : "=&r"(res), "=&r"(overflow)
- : "r"(nmemb),
- "r"(size),
- "r"(offset));
-
- if (UNEXPECTED(overflow)) {
- zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
- return 0;
- }
- return res;
-}
-
-#elif SIZEOF_SIZE_T == 4 && defined(HAVE_ZEND_LONG64)
-
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
-{
- zend_ulong64 res = (zend_ulong64)nmemb * (zend_ulong64)size + (zend_ulong64)offset;
-
- if (UNEXPECTED(res > (zend_ulong64)0xFFFFFFFFL)) {
- zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
- return 0;
- }
- return (size_t) res;
-}
-
-#else
-
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
-{
- size_t res = nmemb * size + offset;
- double _d = (double)nmemb * (double)size + (double)offset;
- double _delta = (double)res - _d;
-
- if (UNEXPECTED((_d + _delta ) != _d)) {
- zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
- return 0;
- }
- return res;
+ return ret;
}
-#endif
ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index 3b487d3138..d50d3d5cb8 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -45,8 +45,8 @@ typedef struct _zend_leak_info {
void *addr;
size_t size;
const char *filename;
- uint lineno;
const char *orig_filename;
+ uint lineno;
uint orig_lineno;
} zend_leak_info;
@@ -164,7 +164,7 @@ ZEND_API void ZEND_FASTCALL _efree_huge(void *, size_t size);
#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-inline static void * __zend_malloc(size_t len)
+zend_always_inline static void * __zend_malloc(size_t len)
{
void *tmp = malloc(len);
if (tmp) {
@@ -174,14 +174,14 @@ inline static void * __zend_malloc(size_t len)
exit(1);
}
-inline static void * __zend_calloc(size_t nmemb, size_t len)
+zend_always_inline static void * __zend_calloc(size_t nmemb, size_t len)
{
void *tmp = _safe_malloc(nmemb, len, 0);
memset(tmp, 0, nmemb * len);
return tmp;
}
-inline static void * __zend_realloc(void *p, size_t len)
+zend_always_inline static void * __zend_realloc(void *p, size_t len)
{
p = realloc(p, len);
if (p) {
@@ -220,8 +220,6 @@ ZEND_API int is_zend_mm(TSRMLS_D);
ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC);
ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC);
-END_EXTERN_C()
-
/* fast cache for HashTables */
#define ALLOC_HASHTABLE(ht) \
(ht) = (HashTable *) emalloc(sizeof(HashTable))
@@ -262,6 +260,8 @@ ZEND_API void zend_mm_set_custom_handlers(zend_mm_heap *heap,
void (*_free)(void*),
void* (*_realloc)(void*, size_t));
+END_EXTERN_C()
+
#endif
/*
diff --git a/Zend/zend_arena.h b/Zend/zend_arena.h
index 0a1d6f1107..64fde19619 100644
--- a/Zend/zend_arena.h
+++ b/Zend/zend_arena.h
@@ -65,7 +65,7 @@ static zend_always_inline void* zend_arena_alloc(zend_arena **arena_ptr, size_t
size_t arena_size =
UNEXPECTED((size + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena))) > (size_t)(arena->end - (char*) arena)) ?
(size + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena))) :
- (arena->end - (char*) arena);
+ (size_t)(arena->end - (char*) arena);
zend_arena *new_arena = (zend_arena*)emalloc(arena_size);
ptr = (char*) new_arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena));
@@ -80,10 +80,14 @@ static zend_always_inline void* zend_arena_alloc(zend_arena **arena_ptr, size_t
static zend_always_inline void* zend_arena_calloc(zend_arena **arena_ptr, size_t count, size_t unit_size)
{
- size_t size = unit_size * count;
+ int overflow;
+ size_t size;
void *ret;
- ZEND_ASSERT(size >= unit_size && size >= count);
+ size = zend_safe_address(unit_size, count, 0, &overflow);
+ if (UNEXPECTED(overflow)) {
+ zend_error(E_ERROR, "Possible integer overflow in zend_arena_calloc() (%zu * %zu)", unit_size, count);
+ }
ret = zend_arena_alloc(arena_ptr, size);
memset(ret, 0, size);
return ret;
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 1a8be00395..9604079a9e 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -42,8 +42,10 @@ static inline size_t zend_ast_list_size(uint32_t children) {
}
ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
+ zend_ast_znode *ast;
TSRMLS_FETCH();
- zend_ast_znode *ast = zend_ast_alloc(sizeof(zend_ast_znode) TSRMLS_CC);
+
+ ast = zend_ast_alloc(sizeof(zend_ast_znode) TSRMLS_CC);
ast->kind = ZEND_AST_ZNODE;
ast->attr = 0;
ast->lineno = CG(zend_lineno);
@@ -52,8 +54,10 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
}
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
+ zend_ast_zval *ast;
TSRMLS_FETCH();
- zend_ast_zval *ast = zend_ast_alloc(sizeof(zend_ast_zval) TSRMLS_CC);
+
+ ast = zend_ast_alloc(sizeof(zend_ast_zval) TSRMLS_CC);
ast->kind = ZEND_AST_ZVAL;
ast->attr = attr;
ZVAL_COPY_VALUE(&ast->val, zv);
@@ -65,9 +69,10 @@ ZEND_API zend_ast *zend_ast_create_decl(
zend_ast_kind kind, uint32_t flags, uint32_t start_lineno, zend_string *doc_comment,
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2
) {
+ zend_ast_decl *ast;
TSRMLS_FETCH();
- zend_ast_decl *ast = zend_ast_alloc(sizeof(zend_ast_decl) TSRMLS_CC);
+ ast = zend_ast_alloc(sizeof(zend_ast_decl) TSRMLS_CC);
ast->kind = kind;
ast->attr = 0;
ast->start_lineno = start_lineno;
@@ -84,9 +89,11 @@ ZEND_API zend_ast *zend_ast_create_decl(
}
static zend_ast *zend_ast_create_from_va_list(zend_ast_kind kind, zend_ast_attr attr, va_list va) {
- TSRMLS_FETCH();
uint32_t i, children = kind >> ZEND_AST_NUM_CHILDREN_SHIFT;
- zend_ast *ast = zend_ast_alloc(zend_ast_size(children) TSRMLS_CC);
+ zend_ast *ast;
+ TSRMLS_FETCH();
+
+ ast = zend_ast_alloc(zend_ast_size(children) TSRMLS_CC);
ast->kind = kind;
ast->attr = attr;
ast->lineno = (uint32_t) -1;
@@ -131,10 +138,12 @@ ZEND_API zend_ast *zend_ast_create(zend_ast_kind kind, ...) {
}
ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind kind, ...) {
+ zend_ast *ast;
+ zend_ast_list *list;
TSRMLS_FETCH();
- zend_ast *ast = zend_ast_alloc(zend_ast_list_size(4) TSRMLS_CC);
- zend_ast_list *list = (zend_ast_list *) ast;
+ ast = zend_ast_alloc(zend_ast_list_size(4) TSRMLS_CC);
+ list = (zend_ast_list *) ast;
list->kind = kind;
list->attr = 0;
list->lineno = CG(zend_lineno);
@@ -154,7 +163,7 @@ ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind ki
}
static inline zend_bool is_power_of_two(uint32_t n) {
- return n == (n & -n);
+ return ((n != 0) && (n == (n & (~n + 1))));
}
ZEND_API zend_ast *zend_ast_list_add(zend_ast *ast, zend_ast *op) {
@@ -373,16 +382,11 @@ static void zend_ast_destroy_ex(zend_ast *ast, zend_bool free) {
switch (ast->kind) {
case ZEND_AST_ZVAL:
- {
/* Destroy value without using GC: When opcache moves arrays into SHM it will
* free the zend_array structure, so references to it from outside the op array
* become invalid. GC would cause such a reference in the root buffer. */
- zval *zv = zend_ast_get_zval(ast);
- if (Z_REFCOUNTED_P(zv) && !Z_DELREF_P(zv)) {
- _zval_dtor_func_for_ptr(Z_COUNTED_P(zv) ZEND_FILE_LINE_CC);
- }
+ zval_ptr_dtor_nogc(zend_ast_get_zval(ast));
break;
- }
case ZEND_AST_FUNC_DECL:
case ZEND_AST_CLOSURE:
case ZEND_AST_METHOD:
diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h
index 2a1582ca24..716b385210 100644
--- a/Zend/zend_ast.h
+++ b/Zend/zend_ast.h
@@ -207,27 +207,27 @@ ZEND_API void zend_ast_destroy_and_free(zend_ast *ast);
typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr TSRMLS_DC);
ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn TSRMLS_DC);
-static inline zend_bool zend_ast_is_list(zend_ast *ast) {
+static zend_always_inline zend_bool zend_ast_is_list(zend_ast *ast) {
return (ast->kind >> ZEND_AST_IS_LIST_SHIFT) & 1;
}
-static inline zend_ast_list *zend_ast_get_list(zend_ast *ast) {
+static zend_always_inline zend_ast_list *zend_ast_get_list(zend_ast *ast) {
ZEND_ASSERT(zend_ast_is_list(ast));
return (zend_ast_list *) ast;
}
-static inline zval *zend_ast_get_zval(zend_ast *ast) {
+static zend_always_inline zval *zend_ast_get_zval(zend_ast *ast) {
ZEND_ASSERT(ast->kind == ZEND_AST_ZVAL);
return &((zend_ast_zval *) ast)->val;
}
-static inline zend_string *zend_ast_get_str(zend_ast *ast) {
+static zend_always_inline zend_string *zend_ast_get_str(zend_ast *ast) {
return Z_STR_P(zend_ast_get_zval(ast));
}
-static inline uint32_t zend_ast_get_num_children(zend_ast *ast) {
+static zend_always_inline uint32_t zend_ast_get_num_children(zend_ast *ast) {
ZEND_ASSERT(!zend_ast_is_list(ast));
return ast->kind >> ZEND_AST_NUM_CHILDREN_SHIFT;
}
-static inline uint32_t zend_ast_get_lineno(zend_ast *ast) {
+static zend_always_inline uint32_t zend_ast_get_lineno(zend_ast *ast) {
if (ast->kind == ZEND_AST_ZVAL) {
zval *zv = zend_ast_get_zval(ast);
return zv->u2.lineno;
@@ -236,27 +236,27 @@ static inline uint32_t zend_ast_get_lineno(zend_ast *ast) {
}
}
-static inline zend_ast *zend_ast_create_zval(zval *zv) {
+static zend_always_inline zend_ast *zend_ast_create_zval(zval *zv) {
return zend_ast_create_zval_ex(zv, 0);
}
-static inline zend_ast *zend_ast_create_zval_from_str(zend_string *str) {
+static zend_always_inline zend_ast *zend_ast_create_zval_from_str(zend_string *str) {
zval zv;
ZVAL_STR(&zv, str);
return zend_ast_create_zval(&zv);
}
-static inline zend_ast *zend_ast_create_zval_from_long(zend_long lval) {
+static zend_always_inline zend_ast *zend_ast_create_zval_from_long(zend_long lval) {
zval zv;
ZVAL_LONG(&zv, lval);
return zend_ast_create_zval(&zv);
}
-static inline zend_ast *zend_ast_create_binary_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) {
+static zend_always_inline zend_ast *zend_ast_create_binary_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) {
return zend_ast_create_ex(ZEND_AST_BINARY_OP, opcode, op0, op1);
}
-static inline zend_ast *zend_ast_create_assign_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) {
+static zend_always_inline zend_ast *zend_ast_create_assign_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) {
return zend_ast_create_ex(ZEND_AST_ASSIGN_OP, opcode, op0, op1);
}
-static inline zend_ast *zend_ast_create_cast(uint32_t type, zend_ast *op0) {
+static zend_always_inline zend_ast *zend_ast_create_cast(uint32_t type, zend_ast *op0) {
return zend_ast_create_ex(ZEND_AST_CAST, type, op0);
}
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 4a0a71fd04..91ab77e6c5 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -381,7 +381,7 @@ ZEND_FUNCTION(gc_enabled)
ZEND_FUNCTION(gc_enable)
{
zend_string *key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
- zend_alter_ini_entry(key, "1", sizeof("1")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry_chars(key, "1", sizeof("1")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
zend_string_release(key);
}
/* }}} */
@@ -391,7 +391,7 @@ ZEND_FUNCTION(gc_enable)
ZEND_FUNCTION(gc_disable)
{
zend_string *key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
- zend_alter_ini_entry(key, "0", sizeof("0")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry_chars(key, "0", sizeof("0")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
zend_string_release(key);
}
/* }}} */
@@ -415,7 +415,7 @@ ZEND_FUNCTION(func_num_args)
Get the $arg_num'th argument that was passed to the function */
ZEND_FUNCTION(func_get_arg)
{
- int arg_count, first_extra_arg;
+ uint32_t arg_count, first_extra_arg;
zval *arg;
zend_long requested_offset;
zend_execute_data *ex;
@@ -460,8 +460,8 @@ ZEND_FUNCTION(func_get_arg)
ZEND_FUNCTION(func_get_args)
{
zval *p;
- int arg_count, first_extra_arg;
- int i;
+ uint32_t arg_count, first_extra_arg;
+ uint32_t i;
zend_execute_data *ex = EG(current_execute_data)->prev_execute_data;
if (ex->frame_kind != VM_FRAME_NESTED_FUNCTION && ex->frame_kind != VM_FRAME_TOP_FUNCTION) {
@@ -539,7 +539,6 @@ ZEND_FUNCTION(strlen)
}
/* }}} */
-
/* {{{ proto int strcmp(string str1, string str2)
Binary safe string comparison */
ZEND_FUNCTION(strcmp)
@@ -554,7 +553,6 @@ ZEND_FUNCTION(strcmp)
}
/* }}} */
-
/* {{{ proto int strncmp(string str1, string str2, int len)
Binary safe string comparison */
ZEND_FUNCTION(strncmp)
@@ -575,7 +573,6 @@ ZEND_FUNCTION(strncmp)
}
/* }}} */
-
/* {{{ proto int strcasecmp(string str1, string str2)
Binary safe case-insensitive string comparison */
ZEND_FUNCTION(strcasecmp)
@@ -590,7 +587,6 @@ ZEND_FUNCTION(strcasecmp)
}
/* }}} */
-
/* {{{ proto int strncasecmp(string str1, string str2, int len)
Binary safe string comparison */
ZEND_FUNCTION(strncasecmp)
@@ -611,7 +607,6 @@ ZEND_FUNCTION(strncasecmp)
}
/* }}} */
-
/* {{{ proto array each(array arr)
Return the currently pointed key..value pair in the passed array, and advance the pointer to the next element */
ZEND_FUNCTION(each)
@@ -660,7 +655,7 @@ ZEND_FUNCTION(each)
/* add the key elements */
if (zend_hash_get_current_key(target_hash, &key, &num_key, 0) == HASH_KEY_IS_STRING) {
- ZVAL_STR(&tmp, zend_string_copy(key));
+ ZVAL_STR_COPY(&tmp, key);
if (Z_REFCOUNTED(tmp)) Z_ADDREF(tmp);
} else {
ZVAL_LONG(&tmp, num_key);
@@ -671,23 +666,21 @@ ZEND_FUNCTION(each)
}
/* }}} */
-
/* {{{ proto int error_reporting([int new_error_level])
Return the current error_reporting level, and if an argument was passed - change to the new level */
ZEND_FUNCTION(error_reporting)
{
- char *err;
- size_t err_len;
+ zend_string *err;
int old_error_reporting;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &err, &err_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &err) == FAILURE) {
return;
}
old_error_reporting = EG(error_reporting);
if(ZEND_NUM_ARGS() != 0) {
zend_string *key = zend_string_init("error_reporting", sizeof("error_reporting")-1, 0);
- zend_alter_ini_entry(key, err, err_len, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(key, err, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
zend_string_release(key);
}
@@ -695,7 +688,6 @@ ZEND_FUNCTION(error_reporting)
}
/* }}} */
-
/* {{{ proto bool define(string constant_name, mixed value, boolean case_insensitive=false)
Define a new constant */
ZEND_FUNCTION(define)
@@ -775,7 +767,6 @@ repeat:
}
/* }}} */
-
/* {{{ proto bool defined(string constant_name)
Check whether a constant exists
Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
@@ -801,7 +792,6 @@ ZEND_FUNCTION(defined)
}
/* }}} */
-
/* {{{ proto string get_class([object object])
Retrieves the class name */
ZEND_FUNCTION(get_class)
@@ -825,7 +815,6 @@ ZEND_FUNCTION(get_class)
}
/* }}} */
-
/* {{{ proto string get_called_class()
Retrieves the "Late Static Binding" class name */
ZEND_FUNCTION(get_called_class)
@@ -843,7 +832,6 @@ ZEND_FUNCTION(get_called_class)
}
/* }}} */
-
/* {{{ proto string get_parent_class([mixed object])
Retrieves the parent class name for object or class or current scope. */
ZEND_FUNCTION(get_parent_class)
@@ -884,8 +872,7 @@ ZEND_FUNCTION(get_parent_class)
}
/* }}} */
-
-static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
+static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /* {{{ */
{
zval *obj;
zend_string *class_name;
@@ -937,7 +924,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
RETURN_BOOL(retval);
}
-
+/* }}} */
/* {{{ proto bool is_subclass_of(mixed object_or_string, string class_name [, bool allow_string=true])
Returns true if the object has this class as one of its parents */
@@ -947,7 +934,6 @@ ZEND_FUNCTION(is_subclass_of)
}
/* }}} */
-
/* {{{ proto bool is_a(mixed object_or_string, string class_name [, bool allow_string=false])
Returns true if the first argument is an object and is this class or has this class as one of its parents, */
ZEND_FUNCTION(is_a)
@@ -956,7 +942,6 @@ ZEND_FUNCTION(is_a)
}
/* }}} */
-
/* {{{ add_class_vars */
static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value TSRMLS_DC)
{
@@ -1004,7 +989,6 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
}
/* }}} */
-
/* {{{ proto array get_class_vars(string class_name)
Returns an array of default properties of the class. */
ZEND_FUNCTION(get_class_vars)
@@ -1028,7 +1012,6 @@ ZEND_FUNCTION(get_class_vars)
}
/* }}} */
-
/* {{{ proto array get_object_vars(object obj)
Returns an array of object properties */
ZEND_FUNCTION(get_object_vars)
@@ -1037,8 +1020,6 @@ ZEND_FUNCTION(get_object_vars)
zval *value;
HashTable *properties;
zend_string *key;
- const char *prop_name, *class_name;
- uint prop_len;
zend_object *zobj;
#ifndef FAST_ZPP
@@ -1063,7 +1044,7 @@ ZEND_FUNCTION(get_object_vars)
zobj = Z_OBJ_P(obj);
- array_init(return_value);
+ array_init_size(return_value, zend_hash_num_elements(properties));
ZEND_HASH_FOREACH_STR_KEY_VAL_IND(properties, key, value) {
if (key) {
@@ -1071,7 +1052,9 @@ ZEND_FUNCTION(get_object_vars)
/* Not separating references */
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
if (key->val[0] == 0) {
- zend_unmangle_property_name_ex(key->val, key->len, &class_name, &prop_name, (int*) &prop_len);
+ const char *prop_name, *class_name;
+ size_t prop_len;
+ zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len);
zend_hash_str_add_new(Z_ARRVAL_P(return_value), prop_name, prop_len, value);
} else {
zend_hash_add_new(Z_ARRVAL_P(return_value), key, value);
@@ -1082,13 +1065,14 @@ ZEND_FUNCTION(get_object_vars)
}
/* }}} */
-static int same_name(const char *key, const char *name, uint32_t name_len)
+static int same_name(const char *key, const char *name, uint32_t name_len) /* {{{ */
{
char *lcname = zend_str_tolower_dup(name, name_len);
int ret = memcmp(lcname, key, name_len) == 0;
efree(lcname);
return ret;
}
+/* }}} */
/* {{{ proto array get_class_methods(mixed class)
Returns an array of method names for class or class instance. */
@@ -1132,7 +1116,7 @@ ZEND_FUNCTION(get_class_methods)
/* Do not display old-style inherited constructors */
if (!key) {
- ZVAL_STR(&method_name, zend_string_copy(mptr->common.function_name));
+ ZVAL_STR_COPY(&method_name, mptr->common.function_name);
zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &method_name);
} else if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
mptr->common.scope == ce ||
@@ -1142,10 +1126,10 @@ ZEND_FUNCTION(get_class_methods)
*mptr->op_array.refcount > 1 &&
(len != key->len ||
!same_name(key->val, mptr->common.function_name->val, len))) {
- ZVAL_STR(&method_name, zend_string_copy(zend_find_alias_name(mptr->common.scope, key)));
+ ZVAL_STR_COPY(&method_name, zend_find_alias_name(mptr->common.scope, key));
zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &method_name);
} else {
- ZVAL_STR(&method_name, zend_string_copy(mptr->common.function_name));
+ ZVAL_STR_COPY(&method_name, mptr->common.function_name);
zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &method_name);
}
}
@@ -1154,7 +1138,6 @@ ZEND_FUNCTION(get_class_methods)
}
/* }}} */
-
/* {{{ proto bool method_exists(object object, string method)
Checks if the class method exists */
ZEND_FUNCTION(method_exists)
@@ -1263,7 +1246,6 @@ ZEND_FUNCTION(property_exists)
}
/* }}} */
-
/* {{{ proto bool class_exists(string classname [, bool autoload])
Checks if the class exists */
ZEND_FUNCTION(class_exists)
@@ -1394,7 +1376,6 @@ ZEND_FUNCTION(trait_exists)
}
/* }}} */
-
/* {{{ proto bool function_exists(string function_name)
Checks if the function exists */
ZEND_FUNCTION(function_exists)
@@ -1538,7 +1519,6 @@ ZEND_FUNCTION(get_included_files)
}
/* }}} */
-
/* {{{ proto void trigger_error(string message [, int error_type])
Generates a user-level error/warning/notice message */
ZEND_FUNCTION(trigger_error)
@@ -1568,7 +1548,6 @@ ZEND_FUNCTION(trigger_error)
}
/* }}} */
-
/* {{{ proto string set_error_handler(string error_handler [, int error_types])
Sets a user-defined error handler function. Returns the previously defined error handler, or false on error */
ZEND_FUNCTION(set_error_handler)
@@ -1608,7 +1587,6 @@ ZEND_FUNCTION(set_error_handler)
}
/* }}} */
-
/* {{{ proto void restore_error_handler(void)
Restores the previously defined error handler function */
ZEND_FUNCTION(restore_error_handler)
@@ -1635,7 +1613,6 @@ ZEND_FUNCTION(restore_error_handler)
}
/* }}} */
-
/* {{{ proto string set_exception_handler(callable exception_handler)
Sets a user-defined exception handler function. Returns the previously defined exception handler, or false on error */
ZEND_FUNCTION(set_exception_handler)
@@ -1672,7 +1649,6 @@ ZEND_FUNCTION(set_exception_handler)
}
/* }}} */
-
/* {{{ proto void restore_exception_handler(void)
Restores the previously defined exception handler function */
ZEND_FUNCTION(restore_exception_handler)
@@ -1691,7 +1667,7 @@ ZEND_FUNCTION(restore_exception_handler)
}
/* }}} */
-static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_class_entry *ce = (zend_class_entry *)Z_PTR_P(el);
zval *array = va_arg(args, zval *);
@@ -1711,6 +1687,7 @@ static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_lis
}
return ZEND_HASH_APPLY_KEEP;
}
+/* }}} */
/* {{{ proto array get_declared_traits()
Returns an array of all declared traits. */
@@ -1728,7 +1705,6 @@ ZEND_FUNCTION(get_declared_traits)
}
/* }}} */
-
/* {{{ proto array get_declared_classes()
Returns an array of all declared classes. */
ZEND_FUNCTION(get_declared_classes)
@@ -1761,8 +1737,7 @@ ZEND_FUNCTION(get_declared_interfaces)
}
/* }}} */
-
-static int copy_function_name(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int copy_function_name(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_function *func = Z_PTR_P(zv);
zval *internal_ar = va_arg(args, zval *),
@@ -1780,7 +1755,7 @@ static int copy_function_name(zval *zv TSRMLS_DC, int num_args, va_list args, ze
return 0;
}
-
+/* }}} */
/* {{{ proto array get_defined_functions(void)
Returns an array of all defined functions */
@@ -1818,7 +1793,6 @@ ZEND_FUNCTION(get_defined_functions)
}
/* }}} */
-
/* {{{ proto array get_defined_vars(void)
Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */
ZEND_FUNCTION(get_defined_vars)
@@ -1830,7 +1804,6 @@ ZEND_FUNCTION(get_defined_vars)
}
/* }}} */
-
#define LAMBDA_TEMP_FUNCNAME "__lambda_func"
/* {{{ proto string create_function(string args, string code)
Creates an anonymous function, and returns its name (funny, eh?) */
@@ -1901,7 +1874,6 @@ ZEND_FUNCTION(create_function)
}
/* }}} */
-
#if ZEND_DEBUG
ZEND_FUNCTION(zend_test_func)
{
@@ -1987,22 +1959,24 @@ ZEND_FUNCTION(get_resources)
}
/* }}} */
-static int add_extension_info(zval *item, void *arg TSRMLS_DC)
+static int add_extension_info(zval *item, void *arg TSRMLS_DC) /* {{{ */
{
zval *name_array = (zval *)arg;
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(item);
add_next_index_string(name_array, module->name);
return 0;
}
+/* }}} */
-static int add_zendext_info(zend_extension *ext, void *arg TSRMLS_DC)
+static int add_zendext_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */
{
zval *name_array = (zval *)arg;
add_next_index_string(name_array, ext->name);
return 0;
}
+/* }}} */
-static int add_constant_info(zval *item, void *arg TSRMLS_DC)
+static int add_constant_info(zval *item, void *arg TSRMLS_DC) /* {{{ */
{
zval *name_array = (zval *)arg;
zend_constant *constant = (zend_constant*)Z_PTR_P(item);
@@ -2017,7 +1991,7 @@ static int add_constant_info(zval *item, void *arg TSRMLS_DC)
zend_hash_add_new(Z_ARRVAL_P(name_array), constant->name, &const_val);
return 0;
}
-
+/* }}} */
/* {{{ proto array get_loaded_extensions([bool zend_extensions]) U
Return an array containing names of loaded extensions */
@@ -2039,7 +2013,6 @@ ZEND_FUNCTION(get_loaded_extensions)
}
/* }}} */
-
/* {{{ proto array get_defined_constants([bool categorize])
Return an array containing the names and values of all defined constants */
ZEND_FUNCTION(get_defined_constants)
@@ -2102,18 +2075,17 @@ ZEND_FUNCTION(get_defined_constants)
}
/* }}} */
-
-static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TSRMLS_DC)
+static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TSRMLS_DC) /* {{{ */
{
- int num_args = call->num_args;
+ uint32_t num_args = call->num_args;
array_init_size(arg_array, num_args);
if (num_args) {
- int i = 0;
+ uint32_t i = 0;
zval *p = ZEND_CALL_ARG(call, 1);
if (call->func->type == ZEND_USER_FUNCTION) {
- int first_extra_arg = call->func->op_array.num_args;
+ uint32_t first_extra_arg = call->func->op_array.num_args;
if (call->func->op_array.fn_flags & ZEND_ACC_VARIADIC) {
first_extra_arg--;
@@ -2137,8 +2109,9 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TS
}
}
}
+/* }}} */
-void debug_print_backtrace_args(zval *arg_array TSRMLS_DC)
+void debug_print_backtrace_args(zval *arg_array TSRMLS_DC) /* {{{ */
{
zval *tmp;
int i = 0;
@@ -2150,6 +2123,7 @@ void debug_print_backtrace_args(zval *arg_array TSRMLS_DC)
zend_print_flat_zval_r(tmp TSRMLS_CC);
} ZEND_HASH_FOREACH_END();
}
+/* }}} */
/* {{{ proto void debug_print_backtrace([int options[, int limit]]) */
ZEND_FUNCTION(debug_print_backtrace)
@@ -2340,7 +2314,7 @@ ZEND_FUNCTION(debug_print_backtrace)
/* }}} */
-ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit TSRMLS_DC)
+ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit TSRMLS_DC) /* {{{ */
{
zend_execute_data *call, *ptr, *skip;
zend_object *object;
@@ -2548,7 +2522,6 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
}
/* }}} */
-
/* {{{ proto array debug_backtrace([int options[, int limit]])
Return backtrace as array */
ZEND_FUNCTION(debug_backtrace)
@@ -2587,7 +2560,6 @@ ZEND_FUNCTION(extension_loaded)
}
/* }}} */
-
/* {{{ proto array get_extension_funcs(string extension_name)
Returns an array with the names of functions belonging to the named extension */
ZEND_FUNCTION(get_extension_funcs)
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index c8497a4f2d..cab31ce1c0 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -376,7 +376,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
arg_info->pass_by_reference ? "&" : "",
i + 1);
}
- ZVAL_STR(&info, zend_strpprintf(0, "%s", i >= required ? "<optional>" : "<required>"));
+ ZVAL_NEW_STR(&info, zend_strpprintf(0, "%s", i >= required ? "<optional>" : "<required>"));
zend_hash_update(Z_ARRVAL(val), name, &info);
zend_string_release(name);
arg_info++;
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 4fbdff3059..bad7bffbd7 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -30,6 +30,7 @@
#include "zend_virtual_cwd.h"
#include "zend_multibyte.h"
#include "zend_language_scanner.h"
+#include "zend_inheritance.h"
#define CONSTANT_EX(op_array, op) \
(op_array)->literals[op]
@@ -76,29 +77,6 @@ ZEND_API zend_compiler_globals compiler_globals;
ZEND_API zend_executor_globals executor_globals;
#endif
-static zend_property_info *zend_duplicate_property_info(zend_property_info *property_info TSRMLS_DC) /* {{{ */
-{
- zend_property_info* new_property_info;
-
- new_property_info = zend_arena_alloc(&CG(arena), sizeof(zend_property_info));
- memcpy(new_property_info, property_info, sizeof(zend_property_info));
- zend_string_addref(new_property_info->name);
- if (new_property_info->doc_comment) {
- zend_string_addref(new_property_info->doc_comment);
- }
- return new_property_info;
-}
-/* }}} */
-
-static zend_property_info *zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */
-{
- zend_property_info* new_property_info = pemalloc(sizeof(zend_property_info), 1);
- memcpy(new_property_info, property_info, sizeof(zend_property_info));
- zend_string_addref(new_property_info->name);
- return new_property_info;
-}
-/* }}} */
-
static void zend_destroy_property_info(zval *zv) /* {{{ */
{
zend_property_info *property_info = Z_PTR_P(zv);
@@ -137,20 +115,19 @@ static zend_string *zend_build_runtime_definition_key(zend_string *name, unsigne
{
zend_string *result;
char char_pos_buf[32];
- size_t char_pos_len = zend_sprintf(char_pos_buf, "%p", lex_pos);
+ size_t filename_len, char_pos_len = zend_sprintf(char_pos_buf, "%p", lex_pos);
const char *filename;
if (CG(active_op_array)->filename) {
filename = CG(active_op_array)->filename->val;
+ filename_len = CG(active_op_array)->filename->len;
} else {
filename = "-";
+ filename_len = sizeof("-") - 1;
}
-
/* NULL, name length, filename length, last accepting char position length */
- result = zend_string_alloc(1 + name->len + strlen(filename) + char_pos_len, 0);
-
- result->val[0] = '\0';
- sprintf(result->val + 1, "%s%s%s", name->val, filename, char_pos_buf);
+ result = zend_string_alloc(1 + name->len + filename_len + char_pos_len, 0);
+ sprintf(result->val, "%c%s%s%s", '\0', name->val, filename, char_pos_buf);
return result;
}
/* }}} */
@@ -560,7 +537,7 @@ void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */
if (opline->opcode == ZEND_FETCH_R ||
opline->opcode == ZEND_FETCH_DIM_R ||
opline->opcode == ZEND_FETCH_OBJ_R ||
- opline->opcode == ZEND_QM_ASSIGN_VAR) {
+ opline->opcode == ZEND_QM_ASSIGN) {
/* It's very rare and useless case. It's better to use
additional FREE opcode and simplify the FETCH handlers
their selves */
@@ -600,10 +577,7 @@ void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */
/* Destroy value without using GC: When opcache moves arrays into SHM it will
* free the zend_array structure, so references to it from outside the op array
* become invalid. GC would cause such a reference in the root buffer. */
- zval *zv = &op1->u.constant;
- if (Z_REFCOUNTED_P(zv) && !Z_DELREF_P(zv)) {
- _zval_dtor_func_for_ptr(Z_COUNTED_P(zv) ZEND_FILE_LINE_CC);
- }
+ zval_ptr_dtor_nogc(&op1->u.constant);
}
}
/* }}} */
@@ -935,1527 +909,6 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */
}
/* }}} */
-static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC) /* {{{ */
-{
- zend_function *function, *new_function;
-
- if (!ce->parent) {
- return;
- }
-
- /* You cannot change create_object */
- ce->create_object = ce->parent->create_object;
-
- /* Inherit special functions if needed */
- if (!ce->get_iterator) {
- ce->get_iterator = ce->parent->get_iterator;
- }
- if (!ce->iterator_funcs.funcs) {
- ce->iterator_funcs.funcs = ce->parent->iterator_funcs.funcs;
- }
- if (!ce->__get) {
- ce->__get = ce->parent->__get;
- }
- if (!ce->__set) {
- ce->__set = ce->parent->__set;
- }
- if (!ce->__unset) {
- ce->__unset = ce->parent->__unset;
- }
- if (!ce->__isset) {
- ce->__isset = ce->parent->__isset;
- }
- if (!ce->__call) {
- ce->__call = ce->parent->__call;
- }
- if (!ce->__callstatic) {
- ce->__callstatic = ce->parent->__callstatic;
- }
- if (!ce->__tostring) {
- ce->__tostring = ce->parent->__tostring;
- }
- if (!ce->clone) {
- ce->clone = ce->parent->clone;
- }
- if(!ce->serialize) {
- ce->serialize = ce->parent->serialize;
- }
- if(!ce->unserialize) {
- ce->unserialize = ce->parent->unserialize;
- }
- if (!ce->destructor) {
- ce->destructor = ce->parent->destructor;
- }
- if (!ce->__debugInfo) {
- ce->__debugInfo = ce->parent->__debugInfo;
- }
- if (ce->constructor) {
- if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) {
- zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()",
- ce->parent->name->val, ce->parent->constructor->common.function_name->val,
- ce->name->val, ce->constructor->common.function_name->val
- );
- }
- return;
- }
-
- if ((function = zend_hash_str_find_ptr(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1)) != NULL) {
- /* inherit parent's constructor */
- if (function->type == ZEND_INTERNAL_FUNCTION) {
- new_function = pemalloc(sizeof(zend_internal_function), 1);
- memcpy(new_function, function, sizeof(zend_internal_function));
- } else {
- new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
- memcpy(new_function, function, sizeof(zend_op_array));
- }
- zend_hash_str_update_ptr(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1, new_function);
- function_add_ref(new_function);
- } else {
- /* Don't inherit the old style constructor if we already have the new style constructor */
- zend_string *lc_class_name;
- zend_string *lc_parent_class_name;
-
- lc_class_name = zend_string_alloc(ce->name->len, 0);
- zend_str_tolower_copy(lc_class_name->val, ce->name->val, ce->name->len);
- if (!zend_hash_exists(&ce->function_table, lc_class_name)) {
- lc_parent_class_name = zend_string_alloc(ce->parent->name->len, 0);
- zend_str_tolower_copy(lc_parent_class_name->val, ce->parent->name->val, ce->parent->name->len);
- if (!zend_hash_exists(&ce->function_table, lc_parent_class_name) &&
- (function = zend_hash_find_ptr(&ce->parent->function_table, lc_parent_class_name)) != NULL) {
- if (function->common.fn_flags & ZEND_ACC_CTOR) {
- /* inherit parent's constructor */
- new_function = pemalloc(sizeof(zend_function), function->type == ZEND_INTERNAL_FUNCTION);
- memcpy(new_function, function, sizeof(zend_function));
- zend_hash_update_ptr(&ce->function_table, lc_parent_class_name, new_function);
- function_add_ref(new_function);
- }
- }
- zend_string_release(lc_parent_class_name);
- }
- zend_string_free(lc_class_name);
- }
- ce->constructor = ce->parent->constructor;
-}
-/* }}} */
-
-char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
-{
- if (fn_flags & ZEND_ACC_PRIVATE) {
- return "private";
- }
- if (fn_flags & ZEND_ACC_PROTECTED) {
- return "protected";
- }
- if (fn_flags & ZEND_ACC_PUBLIC) {
- return "public";
- }
- return "";
-}
-/* }}} */
-
-static zend_function *do_inherit_method(zend_function *old_function TSRMLS_DC) /* {{{ */
-{
- zend_function *new_function;
-
- if (old_function->type == ZEND_INTERNAL_FUNCTION) {
- new_function = pemalloc(sizeof(zend_internal_function), 1);
- memcpy(new_function, old_function, sizeof(zend_internal_function));
- } else {
- new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
- memcpy(new_function, old_function, sizeof(zend_op_array));
- }
- /* The class entry of the derived function intentionally remains the same
- * as that of the parent class. That allows us to know in which context
- * we're running, and handle private method calls properly.
- */
- function_add_ref(new_function);
- return new_function;
-}
-/* }}} */
-
-static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */
-{
- uint32_t i, num_args;
-
- /* If it's a user function then arg_info == NULL means we don't have any parameters but
- * we still need to do the arg number checks. We are only willing to ignore this for internal
- * functions because extensions don't always define arg_info.
- */
- if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) {
- return 1;
- }
-
- /* Checks for constructors only if they are declared in an interface,
- * or explicitly marked as abstract
- */
- if ((fe->common.fn_flags & ZEND_ACC_CTOR)
- && ((proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0
- && (proto->common.fn_flags & ZEND_ACC_ABSTRACT) == 0)) {
- return 1;
- }
-
- /* If both methods are private do not enforce a signature */
- if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
- return 1;
- }
-
- /* check number of arguments */
- if (proto->common.required_num_args < fe->common.required_num_args
- || proto->common.num_args > fe->common.num_args) {
- return 0;
- }
-
- /* by-ref constraints on return values are covariant */
- if ((proto->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
- && !(fe->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
- return 0;
- }
-
- if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
- && !(fe->common.fn_flags & ZEND_ACC_VARIADIC)) {
- return 0;
- }
-
- /* For variadic functions any additional (optional) arguments that were added must be
- * checked against the signature of the variadic argument, so in this case we have to
- * go through all the parameters of the function and not just those present in the
- * prototype. */
- num_args = proto->common.num_args;
- if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
- && fe->common.num_args > proto->common.num_args) {
- num_args = fe->common.num_args;
- }
-
- for (i = 0; i < num_args; i++) {
- zend_arg_info *fe_arg_info = &fe->common.arg_info[i];
-
- zend_arg_info *proto_arg_info;
- if (i < proto->common.num_args) {
- proto_arg_info = &proto->common.arg_info[i];
- } else {
- proto_arg_info = &proto->common.arg_info[proto->common.num_args-1];
- }
-
- if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) {
- /* Only one has a type hint and the other one doesn't */
- return 0;
- }
-
- if (fe_arg_info->class_name) {
- zend_string *fe_class_name, *proto_class_name;
-
- if (!strcasecmp(fe_arg_info->class_name, "parent") && proto->common.scope) {
- fe_class_name = zend_string_copy(proto->common.scope->name);
- } else if (!strcasecmp(fe_arg_info->class_name, "self") && fe->common.scope) {
- fe_class_name = zend_string_copy(fe->common.scope->name);
- } else {
- fe_class_name = zend_string_init(
- fe_arg_info->class_name,
- fe_arg_info->class_name_len, 0);
- }
-
- if (!strcasecmp(proto_arg_info->class_name, "parent") && proto->common.scope && proto->common.scope->parent) {
- proto_class_name = zend_string_copy(proto->common.scope->parent->name);
- } else if (!strcasecmp(proto_arg_info->class_name, "self") && proto->common.scope) {
- proto_class_name = zend_string_copy(proto->common.scope->name);
- } else {
- proto_class_name = zend_string_init(
- proto_arg_info->class_name,
- proto_arg_info->class_name_len, 0);
- }
-
- if (strcasecmp(fe_class_name->val, proto_class_name->val)!=0) {
- const char *colon;
-
- if (fe->common.type != ZEND_USER_FUNCTION) {
- zend_string_release(proto_class_name);
- zend_string_release(fe_class_name);
- return 0;
- } else if (strchr(proto_class_name->val, '\\') != NULL ||
- (colon = zend_memrchr(fe_class_name->val, '\\', fe_class_name->len)) == NULL ||
- strcasecmp(colon+1, proto_class_name->val) != 0) {
- zend_class_entry *fe_ce, *proto_ce;
-
- fe_ce = zend_lookup_class(fe_class_name TSRMLS_CC);
- proto_ce = zend_lookup_class(proto_class_name TSRMLS_CC);
-
- /* Check for class alias */
- if (!fe_ce || !proto_ce ||
- fe_ce->type == ZEND_INTERNAL_CLASS ||
- proto_ce->type == ZEND_INTERNAL_CLASS ||
- fe_ce != proto_ce) {
- zend_string_release(proto_class_name);
- zend_string_release(fe_class_name);
- return 0;
- }
- }
- }
- zend_string_release(proto_class_name);
- zend_string_release(fe_class_name);
- }
- if (fe_arg_info->type_hint != proto_arg_info->type_hint) {
- /* Incompatible type hint */
- return 0;
- }
-
- /* by-ref constraints on arguments are invariant */
- if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) {
- return 0;
- }
- }
-
- return 1;
-}
-/* }}} */
-
-#define REALLOC_BUF_IF_EXCEED(buf, offset, length, size) \
- if (UNEXPECTED(offset - buf + size >= length)) { \
- length += size + 1; \
- buf = erealloc(buf, length); \
- }
-
-static char *zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{ */
-{
- char *offset, *buf;
- uint32_t length = 1024;
-
- offset = buf = (char *)emalloc(length * sizeof(char));
- if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
- *(offset++) = '&';
- *(offset++) = ' ';
- }
-
- if (fptr->common.scope) {
- memcpy(offset, fptr->common.scope->name->val, fptr->common.scope->name->len);
- offset += fptr->common.scope->name->len;
- *(offset++) = ':';
- *(offset++) = ':';
- }
-
- {
- size_t name_len = fptr->common.function_name->len;
- REALLOC_BUF_IF_EXCEED(buf, offset, length, name_len);
- memcpy(offset, fptr->common.function_name->val, name_len);
- offset += name_len;
- }
-
- *(offset++) = '(';
- if (fptr->common.arg_info) {
- uint32_t i, required;
- zend_arg_info *arg_info = fptr->common.arg_info;
-
- required = fptr->common.required_num_args;
- for (i = 0; i < fptr->common.num_args;) {
- if (arg_info->class_name) {
- const char *class_name;
- uint32_t class_name_len;
- if (!strcasecmp(arg_info->class_name, "self") && fptr->common.scope ) {
- class_name = fptr->common.scope->name->val;
- class_name_len = fptr->common.scope->name->len;
- } else if (!strcasecmp(arg_info->class_name, "parent") && fptr->common.scope->parent) {
- class_name = fptr->common.scope->parent->name->val;
- class_name_len = fptr->common.scope->parent->name->len;
- } else {
- class_name = arg_info->class_name;
- class_name_len = arg_info->class_name_len;
- }
- REALLOC_BUF_IF_EXCEED(buf, offset, length, class_name_len);
- memcpy(offset, class_name, class_name_len);
- offset += class_name_len;
- *(offset++) = ' ';
- } else if (arg_info->type_hint) {
- uint32_t type_name_len;
- char *type_name = zend_get_type_by_const(arg_info->type_hint);
- type_name_len = strlen(type_name);
- REALLOC_BUF_IF_EXCEED(buf, offset, length, type_name_len);
- memcpy(offset, type_name, type_name_len);
- offset += type_name_len;
- *(offset++) = ' ';
- }
-
- if (arg_info->pass_by_reference) {
- *(offset++) = '&';
- }
-
- if (arg_info->is_variadic) {
- *(offset++) = '.';
- *(offset++) = '.';
- *(offset++) = '.';
- }
-
- *(offset++) = '$';
-
- if (arg_info->name) {
- REALLOC_BUF_IF_EXCEED(buf, offset, length, arg_info->name_len);
- memcpy(offset, arg_info->name, arg_info->name_len);
- offset += arg_info->name_len;
- } else {
- uint32_t idx = i;
- memcpy(offset, "param", 5);
- offset += 5;
- do {
- *(offset++) = (char) (idx % 10) + '0';
- idx /= 10;
- } while (idx > 0);
- }
- if (i >= required && !arg_info->is_variadic) {
- *(offset++) = ' ';
- *(offset++) = '=';
- *(offset++) = ' ';
- if (fptr->type == ZEND_USER_FUNCTION) {
- zend_op *precv = NULL;
- {
- uint32_t idx = i;
- zend_op *op = ((zend_op_array *)fptr)->opcodes;
- zend_op *end = op + ((zend_op_array *)fptr)->last;
-
- ++idx;
- while (op < end) {
- if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT)
- && op->op1.num == (zend_ulong)idx)
- {
- precv = op;
- }
- ++op;
- }
- }
- if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) {
- zval *zv = precv->op2.zv;
-
- if (Z_TYPE_P(zv) == IS_CONSTANT) {
- REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN_P(zv));
- memcpy(offset, Z_STRVAL_P(zv), Z_STRLEN_P(zv));
- offset += Z_STRLEN_P(zv);
- } else if (Z_TYPE_P(zv) == IS_FALSE) {
- memcpy(offset, "false", 5);
- offset += 5;
- } else if (Z_TYPE_P(zv) == IS_TRUE) {
- memcpy(offset, "true", 4);
- offset += 4;
- } else if (Z_TYPE_P(zv) == IS_NULL) {
- memcpy(offset, "NULL", 4);
- offset += 4;
- } else if (Z_TYPE_P(zv) == IS_STRING) {
- *(offset++) = '\'';
- REALLOC_BUF_IF_EXCEED(buf, offset, length, MIN(Z_STRLEN_P(zv), 10));
- memcpy(offset, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 10));
- offset += MIN(Z_STRLEN_P(zv), 10);
- if (Z_STRLEN_P(zv) > 10) {
- *(offset++) = '.';
- *(offset++) = '.';
- *(offset++) = '.';
- }
- *(offset++) = '\'';
- } else if (Z_TYPE_P(zv) == IS_ARRAY) {
- memcpy(offset, "Array", 5);
- offset += 5;
- } else if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
- memcpy(offset, "<expression>", 12);
- offset += 12;
- } else {
- zend_string *str = zval_get_string(zv);
- REALLOC_BUF_IF_EXCEED(buf, offset, length, str->len);
- memcpy(offset, str->val, str->len);
- offset += str->len;
- zend_string_release(str);
- }
- }
- } else {
- memcpy(offset, "NULL", 4);
- offset += 4;
- }
- }
-
- if (++i < fptr->common.num_args) {
- *(offset++) = ',';
- *(offset++) = ' ';
- }
- arg_info++;
- REALLOC_BUF_IF_EXCEED(buf, offset, length, 32);
- }
- }
- *(offset++) = ')';
- *offset = '\0';
-
- return buf;
-}
-/* }}} */
-
-static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) /* {{{ */
-{
- uint32_t child_flags;
- uint32_t parent_flags = parent->common.fn_flags;
-
- if ((parent->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0
- && parent->common.fn_flags & ZEND_ACC_ABSTRACT
- && parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
- && child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)",
- parent->common.scope->name->val,
- child->common.function_name->val,
- child->common.prototype ? child->common.prototype->common.scope->name->val : child->common.scope->name->val);
- }
-
- if (parent_flags & ZEND_ACC_FINAL) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val);
- }
-
- child_flags = child->common.fn_flags;
- /* You cannot change from static to non static and vice versa.
- */
- if ((child_flags & ZEND_ACC_STATIC) != (parent_flags & ZEND_ACC_STATIC)) {
- if (child->common.fn_flags & ZEND_ACC_STATIC) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child));
- } else {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child));
- }
- }
-
- /* Disallow making an inherited method abstract. */
- if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child));
- }
-
- if (parent_flags & ZEND_ACC_CHANGED) {
- child->common.fn_flags |= ZEND_ACC_CHANGED;
- } else {
- /* Prevent derived classes from restricting access that was available in parent classes
- */
- if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
- } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
- && ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
- child->common.fn_flags |= ZEND_ACC_CHANGED;
- }
- }
-
- if (parent_flags & ZEND_ACC_PRIVATE) {
- child->common.prototype = NULL;
- } else if (parent_flags & ZEND_ACC_ABSTRACT) {
- child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
- child->common.prototype = parent;
- } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
- /* ctors only have a prototype if it comes from an interface */
- child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
- }
-
- if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
- if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
- }
- } else if (EG(error_reporting) & E_STRICT || Z_TYPE(EG(user_error_handler)) != IS_UNDEF) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
- if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
- char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
- zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, method_prototype);
- efree(method_prototype);
- }
- }
-}
-/* }}} */
-
-static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_string *key, zend_class_entry *child_ce) /* {{{ */
-{
- uint32_t parent_flags = parent->common.fn_flags;
- zend_function *child;
- TSRMLS_FETCH();
-
- if ((child = zend_hash_find_ptr(child_function_table, key)) == NULL) {
- if (parent_flags & (ZEND_ACC_ABSTRACT)) {
- child_ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
- }
- return 1; /* method doesn't exist in child, copy from parent */
- }
-
- do_inheritance_check_on_method(child, parent TSRMLS_CC);
-
- return 0;
-}
-/* }}} */
-
-static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */
-{
- zend_property_info *child_info;
- zend_class_entry *parent_ce = ce->parent;
-
- if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) {
- if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) {
- child_info->flags |= ZEND_ACC_CHANGED;
- } else {
- if(ce->type & ZEND_INTERNAL_CLASS) {
- child_info = zend_duplicate_property_info_internal(parent_info);
- } else {
- child_info = zend_duplicate_property_info(parent_info TSRMLS_CC);
- }
- zend_hash_update_ptr(&ce->properties_info, key, child_info);
- child_info->flags &= ~ZEND_ACC_PRIVATE; /* it's not private anymore */
- child_info->flags |= ZEND_ACC_SHADOW; /* but it's a shadow of private */
- }
- return 0; /* don't copy access information to child */
- }
-
- if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) {
- if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s",
- (parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name->val, key->val,
- (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name->val, key->val);
-
- }
-
- if(parent_info->flags & ZEND_ACC_CHANGED) {
- child_info->flags |= ZEND_ACC_CHANGED;
- }
-
- if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name->val, key->val, zend_visibility_string(parent_info->flags), parent_ce->name->val, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
- } else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
- zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
- ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
- ZVAL_UNDEF(&ce->default_properties_table[child_info->offset]);
- child_info->offset = parent_info->offset;
- }
- return 0; /* Don't copy from parent */
- } else {
- return 1; /* Copy from parent */
- }
-}
-/* }}} */
-
-static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
-{
- if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce TSRMLS_CC) == FAILURE) {
- zend_error(E_CORE_ERROR, "Class %s could not implement interface %s", ce->name->val, iface->name->val);
- }
- if (ce == iface) {
- zend_error(E_ERROR, "Interface %s cannot implement itself", ce->name->val);
- }
-}
-/* }}} */
-
-ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC) /* {{{ */
-{
- /* expects interface to be contained in ce's interface list already */
- uint32_t i, ce_num, if_num = iface->num_interfaces;
- zend_class_entry *entry;
-
- if (if_num==0) {
- return;
- }
- ce_num = ce->num_interfaces;
-
- if (ce->type == ZEND_INTERNAL_CLASS) {
- ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num));
- } else {
- ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num));
- }
-
- /* Inherit the interfaces, only if they're not already inherited by the class */
- while (if_num--) {
- entry = iface->interfaces[if_num];
- for (i = 0; i < ce_num; i++) {
- if (ce->interfaces[i] == entry) {
- break;
- }
- }
- if (i == ce_num) {
- ce->interfaces[ce->num_interfaces++] = entry;
- }
- }
-
- /* and now call the implementing handlers */
- while (ce_num < ce->num_interfaces) {
- do_implement_interface(ce, ce->interfaces[ce_num++] TSRMLS_CC);
- }
-}
-/* }}} */
-
-#ifdef ZTS
-# define zval_property_ctor(parent_ce, ce) \
- (((parent_ce)->type != (ce)->type) ? ZVAL_COPY_CTOR : zval_add_ref)
-#else
-# define zval_property_ctor(parent_ce, ce) \
- zval_add_ref
-#endif
-
-static void do_inherit_class_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */
-{
- if (!Z_ISREF_P(zv)) {
- if (parent_ce->type == ZEND_INTERNAL_CLASS) {
- ZVAL_NEW_PERSISTENT_REF(zv, zv);
- } else {
- ZVAL_NEW_REF(zv, zv);
- }
- }
- if (Z_CONSTANT_P(Z_REFVAL_P(zv))) {
- ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
- }
- if (zend_hash_add(&ce->constants_table, name, zv)) {
- Z_ADDREF_P(zv);
- }
-}
-/* }}} */
-
-ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */
-{
- zend_property_info *property_info;
- zend_function *func;
- zend_string *key;
- zval *zv;
-
- if ((ce->ce_flags & ZEND_ACC_INTERFACE)
- && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name->val, parent_ce->name->val);
- }
- if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) {
- zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name->val, parent_ce->name->val);
- }
-
- ce->parent = parent_ce;
- /* Copy serialize/unserialize callbacks */
- if (!ce->serialize) {
- ce->serialize = parent_ce->serialize;
- }
- if (!ce->unserialize) {
- ce->unserialize = parent_ce->unserialize;
- }
-
- /* Inherit interfaces */
- zend_do_inherit_interfaces(ce, parent_ce TSRMLS_CC);
-
- /* Inherit properties */
- if (parent_ce->default_properties_count) {
- int i = ce->default_properties_count + parent_ce->default_properties_count;
-
- ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS);
- if (ce->default_properties_count) {
- while (i-- > parent_ce->default_properties_count) {
- ce->default_properties_table[i] = ce->default_properties_table[i - parent_ce->default_properties_count];
- }
- }
- for (i = 0; i < parent_ce->default_properties_count; i++) {
-#ifdef ZTS
- if (parent_ce->type != ce->type) {
- ZVAL_DUP(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
- if (Z_OPT_CONSTANT(ce->default_properties_table[i])) {
- ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
- }
- continue;
- }
-#endif
-
- ZVAL_COPY(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
- if (Z_OPT_CONSTANT(ce->default_properties_table[i])) {
- ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
- }
- }
- ce->default_properties_count += parent_ce->default_properties_count;
- }
-
- if (parent_ce->type != ce->type) {
- /* User class extends internal class */
- zend_update_class_constants(parent_ce TSRMLS_CC);
- if (parent_ce->default_static_members_count) {
- int i = ce->default_static_members_count + parent_ce->default_static_members_count;
-
- ce->default_static_members_table = erealloc(ce->default_static_members_table, sizeof(zval) * i);
- if (ce->default_static_members_count) {
- while (i-- > parent_ce->default_static_members_count) {
- ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count];
- }
- }
- for (i = 0; i < parent_ce->default_static_members_count; i++) {
- ZVAL_MAKE_REF(&CE_STATIC_MEMBERS(parent_ce)[i]);
- ce->default_static_members_table[i] = CE_STATIC_MEMBERS(parent_ce)[i];
- Z_ADDREF(ce->default_static_members_table[i]);
- if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) {
- ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
- }
- }
- ce->default_static_members_count += parent_ce->default_static_members_count;
- ce->static_members_table = ce->default_static_members_table;
- }
- } else {
- if (parent_ce->default_static_members_count) {
- int i = ce->default_static_members_count + parent_ce->default_static_members_count;
-
- ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS);
- if (ce->default_static_members_count) {
- while (i-- > parent_ce->default_static_members_count) {
- ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count];
- }
- }
- for (i = 0; i < parent_ce->default_static_members_count; i++) {
- ZVAL_MAKE_REF(&parent_ce->default_static_members_table[i]);
- ce->default_static_members_table[i] = parent_ce->default_static_members_table[i];
- Z_ADDREF(ce->default_static_members_table[i]);
- if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) {
- ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
- }
- }
- ce->default_static_members_count += parent_ce->default_static_members_count;
- if (ce->type == ZEND_USER_CLASS) {
- ce->static_members_table = ce->default_static_members_table;
- }
- }
- }
-
- ZEND_HASH_FOREACH_PTR(&ce->properties_info, property_info) {
- if (property_info->ce == ce) {
- if (property_info->flags & ZEND_ACC_STATIC) {
- property_info->offset += parent_ce->default_static_members_count;
- } else {
- property_info->offset += parent_ce->default_properties_count;
- }
- }
- } ZEND_HASH_FOREACH_END();
-
- ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) {
- if (do_inherit_property_access_check(&ce->properties_info, property_info, key, ce TSRMLS_CC)) {
- if (ce->type & ZEND_INTERNAL_CLASS) {
- property_info = zend_duplicate_property_info_internal(property_info);
- } else {
- property_info = zend_duplicate_property_info(property_info TSRMLS_CC);
- }
- zend_hash_add_new_ptr(&ce->properties_info, key, property_info);
- }
- } ZEND_HASH_FOREACH_END();
-
- ZEND_HASH_FOREACH_STR_KEY_VAL(&parent_ce->constants_table, key, zv) {
- do_inherit_class_constant(key, zv, ce, parent_ce TSRMLS_CC);
- } ZEND_HASH_FOREACH_END();
-
- ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) {
- if (do_inherit_method_check(&ce->function_table, func, key, ce)) {
- zend_function *new_func = do_inherit_method(func TSRMLS_CC);
- zend_hash_add_new_ptr(&ce->function_table, key, new_func);
- }
- } ZEND_HASH_FOREACH_END();
-
- do_inherit_parent_constructor(ce TSRMLS_CC);
-
- if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
- ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
- } else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
- /* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */
- zend_verify_abstract_class(ce TSRMLS_CC);
- }
- ce->ce_flags |= parent_ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS;
-}
-/* }}} */
-
-static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */
-{
- zval *old_constant;
-
- if ((old_constant = zend_hash_find(child_constants_table, name)) != NULL) {
- if (!Z_ISREF_P(old_constant) ||
- !Z_ISREF_P(parent_constant) ||
- Z_REFVAL_P(old_constant) != Z_REFVAL_P(parent_constant)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", name->val, iface->name->val);
- }
- return 0;
- }
- return 1;
-}
-/* }}} */
-
-static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
-{
- if (do_inherit_constant_check(&ce->constants_table, zv, name, iface)) {
- ZVAL_MAKE_REF(zv);
- Z_ADDREF_P(zv);
- if (Z_CONSTANT_P(Z_REFVAL_P(zv))) {
- ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
- }
- zend_hash_update(&ce->constants_table, name, zv);
- }
-}
-/* }}} */
-
-ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
-{
- uint32_t i, ignore = 0;
- uint32_t current_iface_num = ce->num_interfaces;
- uint32_t parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0;
- zend_function *func;
- zend_string *key;
- zval *zv;
-
- for (i = 0; i < ce->num_interfaces; i++) {
- if (ce->interfaces[i] == NULL) {
- memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i));
- i--;
- } else if (ce->interfaces[i] == iface) {
- if (i < parent_iface_num) {
- ignore = 1;
- } else {
- zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name->val, iface->name->val);
- }
- }
- }
- if (ignore) {
- /* Check for attempt to redeclare interface constants */
- ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, zv) {
- do_inherit_constant_check(&iface->constants_table, zv, key, iface);
- } ZEND_HASH_FOREACH_END();
- } else {
- if (ce->num_interfaces >= current_iface_num) {
- if (ce->type == ZEND_INTERNAL_CLASS) {
- ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
- } else {
- ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
- }
- }
- ce->interfaces[ce->num_interfaces++] = iface;
-
- ZEND_HASH_FOREACH_STR_KEY_VAL(&iface->constants_table, key, zv) {
- do_inherit_iface_constant(key, zv, ce, iface TSRMLS_CC);
- } ZEND_HASH_FOREACH_END();
-
- ZEND_HASH_FOREACH_STR_KEY_PTR(&iface->function_table, key, func) {
- if (do_inherit_method_check(&ce->function_table, func, key, ce)) {
- zend_function *new_func = do_inherit_method(func TSRMLS_CC);
- zend_hash_add_new_ptr(&ce->function_table, key, new_func);
- }
- } ZEND_HASH_FOREACH_END();
-
- do_implement_interface(ce, iface TSRMLS_CC);
- zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
- }
-}
-/* }}} */
-
-ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
-{
- uint32_t i, ignore = 0;
- uint32_t current_trait_num = ce->num_traits;
- uint32_t parent_trait_num = ce->parent ? ce->parent->num_traits : 0;
-
- for (i = 0; i < ce->num_traits; i++) {
- if (ce->traits[i] == NULL) {
- memmove(ce->traits + i, ce->traits + i + 1, sizeof(zend_class_entry*) * (--ce->num_traits - i));
- i--;
- } else if (ce->traits[i] == trait) {
- if (i < parent_trait_num) {
- ignore = 1;
- }
- }
- }
- if (!ignore) {
- if (ce->num_traits >= current_trait_num) {
- if (ce->type == ZEND_INTERNAL_CLASS) {
- ce->traits = (zend_class_entry **) realloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num));
- } else {
- ce->traits = (zend_class_entry **) erealloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num));
- }
- }
- ce->traits[ce->num_traits++] = trait;
- }
-}
-/* }}} */
-
-static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn TSRMLS_DC) /* {{{ */
-{
- uint32_t fn_flags = fn->common.scope->ce_flags;
- uint32_t other_flags = other_fn->common.scope->ce_flags;
-
- return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
- && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
- && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
- (other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
-}
-/* }}} */
-
-static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe TSRMLS_DC) /* {{{ */
-{
- if (!strncmp(mname->val, ZEND_CLONE_FUNC_NAME, mname->len)) {
- ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE;
- } else if (!strncmp(mname->val, ZEND_CONSTRUCTOR_FUNC_NAME, mname->len)) {
- if (ce->constructor) {
- zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val);
- }
- ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR;
- } else if (!strncmp(mname->val, ZEND_DESTRUCTOR_FUNC_NAME, mname->len)) {
- ce->destructor = fe; fe->common.fn_flags |= ZEND_ACC_DTOR;
- } else if (!strncmp(mname->val, ZEND_GET_FUNC_NAME, mname->len)) {
- ce->__get = fe;
- } else if (!strncmp(mname->val, ZEND_SET_FUNC_NAME, mname->len)) {
- ce->__set = fe;
- } else if (!strncmp(mname->val, ZEND_CALL_FUNC_NAME, mname->len)) {
- ce->__call = fe;
- } else if (!strncmp(mname->val, ZEND_UNSET_FUNC_NAME, mname->len)) {
- ce->__unset = fe;
- } else if (!strncmp(mname->val, ZEND_ISSET_FUNC_NAME, mname->len)) {
- ce->__isset = fe;
- } else if (!strncmp(mname->val, ZEND_CALLSTATIC_FUNC_NAME, mname->len)) {
- ce->__callstatic = fe;
- } else if (!strncmp(mname->val, ZEND_TOSTRING_FUNC_NAME, mname->len)) {
- ce->__tostring = fe;
- } else if (!strncmp(mname->val, ZEND_DEBUGINFO_FUNC_NAME, mname->len)) {
- ce->__debugInfo = fe;
- } else if (ce->name->len == mname->len) {
- zend_string *lowercase_name = zend_string_alloc(ce->name->len, 0);
- zend_str_tolower_copy(lowercase_name->val, ce->name->val, ce->name->len);
- lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
- if (!memcmp(mname->val, lowercase_name->val, mname->len)) {
- if (ce->constructor) {
- zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val);
- }
- ce->constructor = fe;
- fe->common.fn_flags |= ZEND_ACC_CTOR;
- }
- zend_string_release(lowercase_name);
- }
-}
-/* }}} */
-
-static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_string *key, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */
-{
- zend_function *existing_fn = NULL;
- zend_function *new_fn;
-
- if ((existing_fn = zend_hash_find_ptr(&ce->function_table, key)) != NULL) {
- if (existing_fn->common.scope == ce) {
- /* members from the current class override trait methods */
- /* use temporary *overriden HashTable to detect hidden conflict */
- if (*overriden) {
- if ((existing_fn = zend_hash_find_ptr(*overriden, key)) != NULL) {
- if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
- /* Make sure the trait method is compatible with previosly declared abstract method */
- if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC),
- zend_get_function_declaration(existing_fn TSRMLS_CC));
- }
- } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
- /* Make sure the abstract declaration is compatible with previous declaration */
- if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC),
- zend_get_function_declaration(existing_fn TSRMLS_CC));
- }
- return;
- }
- }
- } else {
- ALLOC_HASHTABLE(*overriden);
- zend_hash_init_ex(*overriden, 8, NULL, ptr_dtor, 0, 0);
- }
- fn = zend_hash_update_mem(*overriden, key, fn, sizeof(zend_function));
- return;
- } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
- /* Make sure the trait method is compatible with previosly declared abstract method */
- if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC),
- zend_get_function_declaration(existing_fn TSRMLS_CC));
- }
- } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
- /* Make sure the abstract declaration is compatible with previous declaration */
- if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC),
- zend_get_function_declaration(existing_fn TSRMLS_CC));
- }
- return;
- } else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
- /* two traits can't define the same non-abstract method */
-#if 1
- zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s",
- name, ce->name->val);
-#else /* TODO: better error message */
- zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s",
- fn->common.scope->name->val, fn->common.function_name->val,
- ce->name->val, name,
- existing_fn->common.scope->name->val, existing_fn->common.function_name->val);
-#endif
- } else {
- /* inherited members are overridden by members inserted by traits */
- /* check whether the trait method fulfills the inheritance requirements */
- do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
- }
- }
-
- function_add_ref(fn);
- new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
- memcpy(new_fn, fn, sizeof(zend_op_array));
- fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
- zend_add_magic_methods(ce, key, fn TSRMLS_CC);
-}
-/* }}} */
-
-static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /* {{{ */
-{
- if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
-
- fn->common.scope = ce;
-
- if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
- ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
- }
- if (fn->op_array.static_variables) {
- ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
- }
- }
-}
-/* }}} */
-
-static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, zend_class_entry *ce, HashTable **overriden, HashTable *exclude_table TSRMLS_DC) /* {{{ */
-{
- zend_trait_alias *alias, **alias_ptr;
- zend_string *lcname;
- zend_function fn_copy;
-
- /* apply aliases which are qualified with a class name, there should not be any ambiguity */
- if (ce->trait_aliases) {
- alias_ptr = ce->trait_aliases;
- alias = *alias_ptr;
- while (alias) {
- /* Scope unset or equal to the function we compare to, and the alias applies to fn */
- if (alias->alias != NULL
- && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
- && alias->trait_method->method_name->len == fnname->len
- && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) {
- fn_copy = *fn;
-
- /* if it is 0, no modifieres has been changed */
- if (alias->modifiers) {
- fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
- }
-
- lcname = zend_string_alloc(alias->alias->len, 0);
- zend_str_tolower_copy(lcname->val, alias->alias->val, alias->alias->len);
- zend_add_trait_method(ce, alias->alias->val, lcname, &fn_copy, overriden TSRMLS_CC);
- zend_string_release(lcname);
-
- /* Record the trait from which this alias was resolved. */
- if (!alias->trait_method->ce) {
- alias->trait_method->ce = fn->common.scope;
- }
- }
- alias_ptr++;
- alias = *alias_ptr;
- }
- }
-
- if (exclude_table == NULL || zend_hash_find(exclude_table, fnname) == NULL) {
- /* is not in hashtable, thus, function is not to be excluded */
- fn_copy = *fn;
-
- /* apply aliases which have not alias name, just setting visibility */
- if (ce->trait_aliases) {
- alias_ptr = ce->trait_aliases;
- alias = *alias_ptr;
- while (alias) {
- /* Scope unset or equal to the function we compare to, and the alias applies to fn */
- if (alias->alias == NULL && alias->modifiers != 0
- && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
- && (alias->trait_method->method_name->len == fnname->len)
- && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) {
-
- fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
-
- /** Record the trait from which this alias was resolved. */
- if (!alias->trait_method->ce) {
- alias->trait_method->ce = fn->common.scope;
- }
- }
- alias_ptr++;
- alias = *alias_ptr;
- }
- }
-
- zend_add_trait_method(ce, fn->common.function_name->val, fnname, &fn_copy, overriden TSRMLS_CC);
- }
-
- return ZEND_HASH_APPLY_KEEP;
-}
-/* }}} */
-
-static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
-{
- uint32_t i;
-
- if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
- zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name->val);
- }
-
- for (i = 0; i < ce->num_traits; i++) {
- if (ce->traits[i] == trait) {
- return;
- }
- }
- zend_error_noreturn(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name->val, ce->name->val);
-}
-/* }}} */
-
-static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */
-{
- size_t i, j = 0;
- zend_trait_precedence *cur_precedence;
- zend_trait_method_reference *cur_method_ref;
- zend_string *lcname;
- zend_bool method_exists;
-
- /* resolve class references */
- if (ce->trait_precedences) {
- i = 0;
- while ((cur_precedence = ce->trait_precedences[i])) {
- /** Resolve classes for all precedence operations. */
- if (cur_precedence->exclude_from_classes) {
- cur_method_ref = cur_precedence->trait_method;
- if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name,
- ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
- zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val);
- }
- zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC);
-
- /** Ensure that the prefered method is actually available. */
- lcname = zend_string_alloc(cur_method_ref->method_name->len, 0);
- zend_str_tolower_copy(lcname->val,
- cur_method_ref->method_name->val,
- cur_method_ref->method_name->len);
- method_exists = zend_hash_exists(&cur_method_ref->ce->function_table,
- lcname);
- zend_string_free(lcname);
- if (!method_exists) {
- zend_error_noreturn(E_COMPILE_ERROR,
- "A precedence rule was defined for %s::%s but this method does not exist",
- cur_method_ref->ce->name->val,
- cur_method_ref->method_name->val);
- }
-
- /** With the other traits, we are more permissive.
- We do not give errors for those. This allows to be more
- defensive in such definitions.
- However, we want to make sure that the insteadof declaration
- is consistent in itself.
- */
- j = 0;
- while (cur_precedence->exclude_from_classes[j].class_name) {
- zend_string* class_name = cur_precedence->exclude_from_classes[j].class_name;
-
- if (!(cur_precedence->exclude_from_classes[j].ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
- zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name->val);
- }
- zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j].ce TSRMLS_CC);
-
- /* make sure that the trait method is not from a class mentioned in
- exclude_from_classes, for consistency */
- if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i].ce) {
- zend_error_noreturn(E_COMPILE_ERROR,
- "Inconsistent insteadof definition. "
- "The method %s is to be used from %s, but %s is also on the exclude list",
- cur_method_ref->method_name->val,
- cur_precedence->trait_method->ce->name->val,
- cur_precedence->trait_method->ce->name->val);
- }
-
- zend_string_release(class_name);
- j++;
- }
- }
- i++;
- }
- }
-
- if (ce->trait_aliases) {
- i = 0;
- while (ce->trait_aliases[i]) {
- /** For all aliases with an explicit class name, resolve the class now. */
- if (ce->trait_aliases[i]->trait_method->class_name) {
- cur_method_ref = ce->trait_aliases[i]->trait_method;
- if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
- zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val);
- }
- zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC);
-
- /** And, ensure that the referenced method is resolvable, too. */
- lcname = zend_string_alloc(cur_method_ref->method_name->len, 0);
- zend_str_tolower_copy(lcname->val,
- cur_method_ref->method_name->val,
- cur_method_ref->method_name->len);
- method_exists = zend_hash_exists(&cur_method_ref->ce->function_table,
- lcname);
- zend_string_free(lcname);
-
- if (!method_exists) {
- zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name->val, cur_method_ref->method_name->val);
- }
- }
- i++;
- }
- }
-}
-/* }}} */
-
-static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_trait_precedence **precedences, zend_class_entry *trait) /* {{{ */
-{
- size_t i = 0, j;
-
- if (!precedences) {
- return;
- }
- while (precedences[i]) {
- if (precedences[i]->exclude_from_classes) {
- j = 0;
- while (precedences[i]->exclude_from_classes[j].ce) {
- if (precedences[i]->exclude_from_classes[j].ce == trait) {
- zend_string *lcname = zend_string_alloc(precedences[i]->trait_method->method_name->len, 0);
-
- zend_str_tolower_copy(lcname->val,
- precedences[i]->trait_method->method_name->val,
- precedences[i]->trait_method->method_name->len);
- if (zend_hash_add_empty_element(exclude_table, lcname) == NULL) {
- zend_string_release(lcname);
- zend_error_noreturn(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name->val, trait->name->val);
- }
- zend_string_release(lcname);
- }
- ++j;
- }
- }
- ++i;
- }
-}
-/* }}} */
-
-static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
-{
- uint32_t i;
- HashTable *overriden = NULL;
- zend_string *key;
- zend_function *fn;
-
- for (i = 0; i < ce->num_traits; i++) {
- if (ce->trait_precedences) {
- HashTable exclude_table;
-
- /* TODO: revisit this start size, may be its not optimal */
- zend_hash_init_ex(&exclude_table, 8, NULL, NULL, 0, 0);
-
- zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]);
-
- /* copies functions, applies defined aliasing, and excludes unused trait methods */
- ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) {
- zend_traits_copy_functions(key, fn, ce, &overriden, &exclude_table TSRMLS_CC);
- } ZEND_HASH_FOREACH_END();
-
- zend_hash_destroy(&exclude_table);
- } else {
- ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) {
- zend_traits_copy_functions(key, fn, ce, &overriden, NULL TSRMLS_CC);
- } ZEND_HASH_FOREACH_END();
- }
- }
-
- ZEND_HASH_FOREACH_PTR(&ce->function_table, fn) {
- zend_fixup_trait_method(fn, ce);
- } ZEND_HASH_FOREACH_END();
-
- if (overriden) {
- zend_hash_destroy(overriden);
- FREE_HASHTABLE(overriden);
- }
-}
-/* }}} */
-
-static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, zend_string *prop_name, zend_class_entry *coliding_ce) /* {{{ */
-{
- size_t i;
-
- if (coliding_ce == ce) {
- for (i = 0; i < current_trait; i++) {
- if (zend_hash_exists(&ce->traits[i]->properties_info, prop_name)) {
- return ce->traits[i];
- }
- }
- }
-
- return coliding_ce;
-}
-/* }}} */
-
-static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
-{
- size_t i;
- zend_property_info *property_info;
- zend_property_info *coliding_prop;
- zval compare_result;
- zend_string* prop_name;
- const char* class_name_unused;
- zend_bool not_compatible;
- zval* prop_value;
- uint32_t flags;
- zend_string *doc_comment;
-
- /* In the following steps the properties are inserted into the property table
- * for that, a very strict approach is applied:
- * - check for compatibility, if not compatible with any property in class -> fatal
- * - if compatible, then strict notice
- */
- for (i = 0; i < ce->num_traits; i++) {
- ZEND_HASH_FOREACH_PTR(&ce->traits[i]->properties_info, property_info) {
- /* first get the unmangeld name if necessary,
- * then check whether the property is already there
- */
- flags = property_info->flags;
- if ((flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) {
- prop_name = zend_string_copy(property_info->name);
- } else {
- const char *pname;
- int pname_len;
-
- /* for private and protected we need to unmangle the names */
- zend_unmangle_property_name_ex(property_info->name->val, property_info->name->len,
- &class_name_unused, &pname, &pname_len);
- prop_name = zend_string_init(pname, pname_len, 0);
- }
-
- /* next: check for conflicts with current class */
- if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
- if (coliding_prop->flags & ZEND_ACC_SHADOW) {
- zend_hash_del(&ce->properties_info, prop_name);
- flags |= ZEND_ACC_CHANGED;
- } else {
- if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
- == (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
- /* flags are identical, now the value needs to be checked */
- if (flags & ZEND_ACC_STATIC) {
- not_compatible = (FAILURE == compare_function(&compare_result,
- &ce->default_static_members_table[coliding_prop->offset],
- &ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
- || (Z_LVAL(compare_result) != 0);
- } else {
- not_compatible = (FAILURE == compare_function(&compare_result,
- &ce->default_properties_table[coliding_prop->offset],
- &ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
- || (Z_LVAL(compare_result) != 0);
- }
- } else {
- /* the flags are not identical, thus, we assume properties are not compatible */
- not_compatible = 1;
- }
-
- if (not_compatible) {
- zend_error_noreturn(E_COMPILE_ERROR,
- "%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
- find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val,
- property_info->ce->name->val,
- prop_name->val,
- ce->name->val);
- } else {
- zend_error(E_STRICT,
- "%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed",
- find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val,
- property_info->ce->name->val,
- prop_name->val,
- ce->name->val);
- zend_string_release(prop_name);
- continue;
- }
- }
- }
-
- /* property not found, so lets add it */
- if (flags & ZEND_ACC_STATIC) {
- prop_value = &ce->traits[i]->default_static_members_table[property_info->offset];
- } else {
- prop_value = &ce->traits[i]->default_properties_table[property_info->offset];
- }
- if (Z_REFCOUNTED_P(prop_value)) Z_ADDREF_P(prop_value);
-
- doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL;
- zend_declare_property_ex(ce, prop_name,
- prop_value, flags,
- doc_comment TSRMLS_CC);
- zend_string_release(prop_name);
- } ZEND_HASH_FOREACH_END();
- }
-}
-/* }}} */
-
-static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce TSRMLS_DC) /* {{{ */
-{
- int i = 0;
- zend_trait_alias* cur_alias;
- zend_string* lc_method_name;
-
- if (ce->trait_aliases) {
- while (ce->trait_aliases[i]) {
- cur_alias = ce->trait_aliases[i];
- /** The trait for this alias has not been resolved, this means, this
- alias was not applied. Abort with an error. */
- if (!cur_alias->trait_method->ce) {
- if (cur_alias->alias) {
- /** Plain old inconsistency/typo/bug */
- zend_error_noreturn(E_COMPILE_ERROR,
- "An alias (%s) was defined for method %s(), but this method does not exist",
- cur_alias->alias->val,
- cur_alias->trait_method->method_name->val);
- } else {
- /** Here are two possible cases:
- 1) this is an attempt to modifiy the visibility
- of a method introduce as part of another alias.
- Since that seems to violate the DRY principle,
- we check against it and abort.
- 2) it is just a plain old inconsitency/typo/bug
- as in the case where alias is set. */
-
- lc_method_name = zend_string_alloc(cur_alias->trait_method->method_name->len, 0);
- zend_str_tolower_copy(
- lc_method_name->val,
- cur_alias->trait_method->method_name->val,
- cur_alias->trait_method->method_name->len);
- if (zend_hash_exists(&ce->function_table,
- lc_method_name)) {
- zend_string_free(lc_method_name);
- zend_error_noreturn(E_COMPILE_ERROR,
- "The modifiers for the trait alias %s() need to be changed in the same statment in which the alias is defined. Error",
- cur_alias->trait_method->method_name->val);
- } else {
- zend_string_free(lc_method_name);
- zend_error_noreturn(E_COMPILE_ERROR,
- "The modifiers of the trait method %s() are changed, but this method does not exist. Error",
- cur_alias->trait_method->method_name->val);
-
- }
- }
- }
- i++;
- }
- }
-}
-/* }}} */
-
-ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */
-{
-
- if (ce->num_traits <= 0) {
- return;
- }
-
- /* complete initialization of trait strutures in ce */
- zend_traits_init_trait_structures(ce TSRMLS_CC);
-
- /* first care about all methods to be flattened into the class */
- zend_do_traits_method_binding(ce TSRMLS_CC);
-
- /* Aliases which have not been applied indicate typos/bugs. */
- zend_do_check_for_inconsistent_traits_aliasing(ce TSRMLS_CC);
-
- /* then flatten the properties into it, to, mostly to notfiy developer about problems */
- zend_do_traits_property_binding(ce TSRMLS_CC);
-
- /* verify that all abstract methods from traits have been implemented */
- zend_verify_abstract_class(ce TSRMLS_CC);
-
- /* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */
- if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) {
- ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
- }
-}
-/* }}} */
-
ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time TSRMLS_DC) /* {{{ */
{
zend_function *function, *new_function;
@@ -2671,13 +1124,11 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS
}
/* }}} */
-ZEND_API zend_string *zend_mangle_property_name(const char *src1, int src1_length, const char *src2, int src2_length, int internal) /* {{{ */
+ZEND_API zend_string *zend_mangle_property_name(const char *src1, size_t src1_length, const char *src2, size_t src2_length, int internal) /* {{{ */
{
- zend_string *prop_name;
- int prop_name_length;
+ size_t prop_name_length = 1 + src1_length + 1 + src2_length;
+ zend_string *prop_name = zend_string_alloc(prop_name_length, internal);
- prop_name_length = 1 + src1_length + 1 + src2_length;
- prop_name = zend_string_alloc(prop_name_length, internal);
prop_name->val[0] = '\0';
memcpy(prop_name->val + 1, src1, src1_length+1);
memcpy(prop_name->val + 1 + src1_length + 1, src2, src2_length+1);
@@ -2685,49 +1136,50 @@ ZEND_API zend_string *zend_mangle_property_name(const char *src1, int src1_lengt
}
/* }}} */
-static int zend_strnlen(const char* s, int maxlen) /* {{{ */
+static int zend_strnlen(const char* s, size_t maxlen) /* {{{ */
{
- int len = 0;
+ size_t len = 0;
while (*s++ && maxlen--) len++;
return len;
}
/* }}} */
-ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int len, const char **class_name, const char **prop_name, int *prop_len) /* {{{ */
+ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char **class_name, const char **prop_name, size_t *prop_len) /* {{{ */
{
- int class_name_len;
+ size_t class_name_len;
*class_name = NULL;
- if (mangled_property[0]!=0) {
- *prop_name = mangled_property;
+ if (name->val[0] != '\0') {
+ *prop_name = name->val;
if (prop_len) {
- *prop_len = len;
+ *prop_len = name->len;
}
return SUCCESS;
}
- if (len < 3 || mangled_property[1]==0) {
+ if (name->len < 3 || name->val[1] == '\0') {
zend_error(E_NOTICE, "Illegal member variable name");
- *prop_name = mangled_property;
+ *prop_name = name->val;
if (prop_len) {
- *prop_len = len;
+ *prop_len = name->len;
}
return FAILURE;
}
- class_name_len = zend_strnlen(mangled_property + 1, --len - 1) + 1;
- if (class_name_len >= len || mangled_property[class_name_len]!=0) {
+ class_name_len = zend_strnlen(name->val + 1, name->len - 2);
+ if (class_name_len >= name->len - 2 || name->val[class_name_len + 1] != '\0') {
zend_error(E_NOTICE, "Corrupt member variable name");
- *prop_name = mangled_property;
+ *prop_name = name->val;
if (prop_len) {
- *prop_len = len + 1;
+ *prop_len = name->len;
}
return FAILURE;
}
- *class_name = mangled_property + 1;
- *prop_name = (*class_name) + class_name_len;
+
+ *class_name = name->val + 1;
+ *prop_name = name->val + class_name_len + 2;
if (prop_len) {
- *prop_len = len - class_name_len;
+ *prop_len = name->len - class_name_len - 2;
}
return SUCCESS;
}
@@ -3578,7 +2030,6 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
zend_compile_expr(&name_node, name_ast TSRMLS_CC);
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL TSRMLS_CC);
opline->extended_value = ZEND_FETCH_LOCAL;
@@ -3604,9 +2055,13 @@ static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type
static void zend_separate_if_call_and_write(znode *node, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
{
if (type != BP_VAR_R && type != BP_VAR_IS && zend_is_call(ast)) {
- zend_op *opline = zend_emit_op(NULL, ZEND_SEPARATE, node, NULL TSRMLS_CC);
- opline->result_type = IS_VAR;
- opline->result.var = opline->op1.var;
+ if (node->op_type == IS_VAR) {
+ zend_op *opline = zend_emit_op(NULL, ZEND_SEPARATE, node, NULL TSRMLS_CC);
+ opline->result_type = IS_VAR;
+ opline->result.var = opline->op1.var;
+ } else {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use result of built-in function in write context");
+ }
}
}
/* }}} */
@@ -4550,7 +3005,7 @@ void zend_compile_new(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_compile_class_ref(&class_node, class_ast TSRMLS_CC);
opnum = get_next_op_number(CG(active_op_array));
- opline = zend_emit_op(result, ZEND_NEW, &class_node, NULL TSRMLS_CC);
+ zend_emit_op(result, ZEND_NEW, &class_node, NULL TSRMLS_CC);
zend_compile_call_common(&ctor_result, args_ast, NULL TSRMLS_CC);
zend_do_free(&ctor_result TSRMLS_CC);
@@ -4587,7 +3042,8 @@ void zend_compile_global_var(zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (zend_try_compile_cv(&result, var_ast TSRMLS_CC) == SUCCESS) {
- zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node TSRMLS_CC);
+ zend_op *opline = zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node TSRMLS_CC);
+ zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
} else {
zend_emit_op(&result, ZEND_FETCH_W, &name_node, NULL TSRMLS_CC);
@@ -5090,6 +3546,11 @@ void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */
znode cond_node;
if (!cond_ast) {
+ if (has_default_case) {
+ CG(zend_lineno) = case_ast->lineno;
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "Switch statements may only contain one default clause");
+ }
has_default_case = 1;
continue;
}
@@ -6523,7 +4984,7 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC)
ZVAL_LONG(zv, CG(zend_lineno));
break;
case T_FILE:
- ZVAL_STR(zv, zend_string_copy(CG(compiled_filename)));
+ ZVAL_STR_COPY(zv, CG(compiled_filename));
break;
case T_DIR:
{
@@ -6546,7 +5007,7 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC)
}
case T_FUNC_C:
if (op_array && op_array->function_name) {
- ZVAL_STR(zv, zend_string_copy(op_array->function_name));
+ ZVAL_STR_COPY(zv, op_array->function_name);
} else {
ZVAL_EMPTY_STRING(zv);
}
@@ -6554,13 +5015,13 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC)
case T_METHOD_C:
if (ce) {
if (op_array && op_array->function_name) {
- ZVAL_STR(zv, zend_concat3(ce->name->val, ce->name->len, "::", 2,
+ ZVAL_NEW_STR(zv, zend_concat3(ce->name->val, ce->name->len, "::", 2,
op_array->function_name->val, op_array->function_name->len));
} else {
- ZVAL_STR(zv, zend_string_copy(ce->name));
+ ZVAL_STR_COPY(zv, ce->name);
}
} else if (op_array && op_array->function_name) {
- ZVAL_STR(zv, zend_string_copy(op_array->function_name));
+ ZVAL_STR_COPY(zv, op_array->function_name);
} else {
ZVAL_EMPTY_STRING(zv);
}
@@ -6570,7 +5031,7 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC)
if (ZEND_CE_IS_TRAIT(ce)) {
return 0;
} else {
- ZVAL_STR(zv, zend_string_copy(ce->name));
+ ZVAL_STR_COPY(zv, ce->name);
}
} else {
ZVAL_EMPTY_STRING(zv);
@@ -6578,14 +5039,14 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC)
break;
case T_TRAIT_C:
if (ce && ZEND_CE_IS_TRAIT(ce)) {
- ZVAL_STR(zv, zend_string_copy(ce->name));
+ ZVAL_STR_COPY(zv, ce->name);
} else {
ZVAL_EMPTY_STRING(zv);
}
break;
case T_NS_C:
if (CG(current_namespace)) {
- ZVAL_STR(zv, zend_string_copy(CG(current_namespace)));
+ ZVAL_STR_COPY(zv, CG(current_namespace));
} else {
ZVAL_EMPTY_STRING(zv);
}
@@ -6869,23 +5330,13 @@ static void zend_compile_shorthand_conditional(znode *result, zend_ast *ast TSRM
zend_compile_expr(&cond_node, cond_ast TSRMLS_CC);
opnum_jmp_set = get_next_op_number(CG(active_op_array));
- zend_emit_op_tmp(result, ZEND_JMP_SET, &cond_node, NULL TSRMLS_CC);
+ zend_emit_op(result, ZEND_JMP_SET, &cond_node, NULL TSRMLS_CC);
zend_compile_expr(&false_node, false_ast TSRMLS_CC);
opline_jmp_set = &CG(active_op_array)->opcodes[opnum_jmp_set];
opline_jmp_set->op2.opline_num = get_next_op_number(CG(active_op_array)) + 1;
- if (cond_node.op_type == IS_VAR || cond_node.op_type == IS_CV
- || false_node.op_type == IS_VAR || false_node.op_type == IS_CV
- ) {
- opline_jmp_set->opcode = ZEND_JMP_SET_VAR;
- opline_jmp_set->result_type = IS_VAR;
- GET_NODE(result, opline_jmp_set->result);
-
- opline_qm_assign = zend_emit_op(NULL, ZEND_QM_ASSIGN_VAR, &false_node, NULL TSRMLS_CC);
- } else {
- opline_qm_assign = zend_emit_op(NULL, ZEND_QM_ASSIGN, &false_node, NULL TSRMLS_CC);
- }
+ opline_qm_assign = zend_emit_op(NULL, ZEND_QM_ASSIGN, &false_node, NULL TSRMLS_CC);
SET_NODE(opline_qm_assign->result, result);
}
/* }}} */
@@ -6921,14 +5372,6 @@ void zend_compile_conditional(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_compile_expr(&false_node, false_ast TSRMLS_CC);
opline_qm_assign1 = &CG(active_op_array)->opcodes[opnum_qm_assign1];
- if (true_node.op_type == IS_VAR || true_node.op_type == IS_CV
- || false_node.op_type == IS_VAR || false_node.op_type == IS_CV
- ) {
- opline_qm_assign1->opcode = ZEND_QM_ASSIGN_VAR;
- opline_qm_assign1->result_type = IS_VAR;
- GET_NODE(result, opline_qm_assign1->result);
- }
-
opline_qm_assign2 = zend_emit_op(NULL, opline_qm_assign1->opcode, &false_node, NULL TSRMLS_CC);
SET_NODE(opline_qm_assign2->result, result);
@@ -7096,8 +5539,13 @@ 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;
- zend_emit_op_tmp(&silence_node, ZEND_BEGIN_SILENCE, NULL, NULL TSRMLS_CC);
+ 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;
if (expr_ast->kind == ZEND_AST_VAR) {
/* For @$var we need to force a FETCH instruction, otherwise the CV access will
@@ -7107,7 +5555,9 @@ void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_compile_expr(result, expr_ast TSRMLS_CC);
}
- zend_emit_op(NULL, ZEND_END_SILENCE, &silence_node, NULL 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;
}
/* }}} */
@@ -7271,7 +5721,7 @@ void zend_compile_resolve_class_name(znode *result, zend_ast *ast TSRMLS_DC) /*
"Cannot access self::class when no class scope is active");
}
result->op_type = IS_CONST;
- ZVAL_STR(&result->u.constant, zend_string_copy(CG(active_class_entry)->name));
+ ZVAL_STR_COPY(&result->u.constant, CG(active_class_entry)->name);
break;
case ZEND_FETCH_CLASS_STATIC:
case ZEND_FETCH_CLASS_PARENT:
@@ -7421,9 +5871,6 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
class_name->val, class_name->len, "::", 2, const_name->val, const_name->len);
Z_TYPE_INFO(result) = IS_CONSTANT_EX;
- if (IS_INTERNED(Z_STR(result))) {
- Z_TYPE_FLAGS(result) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
- }
Z_CONST_FLAGS(result) = fetch_type;
zend_ast_destroy(ast);
@@ -7475,7 +5922,7 @@ void zend_compile_const_expr_resolve_class_name(zend_ast **ast_ptr TSRMLS_DC) /*
zend_error_noreturn(E_COMPILE_ERROR,
"Cannot access self::class when no class scope is active");
}
- ZVAL_STR(&result, zend_string_copy(CG(active_class_entry)->name));
+ ZVAL_STR_COPY(&result, CG(active_class_entry)->name);
break;
case ZEND_FETCH_CLASS_STATIC:
case ZEND_FETCH_CLASS_PARENT:
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 71a622f417..3ba37c3b0e 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -83,7 +83,7 @@ typedef struct _zend_ast_znode {
} zend_ast_znode;
ZEND_API zend_ast *zend_ast_create_znode(znode *node);
-static inline znode *zend_ast_get_znode(zend_ast *ast) {
+static zend_always_inline znode *zend_ast_get_znode(zend_ast *ast) {
return &((zend_ast_znode *) ast)->node;
}
@@ -449,14 +449,6 @@ void zend_do_free(znode *op1 TSRMLS_DC);
ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time TSRMLS_DC);
ZEND_API zend_class_entry *do_bind_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC);
ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC);
-ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC);
-ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC);
-
-ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC);
-ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC);
-
-ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC);
-void zend_do_early_binding(TSRMLS_D);
ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC);
/* Functions for a null terminated pointer list, used for traits parsing and compilation */
@@ -491,16 +483,18 @@ ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_cleanup_internal_classes(TSRMLS_D);
ZEND_API void zend_cleanup_op_array_data(zend_op_array *op_array);
+ZEND_API int clean_non_persistent_function_full(zval *zv TSRMLS_DC);
+ZEND_API int clean_non_persistent_class_full(zval *zv TSRMLS_DC);
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
ZEND_API void zend_function_dtor(zval *zv);
ZEND_API void destroy_zend_class(zval *zv);
void zend_class_add_ref(zval *zv);
-ZEND_API zend_string *zend_mangle_property_name(const char *src1, int src1_length, const char *src2, int src2_length, int internal);
-#define zend_unmangle_property_name(mangled_property, mangled_property_len, class_name, prop_name) \
- zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL)
-ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int mangled_property_len, const char **class_name, const char **prop_name, int *prop_len);
+ZEND_API zend_string *zend_mangle_property_name(const char *src1, size_t src1_length, const char *src2, size_t src2_length, int internal);
+#define zend_unmangle_property_name(mangled_property, class_name, prop_name) \
+ zend_unmangle_property_name_ex(mangled_property, class_name, prop_name, NULL)
+ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char **class_name, const char **prop_name, size_t *prop_len);
#define ZEND_FUNCTION_DTOR zend_function_dtor
#define ZEND_CLASS_DTOR destroy_zend_class
@@ -648,21 +642,28 @@ int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC);
#define ZEND_SEND_BY_REF 1
#define ZEND_SEND_PREFER_REF 2
-#define CHECK_ARG_SEND_TYPE(zf, arg_num, m) \
- (EXPECTED((zf)->common.arg_info != NULL) && \
- (EXPECTED(arg_num <= (zf)->common.num_args) \
- ? ((zf)->common.arg_info[arg_num-1].pass_by_reference & (m)) \
- : (UNEXPECTED((zf)->common.fn_flags & ZEND_ACC_VARIADIC) != 0) && \
- ((zf)->common.arg_info[(zf)->common.num_args-1].pass_by_reference & (m))))
+static zend_always_inline int zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask)
+{
+ if (UNEXPECTED(zf->common.arg_info == NULL)) {
+ return 0;
+ }
+ if (UNEXPECTED(arg_num > zf->common.num_args)) {
+ if (EXPECTED((zf->common.fn_flags & ZEND_ACC_VARIADIC) == 0)) {
+ return 0;
+ }
+ arg_num = zf->common.num_args;
+ }
+ return UNEXPECTED((zf->common.arg_info[arg_num-1].pass_by_reference & mask) != 0);
+}
#define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \
- CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF)
+ zend_check_arg_send_type(zf, arg_num, ZEND_SEND_BY_REF)
#define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \
- CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF)
+ zend_check_arg_send_type(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF)
#define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \
- CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF)
+ zend_check_arg_send_type(zf, arg_num, ZEND_SEND_PREFER_REF)
#define ZEND_RETURN_VAL 0
#define ZEND_RETURN_REF 1
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index bca35cf591..164901f898 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -246,7 +246,7 @@ static zend_constant *zend_get_special_constant(const char *name, uint name_len
if ((c = zend_hash_find_ptr(EG(zend_constants), const_name)) == NULL) {
c = emalloc(sizeof(zend_constant));
memset(c, 0, sizeof(zend_constant));
- ZVAL_STR(&c->value, zend_string_copy(EG(scope)->name));
+ ZVAL_STR_COPY(&c->value, EG(scope)->name);
zend_hash_add_ptr(EG(zend_constants), const_name, c);
}
zend_string_release(const_name);
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index c5193ce7b6..9a270c0c10 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -362,7 +362,7 @@ ZEND_METHOD(error_exception, getSeverity)
#define TRACE_ARG_APPEND(vallen) do { \
- int len = str->len; \
+ size_t len = str->len; \
str = zend_string_realloc(str, len + vallen, 0); \
memmove(str->val + len - l_added + 1 + vallen, str->val + len - l_added + 1, l_added); \
} while (0)
@@ -620,10 +620,10 @@ ZEND_METHOD(exception, getPrevious)
RETURN_ZVAL(previous, 1, 0);
} /* }}} */
-int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ */
+size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) /* {{{ */
{
va_list arg;
- int len;
+ size_t len;
va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
@@ -632,7 +632,7 @@ int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ *
}
/* }}} */
-zend_string *zend_strpprintf(int max_len, const char *format, ...) /* {{{ */
+zend_string *zend_strpprintf(size_t max_len, const char *format, ...) /* {{{ */
{
va_list arg;
zend_string *str;
diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h
index 0c13b66281..5aa6544e5d 100644
--- a/Zend/zend_exceptions.h
+++ b/Zend/zend_exceptions.h
@@ -53,8 +53,8 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
ZEND_API void zend_exception_error(zend_object *exception, int severity TSRMLS_DC);
/* do not export, in php it's available thru spprintf directly */
-int zend_spprintf(char **message, int max_len, const char *format, ...);
-zend_string *zend_strpprintf(int max_len, const char *format, ...);
+size_t zend_spprintf(char **message, size_t max_len, const char *format, ...);
+zend_string *zend_strpprintf(size_t max_len, const char *format, ...);
END_EXTERN_C()
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 9237e97415..700b986d61 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -38,6 +38,7 @@
#include "zend_generators.h"
#include "zend_vm.h"
#include "zend_dtrace.h"
+#include "zend_inheritance.h"
/* Virtual current working directory support */
#include "zend_virtual_cwd.h"
@@ -83,7 +84,6 @@ static const zend_internal_function zend_pass_function = {
#undef zval_ptr_dtor
#define zval_ptr_dtor(zv) i_zval_ptr_dtor(zv ZEND_FILE_LINE_CC TSRMLS_CC)
-#define zval_ptr_dtor_nogc(zv) i_zval_ptr_dtor_nogc(zv ZEND_FILE_LINE_CC TSRMLS_CC)
#define PZVAL_LOCK(z) if (Z_REFCOUNTED_P(z)) Z_ADDREF_P((z))
#define SELECTIVE_PZVAL_LOCK(pzv, opline) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(pzv); }
@@ -211,11 +211,6 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint
return &EG(uninitialized_zval);
}
-static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_IS(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
-{
- return &EG(uninitialized_zval);
-}
-
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
{
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
@@ -298,9 +293,6 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_da
{
zval *ret = EX_VAR(var);
- if (Z_TYPE_P(ret) == IS_UNDEF) {
- return _get_zval_cv_lookup_BP_VAR_IS(ret, var, execute_data TSRMLS_CC);
- }
return ret;
}
@@ -308,9 +300,6 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_exec
{
zval *ret = EX_VAR(var);
- if (Z_TYPE_P(ret) == IS_UNDEF) {
- return _get_zval_cv_lookup_BP_VAR_IS(ret, var, execute_data TSRMLS_CC);
- }
ZVAL_DEREF(ret);
return ret;
}
@@ -637,6 +626,7 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n
need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "none", "", NULL TSRMLS_CC);
+ return 0;
} else if (cur_arg_info->type_hint) {
if (cur_arg_info->type_hint == IS_ARRAY) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "", NULL TSRMLS_CC);
@@ -647,8 +637,9 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n
zend_error(E_ERROR, "Unknown typehint");
#endif
}
+ return 0;
}
- return 0;
+ return 1;
}
static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num TSRMLS_DC)
@@ -756,17 +747,12 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval *p
FREE_OP_IF_VAR(free_value);
}
-static void zend_assign_to_string_offset(zval *str_offset, zval *value, int value_type, zval *result TSRMLS_DC)
+static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *value, int value_type, zval *result TSRMLS_DC)
{
- zval *str = Z_STR_OFFSET_STR_P(str_offset);
- /* XXX String offset is uint32_t in _zval_struct, so can address only 2^32+1 space.
- To make the offset get over that barier, we need to make str_offset size_t and that
- would grow zval size by 8 bytes (currently from 16 to 24) on 64 bit build. */
- uint32_t offset = Z_STR_OFFSET_IDX_P(str_offset);
zend_string *old_str;
- if ((int)offset < 0) {
- zend_error(E_WARNING, "Illegal string offset: %d", offset);
+ if (offset < 0) {
+ zend_error(E_WARNING, "Illegal string offset: " ZEND_LONG_FMT, offset);
zend_string_release(Z_STR_P(str));
if (result) {
ZVAL_NULL(result);
@@ -775,13 +761,13 @@ static void zend_assign_to_string_offset(zval *str_offset, zval *value, int valu
}
old_str = Z_STR_P(str);
- if (offset >= Z_STRLEN_P(str)) {
- int old_len = Z_STRLEN_P(str);
+ if ((size_t)offset >= Z_STRLEN_P(str)) {
+ zend_long old_len = Z_STRLEN_P(str);
Z_STR_P(str) = zend_string_realloc(Z_STR_P(str), offset + 1, 0);
Z_TYPE_INFO_P(str) = IS_STRING_EX;
memset(Z_STRVAL_P(str) + old_len, ' ', offset - old_len);
Z_STRVAL_P(str)[offset+1] = 0;
- } else if (IS_INTERNED(Z_STR_P(str))) {
+ } else if (!Z_REFCOUNTED_P(str)) {
Z_STR_P(str) = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0);
Z_TYPE_INFO_P(str) = IS_STRING_EX;
}
@@ -817,144 +803,61 @@ static void zend_assign_to_string_offset(zval *str_offset, zval *value, int valu
}
}
-static inline zval* zend_assign_tmp_to_variable(zval *variable_ptr, zval *value TSRMLS_DC)
+static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC)
{
- ZVAL_DEREF(variable_ptr);
-
- if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
- zend_refcounted *garbage;
-
- if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
- UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
- Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
- return variable_ptr;
- }
+ do {
+ if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
+ zend_refcounted *garbage;
- garbage = Z_COUNTED_P(variable_ptr);
- if (UNEXPECTED(GC_REFCOUNT(garbage) > 1)) {
- /* we need to split */
- GC_REFCOUNT(garbage)--;
- /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
- if ((Z_COLLECTABLE_P(variable_ptr)) &&
- UNEXPECTED(!GC_INFO(garbage))) {
- gc_possible_root(garbage TSRMLS_CC);
+ if (Z_ISREF_P(variable_ptr)) {
+ variable_ptr = Z_REFVAL_P(variable_ptr);
+ if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
+ break;
+ }
}
- } else {
- ZVAL_COPY_VALUE(variable_ptr, value);
- _zval_dtor_func(garbage ZEND_FILE_LINE_CC);
- return variable_ptr;
- }
- }
-
- ZVAL_COPY_VALUE(variable_ptr, value);
-
- return variable_ptr;
-}
-
-static inline zval* zend_assign_const_to_variable(zval *variable_ptr, zval *value TSRMLS_DC)
-{
- ZVAL_DEREF(variable_ptr);
-
- if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
- zend_refcounted *garbage;
-
- if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
- UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
- Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
- return variable_ptr;
- }
-
- garbage = Z_COUNTED_P(variable_ptr);
- if (UNEXPECTED(GC_REFCOUNT(garbage) > 1)) {
- /* we need to split */
- GC_REFCOUNT(garbage)--;
- /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
- if (Z_COLLECTABLE_P(variable_ptr) &&
- UNEXPECTED(!GC_INFO(garbage))) {
- gc_possible_root(garbage TSRMLS_CC);
+ if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
+ UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
+ Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
+ return variable_ptr;
}
- } else {
- ZVAL_COPY_VALUE(variable_ptr, value);
- /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
- if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
- zval_copy_ctor_func(variable_ptr);
+ if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
+ return variable_ptr;
}
- _zval_dtor_func(garbage ZEND_FILE_LINE_CC);
- return variable_ptr;
- }
- }
-
- ZVAL_COPY_VALUE(variable_ptr, value);
- /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
- if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
- zval_copy_ctor_func(variable_ptr);
- }
-
- return variable_ptr;
-}
-
-static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRMLS_DC)
-{
- zend_refcounted *garbage;
-
- if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
- goto assign_simple;
- } else if (UNEXPECTED(variable_ptr == value)) {
- return variable_ptr;
- }
- if (Z_ISREF_P(variable_ptr)) {
- variable_ptr = Z_REFVAL_P(variable_ptr);
- if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
- goto assign_simple;
- } else if (UNEXPECTED(variable_ptr == value)) {
- return variable_ptr;
- }
- }
-
- if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
- UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
- Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
- } else {
- if (Z_REFCOUNT_P(variable_ptr)==1) {
garbage = Z_COUNTED_P(variable_ptr);
- if (UNEXPECTED(Z_REFCOUNTED_P(value))) {
- if (EXPECTED(!Z_ISREF_P(value))) {
- Z_ADDREF_P(value);
- } else {
- if (Z_REFCOUNT_P(value) == 1) {
- ZVAL_UNREF(value);
- } else {
- value = Z_REFVAL_P(value);
+ if (GC_REFCOUNT(garbage) == 1) {
+ ZVAL_COPY_VALUE(variable_ptr, value);
+ if (value_type == IS_CONST) {
+ /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
+ zval_copy_ctor_func(variable_ptr);
}
- if (Z_REFCOUNTED_P(value)) {
- if (UNEXPECTED(variable_ptr == value)) {
- return variable_ptr;
- }
- Z_ADDREF_P(value);
+ } else if (value_type != IS_TMP_VAR) {
+ if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
+ Z_ADDREF_P(variable_ptr);
}
}
- }
- ZVAL_COPY_VALUE(variable_ptr, value);
- _zval_dtor_func(garbage ZEND_FILE_LINE_CC);
- } else { /* we need to split */
- Z_DELREF_P(variable_ptr);
- GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
-assign_simple:
- if (UNEXPECTED(Z_REFCOUNTED_P(value))) {
- if (EXPECTED(!Z_ISREF_P(value))) {
- Z_ADDREF_P(value);
- } else {
- if (Z_REFCOUNT_P(value) == 1) {
- ZVAL_UNREF(value);
- } else {
- value = Z_REFVAL_P(value);
- }
- if (Z_REFCOUNTED_P(value)) {
- Z_ADDREF_P(value);
- }
+ _zval_dtor_func(garbage ZEND_FILE_LINE_CC);
+ return variable_ptr;
+ } else { /* we need to split */
+ GC_REFCOUNT(garbage)--;
+ /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
+ if ((Z_COLLECTABLE_P(variable_ptr)) &&
+ UNEXPECTED(!GC_INFO(garbage))) {
+ gc_possible_root(garbage TSRMLS_CC);
}
}
- ZVAL_COPY_VALUE(variable_ptr, value);
+ }
+ } while (0);
+
+ ZVAL_COPY_VALUE(variable_ptr, value);
+ if (value_type == IS_CONST) {
+ /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
+ zval_copy_ctor_func(variable_ptr);
+ }
+ } else if (value_type != IS_TMP_VAR) {
+ if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
+ Z_ADDREF_P(variable_ptr);
}
}
return variable_ptr;
@@ -1107,7 +1010,7 @@ str_index:
return retval;
}
-static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *container_ptr, zval *dim, int dim_type, int type, int is_ref TSRMLS_DC)
+static zend_always_inline zval *zend_fetch_dimension_address(zval *result, zval *container_ptr, zval *dim, int dim_type, int type, int is_ref, int allow_str_offset TSRMLS_DC)
{
zval *retval;
zval *container = container_ptr;
@@ -1142,14 +1045,11 @@ convert_to_array:
zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
goto fetch_from_array;
}
+
if (dim == NULL) {
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
}
- if (type != BP_VAR_UNSET) {
- SEPARATE_STRING(container);
- }
-
if (UNEXPECTED(Z_TYPE_P(dim) != IS_LONG)) {
switch(Z_TYPE_P(dim)) {
case IS_STRING:
@@ -1176,8 +1076,19 @@ convert_to_array:
offset = Z_LVAL_P(dim);
}
- if (!IS_INTERNED(Z_STR_P(container))) zend_string_addref(Z_STR_P(container));
- ZVAL_STR_OFFSET(result, container, offset);
+ if (allow_str_offset) {
+ if (Z_REFCOUNTED_P(container)) {
+ if (Z_REFCOUNT_P(container) > 1) {
+ Z_DELREF_P(container);
+ zval_copy_ctor_func(container);
+ }
+ Z_ADDREF_P(container);
+ }
+ ZVAL_LONG(result, offset);
+ return container; /* assignment to string offset */
+ } else {
+ ZVAL_INDIRECT(result, NULL); /* wrong string offset */
+ }
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (!Z_OBJ_HT_P(container)->read_dimension) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
@@ -1242,26 +1153,32 @@ convert_to_array:
ZVAL_INDIRECT(result, &EG(error_zval));
}
}
+ return NULL; /* not an assignment to string offset */
}
static zend_never_inline void zend_fetch_dimension_address_W(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
{
- zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 0, 0 TSRMLS_CC);
+}
+
+static zend_never_inline zval *zend_fetch_dimension_address_W_str(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
+{
+ return zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 0, 1 TSRMLS_CC);
}
static zend_never_inline void zend_fetch_dimension_address_W_ref(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
{
- zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 1 TSRMLS_CC);
+ zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 1, 0 TSRMLS_CC);
}
static zend_never_inline void zend_fetch_dimension_address_RW(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
{
- zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_RW, 0, 0 TSRMLS_CC);
}
static zend_never_inline void zend_fetch_dimension_address_UNSET(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
{
- zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_UNSET, 0, 0 TSRMLS_CC);
}
static zend_always_inline void zend_fetch_dimension_address_read(zval *result, zval *container, zval *dim, int dim_type, int type TSRMLS_DC)
@@ -1304,9 +1221,9 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
offset = Z_LVAL_P(dim);
}
- if (UNEXPECTED(offset < 0) || UNEXPECTED(Z_STRLEN_P(container) <= offset)) {
+ if (UNEXPECTED(offset < 0) || UNEXPECTED(Z_STRLEN_P(container) <= (size_t)offset)) {
if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Uninitialized string offset: %ld", offset);
+ zend_error(E_NOTICE, "Uninitialized string offset: %pd", offset);
}
ZVAL_EMPTY_STRING(result);
} else {
@@ -1546,49 +1463,59 @@ void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /*
static zend_always_inline void i_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */
{
- uint32_t first_extra_arg;
+ uint32_t first_extra_arg, num_args;
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
- EX(return_value) = return_value;
- EX(frame_kind) = frame_kind;
- ZVAL_UNDEF(&EX(old_error_reporting));
- EX(delayed_exception) = NULL;
- EX(call) = NULL;
-
EX(opline) = op_array->opcodes;
- if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
- /* Skip useless ZEND_RECV opcodes */
- EX(opline) += MIN(EX(num_args), op_array->required_num_args);
- }
+ EX(call) = NULL;
+ EX(frame_kind) = frame_kind;
+ EX(return_value) = return_value;
EX(scope) = EG(scope);
+ EX(delayed_exception) = NULL;
+ ZVAL_UNDEF(&EX(old_error_reporting));
+ /* Handle arguments */
first_extra_arg = op_array->num_args;
-
if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
first_extra_arg--;
}
- if (UNEXPECTED(EX(num_args) > first_extra_arg)) {
- /* move extra args into separate array after all CV and TMP vars */
- zval *extra_args = EX_VAR_NUM(op_array->last_var + op_array->T);
-
- memmove(extra_args, EX_VAR_NUM(first_extra_arg), sizeof(zval) * (EX(num_args) - first_extra_arg));
- }
-
- do {
- /* Initialize CV variables (skip arguments) */
- int num_args = MIN(op_array->num_args, EX(num_args));
+ num_args = EX(num_args);
+ if (UNEXPECTED(num_args > first_extra_arg)) {
+ zval *end, *src, *dst;
- if (EXPECTED(num_args < op_array->last_var)) {
- zval *var = EX_VAR_NUM(num_args);
- zval *end = EX_VAR_NUM(op_array->last_var);
+ if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
+ /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
+ EX(opline) += first_extra_arg;
+ }
+ /* move extra args into separate array after all CV and TMP vars */
+ end = EX_VAR_NUM(first_extra_arg - 1);
+ src = end + (num_args - first_extra_arg);
+ dst = src + (op_array->last_var + op_array->T - first_extra_arg);
+ if (EXPECTED(src != dst)) {
do {
- ZVAL_UNDEF(var);
- var++;
- } while (var != end);
+ ZVAL_COPY_VALUE(dst, src);
+ ZVAL_UNDEF(src);
+ src--;
+ dst--;
+ } while (src != end);
}
- } while (0);
+ } else if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
+ /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
+ EX(opline) += num_args;
+ }
+
+ /* Initialize CV variables (skip arguments) */
+ if (EXPECTED(num_args < op_array->last_var)) {
+ zval *var = EX_VAR_NUM(num_args);
+ zval *end = EX_VAR_NUM(op_array->last_var);
+
+ do {
+ ZVAL_UNDEF(var);
+ var++;
+ } while (var != end);
+ }
if (op_array->this_var != -1 && EX(object)) {
ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object));
@@ -1596,11 +1523,7 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
}
if (!op_array->run_time_cache && op_array->last_cache_slot) {
- if (op_array->function_name) {
- op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*));
- } else {
- op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
- }
+ op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*));
}
EX(run_time_cache) = op_array->run_time_cache;
@@ -1613,23 +1536,18 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
- EX(return_value) = return_value;
- EX(frame_kind) = frame_kind;
- ZVAL_UNDEF(&EX(old_error_reporting));
- EX(delayed_exception) = NULL;
- EX(call) = NULL;
-
EX(opline) = op_array->opcodes;
+ EX(call) = NULL;
+ EX(frame_kind) = frame_kind;
+ EX(return_value) = return_value;
EX(scope) = EG(scope);
+ EX(delayed_exception) = NULL;
+ ZVAL_UNDEF(&EX(old_error_reporting));
zend_attach_symbol_table(execute_data);
if (!op_array->run_time_cache && op_array->last_cache_slot) {
- if (op_array->function_name) {
- op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*));
- } else {
- op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
- }
+ op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
}
EX(run_time_cache) = op_array->run_time_cache;
@@ -1642,44 +1560,60 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
- EX(return_value) = return_value;
- EX(frame_kind) = frame_kind;
- ZVAL_UNDEF(&EX(old_error_reporting));
- EX(delayed_exception) = NULL;
- EX(call) = NULL;
-
EX(opline) = op_array->opcodes;
+ EX(call) = NULL;
+ EX(frame_kind) = frame_kind;
+ EX(return_value) = return_value;
EX(scope) = EG(scope);
+ EX(delayed_exception) = NULL;
+ ZVAL_UNDEF(&EX(old_error_reporting));
if (UNEXPECTED(EX(symbol_table) != NULL)) {
zend_attach_symbol_table(execute_data);
} else {
- uint32_t first_extra_arg = op_array->num_args;
+ uint32_t first_extra_arg, num_args;
+ /* Handle arguments */
+ first_extra_arg = op_array->num_args;
if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
first_extra_arg--;
}
- if (UNEXPECTED(EX(num_args) > first_extra_arg)) {
- /* move extra args into separate array after all CV and TMP vars */
- zval *extra_args = EX_VAR_NUM(op_array->last_var + op_array->T);
+ num_args = EX(num_args);
+ if (UNEXPECTED(num_args > first_extra_arg)) {
+ zval *end, *src, *dst;
- memmove(extra_args, EX_VAR_NUM(first_extra_arg), sizeof(zval) * (EX(num_args) - first_extra_arg));
- }
-
- do {
- /* Initialize CV variables (skip arguments) */
- int num_args = MIN(op_array->num_args, EX(num_args));
-
- if (EXPECTED(num_args < op_array->last_var)) {
- zval *var = EX_VAR_NUM(num_args);
- zval *end = EX_VAR_NUM(op_array->last_var);
+ if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
+ /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
+ EX(opline) += first_extra_arg;
+ }
+ /* move extra args into separate array after all CV and TMP vars */
+ end = EX_VAR_NUM(first_extra_arg - 1);
+ src = end + (num_args - first_extra_arg);
+ dst = src + (op_array->last_var + op_array->T - first_extra_arg);
+ if (EXPECTED(src != dst)) {
do {
- ZVAL_UNDEF(var);
- var++;
- } while (var != end);
+ ZVAL_COPY_VALUE(dst, src);
+ ZVAL_UNDEF(src);
+ src--;
+ dst--;
+ } while (src != end);
}
- } while (0);
+ } else if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
+ /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
+ EX(opline) += num_args;
+ }
+
+ /* Initialize CV variables (skip arguments) */
+ if (EXPECTED(num_args < op_array->last_var)) {
+ zval *var = EX_VAR_NUM(num_args);
+ zval *end = EX_VAR_NUM(op_array->last_var);
+
+ do {
+ ZVAL_UNDEF(var);
+ var++;
+ } while (var != end);
+ }
if (op_array->this_var != -1 && EX(object)) {
ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object));
@@ -1732,7 +1666,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
if (num_args > 0) {
zval *arg_src = ZEND_CALL_ARG(call, 1);
zval *arg_dst = ZEND_CALL_ARG(execute_data, 1);
- int i;
+ uint32_t i;
for (i = 0; i < num_args; i++) {
ZVAL_COPY_VALUE(arg_dst + i, arg_src + i);
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index ed905ff8cf..334a4ccc03 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -56,23 +56,13 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC
if (Z_REFCOUNTED_P(zval_ptr)) {
if (!Z_DELREF_P(zval_ptr)) {
ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
- _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_CC);
+ _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr);
}
}
}
-static zend_always_inline void i_zval_ptr_dtor_nogc(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_CC);
- }
- }
-}
-
static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC)
{
int result;
@@ -196,9 +186,9 @@ static zend_always_inline void zend_vm_stack_destroy(TSRMLS_D)
}
}
-static zend_always_inline void zend_vm_stack_extend(int count TSRMLS_DC)
+static zend_always_inline void zend_vm_stack_extend(uint32_t count TSRMLS_DC)
{
- int size = count * ZEND_MM_ALIGNED_SIZE(sizeof(zval));
+ uint32_t size = count * ZEND_MM_ALIGNED_SIZE(sizeof(zval));
zend_vm_stack p = zend_vm_stack_new_page(
(size >= (ZEND_VM_STACK_PAGE_SIZE - ZEND_VM_STACK_HEADER_SLOT) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) ?
(size + ((ZEND_VM_STACK_HEADER_SLOT + ZEND_VM_STACK_PAGE_SIZE) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) - 1) &
@@ -210,7 +200,7 @@ static zend_always_inline void zend_vm_stack_extend(int count TSRMLS_DC)
static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_function *func, uint32_t num_args, zend_uchar flags, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
{
- int used_stack = ZEND_CALL_FRAME_SLOT + num_args;
+ uint32_t used_stack = ZEND_CALL_FRAME_SLOT + num_args;
zend_execute_data *call;
if (ZEND_USER_CODE(func->type)) {
@@ -237,7 +227,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *
zval *p = end + (call->num_args - first_extra_arg);
do {
p--;
- i_zval_ptr_dtor_nogc(p ZEND_FILE_LINE_CC TSRMLS_CC);
+ zval_ptr_dtor_nogc(p);
} while (p != end);
}
}
@@ -252,7 +242,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call T
do {
p--;
- i_zval_ptr_dtor_nogc(p ZEND_FILE_LINE_CC TSRMLS_CC);
+ zval_ptr_dtor_nogc(p);
} while (p != end);
}
}
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 5984e2dc82..f59a10179b 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -42,7 +42,7 @@ ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data TSRMLS_DC);
ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
/* true globals */
-ZEND_API const zend_fcall_info empty_fcall_info = { 0, NULL, {{0}, {{0}}, {0}}, NULL, NULL, 0, NULL, NULL, 0 };
+ZEND_API const zend_fcall_info empty_fcall_info = { 0, NULL, {{0}, {{0}}, {0}}, NULL, NULL, NULL, NULL, 0, 0 };
ZEND_API const zend_fcall_info_cache empty_fcall_info_cache = { 0, NULL, NULL, NULL, NULL };
#ifdef ZEND_WIN32
@@ -110,7 +110,7 @@ static int clean_non_persistent_function(zval *zv TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int clean_non_persistent_function_full(zval *zv TSRMLS_DC) /* {{{ */
+ZEND_API int clean_non_persistent_function_full(zval *zv TSRMLS_DC) /* {{{ */
{
zend_function *function = Z_PTR_P(zv);
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
@@ -124,7 +124,7 @@ static int clean_non_persistent_class(zval *zv TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int clean_non_persistent_class_full(zval *zv TSRMLS_DC) /* {{{ */
+ZEND_API int clean_non_persistent_class_full(zval *zv TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce = Z_PTR_P(zv);
return (ce->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
@@ -580,8 +580,8 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
if (!inline_change) {
ZVAL_STRINGL(p, actual, actual_len);
} else {
- Z_TYPE_INFO_P(p) = IS_INTERNED(Z_STR_P(p)) ?
- IS_INTERNED_STRING_EX : IS_STRING_EX;
+ Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
+ IS_STRING_EX : IS_INTERNED_STRING_EX;
if (save && save->val != actual) {
zend_string_release(save);
}
@@ -1011,12 +1011,12 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
if (name->val[0] == '\\') {
ZVAL_STRINGL(&args[0], name->val + 1, name->len - 1);
} else {
- ZVAL_STR(&args[0], zend_string_copy(name));
+ ZVAL_STR_COPY(&args[0], name);
}
fcall_info.size = sizeof(fcall_info);
fcall_info.function_table = EG(function_table);
- ZVAL_STR(&fcall_info.function_name, zend_string_copy(EG(autoload_func)->common.function_name));
+ ZVAL_STR_COPY(&fcall_info.function_name, EG(autoload_func)->common.function_name);
fcall_info.symbol_table = NULL;
fcall_info.retval = &local_retval;
fcall_info.param_count = 1;
@@ -1502,7 +1502,7 @@ ZEND_API int zend_delete_global_variable(zend_string *name TSRMLS_DC) /* {{{ */
ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
{
- uint32_t i;
+ int i;
zend_execute_data *ex;
zend_array *symbol_table;
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c
index 5fe6627f6c..04150920af 100644
--- a/Zend/zend_extensions.c
+++ b/Zend/zend_extensions.c
@@ -195,7 +195,7 @@ void zend_shutdown_extensions(TSRMLS_D)
void zend_extension_dtor(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT && !ZEND_DEBUG
- if (extension->handle) {
+ if (extension->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) {
DL_UNLOAD(extension->handle);
}
#endif
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index adc02a3eb0..b331f979fd 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -99,6 +99,7 @@ ZEND_API void gc_reset(TSRMLS_D)
{
GC_G(gc_runs) = 0;
GC_G(collected) = 0;
+ GC_G(gc_full) = 0;
#if GC_BENCH
GC_G(root_buf_length) = 0;
@@ -185,14 +186,6 @@ ZEND_API void gc_remove_from_buffer(zend_refcounted *ref TSRMLS_DC)
{
gc_root_buffer *root;
- if (UNEXPECTED(/*GC_ADDRESS(GC_INFO(ref)) &&*/
- GC_GET_COLOR(GC_INFO(ref)) == GC_BLACK &&
- GC_ADDRESS(GC_INFO(ref)) >= GC_G(last_unused) - GC_G(buf))) {
- /* The given zval is a garbage that is going to be deleted by
- * currently running GC */
- return;
- }
-
root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref));
GC_BENCH_INC(zval_remove_from_buffer);
GC_REMOVE_FROM_ROOTS(root);
@@ -492,8 +485,11 @@ tail_call:
} else if (GC_G(first_unused) != GC_G(last_unused)) {
buf = GC_G(first_unused);
GC_G(first_unused)++;
+ } else {
+ /* TODO: find a perfect way to handle such case */
+ GC_G(gc_full) = 1;
}
- /* TODO: what should we do if we don't have room ??? */
+
if (buf) {
buf->ref = ref;
buf->next = GC_G(roots).next;
@@ -609,6 +605,18 @@ static int gc_collect_roots(TSRMLS_D)
}
current = current->next;
}
+
+ if (GC_G(gc_full) == 1) {
+ current = GC_G(roots).next;
+ while (current != &GC_G(roots)) {
+ GC_SET_ADDRESS(GC_INFO(current->ref), 0);
+ GC_SET_BLACK(GC_INFO(current->ref));
+ current = current->next;
+ }
+ gc_reset(TSRMLS_C);
+ return 0;
+ }
+
/* relink remaining roots into list to free */
if (GC_G(roots).next != &GC_G(roots)) {
if (GC_G(to_free).next == &GC_G(to_free)) {
diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h
index 84b7ef3208..2eb8ea6ea3 100644
--- a/Zend/zend_gc.h
+++ b/Zend/zend_gc.h
@@ -83,6 +83,7 @@ typedef struct _gc_root_buffer {
typedef struct _zend_gc_globals {
zend_bool gc_enabled;
zend_bool gc_active;
+ zend_bool gc_full;
gc_root_buffer *buf; /* preallocated arrays of buffers */
gc_root_buffer roots; /* list of possible roots of cycles */
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index c757f1fa2f..69e1cf9e68 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -254,7 +254,7 @@ struct _zend_ini_scanner_globals {
char *filename;
int lineno;
- /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW */
+ /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
int scanner_mode;
};
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 5201e88bd4..6304737f04 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -97,9 +97,9 @@ static void zend_hash_do_resize(HashTable *ht);
static const uint32_t uninitialized_bucket = {INVALID_IDX};
-ZEND_API void _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
+ZEND_API void _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
{
- uint i = 3;
+ uint32_t i = 3;
SET_INCONSISTENT(HT_OK);
@@ -137,7 +137,7 @@ static void zend_hash_packed_grow(HashTable *ht)
HANDLE_UNBLOCK_INTERRUPTIONS();
}
-ZEND_API void zend_hash_real_init(HashTable *ht, int packed)
+ZEND_API void zend_hash_real_init(HashTable *ht, zend_bool packed)
{
IS_CONSISTENT(ht);
@@ -163,7 +163,7 @@ ZEND_API void zend_hash_to_packed(HashTable *ht)
HANDLE_UNBLOCK_INTERRUPTIONS();
}
-ZEND_API void _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
+ZEND_API void _zend_hash_init_ex(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
{
_zend_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_CC);
if (!bApplyProtection) {
@@ -184,8 +184,8 @@ ZEND_API void zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProt
static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zend_string *key)
{
zend_ulong h;
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
h = zend_string_hash_val(key);
@@ -205,10 +205,10 @@ static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zen
return NULL;
}
-static zend_always_inline Bucket *zend_hash_str_find_bucket(const HashTable *ht, const char *str, int len, zend_ulong h)
+static zend_always_inline Bucket *zend_hash_str_find_bucket(const HashTable *ht, const char *str, size_t len, zend_ulong h)
{
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
nIndex = h & ht->nTableMask;
@@ -229,8 +229,8 @@ static zend_always_inline Bucket *zend_hash_str_find_bucket(const HashTable *ht,
static zend_always_inline Bucket *zend_hash_index_find_bucket(const HashTable *ht, zend_ulong h)
{
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
nIndex = h & ht->nTableMask;
@@ -246,11 +246,11 @@ static zend_always_inline Bucket *zend_hash_index_find_bucket(const HashTable *h
return NULL;
}
-static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_string *key, zval *pData, int flag ZEND_FILE_LINE_DC)
+static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_string *key, zval *pData, uint32_t flag ZEND_FILE_LINE_DC)
{
zend_ulong h;
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
@@ -310,7 +310,7 @@ static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_s
return &p->val;
}
-ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, int flag ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, uint32_t flag ZEND_FILE_LINE_DC)
{
return _zend_hash_add_or_update_i(ht, key, pData, flag ZEND_FILE_LINE_RELAY_CC);
}
@@ -335,7 +335,7 @@ ZEND_API zval *_zend_hash_add_new(HashTable *ht, zend_string *key, zval *pData Z
return _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC);
}
-ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *str, int len, zval *pData, int flag ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *str, size_t len, zval *pData, uint32_t flag ZEND_FILE_LINE_DC)
{
zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, flag ZEND_FILE_LINE_CC);
@@ -343,7 +343,7 @@ ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *str, int
return ret;
}
-ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC)
{
zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_UPDATE ZEND_FILE_LINE_CC);
@@ -351,7 +351,7 @@ ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *str, int len, zv
return ret;
}
-ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC)
{
zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_UPDATE | HASH_UPDATE_INDIRECT ZEND_FILE_LINE_CC);
@@ -359,7 +359,7 @@ ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *str, int len
return ret;
}
-ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC)
{
zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD ZEND_FILE_LINE_CC);
@@ -367,7 +367,7 @@ ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *str, int len, zval
return ret;
}
-ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *str, int len, zval *pData ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *str, size_t len, zval *pData ZEND_FILE_LINE_DC)
{
zend_string *key = zend_string_init(str, len, ht->u.flags & HASH_FLAG_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD_NEW ZEND_FILE_LINE_CC);
@@ -393,7 +393,7 @@ ZEND_API zval *zend_hash_add_empty_element(HashTable *ht, zend_string *key)
return zend_hash_add(ht, key, &dummy);
}
-ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *str, int len)
+ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *str, size_t len)
{
zval dummy;
@@ -402,85 +402,80 @@ ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *str, i
return zend_hash_str_add(ht, str, len, &dummy);
}
-static zend_always_inline zval *_zend_hash_index_update_or_next_insert_i(HashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC)
+static zend_always_inline zval *_zend_hash_index_add_or_update_i(HashTable *ht, zend_ulong h, zval *pData, uint32_t flag ZEND_FILE_LINE_DC)
{
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
-
- if (flag & HASH_NEXT_INSERT) {
- h = ht->nNextFreeElement;
- }
- CHECK_INIT(ht, h >= 0 && h < ht->nTableSize);
+ CHECK_INIT(ht, h < ht->nTableSize);
if (ht->u.flags & HASH_FLAG_PACKED) {
- if (EXPECTED(h >= 0)) {
- if (h < ht->nNumUsed) {
- p = ht->arData + h;
- if (Z_TYPE(p->val) != IS_UNDEF) {
- if (flag & (HASH_NEXT_INSERT | HASH_ADD)) {
- return NULL;
- }
- if (ht->pDestructor) {
- ht->pDestructor(&p->val);
- }
- ZVAL_COPY_VALUE(&p->val, pData);
- if ((zend_long)h >= (zend_long)ht->nNextFreeElement) {
- ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX;
- }
- return &p->val;
- } else { /* we have to keep the order :( */
- goto convert_to_hash;
+ if (h < ht->nNumUsed) {
+ p = ht->arData + h;
+ if (Z_TYPE(p->val) != IS_UNDEF) {
+ if (flag & HASH_ADD) {
+ return NULL;
}
- } else if (EXPECTED(h < ht->nTableSize)) {
- p = ht->arData + h;
- } else if (h < ht->nTableSize * 2 &&
- ht->nTableSize - ht->nNumOfElements < ht->nTableSize / 2) {
- zend_hash_packed_grow(ht);
- p = ht->arData + h;
- } else {
- goto convert_to_hash;
- }
- HANDLE_BLOCK_INTERRUPTIONS();
- /* incremental initialization of empty Buckets */
- if (h >= ht->nNumUsed) {
- Bucket *q = ht->arData + ht->nNumUsed;
- while (q != p) {
- ZVAL_UNDEF(&q->val);
- q++;
+ if (ht->pDestructor) {
+ ht->pDestructor(&p->val);
}
- ht->nNumUsed = h + 1;
- }
- ht->nNumOfElements++;
- if (ht->nInternalPointer == INVALID_IDX) {
- ht->nInternalPointer = h;
+ ZVAL_COPY_VALUE(&p->val, pData);
+ if ((zend_long)h >= (zend_long)ht->nNextFreeElement) {
+ ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX;
+ }
+ return &p->val;
+ } else { /* we have to keep the order :( */
+ goto convert_to_hash;
}
- if ((zend_long)h >= (zend_long)ht->nNextFreeElement) {
- ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX;
+ } else if (EXPECTED(h < ht->nTableSize)) {
+ p = ht->arData + h;
+ } else if (h < ht->nTableSize * 2 &&
+ ht->nTableSize - ht->nNumOfElements < ht->nTableSize / 2) {
+ zend_hash_packed_grow(ht);
+ p = ht->arData + h;
+ } else {
+ goto convert_to_hash;
+ }
+
+ HANDLE_BLOCK_INTERRUPTIONS();
+ /* incremental initialization of empty Buckets */
+ if (h >= ht->nNumUsed) {
+ Bucket *q = ht->arData + ht->nNumUsed;
+ while (q != p) {
+ ZVAL_UNDEF(&q->val);
+ q++;
}
- p->h = h;
- p->key = NULL;
- ZVAL_COPY_VALUE(&p->val, pData);
- Z_NEXT(p->val) = INVALID_IDX;
+ ht->nNumUsed = h + 1;
+ }
+ ht->nNumOfElements++;
+ if (ht->nInternalPointer == INVALID_IDX) {
+ ht->nInternalPointer = h;
+ }
+ if ((zend_long)h >= (zend_long)ht->nNextFreeElement) {
+ ht->nNextFreeElement = h < ZEND_LONG_MAX ? h + 1 : ZEND_LONG_MAX;
+ }
+ p->h = h;
+ p->key = NULL;
+ ZVAL_COPY_VALUE(&p->val, pData);
+ Z_NEXT(p->val) = INVALID_IDX;
- HANDLE_UNBLOCK_INTERRUPTIONS();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+
+ return &p->val;
- return &p->val;
- } else {
convert_to_hash:
- zend_hash_packed_to_hash(ht);
- }
+ zend_hash_packed_to_hash(ht);
}
if ((flag & HASH_ADD_NEW) == 0) {
p = zend_hash_index_find_bucket(ht, h);
if (p) {
- if (flag & (HASH_NEXT_INSERT | HASH_ADD)) {
+ if (flag & HASH_ADD) {
return NULL;
}
ZEND_ASSERT(&p->val != pData);
@@ -520,34 +515,34 @@ convert_to_hash:
return &p->val;
}
-ZEND_API zval *_zend_hash_index_update_or_next_insert(HashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_hash_index_add_or_update(HashTable *ht, zend_ulong h, zval *pData, uint32_t flag ZEND_FILE_LINE_DC)
{
- return _zend_hash_index_update_or_next_insert_i(ht, h, pData, flag ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_index_add_or_update_i(ht, h, pData, flag ZEND_FILE_LINE_RELAY_CC);
}
ZEND_API zval *_zend_hash_index_add(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC)
{
- return _zend_hash_index_update_or_next_insert_i(ht, h, pData, HASH_ADD ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_index_add_or_update_i(ht, h, pData, HASH_ADD ZEND_FILE_LINE_RELAY_CC);
}
ZEND_API zval *_zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC)
{
- return _zend_hash_index_update_or_next_insert_i(ht, h, pData, HASH_ADD | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_index_add_or_update_i(ht, h, pData, HASH_ADD | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC);
}
ZEND_API zval *_zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC)
{
- return _zend_hash_index_update_or_next_insert_i(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_index_add_or_update_i(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_RELAY_CC);
}
ZEND_API zval *_zend_hash_next_index_insert(HashTable *ht, zval *pData ZEND_FILE_LINE_DC)
{
- return _zend_hash_index_update_or_next_insert_i(ht, ht->nNextFreeElement, pData, HASH_NEXT_INSERT ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_index_add_or_update_i(ht, ht->nNextFreeElement, pData, HASH_ADD ZEND_FILE_LINE_RELAY_CC);
}
ZEND_API zval *_zend_hash_next_index_insert_new(HashTable *ht, zval *pData ZEND_FILE_LINE_DC)
{
- return _zend_hash_index_update_or_next_insert_i(ht, ht->nNextFreeElement, pData, HASH_NEXT_INSERT | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_index_add_or_update_i(ht, ht->nNextFreeElement, pData, HASH_ADD | HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC);
}
static void zend_hash_do_resize(HashTable *ht)
@@ -576,7 +571,7 @@ static void zend_hash_do_resize(HashTable *ht)
ZEND_API int zend_hash_rehash(HashTable *ht)
{
Bucket *p;
- uint nIndex, i, j;
+ uint32_t nIndex, i, j;
IS_CONSISTENT(ht);
@@ -606,7 +601,7 @@ ZEND_API int zend_hash_rehash(HashTable *ht)
return SUCCESS;
}
-static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint idx, Bucket *p, Bucket *prev)
+static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint32_t idx, Bucket *p, Bucket *prev)
{
if (!(ht->u.flags & HASH_FLAG_PACKED)) {
if (prev) {
@@ -646,21 +641,20 @@ static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint idx, Buc
}
}
-static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint idx, Bucket *p)
+static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p)
{
- uint nIndex;
Bucket *prev = NULL;
if (!(ht->u.flags & HASH_FLAG_PACKED)) {
- nIndex = p->h & ht->nTableMask;
- idx = ht->arHash[nIndex];
- if (p != ht->arData + idx) {
- prev = ht->arData + idx;
- while (ht->arData + Z_NEXT(prev->val) != p) {
- idx = Z_NEXT(prev->val);
- prev = ht->arData + idx;
+ uint32_t nIndex = p->h & ht->nTableMask;
+ uint32_t i = ht->arHash[nIndex];
+
+ if (i != idx) {
+ prev = ht->arData + i;
+ while (Z_NEXT(prev->val) != idx) {
+ i = Z_NEXT(prev->val);
+ prev = ht->arData + i;
}
- idx = Z_NEXT(prev->val);
}
}
@@ -670,8 +664,8 @@ static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint idx, Bucket
ZEND_API int zend_hash_del(HashTable *ht, zend_string *key)
{
zend_ulong h;
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
@@ -709,8 +703,8 @@ ZEND_API int zend_hash_del(HashTable *ht, zend_string *key)
ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key)
{
zend_ulong h;
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
@@ -758,11 +752,11 @@ ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key)
return FAILURE;
}
-ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, int len)
+ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, size_t len)
{
zend_ulong h;
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
@@ -809,11 +803,11 @@ ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, int len)
return FAILURE;
}
-ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, int len)
+ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, size_t len)
{
zend_ulong h;
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
@@ -845,8 +839,8 @@ ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, int len)
ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h)
{
- uint nIndex;
- uint idx;
+ uint32_t nIndex;
+ uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
@@ -856,7 +850,7 @@ ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h)
IS_CONSISTENT(ht);
if (ht->u.flags & HASH_FLAG_PACKED) {
- if (h >=0 && h < ht->nNumUsed) {
+ if (h < ht->nNumUsed) {
p = ht->arData + h;
if (Z_TYPE(p->val) != IS_UNDEF) {
HANDLE_BLOCK_INTERRUPTIONS();
@@ -934,7 +928,7 @@ ZEND_API void zend_hash_destroy(HashTable *ht)
ZEND_API void zend_hash_clean(HashTable *ht)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
IS_CONSISTENT(ht);
@@ -965,7 +959,7 @@ ZEND_API void zend_hash_clean(HashTable *ht)
* next bucket. The hash *may* be altered during that time, the
* returned value will still be valid.
*/
-static void zend_hash_apply_deleter(HashTable *ht, uint idx, Bucket *p)
+static void zend_hash_apply_deleter(HashTable *ht, uint32_t idx, Bucket *p)
{
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
@@ -979,7 +973,7 @@ static void zend_hash_apply_deleter(HashTable *ht, uint idx, Bucket *p)
ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
IS_CONSISTENT(ht);
@@ -998,7 +992,7 @@ ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
IS_CONSISTENT(ht);
@@ -1029,7 +1023,7 @@ ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht)
ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
int result;
@@ -1055,7 +1049,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
int result;
@@ -1081,7 +1075,7 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int num_args, ...)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
va_list args;
zend_hash_key hash_key;
@@ -1116,7 +1110,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
int result;
@@ -1144,7 +1138,7 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
zval *new_entry, *data;
zend_bool setTargetPointer;
@@ -1189,8 +1183,8 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun
ZEND_API void zend_array_dup(HashTable *target, HashTable *source)
{
- uint idx, target_idx;
- uint nIndex;
+ uint32_t idx, target_idx;
+ uint32_t nIndex;
Bucket *p, *q;
zval *data;
@@ -1308,12 +1302,12 @@ ZEND_API void zend_array_dup(HashTable *target, HashTable *source)
}
-ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, int overwrite ZEND_FILE_LINE_DC)
+ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite ZEND_FILE_LINE_DC)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
zval *t;
- int mode = (overwrite?HASH_UPDATE:HASH_ADD);
+ uint32_t mode = (overwrite?HASH_UPDATE:HASH_ADD);
IS_CONSISTENT(source);
IS_CONSISTENT(target);
@@ -1357,7 +1351,7 @@ static zend_bool zend_hash_replace_checker_wrapper(HashTable *target, zval *sour
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam)
{
- uint idx;
+ uint32_t idx;
Bucket *p;
zval *t;
@@ -1402,7 +1396,7 @@ ZEND_API zval *zend_hash_find(const HashTable *ht, zend_string *key)
return p ? &p->val : NULL;
}
-ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *str, int len)
+ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *str, size_t len)
{
zend_ulong h;
Bucket *p;
@@ -1418,7 +1412,7 @@ ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *str, int len)
return p ? &p->val : NULL;
}
-ZEND_API int zend_hash_exists(const HashTable *ht, zend_string *key)
+ZEND_API zend_bool zend_hash_exists(const HashTable *ht, zend_string *key)
{
Bucket *p;
@@ -1432,7 +1426,7 @@ ZEND_API int zend_hash_exists(const HashTable *ht, zend_string *key)
return p ? 1 : 0;
}
-ZEND_API int zend_hash_str_exists(const HashTable *ht, const char *str, int len)
+ZEND_API zend_bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len)
{
zend_ulong h;
Bucket *p;
@@ -1455,7 +1449,7 @@ ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h)
IS_CONSISTENT(ht);
if (ht->u.flags & HASH_FLAG_PACKED) {
- if (h >= 0 && h < ht->nNumUsed) {
+ if (h < ht->nNumUsed) {
p = ht->arData + h;
if (Z_TYPE(p->val) != IS_UNDEF) {
return &p->val;
@@ -1469,14 +1463,14 @@ ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h)
}
-ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_ulong h)
+ZEND_API zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h)
{
Bucket *p;
IS_CONSISTENT(ht);
if (ht->u.flags & HASH_FLAG_PACKED) {
- if (h >= 0 && h < ht->nNumUsed) {
+ if (h < ht->nNumUsed) {
if (Z_TYPE(ht->arData[h].val) != IS_UNDEF) {
return 1;
}
@@ -1489,61 +1483,9 @@ ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_ulong h)
}
-ZEND_API int zend_hash_get_pointer(const HashTable *ht, HashPointer *ptr)
-{
- ptr->pos = ht->nInternalPointer;
- ptr->ht = (HashTable*)ht;
- if (ht->nInternalPointer != INVALID_IDX) {
- ptr->h = ht->arData[ht->nInternalPointer].h;
- return 1;
- } else {
- ptr->h = 0;
- return 0;
- }
-}
-
-ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr)
-{
- uint idx;
-
- if (ptr->pos == INVALID_IDX) {
- ht->nInternalPointer = INVALID_IDX;
- } else if (ptr->ht != ht) {
- IS_CONSISTENT(ht);
- for (idx = 0; idx < ht->nNumUsed; idx++) {
- if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) {
- ht->nInternalPointer = idx;
- return 0;
- }
- }
- idx = INVALID_IDX;
- return 0;
- } else if (ht->nInternalPointer != ptr->pos) {
- IS_CONSISTENT(ht);
- if (ht->u.flags & HASH_FLAG_PACKED) {
- if (ptr->h < ht->nNumUsed &&
- Z_TYPE(ht->arData[ptr->h].val) != IS_UNDEF) {
- ht->nInternalPointer = ptr->h;
- return 1;
- }
- } else {
- idx = ht->arHash[ptr->h & ht->nTableMask];
- while (idx != INVALID_IDX) {
- if (ht->arData[idx].h == ptr->h && idx == ptr->pos) {
- ht->nInternalPointer = idx;
- return 1;
- }
- idx = Z_NEXT(ht->arData[idx].val);
- }
- }
- return 0;
- }
- return 1;
-}
-
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos)
{
- uint idx;
+ uint32_t idx;
IS_CONSISTENT(ht);
for (idx = 0; idx < ht->nNumUsed; idx++) {
@@ -1561,7 +1503,7 @@ ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *p
*/
ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos)
{
- uint idx;
+ uint32_t idx;
IS_CONSISTENT(ht);
@@ -1579,7 +1521,7 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos)
{
- uint idx = *pos;
+ uint32_t idx = *pos;
IS_CONSISTENT(ht);
@@ -1602,7 +1544,7 @@ ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos)
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
{
- uint idx = *pos;
+ uint32_t idx = *pos;
IS_CONSISTENT(ht);
@@ -1625,7 +1567,7 @@ ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
/* This function should be made binary safe */
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, zend_bool duplicate, HashPosition *pos)
{
- uint idx = *pos;
+ uint32_t idx = *pos;
Bucket *p;
IS_CONSISTENT(ht);
@@ -1648,7 +1590,7 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos)
{
- uint idx = *pos;
+ uint32_t idx = *pos;
Bucket *p;
IS_CONSISTENT(ht);
@@ -1657,8 +1599,7 @@ ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key,
} else {
p = ht->arData + idx;
if (p->key) {
- ZVAL_STR(key, p->key);
- zend_string_addref(p->key);
+ ZVAL_STR_COPY(key, p->key);
} else {
ZVAL_LONG(key, p->h);
}
@@ -1667,7 +1608,7 @@ ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key,
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
{
- uint idx = *pos;
+ uint32_t idx = *pos;
Bucket *p;
IS_CONSISTENT(ht);
@@ -1685,7 +1626,7 @@ ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos)
{
- uint idx = *pos;
+ uint32_t idx = *pos;
Bucket *p;
IS_CONSISTENT(ht);
@@ -1698,10 +1639,10 @@ ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos)
}
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
- compare_func_t compar, int renumber TSRMLS_DC)
+ compare_func_t compar, zend_bool renumber TSRMLS_DC)
{
Bucket *p;
- int i, j;
+ uint32_t i, j;
IS_CONSISTENT(ht);
@@ -1763,7 +1704,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
{
- uint idx1, idx2;
+ uint32_t idx1, idx2;
Bucket *p1, *p2 = NULL;
int result;
zval *pData1, *pData2;
@@ -1867,9 +1808,9 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
}
-ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, int flag TSRMLS_DC)
+ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag TSRMLS_DC)
{
- uint idx;
+ uint32_t idx;
Bucket *p, *res;
IS_CONSISTENT(ht);
@@ -1904,6 +1845,56 @@ ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, int
return &res->val;
}
+ZEND_API int _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx)
+{
+ register const char *tmp = key;
+ const char *end;
+
+ if (*tmp > '9') {
+ return 0;
+ } else if (*tmp < '0') {
+ if (*tmp != '-') {
+ return 0;
+ }
+ tmp++;
+ if (*tmp > '9' || *tmp < '0') {
+ return 0;
+ }
+ }
+
+ /* possibly a numeric index */
+ end = key + length;
+
+ if ((*end != '\0') /* not a null terminated string */
+ || (*tmp == '0' && length > 1) /* numbers with leading zeros */
+ || (end - tmp > MAX_LENGTH_OF_LONG - 1) /* number too long */
+ || (SIZEOF_ZEND_LONG == 4 &&
+ end - tmp == MAX_LENGTH_OF_LONG - 1 &&
+ *tmp > '2')) { /* overflow */
+ return 0;
+ }
+ *idx = (*tmp - '0');
+ while (1) {
+ ++tmp;
+ if (tmp == end) {
+ if (*key == '-') {
+ if (*idx-1 > ZEND_LONG_MAX) { /* overflow */
+ return 0;
+ }
+ *idx = 0 - *idx;
+ } else if (*idx > ZEND_LONG_MAX) { /* overflow */
+ return 0;
+ }
+ return 1;
+ }
+ if (*tmp <= '9' && *tmp >= '0') {
+ *idx = (*idx * 10) + (*tmp - '0');
+ } else {
+ return 0;
+ }
+ }
+}
+
/*
* Local variables:
* tab-width: 4
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index ae71312ade..5c27873aa1 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -22,21 +22,18 @@
#ifndef ZEND_HASH_H
#define ZEND_HASH_H
-#include <sys/types.h>
#include "zend.h"
#define HASH_KEY_IS_STRING 1
#define HASH_KEY_IS_LONG 2
#define HASH_KEY_NON_EXISTENT 3
-#define HASH_KEY_NON_EXISTANT HASH_KEY_NON_EXISTENT /* Keeping old define (with typo) for backward compatibility */
#define HASH_UPDATE (1<<0)
#define HASH_ADD (1<<1)
-#define HASH_NEXT_INSERT (1<<2)
-#define HASH_UPDATE_INDIRECT (1<<3)
-#define HASH_ADD_NEW (1<<4)
+#define HASH_UPDATE_INDIRECT (1<<2)
+#define HASH_ADD_NEW (1<<3)
-#define INVALID_IDX ((uint)-1)
+#define INVALID_IDX ((uint32_t) -1)
#define HASH_FLAG_PERSISTENT (1<<0)
#define HASH_FLAG_APPLY_PROTECTION (1<<1)
@@ -45,30 +42,30 @@
#define HASH_MASK_CONSISTENCY 0x60
typedef struct _zend_hash_key {
- zend_ulong h;
+ zend_ulong h;
zend_string *key;
} zend_hash_key;
typedef zend_bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam);
-typedef uint HashPosition;
+typedef uint32_t HashPosition;
BEGIN_EXTERN_C()
/* startup/shutdown */
-ZEND_API void _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
-ZEND_API void _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
+ZEND_API void _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
+ZEND_API void _zend_hash_init_ex(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_destroy(HashTable *ht);
ZEND_API void zend_hash_clean(HashTable *ht);
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pDestructor), (persistent) ZEND_FILE_LINE_CC)
#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC)
-ZEND_API void zend_hash_real_init(HashTable *ht, int packed);
+ZEND_API void zend_hash_real_init(HashTable *ht, zend_bool packed);
ZEND_API void zend_hash_packed_to_hash(HashTable *ht);
ZEND_API void zend_hash_to_packed(HashTable *ht);
/* additions/updates/changes */
-ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, int flag ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, uint32_t flag ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_update(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_update_ind(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_add(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
@@ -83,11 +80,11 @@ ZEND_API zval *_zend_hash_add_new(HashTable *ht, zend_string *key,zval *pData ZE
#define zend_hash_add_new(ht, key, pData) \
_zend_hash_add_new(ht, key, pData ZEND_FILE_LINE_CC)
-ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *key, int len, zval *pData, int flag ZEND_FILE_LINE_DC);
-ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
-ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
-ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
-ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *key, size_t len, zval *pData, uint32_t flag ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *key, size_t len, zval *pData ZEND_FILE_LINE_DC);
#define zend_hash_str_update(ht, key, len, pData) \
_zend_hash_str_update(ht, key, len, pData ZEND_FILE_LINE_CC)
@@ -98,7 +95,7 @@ ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *key, int len, z
#define zend_hash_str_add_new(ht, key, len, pData) \
_zend_hash_str_add_new(ht, key, len, pData ZEND_FILE_LINE_CC)
-ZEND_API zval *_zend_hash_index_update_or_next_insert(HashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_hash_index_add_or_update(HashTable *ht, zend_ulong h, zval *pData, uint32_t flag ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_index_add(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC);
@@ -118,7 +115,7 @@ ZEND_API zval *_zend_hash_next_index_insert_new(HashTable *ht, zval *pData ZEND_
ZEND_API zval *zend_hash_index_add_empty_element(HashTable *ht, zend_ulong h);
ZEND_API zval *zend_hash_add_empty_element(HashTable *ht, zend_string *key);
-ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *key, int len);
+ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *key, size_t len);
#define ZEND_HASH_APPLY_KEEP 0
#define ZEND_HASH_APPLY_REMOVE 1<<0
@@ -146,19 +143,19 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
/* Deletes */
ZEND_API int zend_hash_del(HashTable *ht, zend_string *key);
ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key);
-ZEND_API int zend_hash_str_del(HashTable *ht, const char *key, int len);
-ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *key, int len);
+ZEND_API int zend_hash_str_del(HashTable *ht, const char *key, size_t len);
+ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *key, size_t len);
ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h);
/* Data retreival */
ZEND_API zval *zend_hash_find(const HashTable *ht, zend_string *key);
-ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *key, int len);
+ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *key, size_t len);
ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h);
/* Misc */
-ZEND_API int zend_hash_exists(const HashTable *ht, zend_string *key);
-ZEND_API int zend_hash_str_exists(const HashTable *ht, const char *str, int len);
-ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_ulong h);
+ZEND_API zend_bool zend_hash_exists(const HashTable *ht, zend_string *key);
+ZEND_API zend_bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len);
+ZEND_API zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h);
/* traversing */
#define zend_hash_has_more_elements_ex(ht, pos) \
@@ -178,9 +175,6 @@ typedef struct _HashPointer {
zend_ulong h;
} HashPointer;
-ZEND_API int zend_hash_get_pointer(const HashTable *ht, HashPointer *ptr);
-ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr);
-
#define zend_hash_has_more_elements(ht) \
zend_hash_has_more_elements_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_move_forward(ht) \
@@ -202,11 +196,11 @@ ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr);
/* Copying, merging and sorting */
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor);
-ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, int overwrite ZEND_FILE_LINE_DC);
+ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam);
-ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC);
+ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, zend_bool renumber TSRMLS_DC);
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC);
-ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, int flag TSRMLS_DC);
+ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag TSRMLS_DC);
#define zend_hash_merge(target, source, pCopyConstructor, overwrite) \
_zend_hash_merge(target, source, pCopyConstructor, overwrite ZEND_FILE_LINE_CC)
@@ -235,10 +229,11 @@ END_EXTERN_C()
#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent)
-static inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx)
+ZEND_API int _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx);
+
+static zend_always_inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx)
{
register const char *tmp = key;
- const char *end;
if (*tmp > '9') {
return 0;
@@ -251,48 +246,17 @@ static inline int _zend_handle_numeric_str(const char *key, size_t length, zend_
return 0;
}
}
-
- /* possibly a numeric index */
- end = key + length;
-
- if ((*end != '\0') /* not a null terminated string */
- || (*tmp == '0' && length > 1) /* numbers with leading zeros */
- || (end - tmp > MAX_LENGTH_OF_LONG - 1) /* number too long */
- || (SIZEOF_ZEND_LONG == 4 &&
- end - tmp == MAX_LENGTH_OF_LONG - 1 &&
- *tmp > '2')) { /* overflow */
- return 0;
- }
- *idx = (*tmp - '0');
- while (1) {
- ++tmp;
- if (tmp == end) {
- if (*key == '-') {
- if (*idx-1 > ZEND_LONG_MAX) { /* overflow */
- return 0;
- }
- *idx = 0 - *idx;
- } else if (*idx > ZEND_LONG_MAX) { /* overflow */
- return 0;
- }
- return 1;
- }
- if (*tmp <= '9' && *tmp >= '0') {
- *idx = (*idx * 10) + (*tmp - '0');
- } else {
- return 0;
- }
- }
+ return _zend_handle_numeric_str_ex(key, length, idx);
}
#define ZEND_HANDLE_NUMERIC_STR(key, length, idx) \
_zend_handle_numeric_str(key, length, &idx)
#define ZEND_HANDLE_NUMERIC(key, idx) \
- _zend_handle_numeric_str((key)->val, (key)->len, &idx)
+ ZEND_HANDLE_NUMERIC_STR((key)->val, (key)->len, idx)
-static inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key)
+static zend_always_inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key)
{
zval *zv;
@@ -301,7 +265,7 @@ static inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key)
}
-static inline int zend_hash_exists_ind(const HashTable *ht, zend_string *key)
+static zend_always_inline int zend_hash_exists_ind(const HashTable *ht, zend_string *key)
{
zval *zv;
@@ -311,7 +275,7 @@ static inline int zend_hash_exists_ind(const HashTable *ht, zend_string *key)
}
-static inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, int len)
+static zend_always_inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, int len)
{
zval *zv;
@@ -320,7 +284,7 @@ static inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str,
}
-static inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
+static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
@@ -332,7 +296,7 @@ static inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *
}
-static inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zval *pData)
+static zend_always_inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
@@ -344,7 +308,7 @@ static inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zv
}
-static inline int zend_symtable_del(HashTable *ht, zend_string *key)
+static zend_always_inline int zend_symtable_del(HashTable *ht, zend_string *key)
{
zend_ulong idx;
@@ -356,7 +320,7 @@ static inline int zend_symtable_del(HashTable *ht, zend_string *key)
}
-static inline int zend_symtable_del_ind(HashTable *ht, zend_string *key)
+static zend_always_inline int zend_symtable_del_ind(HashTable *ht, zend_string *key)
{
zend_ulong idx;
@@ -368,7 +332,7 @@ static inline int zend_symtable_del_ind(HashTable *ht, zend_string *key)
}
-static inline zval *zend_symtable_find(const HashTable *ht, zend_string *key)
+static zend_always_inline zval *zend_symtable_find(const HashTable *ht, zend_string *key)
{
zend_ulong idx;
@@ -380,7 +344,7 @@ static inline zval *zend_symtable_find(const HashTable *ht, zend_string *key)
}
-static inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key)
+static zend_always_inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key)
{
zend_ulong idx;
@@ -392,7 +356,7 @@ static inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key
}
-static inline int zend_symtable_exists(HashTable *ht, zend_string *key)
+static zend_always_inline int zend_symtable_exists(HashTable *ht, zend_string *key)
{
zend_ulong idx;
@@ -404,7 +368,7 @@ static inline int zend_symtable_exists(HashTable *ht, zend_string *key)
}
-static inline zval *zend_symtable_str_update(HashTable *ht, const char *str, int len, zval *pData)
+static zend_always_inline zval *zend_symtable_str_update(HashTable *ht, const char *str, int len, zval *pData)
{
zend_ulong idx;
@@ -416,7 +380,7 @@ static inline zval *zend_symtable_str_update(HashTable *ht, const char *str, int
}
-static inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, int len, zval *pData)
+static zend_always_inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, int len, zval *pData)
{
zend_ulong idx;
@@ -428,7 +392,7 @@ static inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str,
}
-static inline int zend_symtable_str_del(HashTable *ht, const char *str, int len)
+static zend_always_inline int zend_symtable_str_del(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
@@ -440,7 +404,7 @@ static inline int zend_symtable_str_del(HashTable *ht, const char *str, int len)
}
-static inline int zend_symtable_str_del_ind(HashTable *ht, const char *str, int len)
+static zend_always_inline int zend_symtable_str_del_ind(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
@@ -452,7 +416,7 @@ static inline int zend_symtable_str_del_ind(HashTable *ht, const char *str, int
}
-static inline zval *zend_symtable_str_find(HashTable *ht, const char *str, int len)
+static zend_always_inline zval *zend_symtable_str_find(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
@@ -464,7 +428,7 @@ static inline zval *zend_symtable_str_find(HashTable *ht, const char *str, int l
}
-static inline int zend_symtable_str_exists(HashTable *ht, const char *str, int len)
+static zend_always_inline int zend_symtable_str_exists(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
@@ -475,7 +439,7 @@ static inline int zend_symtable_str_exists(HashTable *ht, const char *str, int l
}
}
-static inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pData)
+static zend_always_inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pData)
{
zval tmp, *zv;
@@ -484,7 +448,7 @@ static inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pDa
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void *pData)
+static zend_always_inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void *pData)
{
zval tmp, *zv;
@@ -493,7 +457,7 @@ static inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, int len, void *pData)
+static zend_always_inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, int len, void *pData)
{
zval tmp, *zv;
@@ -502,7 +466,7 @@ static inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, int le
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *pData)
+static zend_always_inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *pData)
{
zval tmp, *zv;
@@ -511,7 +475,7 @@ static inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, int len, void *pData)
+static zend_always_inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, int len, void *pData)
{
zval tmp, *zv;
@@ -520,7 +484,7 @@ static inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, int
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pData, size_t size)
+static zend_always_inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pData, size_t size)
{
zval tmp, *zv;
@@ -533,7 +497,7 @@ static inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pDa
return NULL;
}
-static inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, int len, void *pData, size_t size)
+static zend_always_inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, int len, void *pData, size_t size)
{
zval tmp, *zv;
@@ -546,7 +510,7 @@ static inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, int le
return NULL;
}
-static inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *pData, size_t size)
+static zend_always_inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *pData, size_t size)
{
void *p;
@@ -555,7 +519,7 @@ static inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *
return zend_hash_update_ptr(ht, key, p);
}
-static inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, int len, void *pData, size_t size)
+static zend_always_inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, int len, void *pData, size_t size)
{
void *p;
@@ -564,7 +528,7 @@ static inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, int
return zend_hash_str_update_ptr(ht, str, len, p);
}
-static inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData)
+static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData)
{
zval tmp, *zv;
@@ -573,7 +537,7 @@ static inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData)
+static zend_always_inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData)
{
zval tmp, *zv;
@@ -582,7 +546,7 @@ static inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData)
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void *pData, size_t size)
+static zend_always_inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void *pData, size_t size)
{
void *p;
@@ -591,7 +555,7 @@ static inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void
return zend_hash_index_update_ptr(ht, h, p);
}
-static inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, size_t size)
+static zend_always_inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, size_t size)
{
zval tmp, *zv;
@@ -604,7 +568,7 @@ static inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData,
return NULL;
}
-static inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key)
+static zend_always_inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key)
{
zval *zv;
@@ -612,7 +576,7 @@ static inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key)
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, int len)
+static zend_always_inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, int len)
{
zval *zv;
@@ -620,7 +584,7 @@ static inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str,
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h)
+static zend_always_inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h)
{
zval *zv;
@@ -628,7 +592,7 @@ static inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h)
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, int len)
+static zend_always_inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
@@ -639,7 +603,7 @@ static inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, i
}
}
-static inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPosition *pos)
+static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPosition *pos)
{
zval *zv;
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
new file mode 100644
index 0000000000..c6b965714a
--- /dev/null
+++ b/Zend/zend_inheritance.c
@@ -0,0 +1,1581 @@
+/*
+ +----------------------------------------------------------------------+
+ | Zend Engine |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 2.00 of the Zend license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.zend.com/license/2_00.txt. |
+ | If you did not receive a copy of the Zend license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@zend.com so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Andi Gutmans <andi@zend.com> |
+ | Zeev Suraski <zeev@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+#include "zend.h"
+#include "zend_API.h"
+#include "zend_compile.h"
+#include "zend_execute.h"
+
+static void ptr_dtor(zval *zv) /* {{{ */
+{
+ efree(Z_PTR_P(zv));
+}
+/* }}} */
+
+static zend_property_info *zend_duplicate_property_info(zend_property_info *property_info TSRMLS_DC) /* {{{ */
+{
+ zend_property_info* new_property_info;
+
+ new_property_info = zend_arena_alloc(&CG(arena), sizeof(zend_property_info));
+ memcpy(new_property_info, property_info, sizeof(zend_property_info));
+ zend_string_addref(new_property_info->name);
+ if (new_property_info->doc_comment) {
+ zend_string_addref(new_property_info->doc_comment);
+ }
+ return new_property_info;
+}
+/* }}} */
+
+static zend_property_info *zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */
+{
+ zend_property_info* new_property_info = pemalloc(sizeof(zend_property_info), 1);
+ memcpy(new_property_info, property_info, sizeof(zend_property_info));
+ zend_string_addref(new_property_info->name);
+ return new_property_info;
+}
+/* }}} */
+
+static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+{
+ zend_function *function, *new_function;
+
+ if (!ce->parent) {
+ return;
+ }
+
+ /* You cannot change create_object */
+ ce->create_object = ce->parent->create_object;
+
+ /* Inherit special functions if needed */
+ if (!ce->get_iterator) {
+ ce->get_iterator = ce->parent->get_iterator;
+ }
+ if (!ce->iterator_funcs.funcs) {
+ ce->iterator_funcs.funcs = ce->parent->iterator_funcs.funcs;
+ }
+ if (!ce->__get) {
+ ce->__get = ce->parent->__get;
+ }
+ if (!ce->__set) {
+ ce->__set = ce->parent->__set;
+ }
+ if (!ce->__unset) {
+ ce->__unset = ce->parent->__unset;
+ }
+ if (!ce->__isset) {
+ ce->__isset = ce->parent->__isset;
+ }
+ if (!ce->__call) {
+ ce->__call = ce->parent->__call;
+ }
+ if (!ce->__callstatic) {
+ ce->__callstatic = ce->parent->__callstatic;
+ }
+ if (!ce->__tostring) {
+ ce->__tostring = ce->parent->__tostring;
+ }
+ if (!ce->clone) {
+ ce->clone = ce->parent->clone;
+ }
+ if(!ce->serialize) {
+ ce->serialize = ce->parent->serialize;
+ }
+ if(!ce->unserialize) {
+ ce->unserialize = ce->parent->unserialize;
+ }
+ if (!ce->destructor) {
+ ce->destructor = ce->parent->destructor;
+ }
+ if (!ce->__debugInfo) {
+ ce->__debugInfo = ce->parent->__debugInfo;
+ }
+ if (ce->constructor) {
+ if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) {
+ zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()",
+ ce->parent->name->val, ce->parent->constructor->common.function_name->val,
+ ce->name->val, ce->constructor->common.function_name->val
+ );
+ }
+ return;
+ }
+
+ if ((function = zend_hash_str_find_ptr(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1)) != NULL) {
+ /* inherit parent's constructor */
+ if (function->type == ZEND_INTERNAL_FUNCTION) {
+ new_function = pemalloc(sizeof(zend_internal_function), 1);
+ memcpy(new_function, function, sizeof(zend_internal_function));
+ } else {
+ new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
+ memcpy(new_function, function, sizeof(zend_op_array));
+ }
+ zend_hash_str_update_ptr(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1, new_function);
+ function_add_ref(new_function);
+ } else {
+ /* Don't inherit the old style constructor if we already have the new style constructor */
+ zend_string *lc_class_name;
+ zend_string *lc_parent_class_name;
+
+ lc_class_name = zend_string_alloc(ce->name->len, 0);
+ zend_str_tolower_copy(lc_class_name->val, ce->name->val, ce->name->len);
+ if (!zend_hash_exists(&ce->function_table, lc_class_name)) {
+ lc_parent_class_name = zend_string_alloc(ce->parent->name->len, 0);
+ zend_str_tolower_copy(lc_parent_class_name->val, ce->parent->name->val, ce->parent->name->len);
+ if (!zend_hash_exists(&ce->function_table, lc_parent_class_name) &&
+ (function = zend_hash_find_ptr(&ce->parent->function_table, lc_parent_class_name)) != NULL) {
+ if (function->common.fn_flags & ZEND_ACC_CTOR) {
+ /* inherit parent's constructor */
+ new_function = pemalloc(sizeof(zend_function), function->type == ZEND_INTERNAL_FUNCTION);
+ memcpy(new_function, function, sizeof(zend_function));
+ zend_hash_update_ptr(&ce->function_table, lc_parent_class_name, new_function);
+ function_add_ref(new_function);
+ }
+ }
+ zend_string_release(lc_parent_class_name);
+ }
+ zend_string_free(lc_class_name);
+ }
+ ce->constructor = ce->parent->constructor;
+}
+/* }}} */
+
+char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
+{
+ if (fn_flags & ZEND_ACC_PRIVATE) {
+ return "private";
+ }
+ if (fn_flags & ZEND_ACC_PROTECTED) {
+ return "protected";
+ }
+ if (fn_flags & ZEND_ACC_PUBLIC) {
+ return "public";
+ }
+ return "";
+}
+/* }}} */
+
+static zend_function *do_inherit_method(zend_function *old_function TSRMLS_DC) /* {{{ */
+{
+ zend_function *new_function;
+
+ if (old_function->type == ZEND_INTERNAL_FUNCTION) {
+ new_function = pemalloc(sizeof(zend_internal_function), 1);
+ memcpy(new_function, old_function, sizeof(zend_internal_function));
+ } else {
+ new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
+ memcpy(new_function, old_function, sizeof(zend_op_array));
+ }
+ /* The class entry of the derived function intentionally remains the same
+ * as that of the parent class. That allows us to know in which context
+ * we're running, and handle private method calls properly.
+ */
+ function_add_ref(new_function);
+ return new_function;
+}
+/* }}} */
+
+static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */
+{
+ uint32_t i, num_args;
+
+ /* If it's a user function then arg_info == NULL means we don't have any parameters but
+ * we still need to do the arg number checks. We are only willing to ignore this for internal
+ * functions because extensions don't always define arg_info.
+ */
+ if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) {
+ return 1;
+ }
+
+ /* Checks for constructors only if they are declared in an interface,
+ * or explicitly marked as abstract
+ */
+ if ((fe->common.fn_flags & ZEND_ACC_CTOR)
+ && ((proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0
+ && (proto->common.fn_flags & ZEND_ACC_ABSTRACT) == 0)) {
+ return 1;
+ }
+
+ /* If both methods are private do not enforce a signature */
+ if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ return 1;
+ }
+
+ /* check number of arguments */
+ if (proto->common.required_num_args < fe->common.required_num_args
+ || proto->common.num_args > fe->common.num_args) {
+ return 0;
+ }
+
+ /* by-ref constraints on return values are covariant */
+ if ((proto->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
+ && !(fe->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
+ return 0;
+ }
+
+ if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
+ && !(fe->common.fn_flags & ZEND_ACC_VARIADIC)) {
+ return 0;
+ }
+
+ /* For variadic functions any additional (optional) arguments that were added must be
+ * checked against the signature of the variadic argument, so in this case we have to
+ * go through all the parameters of the function and not just those present in the
+ * prototype. */
+ num_args = proto->common.num_args;
+ if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
+ && fe->common.num_args > proto->common.num_args) {
+ num_args = fe->common.num_args;
+ }
+
+ for (i = 0; i < num_args; i++) {
+ zend_arg_info *fe_arg_info = &fe->common.arg_info[i];
+
+ zend_arg_info *proto_arg_info;
+ if (i < proto->common.num_args) {
+ proto_arg_info = &proto->common.arg_info[i];
+ } else {
+ proto_arg_info = &proto->common.arg_info[proto->common.num_args-1];
+ }
+
+ if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) {
+ /* Only one has a type hint and the other one doesn't */
+ return 0;
+ }
+
+ if (fe_arg_info->class_name) {
+ zend_string *fe_class_name, *proto_class_name;
+
+ if (!strcasecmp(fe_arg_info->class_name, "parent") && proto->common.scope) {
+ fe_class_name = zend_string_copy(proto->common.scope->name);
+ } else if (!strcasecmp(fe_arg_info->class_name, "self") && fe->common.scope) {
+ fe_class_name = zend_string_copy(fe->common.scope->name);
+ } else {
+ fe_class_name = zend_string_init(
+ fe_arg_info->class_name,
+ fe_arg_info->class_name_len, 0);
+ }
+
+ if (!strcasecmp(proto_arg_info->class_name, "parent") && proto->common.scope && proto->common.scope->parent) {
+ proto_class_name = zend_string_copy(proto->common.scope->parent->name);
+ } else if (!strcasecmp(proto_arg_info->class_name, "self") && proto->common.scope) {
+ proto_class_name = zend_string_copy(proto->common.scope->name);
+ } else {
+ proto_class_name = zend_string_init(
+ proto_arg_info->class_name,
+ proto_arg_info->class_name_len, 0);
+ }
+
+ if (strcasecmp(fe_class_name->val, proto_class_name->val)!=0) {
+ const char *colon;
+
+ if (fe->common.type != ZEND_USER_FUNCTION) {
+ zend_string_release(proto_class_name);
+ zend_string_release(fe_class_name);
+ return 0;
+ } else if (strchr(proto_class_name->val, '\\') != NULL ||
+ (colon = zend_memrchr(fe_class_name->val, '\\', fe_class_name->len)) == NULL ||
+ strcasecmp(colon+1, proto_class_name->val) != 0) {
+ zend_class_entry *fe_ce, *proto_ce;
+
+ fe_ce = zend_lookup_class(fe_class_name TSRMLS_CC);
+ proto_ce = zend_lookup_class(proto_class_name TSRMLS_CC);
+
+ /* Check for class alias */
+ if (!fe_ce || !proto_ce ||
+ fe_ce->type == ZEND_INTERNAL_CLASS ||
+ proto_ce->type == ZEND_INTERNAL_CLASS ||
+ fe_ce != proto_ce) {
+ zend_string_release(proto_class_name);
+ zend_string_release(fe_class_name);
+ return 0;
+ }
+ }
+ }
+ zend_string_release(proto_class_name);
+ zend_string_release(fe_class_name);
+ }
+ if (fe_arg_info->type_hint != proto_arg_info->type_hint) {
+ /* Incompatible type hint */
+ return 0;
+ }
+
+ /* by-ref constraints on arguments are invariant */
+ if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+/* }}} */
+
+#define REALLOC_BUF_IF_EXCEED(buf, offset, length, size) \
+ if (UNEXPECTED(offset - buf + size >= length)) { \
+ length += size + 1; \
+ buf = erealloc(buf, length); \
+ }
+
+static char *zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{ */
+{
+ char *offset, *buf;
+ uint32_t length = 1024;
+
+ offset = buf = (char *)emalloc(length * sizeof(char));
+ if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
+ *(offset++) = '&';
+ *(offset++) = ' ';
+ }
+
+ if (fptr->common.scope) {
+ memcpy(offset, fptr->common.scope->name->val, fptr->common.scope->name->len);
+ offset += fptr->common.scope->name->len;
+ *(offset++) = ':';
+ *(offset++) = ':';
+ }
+
+ {
+ size_t name_len = fptr->common.function_name->len;
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, name_len);
+ memcpy(offset, fptr->common.function_name->val, name_len);
+ offset += name_len;
+ }
+
+ *(offset++) = '(';
+ if (fptr->common.arg_info) {
+ uint32_t i, required;
+ zend_arg_info *arg_info = fptr->common.arg_info;
+
+ required = fptr->common.required_num_args;
+ for (i = 0; i < fptr->common.num_args;) {
+ if (arg_info->class_name) {
+ const char *class_name;
+ uint32_t class_name_len;
+ if (!strcasecmp(arg_info->class_name, "self") && fptr->common.scope ) {
+ class_name = fptr->common.scope->name->val;
+ class_name_len = fptr->common.scope->name->len;
+ } else if (!strcasecmp(arg_info->class_name, "parent") && fptr->common.scope->parent) {
+ class_name = fptr->common.scope->parent->name->val;
+ class_name_len = fptr->common.scope->parent->name->len;
+ } else {
+ class_name = arg_info->class_name;
+ class_name_len = arg_info->class_name_len;
+ }
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, class_name_len);
+ memcpy(offset, class_name, class_name_len);
+ offset += class_name_len;
+ *(offset++) = ' ';
+ } else if (arg_info->type_hint) {
+ uint32_t type_name_len;
+ char *type_name = zend_get_type_by_const(arg_info->type_hint);
+ type_name_len = strlen(type_name);
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, type_name_len);
+ memcpy(offset, type_name, type_name_len);
+ offset += type_name_len;
+ *(offset++) = ' ';
+ }
+
+ if (arg_info->pass_by_reference) {
+ *(offset++) = '&';
+ }
+
+ if (arg_info->is_variadic) {
+ *(offset++) = '.';
+ *(offset++) = '.';
+ *(offset++) = '.';
+ }
+
+ *(offset++) = '$';
+
+ if (arg_info->name) {
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, arg_info->name_len);
+ memcpy(offset, arg_info->name, arg_info->name_len);
+ offset += arg_info->name_len;
+ } else {
+ uint32_t idx = i;
+ memcpy(offset, "param", 5);
+ offset += 5;
+ do {
+ *(offset++) = (char) (idx % 10) + '0';
+ idx /= 10;
+ } while (idx > 0);
+ }
+ if (i >= required && !arg_info->is_variadic) {
+ *(offset++) = ' ';
+ *(offset++) = '=';
+ *(offset++) = ' ';
+ if (fptr->type == ZEND_USER_FUNCTION) {
+ zend_op *precv = NULL;
+ {
+ uint32_t idx = i;
+ zend_op *op = ((zend_op_array *)fptr)->opcodes;
+ zend_op *end = op + ((zend_op_array *)fptr)->last;
+
+ ++idx;
+ while (op < end) {
+ if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT)
+ && op->op1.num == (zend_ulong)idx)
+ {
+ precv = op;
+ }
+ ++op;
+ }
+ }
+ if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) {
+ zval *zv = precv->op2.zv;
+
+ if (Z_TYPE_P(zv) == IS_CONSTANT) {
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN_P(zv));
+ memcpy(offset, Z_STRVAL_P(zv), Z_STRLEN_P(zv));
+ offset += Z_STRLEN_P(zv);
+ } else if (Z_TYPE_P(zv) == IS_FALSE) {
+ memcpy(offset, "false", 5);
+ offset += 5;
+ } else if (Z_TYPE_P(zv) == IS_TRUE) {
+ memcpy(offset, "true", 4);
+ offset += 4;
+ } else if (Z_TYPE_P(zv) == IS_NULL) {
+ memcpy(offset, "NULL", 4);
+ offset += 4;
+ } else if (Z_TYPE_P(zv) == IS_STRING) {
+ *(offset++) = '\'';
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, MIN(Z_STRLEN_P(zv), 10));
+ memcpy(offset, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 10));
+ offset += MIN(Z_STRLEN_P(zv), 10);
+ if (Z_STRLEN_P(zv) > 10) {
+ *(offset++) = '.';
+ *(offset++) = '.';
+ *(offset++) = '.';
+ }
+ *(offset++) = '\'';
+ } else if (Z_TYPE_P(zv) == IS_ARRAY) {
+ memcpy(offset, "Array", 5);
+ offset += 5;
+ } else if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
+ memcpy(offset, "<expression>", 12);
+ offset += 12;
+ } else {
+ zend_string *str = zval_get_string(zv);
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, str->len);
+ memcpy(offset, str->val, str->len);
+ offset += str->len;
+ zend_string_release(str);
+ }
+ }
+ } else {
+ memcpy(offset, "NULL", 4);
+ offset += 4;
+ }
+ }
+
+ if (++i < fptr->common.num_args) {
+ *(offset++) = ',';
+ *(offset++) = ' ';
+ }
+ arg_info++;
+ REALLOC_BUF_IF_EXCEED(buf, offset, length, 32);
+ }
+ }
+ *(offset++) = ')';
+ *offset = '\0';
+
+ return buf;
+}
+/* }}} */
+
+static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) /* {{{ */
+{
+ uint32_t child_flags;
+ uint32_t parent_flags = parent->common.fn_flags;
+
+ if ((parent->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0
+ && parent->common.fn_flags & ZEND_ACC_ABSTRACT
+ && parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
+ && child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)",
+ parent->common.scope->name->val,
+ child->common.function_name->val,
+ child->common.prototype ? child->common.prototype->common.scope->name->val : child->common.scope->name->val);
+ }
+
+ if (parent_flags & ZEND_ACC_FINAL) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val);
+ }
+
+ child_flags = child->common.fn_flags;
+ /* You cannot change from static to non static and vice versa.
+ */
+ if ((child_flags & ZEND_ACC_STATIC) != (parent_flags & ZEND_ACC_STATIC)) {
+ if (child->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child));
+ } else {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child));
+ }
+ }
+
+ /* Disallow making an inherited method abstract. */
+ if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name->val, ZEND_FN_SCOPE_NAME(child));
+ }
+
+ if (parent_flags & ZEND_ACC_CHANGED) {
+ child->common.fn_flags |= ZEND_ACC_CHANGED;
+ } else {
+ /* Prevent derived classes from restricting access that was available in parent classes
+ */
+ if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
+ } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
+ && ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
+ child->common.fn_flags |= ZEND_ACC_CHANGED;
+ }
+ }
+
+ if (parent_flags & ZEND_ACC_PRIVATE) {
+ child->common.prototype = NULL;
+ } else if (parent_flags & ZEND_ACC_ABSTRACT) {
+ child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
+ child->common.prototype = parent;
+ } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
+ /* ctors only have a prototype if it comes from an interface */
+ child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
+ }
+
+ if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
+ if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
+ }
+ } else if (EG(error_reporting) & E_STRICT || Z_TYPE(EG(user_error_handler)) != IS_UNDEF) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
+ if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
+ char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
+ zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, method_prototype);
+ efree(method_prototype);
+ }
+ }
+}
+/* }}} */
+
+static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_string *key, zend_class_entry *child_ce) /* {{{ */
+{
+ uint32_t parent_flags = parent->common.fn_flags;
+ zend_function *child;
+ TSRMLS_FETCH();
+
+ if ((child = zend_hash_find_ptr(child_function_table, key)) == NULL) {
+ if (parent_flags & (ZEND_ACC_ABSTRACT)) {
+ child_ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
+ }
+ return 1; /* method doesn't exist in child, copy from parent */
+ }
+
+ do_inheritance_check_on_method(child, parent TSRMLS_CC);
+
+ return 0;
+}
+/* }}} */
+
+static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */
+{
+ zend_property_info *child_info;
+ zend_class_entry *parent_ce = ce->parent;
+
+ if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) {
+ if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) {
+ child_info->flags |= ZEND_ACC_CHANGED;
+ } else {
+ if(ce->type & ZEND_INTERNAL_CLASS) {
+ child_info = zend_duplicate_property_info_internal(parent_info);
+ } else {
+ child_info = zend_duplicate_property_info(parent_info TSRMLS_CC);
+ }
+ zend_hash_update_ptr(&ce->properties_info, key, child_info);
+ child_info->flags &= ~ZEND_ACC_PRIVATE; /* it's not private anymore */
+ child_info->flags |= ZEND_ACC_SHADOW; /* but it's a shadow of private */
+ }
+ return 0; /* don't copy access information to child */
+ }
+
+ if ((child_info = zend_hash_find_ptr(&ce->properties_info, key)) != NULL) {
+ if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s",
+ (parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name->val, key->val,
+ (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name->val, key->val);
+
+ }
+
+ if(parent_info->flags & ZEND_ACC_CHANGED) {
+ child_info->flags |= ZEND_ACC_CHANGED;
+ }
+
+ if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name->val, key->val, zend_visibility_string(parent_info->flags), parent_ce->name->val, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
+ } else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
+ zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
+ ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
+ ZVAL_UNDEF(&ce->default_properties_table[child_info->offset]);
+ child_info->offset = parent_info->offset;
+ }
+ return 0; /* Don't copy from parent */
+ } else {
+ return 1; /* Copy from parent */
+ }
+}
+/* }}} */
+
+static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
+{
+ if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce TSRMLS_CC) == FAILURE) {
+ zend_error(E_CORE_ERROR, "Class %s could not implement interface %s", ce->name->val, iface->name->val);
+ }
+ if (ce == iface) {
+ zend_error(E_ERROR, "Interface %s cannot implement itself", ce->name->val);
+ }
+}
+/* }}} */
+
+ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC) /* {{{ */
+{
+ /* expects interface to be contained in ce's interface list already */
+ uint32_t i, ce_num, if_num = iface->num_interfaces;
+ zend_class_entry *entry;
+
+ if (if_num==0) {
+ return;
+ }
+ ce_num = ce->num_interfaces;
+
+ if (ce->type == ZEND_INTERNAL_CLASS) {
+ ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num));
+ } else {
+ ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (ce_num + if_num));
+ }
+
+ /* Inherit the interfaces, only if they're not already inherited by the class */
+ while (if_num--) {
+ entry = iface->interfaces[if_num];
+ for (i = 0; i < ce_num; i++) {
+ if (ce->interfaces[i] == entry) {
+ break;
+ }
+ }
+ if (i == ce_num) {
+ ce->interfaces[ce->num_interfaces++] = entry;
+ }
+ }
+
+ /* and now call the implementing handlers */
+ while (ce_num < ce->num_interfaces) {
+ do_implement_interface(ce, ce->interfaces[ce_num++] TSRMLS_CC);
+ }
+}
+/* }}} */
+
+#ifdef ZTS
+# define zval_property_ctor(parent_ce, ce) \
+ (((parent_ce)->type != (ce)->type) ? ZVAL_COPY_CTOR : zval_add_ref)
+#else
+# define zval_property_ctor(parent_ce, ce) \
+ zval_add_ref
+#endif
+
+static void do_inherit_class_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */
+{
+ if (!Z_ISREF_P(zv)) {
+ if (parent_ce->type == ZEND_INTERNAL_CLASS) {
+ ZVAL_NEW_PERSISTENT_REF(zv, zv);
+ } else {
+ ZVAL_NEW_REF(zv, zv);
+ }
+ }
+ if (Z_CONSTANT_P(Z_REFVAL_P(zv))) {
+ ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
+ }
+ if (zend_hash_add(&ce->constants_table, name, zv)) {
+ Z_ADDREF_P(zv);
+ }
+}
+/* }}} */
+
+ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */
+{
+ zend_property_info *property_info;
+ zend_function *func;
+ zend_string *key;
+ zval *zv;
+
+ if ((ce->ce_flags & ZEND_ACC_INTERFACE)
+ && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name->val, parent_ce->name->val);
+ }
+ if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name->val, parent_ce->name->val);
+ }
+
+ ce->parent = parent_ce;
+ /* Copy serialize/unserialize callbacks */
+ if (!ce->serialize) {
+ ce->serialize = parent_ce->serialize;
+ }
+ if (!ce->unserialize) {
+ ce->unserialize = parent_ce->unserialize;
+ }
+
+ /* Inherit interfaces */
+ zend_do_inherit_interfaces(ce, parent_ce TSRMLS_CC);
+
+ /* Inherit properties */
+ if (parent_ce->default_properties_count) {
+ int i = ce->default_properties_count + parent_ce->default_properties_count;
+
+ ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS);
+ if (ce->default_properties_count) {
+ while (i-- > parent_ce->default_properties_count) {
+ ce->default_properties_table[i] = ce->default_properties_table[i - parent_ce->default_properties_count];
+ }
+ }
+ for (i = 0; i < parent_ce->default_properties_count; i++) {
+#ifdef ZTS
+ if (parent_ce->type != ce->type) {
+ ZVAL_DUP(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
+ if (Z_OPT_CONSTANT(ce->default_properties_table[i])) {
+ ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
+ }
+ continue;
+ }
+#endif
+
+ ZVAL_COPY(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
+ if (Z_OPT_CONSTANT(ce->default_properties_table[i])) {
+ ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
+ }
+ }
+ ce->default_properties_count += parent_ce->default_properties_count;
+ }
+
+ if (parent_ce->type != ce->type) {
+ /* User class extends internal class */
+ zend_update_class_constants(parent_ce TSRMLS_CC);
+ if (parent_ce->default_static_members_count) {
+ int i = ce->default_static_members_count + parent_ce->default_static_members_count;
+
+ ce->default_static_members_table = erealloc(ce->default_static_members_table, sizeof(zval) * i);
+ if (ce->default_static_members_count) {
+ while (i-- > parent_ce->default_static_members_count) {
+ ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count];
+ }
+ }
+ for (i = 0; i < parent_ce->default_static_members_count; i++) {
+ ZVAL_MAKE_REF(&CE_STATIC_MEMBERS(parent_ce)[i]);
+ ce->default_static_members_table[i] = CE_STATIC_MEMBERS(parent_ce)[i];
+ Z_ADDREF(ce->default_static_members_table[i]);
+ if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) {
+ ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
+ }
+ }
+ ce->default_static_members_count += parent_ce->default_static_members_count;
+ ce->static_members_table = ce->default_static_members_table;
+ }
+ } else {
+ if (parent_ce->default_static_members_count) {
+ int i = ce->default_static_members_count + parent_ce->default_static_members_count;
+
+ ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval) * i, ce->type == ZEND_INTERNAL_CLASS);
+ if (ce->default_static_members_count) {
+ while (i-- > parent_ce->default_static_members_count) {
+ ce->default_static_members_table[i] = ce->default_static_members_table[i - parent_ce->default_static_members_count];
+ }
+ }
+ for (i = 0; i < parent_ce->default_static_members_count; i++) {
+ ZVAL_MAKE_REF(&parent_ce->default_static_members_table[i]);
+ ce->default_static_members_table[i] = parent_ce->default_static_members_table[i];
+ Z_ADDREF(ce->default_static_members_table[i]);
+ if (Z_CONSTANT_P(Z_REFVAL(ce->default_static_members_table[i]))) {
+ ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
+ }
+ }
+ ce->default_static_members_count += parent_ce->default_static_members_count;
+ if (ce->type == ZEND_USER_CLASS) {
+ ce->static_members_table = ce->default_static_members_table;
+ }
+ }
+ }
+
+ ZEND_HASH_FOREACH_PTR(&ce->properties_info, property_info) {
+ if (property_info->ce == ce) {
+ if (property_info->flags & ZEND_ACC_STATIC) {
+ property_info->offset += parent_ce->default_static_members_count;
+ } else {
+ property_info->offset += parent_ce->default_properties_count;
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+
+ ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) {
+ if (do_inherit_property_access_check(&ce->properties_info, property_info, key, ce TSRMLS_CC)) {
+ if (ce->type & ZEND_INTERNAL_CLASS) {
+ property_info = zend_duplicate_property_info_internal(property_info);
+ } else {
+ property_info = zend_duplicate_property_info(property_info TSRMLS_CC);
+ }
+ zend_hash_add_new_ptr(&ce->properties_info, key, property_info);
+ }
+ } ZEND_HASH_FOREACH_END();
+
+ ZEND_HASH_FOREACH_STR_KEY_VAL(&parent_ce->constants_table, key, zv) {
+ do_inherit_class_constant(key, zv, ce, parent_ce TSRMLS_CC);
+ } ZEND_HASH_FOREACH_END();
+
+ ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) {
+ if (do_inherit_method_check(&ce->function_table, func, key, ce)) {
+ zend_function *new_func = do_inherit_method(func TSRMLS_CC);
+ zend_hash_add_new_ptr(&ce->function_table, key, new_func);
+ }
+ } ZEND_HASH_FOREACH_END();
+
+ do_inherit_parent_constructor(ce TSRMLS_CC);
+
+ if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
+ ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
+ } else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
+ /* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */
+ zend_verify_abstract_class(ce TSRMLS_CC);
+ }
+ ce->ce_flags |= parent_ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS;
+}
+/* }}} */
+
+static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */
+{
+ zval *old_constant;
+
+ if ((old_constant = zend_hash_find(child_constants_table, name)) != NULL) {
+ if (!Z_ISREF_P(old_constant) ||
+ !Z_ISREF_P(parent_constant) ||
+ Z_REFVAL_P(old_constant) != Z_REFVAL_P(parent_constant)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", name->val, iface->name->val);
+ }
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
+{
+ if (do_inherit_constant_check(&ce->constants_table, zv, name, iface)) {
+ ZVAL_MAKE_REF(zv);
+ Z_ADDREF_P(zv);
+ if (Z_CONSTANT_P(Z_REFVAL_P(zv))) {
+ ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
+ }
+ zend_hash_update(&ce->constants_table, name, zv);
+ }
+}
+/* }}} */
+
+ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
+{
+ uint32_t i, ignore = 0;
+ uint32_t current_iface_num = ce->num_interfaces;
+ uint32_t parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0;
+ zend_function *func;
+ zend_string *key;
+ zval *zv;
+
+ for (i = 0; i < ce->num_interfaces; i++) {
+ if (ce->interfaces[i] == NULL) {
+ memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i));
+ i--;
+ } else if (ce->interfaces[i] == iface) {
+ if (i < parent_iface_num) {
+ ignore = 1;
+ } else {
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name->val, iface->name->val);
+ }
+ }
+ }
+ if (ignore) {
+ /* Check for attempt to redeclare interface constants */
+ ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, zv) {
+ do_inherit_constant_check(&iface->constants_table, zv, key, iface);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ if (ce->num_interfaces >= current_iface_num) {
+ if (ce->type == ZEND_INTERNAL_CLASS) {
+ ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
+ } else {
+ ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
+ }
+ }
+ ce->interfaces[ce->num_interfaces++] = iface;
+
+ ZEND_HASH_FOREACH_STR_KEY_VAL(&iface->constants_table, key, zv) {
+ do_inherit_iface_constant(key, zv, ce, iface TSRMLS_CC);
+ } ZEND_HASH_FOREACH_END();
+
+ ZEND_HASH_FOREACH_STR_KEY_PTR(&iface->function_table, key, func) {
+ if (do_inherit_method_check(&ce->function_table, func, key, ce)) {
+ zend_function *new_func = do_inherit_method(func TSRMLS_CC);
+ zend_hash_add_new_ptr(&ce->function_table, key, new_func);
+ }
+ } ZEND_HASH_FOREACH_END();
+
+ do_implement_interface(ce, iface TSRMLS_CC);
+ zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
+ }
+}
+/* }}} */
+
+ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
+{
+ uint32_t i, ignore = 0;
+ uint32_t current_trait_num = ce->num_traits;
+ uint32_t parent_trait_num = ce->parent ? ce->parent->num_traits : 0;
+
+ for (i = 0; i < ce->num_traits; i++) {
+ if (ce->traits[i] == NULL) {
+ memmove(ce->traits + i, ce->traits + i + 1, sizeof(zend_class_entry*) * (--ce->num_traits - i));
+ i--;
+ } else if (ce->traits[i] == trait) {
+ if (i < parent_trait_num) {
+ ignore = 1;
+ }
+ }
+ }
+ if (!ignore) {
+ if (ce->num_traits >= current_trait_num) {
+ if (ce->type == ZEND_INTERNAL_CLASS) {
+ ce->traits = (zend_class_entry **) realloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num));
+ } else {
+ ce->traits = (zend_class_entry **) erealloc(ce->traits, sizeof(zend_class_entry *) * (++current_trait_num));
+ }
+ }
+ ce->traits[ce->num_traits++] = trait;
+ }
+}
+/* }}} */
+
+static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn TSRMLS_DC) /* {{{ */
+{
+ uint32_t fn_flags = fn->common.scope->ce_flags;
+ uint32_t other_flags = other_fn->common.scope->ce_flags;
+
+ return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
+ && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
+ && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
+ (other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
+}
+/* }}} */
+
+static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe TSRMLS_DC) /* {{{ */
+{
+ if (!strncmp(mname->val, ZEND_CLONE_FUNC_NAME, mname->len)) {
+ ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE;
+ } else if (!strncmp(mname->val, ZEND_CONSTRUCTOR_FUNC_NAME, mname->len)) {
+ if (ce->constructor) {
+ zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val);
+ }
+ ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR;
+ } else if (!strncmp(mname->val, ZEND_DESTRUCTOR_FUNC_NAME, mname->len)) {
+ ce->destructor = fe; fe->common.fn_flags |= ZEND_ACC_DTOR;
+ } else if (!strncmp(mname->val, ZEND_GET_FUNC_NAME, mname->len)) {
+ ce->__get = fe;
+ } else if (!strncmp(mname->val, ZEND_SET_FUNC_NAME, mname->len)) {
+ ce->__set = fe;
+ } else if (!strncmp(mname->val, ZEND_CALL_FUNC_NAME, mname->len)) {
+ ce->__call = fe;
+ } else if (!strncmp(mname->val, ZEND_UNSET_FUNC_NAME, mname->len)) {
+ ce->__unset = fe;
+ } else if (!strncmp(mname->val, ZEND_ISSET_FUNC_NAME, mname->len)) {
+ ce->__isset = fe;
+ } else if (!strncmp(mname->val, ZEND_CALLSTATIC_FUNC_NAME, mname->len)) {
+ ce->__callstatic = fe;
+ } else if (!strncmp(mname->val, ZEND_TOSTRING_FUNC_NAME, mname->len)) {
+ ce->__tostring = fe;
+ } else if (!strncmp(mname->val, ZEND_DEBUGINFO_FUNC_NAME, mname->len)) {
+ ce->__debugInfo = fe;
+ } else if (ce->name->len == mname->len) {
+ zend_string *lowercase_name = zend_string_alloc(ce->name->len, 0);
+ zend_str_tolower_copy(lowercase_name->val, ce->name->val, ce->name->len);
+ lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
+ if (!memcmp(mname->val, lowercase_name->val, mname->len)) {
+ if (ce->constructor) {
+ zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val);
+ }
+ ce->constructor = fe;
+ fe->common.fn_flags |= ZEND_ACC_CTOR;
+ }
+ zend_string_release(lowercase_name);
+ }
+}
+/* }}} */
+
+static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_string *key, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */
+{
+ zend_function *existing_fn = NULL;
+ zend_function *new_fn;
+
+ if ((existing_fn = zend_hash_find_ptr(&ce->function_table, key)) != NULL) {
+ if (existing_fn->common.scope == ce) {
+ /* members from the current class override trait methods */
+ /* use temporary *overriden HashTable to detect hidden conflict */
+ if (*overriden) {
+ if ((existing_fn = zend_hash_find_ptr(*overriden, key)) != NULL) {
+ if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+ /* Make sure the trait method is compatible with previosly declared abstract method */
+ if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_get_function_declaration(fn TSRMLS_CC),
+ zend_get_function_declaration(existing_fn TSRMLS_CC));
+ }
+ } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+ /* Make sure the abstract declaration is compatible with previous declaration */
+ if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_get_function_declaration(fn TSRMLS_CC),
+ zend_get_function_declaration(existing_fn TSRMLS_CC));
+ }
+ return;
+ }
+ }
+ } else {
+ ALLOC_HASHTABLE(*overriden);
+ zend_hash_init_ex(*overriden, 8, NULL, ptr_dtor, 0, 0);
+ }
+ zend_hash_update_mem(*overriden, key, fn, sizeof(zend_function));
+ return;
+ } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+ /* Make sure the trait method is compatible with previosly declared abstract method */
+ if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_get_function_declaration(fn TSRMLS_CC),
+ zend_get_function_declaration(existing_fn TSRMLS_CC));
+ }
+ } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+ /* Make sure the abstract declaration is compatible with previous declaration */
+ if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_get_function_declaration(fn TSRMLS_CC),
+ zend_get_function_declaration(existing_fn TSRMLS_CC));
+ }
+ return;
+ } else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
+ /* two traits can't define the same non-abstract method */
+#if 1
+ zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s",
+ name, ce->name->val);
+#else /* TODO: better error message */
+ zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s",
+ fn->common.scope->name->val, fn->common.function_name->val,
+ ce->name->val, name,
+ existing_fn->common.scope->name->val, existing_fn->common.function_name->val);
+#endif
+ } else {
+ /* inherited members are overridden by members inserted by traits */
+ /* check whether the trait method fulfills the inheritance requirements */
+ do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
+ }
+ }
+
+ function_add_ref(fn);
+ new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
+ memcpy(new_fn, fn, sizeof(zend_op_array));
+ fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
+ zend_add_magic_methods(ce, key, fn TSRMLS_CC);
+}
+/* }}} */
+
+static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /* {{{ */
+{
+ if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
+
+ fn->common.scope = ce;
+
+ if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+ ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
+ }
+ if (fn->op_array.static_variables) {
+ ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
+ }
+ }
+}
+/* }}} */
+
+static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, zend_class_entry *ce, HashTable **overriden, HashTable *exclude_table TSRMLS_DC) /* {{{ */
+{
+ zend_trait_alias *alias, **alias_ptr;
+ zend_string *lcname;
+ zend_function fn_copy;
+
+ /* apply aliases which are qualified with a class name, there should not be any ambiguity */
+ if (ce->trait_aliases) {
+ alias_ptr = ce->trait_aliases;
+ alias = *alias_ptr;
+ while (alias) {
+ /* Scope unset or equal to the function we compare to, and the alias applies to fn */
+ if (alias->alias != NULL
+ && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
+ && alias->trait_method->method_name->len == fnname->len
+ && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) {
+ fn_copy = *fn;
+
+ /* if it is 0, no modifieres has been changed */
+ if (alias->modifiers) {
+ fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
+ }
+
+ lcname = zend_string_alloc(alias->alias->len, 0);
+ zend_str_tolower_copy(lcname->val, alias->alias->val, alias->alias->len);
+ zend_add_trait_method(ce, alias->alias->val, lcname, &fn_copy, overriden TSRMLS_CC);
+ zend_string_release(lcname);
+
+ /* Record the trait from which this alias was resolved. */
+ if (!alias->trait_method->ce) {
+ alias->trait_method->ce = fn->common.scope;
+ }
+ }
+ alias_ptr++;
+ alias = *alias_ptr;
+ }
+ }
+
+ if (exclude_table == NULL || zend_hash_find(exclude_table, fnname) == NULL) {
+ /* is not in hashtable, thus, function is not to be excluded */
+ fn_copy = *fn;
+
+ /* apply aliases which have not alias name, just setting visibility */
+ if (ce->trait_aliases) {
+ alias_ptr = ce->trait_aliases;
+ alias = *alias_ptr;
+ while (alias) {
+ /* Scope unset or equal to the function we compare to, and the alias applies to fn */
+ if (alias->alias == NULL && alias->modifiers != 0
+ && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
+ && (alias->trait_method->method_name->len == fnname->len)
+ && (zend_binary_strcasecmp(alias->trait_method->method_name->val, alias->trait_method->method_name->len, fnname->val, fnname->len) == 0)) {
+
+ fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
+
+ /** Record the trait from which this alias was resolved. */
+ if (!alias->trait_method->ce) {
+ alias->trait_method->ce = fn->common.scope;
+ }
+ }
+ alias_ptr++;
+ alias = *alias_ptr;
+ }
+ }
+
+ zend_add_trait_method(ce, fn->common.function_name->val, fnname, &fn_copy, overriden TSRMLS_CC);
+ }
+
+ return ZEND_HASH_APPLY_KEEP;
+}
+/* }}} */
+
+static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
+{
+ uint32_t i;
+
+ if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name->val);
+ }
+
+ for (i = 0; i < ce->num_traits; i++) {
+ if (ce->traits[i] == trait) {
+ return;
+ }
+ }
+ zend_error_noreturn(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name->val, ce->name->val);
+}
+/* }}} */
+
+static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+{
+ size_t i, j = 0;
+ zend_trait_precedence *cur_precedence;
+ zend_trait_method_reference *cur_method_ref;
+ zend_string *lcname;
+ zend_bool method_exists;
+
+ /* resolve class references */
+ if (ce->trait_precedences) {
+ i = 0;
+ while ((cur_precedence = ce->trait_precedences[i])) {
+ /** Resolve classes for all precedence operations. */
+ if (cur_precedence->exclude_from_classes) {
+ cur_method_ref = cur_precedence->trait_method;
+ if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name,
+ ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val);
+ }
+ zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC);
+
+ /** Ensure that the prefered method is actually available. */
+ lcname = zend_string_alloc(cur_method_ref->method_name->len, 0);
+ zend_str_tolower_copy(lcname->val,
+ cur_method_ref->method_name->val,
+ cur_method_ref->method_name->len);
+ method_exists = zend_hash_exists(&cur_method_ref->ce->function_table,
+ lcname);
+ zend_string_free(lcname);
+ if (!method_exists) {
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "A precedence rule was defined for %s::%s but this method does not exist",
+ cur_method_ref->ce->name->val,
+ cur_method_ref->method_name->val);
+ }
+
+ /** With the other traits, we are more permissive.
+ We do not give errors for those. This allows to be more
+ defensive in such definitions.
+ However, we want to make sure that the insteadof declaration
+ is consistent in itself.
+ */
+ j = 0;
+ while (cur_precedence->exclude_from_classes[j].class_name) {
+ zend_string* class_name = cur_precedence->exclude_from_classes[j].class_name;
+
+ if (!(cur_precedence->exclude_from_classes[j].ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name->val);
+ }
+ zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j].ce TSRMLS_CC);
+
+ /* make sure that the trait method is not from a class mentioned in
+ exclude_from_classes, for consistency */
+ if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i].ce) {
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "Inconsistent insteadof definition. "
+ "The method %s is to be used from %s, but %s is also on the exclude list",
+ cur_method_ref->method_name->val,
+ cur_precedence->trait_method->ce->name->val,
+ cur_precedence->trait_method->ce->name->val);
+ }
+
+ zend_string_release(class_name);
+ j++;
+ }
+ }
+ i++;
+ }
+ }
+
+ if (ce->trait_aliases) {
+ i = 0;
+ while (ce->trait_aliases[i]) {
+ /** For all aliases with an explicit class name, resolve the class now. */
+ if (ce->trait_aliases[i]->trait_method->class_name) {
+ cur_method_ref = ce->trait_aliases[i]->trait_method;
+ if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val);
+ }
+ zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC);
+
+ /** And, ensure that the referenced method is resolvable, too. */
+ lcname = zend_string_alloc(cur_method_ref->method_name->len, 0);
+ zend_str_tolower_copy(lcname->val,
+ cur_method_ref->method_name->val,
+ cur_method_ref->method_name->len);
+ method_exists = zend_hash_exists(&cur_method_ref->ce->function_table,
+ lcname);
+ zend_string_free(lcname);
+
+ if (!method_exists) {
+ zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name->val, cur_method_ref->method_name->val);
+ }
+ }
+ i++;
+ }
+ }
+}
+/* }}} */
+
+static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_trait_precedence **precedences, zend_class_entry *trait) /* {{{ */
+{
+ size_t i = 0, j;
+
+ if (!precedences) {
+ return;
+ }
+ while (precedences[i]) {
+ if (precedences[i]->exclude_from_classes) {
+ j = 0;
+ while (precedences[i]->exclude_from_classes[j].ce) {
+ if (precedences[i]->exclude_from_classes[j].ce == trait) {
+ zend_string *lcname = zend_string_alloc(precedences[i]->trait_method->method_name->len, 0);
+
+ zend_str_tolower_copy(lcname->val,
+ precedences[i]->trait_method->method_name->val,
+ precedences[i]->trait_method->method_name->len);
+ if (zend_hash_add_empty_element(exclude_table, lcname) == NULL) {
+ zend_string_release(lcname);
+ zend_error_noreturn(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name->val, trait->name->val);
+ }
+ zend_string_release(lcname);
+ }
+ ++j;
+ }
+ }
+ ++i;
+ }
+}
+/* }}} */
+
+static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+{
+ uint32_t i;
+ HashTable *overriden = NULL;
+ zend_string *key;
+ zend_function *fn;
+
+ for (i = 0; i < ce->num_traits; i++) {
+ if (ce->trait_precedences) {
+ HashTable exclude_table;
+
+ /* TODO: revisit this start size, may be its not optimal */
+ zend_hash_init_ex(&exclude_table, 8, NULL, NULL, 0, 0);
+
+ zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]);
+
+ /* copies functions, applies defined aliasing, and excludes unused trait methods */
+ ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) {
+ zend_traits_copy_functions(key, fn, ce, &overriden, &exclude_table TSRMLS_CC);
+ } ZEND_HASH_FOREACH_END();
+
+ zend_hash_destroy(&exclude_table);
+ } else {
+ ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) {
+ zend_traits_copy_functions(key, fn, ce, &overriden, NULL TSRMLS_CC);
+ } ZEND_HASH_FOREACH_END();
+ }
+ }
+
+ ZEND_HASH_FOREACH_PTR(&ce->function_table, fn) {
+ zend_fixup_trait_method(fn, ce);
+ } ZEND_HASH_FOREACH_END();
+
+ if (overriden) {
+ zend_hash_destroy(overriden);
+ FREE_HASHTABLE(overriden);
+ }
+}
+/* }}} */
+
+static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, zend_string *prop_name, zend_class_entry *coliding_ce) /* {{{ */
+{
+ size_t i;
+
+ if (coliding_ce == ce) {
+ for (i = 0; i < current_trait; i++) {
+ if (zend_hash_exists(&ce->traits[i]->properties_info, prop_name)) {
+ return ce->traits[i];
+ }
+ }
+ }
+
+ return coliding_ce;
+}
+/* }}} */
+
+static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+{
+ size_t i;
+ zend_property_info *property_info;
+ zend_property_info *coliding_prop;
+ zval compare_result;
+ zend_string* prop_name;
+ const char* class_name_unused;
+ zend_bool not_compatible;
+ zval* prop_value;
+ uint32_t flags;
+ zend_string *doc_comment;
+
+ /* In the following steps the properties are inserted into the property table
+ * for that, a very strict approach is applied:
+ * - check for compatibility, if not compatible with any property in class -> fatal
+ * - if compatible, then strict notice
+ */
+ for (i = 0; i < ce->num_traits; i++) {
+ ZEND_HASH_FOREACH_PTR(&ce->traits[i]->properties_info, property_info) {
+ /* first get the unmangeld name if necessary,
+ * then check whether the property is already there
+ */
+ flags = property_info->flags;
+ if ((flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) {
+ prop_name = zend_string_copy(property_info->name);
+ } else {
+ const char *pname;
+ size_t pname_len;
+
+ /* for private and protected we need to unmangle the names */
+ zend_unmangle_property_name_ex(property_info->name,
+ &class_name_unused, &pname, &pname_len);
+ prop_name = zend_string_init(pname, pname_len, 0);
+ }
+
+ /* next: check for conflicts with current class */
+ if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
+ if (coliding_prop->flags & ZEND_ACC_SHADOW) {
+ zend_hash_del(&ce->properties_info, prop_name);
+ flags |= ZEND_ACC_CHANGED;
+ } else {
+ if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
+ == (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
+ /* flags are identical, now the value needs to be checked */
+ if (flags & ZEND_ACC_STATIC) {
+ not_compatible = (FAILURE == compare_function(&compare_result,
+ &ce->default_static_members_table[coliding_prop->offset],
+ &ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
+ || (Z_LVAL(compare_result) != 0);
+ } else {
+ not_compatible = (FAILURE == compare_function(&compare_result,
+ &ce->default_properties_table[coliding_prop->offset],
+ &ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
+ || (Z_LVAL(compare_result) != 0);
+ }
+ } else {
+ /* the flags are not identical, thus, we assume properties are not compatible */
+ not_compatible = 1;
+ }
+
+ if (not_compatible) {
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
+ find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val,
+ property_info->ce->name->val,
+ prop_name->val,
+ ce->name->val);
+ } else {
+ zend_error(E_STRICT,
+ "%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed",
+ find_first_definition(ce, i, prop_name, coliding_prop->ce)->name->val,
+ property_info->ce->name->val,
+ prop_name->val,
+ ce->name->val);
+ zend_string_release(prop_name);
+ continue;
+ }
+ }
+ }
+
+ /* property not found, so lets add it */
+ if (flags & ZEND_ACC_STATIC) {
+ prop_value = &ce->traits[i]->default_static_members_table[property_info->offset];
+ } else {
+ prop_value = &ce->traits[i]->default_properties_table[property_info->offset];
+ }
+ if (Z_REFCOUNTED_P(prop_value)) Z_ADDREF_P(prop_value);
+
+ doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL;
+ zend_declare_property_ex(ce, prop_name,
+ prop_value, flags,
+ doc_comment TSRMLS_CC);
+ zend_string_release(prop_name);
+ } ZEND_HASH_FOREACH_END();
+ }
+}
+/* }}} */
+
+static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+{
+ int i = 0;
+ zend_trait_alias* cur_alias;
+ zend_string* lc_method_name;
+
+ if (ce->trait_aliases) {
+ while (ce->trait_aliases[i]) {
+ cur_alias = ce->trait_aliases[i];
+ /** The trait for this alias has not been resolved, this means, this
+ alias was not applied. Abort with an error. */
+ if (!cur_alias->trait_method->ce) {
+ if (cur_alias->alias) {
+ /** Plain old inconsistency/typo/bug */
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "An alias (%s) was defined for method %s(), but this method does not exist",
+ cur_alias->alias->val,
+ cur_alias->trait_method->method_name->val);
+ } else {
+ /** Here are two possible cases:
+ 1) this is an attempt to modifiy the visibility
+ of a method introduce as part of another alias.
+ Since that seems to violate the DRY principle,
+ we check against it and abort.
+ 2) it is just a plain old inconsitency/typo/bug
+ as in the case where alias is set. */
+
+ lc_method_name = zend_string_alloc(cur_alias->trait_method->method_name->len, 0);
+ zend_str_tolower_copy(
+ lc_method_name->val,
+ cur_alias->trait_method->method_name->val,
+ cur_alias->trait_method->method_name->len);
+ if (zend_hash_exists(&ce->function_table,
+ lc_method_name)) {
+ zend_string_free(lc_method_name);
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "The modifiers for the trait alias %s() need to be changed in the same statment in which the alias is defined. Error",
+ cur_alias->trait_method->method_name->val);
+ } else {
+ zend_string_free(lc_method_name);
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "The modifiers of the trait method %s() are changed, but this method does not exist. Error",
+ cur_alias->trait_method->method_name->val);
+
+ }
+ }
+ }
+ i++;
+ }
+ }
+}
+/* }}} */
+
+ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+{
+
+ if (ce->num_traits <= 0) {
+ return;
+ }
+
+ /* complete initialization of trait strutures in ce */
+ zend_traits_init_trait_structures(ce TSRMLS_CC);
+
+ /* first care about all methods to be flattened into the class */
+ zend_do_traits_method_binding(ce TSRMLS_CC);
+
+ /* Aliases which have not been applied indicate typos/bugs. */
+ zend_do_check_for_inconsistent_traits_aliasing(ce TSRMLS_CC);
+
+ /* then flatten the properties into it, to, mostly to notfiy developer about problems */
+ zend_do_traits_property_binding(ce TSRMLS_CC);
+
+ /* verify that all abstract methods from traits have been implemented */
+ zend_verify_abstract_class(ce TSRMLS_CC);
+
+ /* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */
+ if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) {
+ ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
+ }
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/Zend/zend_inheritance.h b/Zend/zend_inheritance.h
new file mode 100644
index 0000000000..647b492371
--- /dev/null
+++ b/Zend/zend_inheritance.h
@@ -0,0 +1,46 @@
+/*
+ +----------------------------------------------------------------------+
+ | Zend Engine |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 2.00 of the Zend license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.zend.com/license/2_00.txt. |
+ | If you did not receive a copy of the Zend license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@zend.com so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Andi Gutmans <andi@zend.com> |
+ | Zeev Suraski <zeev@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+#ifndef ZEND_INHERITANCE_H
+#define ZEND_INHERITANCE_H
+
+#include "zend.h"
+
+BEGIN_EXTERN_C()
+
+ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC);
+ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC);
+
+ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC);
+ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC);
+
+ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC);
+void zend_do_early_binding(TSRMLS_D);
+
+END_EXTERN_C()
+
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index 59c2776a85..e60e58d2aa 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -56,7 +56,7 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS
/* even if on_modify bails out, we have to continue on with restoring,
since there can be allocated variables that would be freed on MM shutdown
and would lead to memory corruption later ini entry is modified again */
- result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
+ result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
} zend_end_try();
}
if (stage == ZEND_INI_STAGE_RUNTIME && result == FAILURE) {
@@ -64,14 +64,12 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS
return 1;
}
if (ini_entry->value != ini_entry->orig_value) {
- efree(ini_entry->value);
+ zend_string_release(ini_entry->value);
}
ini_entry->value = ini_entry->orig_value;
- ini_entry->value_length = ini_entry->orig_value_length;
ini_entry->modifiable = ini_entry->orig_modifiable;
ini_entry->modified = 0;
ini_entry->orig_value = NULL;
- ini_entry->orig_value_length = 0;
ini_entry->orig_modifiable = 0;
}
return 0;
@@ -86,9 +84,18 @@ static int zend_restore_ini_entry_wrapper(zval *el TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _free_ptr(zval *zv) /* {{{ */
+static void free_ini_entry(zval *zv) /* {{{ */
{
- free(Z_PTR_P(zv));
+ zend_ini_entry *entry = (zend_ini_entry*)Z_PTR_P(zv);
+
+ zend_string_release(entry->name);
+ if (entry->value) {
+ zend_string_release(entry->value);
+ }
+ if (entry->orig_value) {
+ zend_string_release(entry->orig_value);
+ }
+ free(entry);
}
/* }}} */
@@ -102,7 +109,7 @@ ZEND_API int zend_ini_startup(TSRMLS_D) /* {{{ */
EG(ini_directives) = registered_zend_ini_directives;
EG(modified_ini_directives) = NULL;
EG(error_reporting_ini_entry) = NULL;
- zend_hash_init_ex(registered_zend_ini_directives, 128, NULL, _free_ptr, 1, 0);
+ zend_hash_init_ex(registered_zend_ini_directives, 128, NULL, free_ini_entry, 1, 0);
return SUCCESS;
}
/* }}} */
@@ -136,13 +143,32 @@ ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */
/* }}} */
#ifdef ZTS
+static void copy_ini_entry(zval *zv) /* {{{ */
+{
+ zend_ini_entry *old_entry = (zend_ini_entry*)Z_PTR_P(zv);
+ zend_ini_entry *new_entry = pemalloc(sizeof(zend_ini_entry), 1);
+
+ Z_PTR_P(zv) = new_entry;
+ memcpy(new_entry, old_entry, sizeof(zend_ini_entry));
+ if (old_entry->name) {
+ new_entry->name = zend_string_init(old_entry->name->val, old_entry->name->len, 1);
+ }
+ if (old_entry->value) {
+ new_entry->value = zend_string_init(old_entry->value->val, old_entry->value->len, 1);
+ }
+ if (old_entry->orig_value) {
+ new_entry->orig_value = zend_string_init(old_entry->orig_value->val, old_entry->orig_value->len, 1);
+ }
+}
+/* }}} */
+
ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */
{
EG(modified_ini_directives) = NULL;
EG(error_reporting_ini_entry) = NULL;
EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable));
- zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0);
- zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL);
+ zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, free_ini_entry, 1, 0);
+ zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, copy_ini_entry);
return SUCCESS;
}
/* }}} */
@@ -177,13 +203,11 @@ ZEND_API void zend_ini_sort_entries(TSRMLS_D) /* {{{ */
/*
* Registration / unregistration
*/
-ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int module_number TSRMLS_DC) /* {{{ */
+ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int module_number TSRMLS_DC) /* {{{ */
{
- const zend_ini_entry *p = ini_entry;
- zend_ini_entry *hashed_ini_entry;
- zval default_value;
+ zend_ini_entry *p;
+ zval *default_value;
HashTable *directives = registered_zend_ini_directives;
- zend_bool config_directive_success = 0;
#ifdef ZTS
/* if we are called during the request, eg: from dl(),
@@ -199,26 +223,42 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int modu
}
#endif
- while (p->name) {
- config_directive_success = 0;
- if ((hashed_ini_entry = zend_hash_str_add_mem(directives, p->name, p->name_length, (void*)p, sizeof(zend_ini_entry))) == NULL) {
+ while (ini_entry->name) {
+ p = pemalloc(sizeof(zend_ini_entry), 1);
+ p->name = zend_string_init(ini_entry->name, ini_entry->name_length, 1);
+ p->on_modify = ini_entry->on_modify;
+ p->mh_arg1 = ini_entry->mh_arg1;
+ p->mh_arg2 = ini_entry->mh_arg2;
+ p->mh_arg3 = ini_entry->mh_arg3;
+ p->value = NULL;
+ p->orig_value = NULL;
+ p->displayer = ini_entry->displayer;
+ p->modifiable = ini_entry->modifiable;
+
+ p->orig_modifiable = 0;
+ p->modified = 0;
+ p->module_number = module_number;
+
+ if (zend_hash_add_ptr(directives, p->name, (void*)p) == NULL) {
+ if (p->name) {
+ zend_string_release(p->name);
+ }
zend_unregister_ini_entries(module_number TSRMLS_CC);
return FAILURE;
}
- hashed_ini_entry->module_number = module_number;
- if ((zend_get_configuration_directive(p->name, p->name_length, &default_value)) == SUCCESS) {
- if (!hashed_ini_entry->on_modify
- || hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) {
- hashed_ini_entry->value = Z_STRVAL(default_value);
- hashed_ini_entry->value_length = Z_STRLEN(default_value);
- config_directive_success = 1;
- }
- }
+ if (((default_value = zend_get_configuration_directive(p->name)) != NULL) &&
+ (!p->on_modify || p->on_modify(p, Z_STR_P(default_value), p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS)) {
+
+ p->value = zend_string_copy(Z_STR_P(default_value));
+ } else {
+ p->value = ini_entry->value ?
+ zend_string_init(ini_entry->value, ini_entry->value_length, 1) : NULL;
- if (!config_directive_success && hashed_ini_entry->on_modify) {
- hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC);
+ if (p->on_modify) {
+ p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC);
+ }
}
- p++;
+ ini_entry++;
}
return SUCCESS;
}
@@ -237,7 +277,7 @@ static int zend_ini_refresh_cache(zval *el, void *arg TSRMLS_DC) /* {{{ */
int stage = (int)(zend_intptr_t)arg;
if (p->on_modify) {
- p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC);
+ p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC);
}
return 0;
}
@@ -250,18 +290,43 @@ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */
/* }}} */
#endif
-ZEND_API int zend_alter_ini_entry(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */
+ZEND_API int zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage) /* {{{ */
{
TSRMLS_FETCH();
- return zend_alter_ini_entry_ex(name, new_value, new_value_length, modify_type, stage, 0 TSRMLS_CC);
+ return zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0 TSRMLS_CC);
+}
+/* }}} */
+
+ZEND_API int zend_alter_ini_entry_chars(zend_string *name, const char *value, size_t value_length, int modify_type, int stage) /* {{{ */
+{
+ int ret;
+ zend_string *new_value;
+ TSRMLS_FETCH();
+
+ new_value = zend_string_init(value, value_length, stage != ZEND_INI_STAGE_RUNTIME);
+ ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0 TSRMLS_CC);
+ zend_string_release(new_value);
+ return ret;
+}
+/* }}} */
+
+ZEND_API int zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
+{
+ int ret;
+ zend_string *new_value;
+
+ new_value = zend_string_init(value, value_length, stage != ZEND_INI_STAGE_RUNTIME);
+ ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, force_change TSRMLS_CC);
+ zend_string_release(new_value);
+ return ret;
}
/* }}} */
-ZEND_API int zend_alter_ini_entry_ex(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
+ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
{
zend_ini_entry *ini_entry;
- char *duplicate;
+ zend_string *duplicate;
zend_bool modifiable;
zend_bool modified;
@@ -288,23 +353,21 @@ ZEND_API int zend_alter_ini_entry_ex(zend_string *name, char *new_value, uint ne
}
if (!modified) {
ini_entry->orig_value = ini_entry->value;
- ini_entry->orig_value_length = ini_entry->value_length;
ini_entry->orig_modifiable = modifiable;
ini_entry->modified = 1;
zend_hash_add_ptr(EG(modified_ini_directives), name, ini_entry);
}
- duplicate = estrndup(new_value, new_value_length);
+ duplicate = zend_string_copy(new_value);
if (!ini_entry->on_modify
- || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
+ || ini_entry->on_modify(ini_entry, duplicate, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
if (modified && ini_entry->orig_value != ini_entry->value) { /* we already changed the value, free the changed value */
- efree(ini_entry->value);
+ zend_string_release(ini_entry->value);
}
ini_entry->value = duplicate;
- ini_entry->value_length = new_value_length;
} else {
- efree(duplicate);
+ zend_string_release(duplicate);
return FAILURE;
}
@@ -360,9 +423,9 @@ ZEND_API zend_long zend_ini_long(char *name, uint name_length, int orig) /* {{{
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
if (orig && ini_entry->modified) {
- return (ini_entry->orig_value ? ZEND_STRTOL(ini_entry->orig_value, NULL, 0) : 0);
+ return (ini_entry->orig_value ? ZEND_STRTOL(ini_entry->orig_value->val, NULL, 0) : 0);
} else {
- return (ini_entry->value ? ZEND_STRTOL(ini_entry->value, NULL, 0) : 0);
+ return (ini_entry->value ? ZEND_STRTOL(ini_entry->value->val, NULL, 0) : 0);
}
}
@@ -378,9 +441,9 @@ ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ *
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
if (orig && ini_entry->modified) {
- return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0);
+ return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value->val, NULL) : 0.0);
} else {
- return (double) (ini_entry->value ? zend_strtod(ini_entry->value, NULL) : 0.0);
+ return (double) (ini_entry->value ? zend_strtod(ini_entry->value->val, NULL) : 0.0);
}
}
@@ -400,9 +463,9 @@ ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_b
}
if (orig && ini_entry->modified) {
- return ini_entry->orig_value;
+ return ini_entry->orig_value ? ini_entry->orig_value->val : NULL;
} else {
- return ini_entry->value;
+ return ini_entry->value ? ini_entry->value->val : NULL;
}
} else {
if (exists) {
@@ -470,29 +533,26 @@ static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) /* {{{ */
ZEND_INI_DISP(zend_ini_boolean_displayer_cb) /* {{{ */
{
- int value, tmp_value_len;
- char *tmp_value;
+ int value;
+ zend_string *tmp_value;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL );
- tmp_value_len = ini_entry->orig_value_length;
} else if (ini_entry->value) {
tmp_value = ini_entry->value;
- tmp_value_len = ini_entry->value_length;
} else {
tmp_value = NULL;
- tmp_value_len = 0;
}
if (tmp_value) {
- if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) {
+ if (tmp_value->len == 4 && strcasecmp(tmp_value->val, "true") == 0) {
value = 1;
- } else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) {
+ } else if (tmp_value->len == 3 && strcasecmp(tmp_value->val, "yes") == 0) {
value = 1;
- } else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) {
+ } else if (tmp_value->len == 2 && strcasecmp(tmp_value->val, "on") == 0) {
value = 1;
} else {
- value = atoi(tmp_value);
+ value = atoi(tmp_value->val);
}
} else {
value = 0;
@@ -511,9 +571,9 @@ ZEND_INI_DISP(zend_ini_color_displayer_cb) /* {{{ */
char *value;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value;
+ value = ini_entry->orig_value->val;
} else if (ini_entry->value) {
- value = ini_entry->value;
+ value = ini_entry->value->val;
} else {
value = NULL;
}
@@ -538,9 +598,9 @@ ZEND_INI_DISP(display_link_numbers) /* {{{ */
char *value;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value;
+ value = ini_entry->orig_value->val;
} else if (ini_entry->value) {
- value = ini_entry->value;
+ value = ini_entry->value->val;
} else {
value = NULL;
}
@@ -569,17 +629,17 @@ ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */
p = (zend_bool *) (base+(size_t) mh_arg1);
- if (new_value_length == 2 && strcasecmp("on", new_value) == 0) {
+ if (new_value->len == 2 && strcasecmp("on", new_value->val) == 0) {
*p = (zend_bool) 1;
}
- else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) {
+ else if (new_value->len == 3 && strcasecmp("yes", new_value->val) == 0) {
*p = (zend_bool) 1;
}
- else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) {
+ else if (new_value->len == 4 && strcasecmp("true", new_value->val) == 0) {
*p = (zend_bool) 1;
}
else {
- *p = (zend_bool) atoi(new_value);
+ *p = (zend_bool) atoi(new_value->val);
}
return SUCCESS;
}
@@ -598,7 +658,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
p = (zend_long *) (base+(size_t) mh_arg1);
- *p = zend_atol(new_value, new_value_length);
+ *p = zend_atol(new_value->val, new_value->len);
return SUCCESS;
}
/* }}} */
@@ -614,7 +674,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
- tmp = zend_atol(new_value, new_value_length);
+ tmp = zend_atol(new_value->val, new_value->len);
if (tmp < 0) {
return FAILURE;
}
@@ -639,7 +699,7 @@ ZEND_API ZEND_INI_MH(OnUpdateReal) /* {{{ */
p = (double *) (base+(size_t) mh_arg1);
- *p = zend_strtod(new_value, NULL);
+ *p = zend_strtod(new_value->val, NULL);
return SUCCESS;
}
/* }}} */
@@ -657,7 +717,7 @@ ZEND_API ZEND_INI_MH(OnUpdateString) /* {{{ */
p = (char **) (base+(size_t) mh_arg1);
- *p = new_value;
+ *p = new_value ? new_value->val : NULL;
return SUCCESS;
}
/* }}} */
@@ -673,13 +733,13 @@ ZEND_API ZEND_INI_MH(OnUpdateStringUnempty) /* {{{ */
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
- if (new_value && !new_value[0]) {
+ if (new_value && !new_value->val[0]) {
return FAILURE;
}
p = (char **) (base+(size_t) mh_arg1);
- *p = new_value;
+ *p = new_value ? new_value->val : NULL;
return SUCCESS;
}
/* }}} */
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index 68318612d0..f0a72c5142 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -27,28 +27,37 @@
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
-#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
+#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
-struct _zend_ini_entry {
- int module_number;
- int modifiable;
- char *name; // TODO: convert into zend_string ???
- uint name_length;
+typedef struct _zend_ini_entry_def {
+ const char *name;
ZEND_INI_MH((*on_modify));
void *mh_arg1;
void *mh_arg2;
void *mh_arg3;
+ const char *value;
+ void (*displayer)(zend_ini_entry *ini_entry, int type);
+ int modifiable;
- char *value; // TODO: convert into zend_string ???
+ uint name_length;
uint value_length;
+} zend_ini_entry_def;
+
+struct _zend_ini_entry {
+ zend_string *name;
+ ZEND_INI_MH((*on_modify));
+ void *mh_arg1;
+ void *mh_arg2;
+ void *mh_arg3;
+ zend_string *value;
+ zend_string *orig_value;
+ void (*displayer)(zend_ini_entry *ini_entry, int type);
+ int modifiable;
- char *orig_value; // TODO: convert into zend_string ???
- uint orig_value_length;
int orig_modifiable;
int modified;
-
- void (*displayer)(zend_ini_entry *ini_entry, int type);
+ int module_number;
};
BEGIN_EXTERN_C()
@@ -61,11 +70,13 @@ ZEND_API int zend_copy_ini_directives(TSRMLS_D);
ZEND_API void zend_ini_sort_entries(TSRMLS_D);
-ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int module_number TSRMLS_DC);
+ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int module_number TSRMLS_DC);
ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC);
ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC);
-ZEND_API int zend_alter_ini_entry(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage);
-ZEND_API int zend_alter_ini_entry_ex(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC);
+ZEND_API int zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage);
+ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value, int modify_type, int stage, int force_change TSRMLS_DC);
+ZEND_API int zend_alter_ini_entry_chars(zend_string *name, const char *value, size_t value_length, int modify_type, int stage);
+ZEND_API int zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change TSRMLS_DC);
ZEND_API int zend_restore_ini_entry(zend_string *name, int stage);
ZEND_API void display_ini_entries(zend_module_entry *module);
@@ -81,11 +92,11 @@ ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
ZEND_API ZEND_INI_DISP(display_link_numbers);
END_EXTERN_C()
-#define ZEND_INI_BEGIN() static const zend_ini_entry ini_entries[] = {
-#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
+#define ZEND_INI_BEGIN() static const zend_ini_entry_def ini_entries[] = {
+#define ZEND_INI_END() { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} };
#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \
- { 0, modifiable, name, sizeof(name)-1, on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, 0, displayer },
+ { name, on_modify, arg1, arg2, arg3, default_value, displayer, modifiable, sizeof(name)-1, sizeof(default_value)-1 },
#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL)
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 8093458308..e343fcd92a 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -141,12 +141,12 @@ static void zend_ini_get_constant(zval *result, zval *name TSRMLS_DC)
*/
static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)
{
- zval curval;
+ zval *curval;
char *envvar;
/* Fetch configuration option value */
- if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRLEN_P(name), &curval) == SUCCESS) {
- ZVAL_PSTRINGL(result, Z_STRVAL(curval), Z_STRLEN(curval));
+ if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) {
+ ZVAL_PSTRINGL(result, Z_STRVAL_P(curval), Z_STRLEN_P(curval));
/* ..or if not found, try ENV */
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name) TSRMLS_CC)) != NULL ||
(envvar = getenv(Z_STRVAL_P(name))) != NULL) {
@@ -264,6 +264,7 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
%token TC_QUOTED_STRING
%token BOOL_TRUE
%token BOOL_FALSE
+%token NULL_NULL
%token END_OF_LINE
%token '=' ':' ',' '.' '"' '\'' '^' '+' '-' '/' '*' '%' '$' '~' '<' '>' '?' '@' '{' '}'
%left '|' '&' '^'
@@ -290,7 +291,7 @@ statement:
#endif
ZEND_INI_PARSER_CB(&$1, &$3, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
zend_string_release(Z_STR($1));
- zend_string_release(Z_STR($3));
+ zval_ptr_dtor(&$3);
}
| TC_OFFSET option_offset ']' '=' string_or_value {
#if DEBUG_CFG_PARSER
@@ -299,7 +300,7 @@ statement:
ZEND_INI_PARSER_CB(&$1, &$5, &$2, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
zend_string_release(Z_STR($1));
zend_string_release(Z_STR($2));
- zend_string_release(Z_STR($5));
+ zval_ptr_dtor(&$5);
}
| TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC); zend_string_release(Z_STR($1)); }
| END_OF_LINE
@@ -314,6 +315,7 @@ string_or_value:
expr { $$ = $1; }
| BOOL_TRUE { $$ = $1; }
| BOOL_FALSE { $$ = $1; }
+ | NULL_NULL { $$ = $1; }
| END_OF_LINE { zend_ini_init_string(&$$); }
;
diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index b41c4c3394..2abf1140fc 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include "zend.h"
+#include "zend_API.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
@@ -137,9 +138,55 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
ZVAL_NEW_STR(retval, zend_string_init(str, len, 1))
-#define RETURN_TOKEN(type, str, len) { \
- zend_ini_copy_value(ini_lval, str, len); \
- return type; \
+#define RETURN_TOKEN(type, str, len) { \
+ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
+ zend_ini_copy_typed_value(ini_lval, type, str, len); \
+ } else { \
+ zend_ini_copy_value(ini_lval, str, len); \
+ } \
+ return type; \
+}
+
+static inline int convert_to_number(zval *retval, const char *str, const int str_len)
+{
+ zend_uchar type;
+ int overflow;
+ zend_long lval;
+ double dval;
+
+ if ((type = is_numeric_string_ex(str, str_len, &lval, &dval, 0, &overflow)) != 0) {
+ if (type == IS_LONG) {
+ ZVAL_LONG(retval, lval);
+ return SUCCESS;
+ } else if (type == IS_DOUBLE && !overflow) {
+ ZVAL_DOUBLE(retval, dval);
+ return SUCCESS;
+ }
+ }
+
+ return FAILURE;
+}
+
+static void zend_ini_copy_typed_value(zval *retval, const int type, const char *str, int len)
+{
+ switch (type) {
+ case BOOL_FALSE:
+ case BOOL_TRUE:
+ ZVAL_BOOL(retval, type == BOOL_TRUE);
+ break;
+
+ case NULL_NULL:
+ ZVAL_NULL(retval);
+ break;
+
+ case TC_NUMBER:
+ if (convert_to_number(retval, str, len) == SUCCESS) {
+ break;
+ }
+ /* intentional fall-through */
+ default:
+ zend_ini_copy_value(retval, str, len);
+ }
}
static void _yy_push_state(int new_state TSRMLS_DC)
@@ -171,7 +218,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
{
/* Sanity check */
- if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
+ if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
zend_error(E_WARNING, "Invalid scanner mode");
return FAILURE;
}
@@ -330,7 +377,7 @@ restart:
}
}
-#line 334 "Zend/zend_ini_scanner.c"
+#line 381 "Zend/zend_ini_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -459,7 +506,7 @@ yy2:
yy3:
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 426 "Zend/zend_ini_scanner.l"
+#line 477 "Zend/zend_ini_scanner.l"
{ /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -469,37 +516,37 @@ yy3:
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
}
-#line 473 "Zend/zend_ini_scanner.c"
+#line 520 "Zend/zend_ini_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy68;
+ goto yy73;
yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 572 "Zend/zend_ini_scanner.l"
+#line 623 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
-#line 487 "Zend/zend_ini_scanner.c"
+#line 534 "Zend/zend_ini_scanner.c"
yy6:
YYDEBUG(6, *YYCURSOR);
++YYCURSOR;
yy7:
YYDEBUG(7, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 577 "Zend/zend_ini_scanner.l"
+#line 628 "Zend/zend_ini_scanner.l"
{
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 499 "Zend/zend_ini_scanner.c"
+#line 546 "Zend/zend_ini_scanner.c"
yy8:
YYDEBUG(8, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy71;
+ if (yych == '\n') goto yy76;
goto yy7;
yy9:
YYDEBUG(9, *YYCURSOR);
@@ -508,20 +555,20 @@ yy9:
if (yych <= ' ') {
if (yych <= '\n') {
if (yych <= 0x08) goto yy26;
- if (yych <= '\t') goto yy67;
- goto yy71;
+ if (yych <= '\t') goto yy72;
+ goto yy76;
} else {
- if (yych == '\r') goto yy72;
+ if (yych == '\r') goto yy77;
if (yych <= 0x1F) goto yy26;
- goto yy69;
+ goto yy74;
}
} else {
if (yych <= ':') {
- if (yych == '#') goto yy58;
+ if (yych == '#') goto yy63;
goto yy26;
} else {
- if (yych <= ';') goto yy53;
- if (yych == '=') goto yy51;
+ if (yych <= ';') goto yy58;
+ if (yych == '=') goto yy56;
goto yy26;
}
}
@@ -530,16 +577,16 @@ yy10:
++YYCURSOR;
YYDEBUG(11, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 500 "Zend/zend_ini_scanner.l"
+#line 551 "Zend/zend_ini_scanner.l"
{ /* Disallow these chars outside option values */
return yytext[0];
}
-#line 538 "Zend/zend_ini_scanner.c"
+#line 585 "Zend/zend_ini_scanner.c"
yy12:
YYDEBUG(12, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy59;
+ goto yy64;
yy13:
YYDEBUG(13, *YYCURSOR);
yych = *++YYCURSOR;
@@ -548,23 +595,23 @@ yy14:
YYDEBUG(14, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy54;
+ goto yy59;
YYDEBUG(15, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 600 "Zend/zend_ini_scanner.l"
+#line 651 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 559 "Zend/zend_ini_scanner.c"
+#line 606 "Zend/zend_ini_scanner.c"
yy16:
YYDEBUG(16, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy52;
+ goto yy57;
yy17:
YYDEBUG(17, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 436 "Zend/zend_ini_scanner.l"
+#line 487 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
yy_push_state(ST_RAW TSRMLS_CC);
@@ -573,12 +620,12 @@ yy17:
}
return '=';
}
-#line 577 "Zend/zend_ini_scanner.c"
+#line 624 "Zend/zend_ini_scanner.c"
yy18:
YYDEBUG(18, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy48;
- if (yych == 'a') goto yy48;
+ if (yych == 'A') goto yy53;
+ if (yych == 'a') goto yy53;
goto yy26;
yy19:
YYDEBUG(19, *YYCURSOR);
@@ -629,7 +676,7 @@ yy23:
++YYCURSOR;
YYDEBUG(24, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 355 "Zend/zend_ini_scanner.l"
+#line 402 "Zend/zend_ini_scanner.l"
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
@@ -639,7 +686,7 @@ yy23:
}
return TC_SECTION;
}
-#line 643 "Zend/zend_ini_scanner.c"
+#line 690 "Zend/zend_ini_scanner.c"
yy25:
YYDEBUG(25, *YYCURSOR);
++YYCURSOR;
@@ -669,7 +716,7 @@ yy28:
}
YYDEBUG(30, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 380 "Zend/zend_ini_scanner.l"
+#line 427 "Zend/zend_ini_scanner.l"
{ /* Start of option with offset */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -682,7 +729,7 @@ yy28:
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
-#line 686 "Zend/zend_ini_scanner.c"
+#line 733 "Zend/zend_ini_scanner.c"
yy31:
YYDEBUG(31, *YYCURSOR);
++YYCURSOR;
@@ -728,11 +775,11 @@ yy31:
yy33:
YYDEBUG(33, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 418 "Zend/zend_ini_scanner.l"
+#line 465 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-#line 736 "Zend/zend_ini_scanner.c"
+#line 783 "Zend/zend_ini_scanner.c"
yy34:
YYDEBUG(34, *YYCURSOR);
++YYCURSOR;
@@ -802,11 +849,11 @@ yy39:
yy41:
YYDEBUG(41, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 422 "Zend/zend_ini_scanner.l"
+#line 469 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
-#line 810 "Zend/zend_ini_scanner.c"
+#line 857 "Zend/zend_ini_scanner.c"
yy42:
YYDEBUG(42, *YYCURSOR);
++YYCURSOR;
@@ -849,14 +896,14 @@ yy44:
} else {
if (yych == '=') goto yy41;
if (yych <= 'M') goto yy26;
- goto yy47;
+ goto yy52;
}
} else {
if (yych <= 'm') {
if (yych == '^') goto yy41;
goto yy26;
} else {
- if (yych <= 'n') goto yy47;
+ if (yych <= 'n') goto yy52;
if (yych <= 'z') goto yy26;
if (yych <= '~') goto yy41;
goto yy26;
@@ -871,205 +918,262 @@ yy45:
yy46:
YYDEBUG(46, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy39;
- if (yych == 'l') goto yy39;
- goto yy26;
+ if (yych == 'L') goto yy47;
+ if (yych != 'l') goto yy26;
yy47:
YYDEBUG(47, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(48, *YYCURSOR);
+ if (yych <= '&') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy25;
+ if (yych <= '\t') goto yy50;
+ } else {
+ if (yych != '\r') goto yy25;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= ' ') goto yy47;
+ if (yych >= '#') goto yy25;
+ } else {
+ if (yych == '%') goto yy25;
+ }
+ }
+ } else {
+ if (yych <= '=') {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy25;
+ if (yych >= '*') goto yy25;
+ } else {
+ if (yych == '<') goto yy25;
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych == '[') goto yy28;
+ goto yy25;
+ } else {
+ if (yych <= '^') goto yy49;
+ if (yych <= 'z') goto yy25;
+ if (yych >= 0x7F) goto yy25;
+ }
+ }
+ }
+yy49:
+ YYDEBUG(49, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 473 "Zend/zend_ini_scanner.l"
+ {
+ RETURN_TOKEN(NULL_NULL, "", 0);
+}
+#line 972 "Zend/zend_ini_scanner.c"
+yy50:
+ YYDEBUG(50, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(51, *YYCURSOR);
+ if (yych == '\t') goto yy50;
+ if (yych == ' ') goto yy50;
+ goto yy49;
+yy52:
+ YYDEBUG(52, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy39;
if (yych == 'e') goto yy39;
goto yy26;
-yy48:
- YYDEBUG(48, *YYCURSOR);
+yy53:
+ YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy49;
+ if (yych == 'L') goto yy54;
if (yych != 'l') goto yy26;
-yy49:
- YYDEBUG(49, *YYCURSOR);
+yy54:
+ YYDEBUG(54, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'S') goto yy50;
+ if (yych == 'S') goto yy55;
if (yych != 's') goto yy26;
-yy50:
- YYDEBUG(50, *YYCURSOR);
+yy55:
+ YYDEBUG(55, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy39;
if (yych == 'e') goto yy39;
goto yy26;
-yy51:
- YYDEBUG(51, *YYCURSOR);
+yy56:
+ YYDEBUG(56, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy52:
- YYDEBUG(52, *YYCURSOR);
- if (yych == '\t') goto yy51;
- if (yych == ' ') goto yy51;
+yy57:
+ YYDEBUG(57, *YYCURSOR);
+ if (yych == '\t') goto yy56;
+ if (yych == ' ') goto yy56;
goto yy17;
-yy53:
- YYDEBUG(53, *YYCURSOR);
+yy58:
+ YYDEBUG(58, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy54:
- YYDEBUG(54, *YYCURSOR);
+yy59:
+ YYDEBUG(59, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy53;
+ goto yy58;
}
- if (yych >= '\r') goto yy57;
-yy55:
- YYDEBUG(55, *YYCURSOR);
+ if (yych >= '\r') goto yy62;
+yy60:
+ YYDEBUG(60, *YYCURSOR);
++YYCURSOR;
-yy56:
- YYDEBUG(56, *YYCURSOR);
+yy61:
+ YYDEBUG(61, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 582 "Zend/zend_ini_scanner.l"
+#line 633 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 933 "Zend/zend_ini_scanner.c"
-yy57:
- YYDEBUG(57, *YYCURSOR);
+#line 1037 "Zend/zend_ini_scanner.c"
+yy62:
+ YYDEBUG(62, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy55;
- goto yy56;
-yy58:
- YYDEBUG(58, *YYCURSOR);
+ if (yych == '\n') goto yy60;
+ goto yy61;
+yy63:
+ YYDEBUG(63, *YYCURSOR);
yyaccept = 1;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy59:
- YYDEBUG(59, *YYCURSOR);
+yy64:
+ YYDEBUG(64, *YYCURSOR);
if (yych <= '\'') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy58;
- if (yych >= '\n') goto yy64;
+ if (yych <= 0x08) goto yy63;
+ if (yych >= '\n') goto yy69;
} else {
- if (yych == '\r') goto yy66;
- goto yy58;
+ if (yych == '\r') goto yy71;
+ goto yy63;
}
} else {
if (yych <= '$') {
- if (yych == '#') goto yy58;
+ if (yych == '#') goto yy63;
} else {
- if (yych != '&') goto yy58;
+ if (yych != '&') goto yy63;
}
}
} else {
if (yych <= 'Z') {
if (yych <= ';') {
- if (yych <= ')') goto yy60;
- if (yych <= ':') goto yy58;
+ if (yych <= ')') goto yy65;
+ if (yych <= ':') goto yy63;
} else {
- if (yych != '=') goto yy58;
+ if (yych != '=') goto yy63;
}
} else {
if (yych <= '^') {
- if (yych <= '[') goto yy62;
- if (yych <= ']') goto yy58;
+ if (yych <= '[') goto yy67;
+ if (yych <= ']') goto yy63;
} else {
- if (yych <= 'z') goto yy58;
- if (yych >= 0x7F) goto yy58;
+ if (yych <= 'z') goto yy63;
+ if (yych >= 0x7F) goto yy63;
}
}
}
-yy60:
- YYDEBUG(60, *YYCURSOR);
+yy65:
+ YYDEBUG(65, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(61, *YYCURSOR);
- if (yych == '\n') goto yy64;
- if (yych == '\r') goto yy66;
- goto yy60;
-yy62:
- YYDEBUG(62, *YYCURSOR);
+ YYDEBUG(66, *YYCURSOR);
+ if (yych == '\n') goto yy69;
+ if (yych == '\r') goto yy71;
+ goto yy65;
+yy67:
+ YYDEBUG(67, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(63, *YYCURSOR);
+ YYDEBUG(68, *YYCURSOR);
if (yych <= '\f') {
- if (yych <= 0x08) goto yy60;
- if (yych <= '\t') goto yy62;
- if (yych >= '\v') goto yy60;
+ if (yych <= 0x08) goto yy65;
+ if (yych <= '\t') goto yy67;
+ if (yych >= '\v') goto yy65;
} else {
- if (yych <= '\r') goto yy66;
- if (yych == ' ') goto yy62;
- goto yy60;
+ if (yych <= '\r') goto yy71;
+ if (yych == ' ') goto yy67;
+ goto yy65;
}
-yy64:
- YYDEBUG(64, *YYCURSOR);
+yy69:
+ YYDEBUG(69, *YYCURSOR);
++YYCURSOR;
-yy65:
- YYDEBUG(65, *YYCURSOR);
+yy70:
+ YYDEBUG(70, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 588 "Zend/zend_ini_scanner.l"
+#line 639 "Zend/zend_ini_scanner.l"
{ /* #Comment */
zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 1019 "Zend/zend_ini_scanner.c"
-yy66:
- YYDEBUG(66, *YYCURSOR);
+#line 1123 "Zend/zend_ini_scanner.c"
+yy71:
+ YYDEBUG(71, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy64;
- goto yy65;
-yy67:
- YYDEBUG(67, *YYCURSOR);
+ if (yych == '\n') goto yy69;
+ goto yy70;
+yy72:
+ YYDEBUG(72, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy68:
- YYDEBUG(68, *YYCURSOR);
+yy73:
+ YYDEBUG(73, *YYCURSOR);
if (yych <= ' ') {
if (yych <= '\n') {
if (yych <= 0x08) goto yy5;
- if (yych <= '\t') goto yy67;
- goto yy71;
+ if (yych <= '\t') goto yy72;
+ goto yy76;
} else {
- if (yych == '\r') goto yy72;
+ if (yych == '\r') goto yy77;
if (yych <= 0x1F) goto yy5;
- goto yy67;
+ goto yy72;
}
} else {
if (yych <= ':') {
- if (yych == '#') goto yy60;
+ if (yych == '#') goto yy65;
goto yy5;
} else {
- if (yych <= ';') goto yy53;
- if (yych == '=') goto yy51;
+ if (yych <= ';') goto yy58;
+ if (yych == '=') goto yy56;
goto yy5;
}
}
-yy69:
- YYDEBUG(69, *YYCURSOR);
+yy74:
+ YYDEBUG(74, *YYCURSOR);
yyaccept = 1;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(70, *YYCURSOR);
+ YYDEBUG(75, *YYCURSOR);
if (yych <= '&') {
if (yych <= 0x1F) {
if (yych <= '\n') {
if (yych <= 0x08) goto yy25;
- if (yych <= '\t') goto yy67;
+ if (yych <= '\t') goto yy72;
} else {
- if (yych == '\r') goto yy72;
+ if (yych == '\r') goto yy77;
goto yy25;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy69;
+ if (yych <= ' ') goto yy74;
if (yych <= '"') goto yy3;
- goto yy58;
+ goto yy63;
} else {
if (yych == '%') goto yy25;
goto yy3;
@@ -1082,9 +1186,9 @@ yy69:
if (yych <= ')') goto yy3;
goto yy25;
} else {
- if (yych <= ';') goto yy53;
+ if (yych <= ';') goto yy58;
if (yych <= '<') goto yy25;
- goto yy51;
+ goto yy56;
}
} else {
if (yych <= ']') {
@@ -1098,14 +1202,14 @@ yy69:
}
}
}
-yy71:
- YYDEBUG(71, *YYCURSOR);
+yy76:
+ YYDEBUG(76, *YYCURSOR);
yych = *++YYCURSOR;
goto yy7;
-yy72:
- YYDEBUG(72, *YYCURSOR);
+yy77:
+ YYDEBUG(77, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy71;
+ if ((yych = *YYCURSOR) == '\n') goto yy76;
goto yy7;
}
/* *********************************** */
@@ -1145,17 +1249,17 @@ yyc_ST_DOUBLE_QUOTES:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
- YYDEBUG(73, *YYCURSOR);
+ YYDEBUG(78, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
- if (yych == '"') goto yy77;
- if (yych == '$') goto yy79;
- YYDEBUG(75, *YYCURSOR);
+ if (yych == '"') goto yy82;
+ if (yych == '$') goto yy84;
+ YYDEBUG(80, *YYCURSOR);
++YYCURSOR;
-yy76:
- YYDEBUG(76, *YYCURSOR);
+yy81:
+ YYDEBUG(81, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 532 "Zend/zend_ini_scanner.l"
+#line 583 "Zend/zend_ini_scanner.l"
{ /* Escape double quoted string contents */
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1191,46 +1295,46 @@ yy76:
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
return TC_QUOTED_STRING;
}
-#line 1195 "Zend/zend_ini_scanner.c"
-yy77:
- YYDEBUG(77, *YYCURSOR);
+#line 1299 "Zend/zend_ini_scanner.c"
+yy82:
+ YYDEBUG(82, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy83;
-yy78:
- YYDEBUG(78, *YYCURSOR);
+ goto yy88;
+yy83:
+ YYDEBUG(83, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 527 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string ends */
yy_pop_state(TSRMLS_C);
return '"';
}
-#line 1209 "Zend/zend_ini_scanner.c"
-yy79:
- YYDEBUG(79, *YYCURSOR);
+#line 1313 "Zend/zend_ini_scanner.c"
+yy84:
+ YYDEBUG(84, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych != '{') goto yy76;
- YYDEBUG(80, *YYCURSOR);
+ if (yych != '{') goto yy81;
+ YYDEBUG(85, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(81, *YYCURSOR);
+ YYDEBUG(86, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 398 "Zend/zend_ini_scanner.l"
+#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 1223 "Zend/zend_ini_scanner.c"
-yy82:
- YYDEBUG(82, *YYCURSOR);
+#line 1327 "Zend/zend_ini_scanner.c"
+yy87:
+ YYDEBUG(87, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy83:
- YYDEBUG(83, *YYCURSOR);
+yy88:
+ YYDEBUG(88, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy82;
+ goto yy87;
}
- goto yy78;
+ goto yy83;
}
/* *********************************** */
yyc_ST_OFFSET:
@@ -1269,496 +1373,496 @@ yyc_ST_OFFSET:
66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66,
};
- YYDEBUG(84, *YYCURSOR);
+ YYDEBUG(89, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= '-') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy86;
- if (yych <= '\t') goto yy88;
- goto yy89;
+ if (yych <= 0x08) goto yy91;
+ if (yych <= '\t') goto yy93;
+ goto yy94;
} else {
- if (yych == '\r') goto yy89;
- if (yych >= ' ') goto yy88;
+ if (yych == '\r') goto yy94;
+ if (yych >= ' ') goto yy93;
}
} else {
if (yych <= '$') {
- if (yych == '"') goto yy91;
- if (yych >= '$') goto yy93;
+ if (yych == '"') goto yy96;
+ if (yych >= '$') goto yy98;
} else {
- if (yych == '\'') goto yy94;
- if (yych >= '-') goto yy95;
+ if (yych == '\'') goto yy99;
+ if (yych >= '-') goto yy100;
}
}
} else {
if (yych <= 'Z') {
if (yych <= '9') {
- if (yych <= '.') goto yy96;
- if (yych >= '0') goto yy97;
+ if (yych <= '.') goto yy101;
+ if (yych >= '0') goto yy102;
} else {
- if (yych == ';') goto yy89;
- if (yych >= 'A') goto yy99;
+ if (yych == ';') goto yy94;
+ if (yych >= 'A') goto yy104;
}
} else {
if (yych <= '^') {
- if (yych <= '[') goto yy86;
- if (yych <= '\\') goto yy101;
- if (yych <= ']') goto yy102;
+ if (yych <= '[') goto yy91;
+ if (yych <= '\\') goto yy106;
+ if (yych <= ']') goto yy107;
} else {
- if (yych == '`') goto yy86;
- if (yych <= 'z') goto yy99;
+ if (yych == '`') goto yy91;
+ if (yych <= 'z') goto yy104;
}
}
}
-yy86:
- YYDEBUG(86, *YYCURSOR);
+yy91:
+ YYDEBUG(91, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy105;
-yy87:
- YYDEBUG(87, *YYCURSOR);
+ goto yy110;
+yy92:
+ YYDEBUG(92, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 518 "Zend/zend_ini_scanner.l"
+#line 569 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 1327 "Zend/zend_ini_scanner.c"
-yy88:
- YYDEBUG(88, *YYCURSOR);
+#line 1431 "Zend/zend_ini_scanner.c"
+yy93:
+ YYDEBUG(93, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy131;
+ goto yy136;
}
- if (yych == '"') goto yy133;
- if (yych == ']') goto yy134;
- goto yy105;
-yy89:
- YYDEBUG(89, *YYCURSOR);
+ if (yych == '"') goto yy138;
+ if (yych == ']') goto yy139;
+ goto yy110;
+yy94:
+ YYDEBUG(94, *YYCURSOR);
++YYCURSOR;
-yy90:
- YYDEBUG(90, *YYCURSOR);
+yy95:
+ YYDEBUG(95, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 600 "Zend/zend_ini_scanner.l"
+#line 651 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 1348 "Zend/zend_ini_scanner.c"
-yy91:
- YYDEBUG(91, *YYCURSOR);
+#line 1452 "Zend/zend_ini_scanner.c"
+yy96:
+ YYDEBUG(96, *YYCURSOR);
++YYCURSOR;
-yy92:
- YYDEBUG(92, *YYCURSOR);
+yy97:
+ YYDEBUG(97, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 522 "Zend/zend_ini_scanner.l"
+#line 573 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 1360 "Zend/zend_ini_scanner.c"
-yy93:
- YYDEBUG(93, *YYCURSOR);
+#line 1464 "Zend/zend_ini_scanner.c"
+yy98:
+ YYDEBUG(98, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy90;
- if (yych <= '[') goto yy104;
- goto yy109;
+ if (yych <= 0x00) goto yy95;
+ if (yych <= '[') goto yy109;
+ goto yy114;
} else {
- if (yych == '{') goto yy129;
- goto yy104;
+ if (yych == '{') goto yy134;
+ goto yy109;
}
-yy94:
- YYDEBUG(94, *YYCURSOR);
+yy99:
+ YYDEBUG(99, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy125;
+ goto yy130;
}
- goto yy90;
-yy95:
- YYDEBUG(95, *YYCURSOR);
+ goto yy95;
+yy100:
+ YYDEBUG(100, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy105;
- if (yych <= '9') goto yy123;
- goto yy105;
-yy96:
- YYDEBUG(96, *YYCURSOR);
+ if (yych <= '/') goto yy110;
+ if (yych <= '9') goto yy128;
+ goto yy110;
+yy101:
+ YYDEBUG(101, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy105;
- if (yych <= '9') goto yy121;
- goto yy105;
-yy97:
- YYDEBUG(97, *YYCURSOR);
+ if (yych <= '/') goto yy110;
+ if (yych <= '9') goto yy126;
+ goto yy110;
+yy102:
+ YYDEBUG(102, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '\'') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy105;
+ if (yych == '\n') goto yy103;
+ if (yych <= '\f') goto yy110;
} else {
- if (yych == '"') goto yy98;
- if (yych <= '&') goto yy105;
+ if (yych == '"') goto yy103;
+ if (yych <= '&') goto yy110;
}
} else {
if (yych <= '9') {
- if (yych == '.') goto yy117;
- if (yych <= '/') goto yy105;
- goto yy119;
+ if (yych == '.') goto yy122;
+ if (yych <= '/') goto yy110;
+ goto yy124;
} else {
if (yych <= ';') {
- if (yych <= ':') goto yy105;
+ if (yych <= ':') goto yy110;
} else {
- if (yych != ']') goto yy105;
+ if (yych != ']') goto yy110;
}
}
}
-yy98:
- YYDEBUG(98, *YYCURSOR);
+yy103:
+ YYDEBUG(103, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 496 "Zend/zend_ini_scanner.l"
+#line 547 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 1426 "Zend/zend_ini_scanner.c"
-yy99:
- YYDEBUG(99, *YYCURSOR);
+#line 1530 "Zend/zend_ini_scanner.c"
+yy104:
+ YYDEBUG(104, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy115;
+ goto yy120;
}
if (yych <= '"') {
if (yych <= '\f') {
- if (yych != '\n') goto yy105;
+ if (yych != '\n') goto yy110;
} else {
- if (yych <= '\r') goto yy100;
- if (yych <= '!') goto yy105;
+ if (yych <= '\r') goto yy105;
+ if (yych <= '!') goto yy110;
}
} else {
if (yych <= ':') {
- if (yych != '\'') goto yy105;
+ if (yych != '\'') goto yy110;
} else {
- if (yych <= ';') goto yy100;
- if (yych != ']') goto yy105;
+ if (yych <= ';') goto yy105;
+ if (yych != ']') goto yy110;
}
}
-yy100:
- YYDEBUG(100, *YYCURSOR);
+yy105:
+ YYDEBUG(105, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 492 "Zend/zend_ini_scanner.l"
+#line 543 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 1456 "Zend/zend_ini_scanner.c"
-yy101:
- YYDEBUG(101, *YYCURSOR);
+#line 1560 "Zend/zend_ini_scanner.c"
+yy106:
+ YYDEBUG(106, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy104;
-yy102:
- YYDEBUG(102, *YYCURSOR);
+ goto yy109;
+yy107:
+ YYDEBUG(107, *YYCURSOR);
++YYCURSOR;
-yy103:
- YYDEBUG(103, *YYCURSOR);
+yy108:
+ YYDEBUG(108, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 393 "Zend/zend_ini_scanner.l"
+#line 440 "Zend/zend_ini_scanner.l"
{ /* End of section or an option offset */
BEGIN(INITIAL);
return ']';
}
-#line 1472 "Zend/zend_ini_scanner.c"
-yy104:
- YYDEBUG(104, *YYCURSOR);
+#line 1576 "Zend/zend_ini_scanner.c"
+yy109:
+ YYDEBUG(109, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy105:
- YYDEBUG(105, *YYCURSOR);
+yy110:
+ YYDEBUG(110, *YYCURSOR);
if (yybm[0+yych] & 2) {
- goto yy104;
+ goto yy109;
}
- if (yych == '$') goto yy107;
- if (yych != '\\') goto yy87;
-yy106:
- YYDEBUG(106, *YYCURSOR);
+ if (yych == '$') goto yy112;
+ if (yych != '\\') goto yy92;
+yy111:
+ YYDEBUG(111, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- goto yy104;
-yy107:
- YYDEBUG(107, *YYCURSOR);
+ goto yy109;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy108;
- if (yych <= '[') goto yy104;
- goto yy109;
+ if (yych <= 0x00) goto yy113;
+ if (yych <= '[') goto yy109;
+ goto yy114;
} else {
- if (yych != '{') goto yy104;
+ if (yych != '{') goto yy109;
}
-yy108:
- YYDEBUG(108, *YYCURSOR);
+yy113:
+ YYDEBUG(113, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 1) {
if (yyaccept <= 0) {
- goto yy87;
+ goto yy92;
} else {
- goto yy90;
+ goto yy95;
}
} else {
if (yyaccept <= 2) {
- goto yy98;
+ goto yy103;
} else {
- goto yy100;
+ goto yy105;
}
}
-yy109:
- YYDEBUG(109, *YYCURSOR);
+yy114:
+ YYDEBUG(114, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy115;
}
- if (yych == '\\') goto yy112;
- goto yy104;
-yy110:
- YYDEBUG(110, *YYCURSOR);
+ if (yych == '\\') goto yy117;
+ goto yy109;
+yy115:
+ YYDEBUG(115, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(111, *YYCURSOR);
+ YYDEBUG(116, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy115;
}
- if (yych == '\\') goto yy114;
- goto yy104;
-yy112:
- YYDEBUG(112, *YYCURSOR);
+ if (yych == '\\') goto yy119;
+ goto yy109;
+yy117:
+ YYDEBUG(117, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(113, *YYCURSOR);
+ YYDEBUG(118, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy115;
}
- if (yych == '\\') goto yy112;
- goto yy104;
-yy114:
- YYDEBUG(114, *YYCURSOR);
+ if (yych == '\\') goto yy117;
+ goto yy109;
+yy119:
+ YYDEBUG(119, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy115;
}
- if (yych == '\\') goto yy112;
- goto yy104;
-yy115:
- YYDEBUG(115, *YYCURSOR);
+ if (yych == '\\') goto yy117;
+ goto yy109;
+yy120:
+ YYDEBUG(120, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(116, *YYCURSOR);
+ YYDEBUG(121, *YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy115;
+ goto yy120;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy100;
- if (yych <= '\f') goto yy104;
- goto yy100;
+ if (yych == '\n') goto yy105;
+ if (yych <= '\f') goto yy109;
+ goto yy105;
} else {
- if (yych == '"') goto yy100;
- if (yych <= '#') goto yy104;
- goto yy107;
+ if (yych == '"') goto yy105;
+ if (yych <= '#') goto yy109;
+ goto yy112;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy100;
- if (yych <= ':') goto yy104;
- goto yy100;
+ if (yych == '\'') goto yy105;
+ if (yych <= ':') goto yy109;
+ goto yy105;
} else {
- if (yych <= '[') goto yy104;
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy100;
- goto yy104;
+ if (yych <= '[') goto yy109;
+ if (yych <= '\\') goto yy111;
+ if (yych <= ']') goto yy105;
+ goto yy109;
}
}
-yy117:
- YYDEBUG(117, *YYCURSOR);
+yy122:
+ YYDEBUG(122, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(118, *YYCURSOR);
+ YYDEBUG(123, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy117;
+ goto yy122;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy104;
- goto yy98;
+ if (yych == '\n') goto yy103;
+ if (yych <= '\f') goto yy109;
+ goto yy103;
} else {
- if (yych == '"') goto yy98;
- if (yych <= '#') goto yy104;
- goto yy107;
+ if (yych == '"') goto yy103;
+ if (yych <= '#') goto yy109;
+ goto yy112;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy98;
- if (yych <= ':') goto yy104;
- goto yy98;
+ if (yych == '\'') goto yy103;
+ if (yych <= ':') goto yy109;
+ goto yy103;
} else {
- if (yych <= '[') goto yy104;
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
- goto yy104;
+ if (yych <= '[') goto yy109;
+ if (yych <= '\\') goto yy111;
+ if (yych <= ']') goto yy103;
+ goto yy109;
}
}
-yy119:
- YYDEBUG(119, *YYCURSOR);
+yy124:
+ YYDEBUG(124, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(120, *YYCURSOR);
+ YYDEBUG(125, *YYCURSOR);
if (yych <= '\'') {
if (yych <= '!') {
if (yych <= '\n') {
- if (yych <= '\t') goto yy104;
- goto yy98;
+ if (yych <= '\t') goto yy109;
+ goto yy103;
} else {
- if (yych == '\r') goto yy98;
- goto yy104;
+ if (yych == '\r') goto yy103;
+ goto yy109;
}
} else {
if (yych <= '#') {
- if (yych <= '"') goto yy98;
- goto yy104;
+ if (yych <= '"') goto yy103;
+ goto yy109;
} else {
- if (yych <= '$') goto yy107;
- if (yych <= '&') goto yy104;
- goto yy98;
+ if (yych <= '$') goto yy112;
+ if (yych <= '&') goto yy109;
+ goto yy103;
}
}
} else {
if (yych <= ':') {
if (yych <= '.') {
- if (yych <= '-') goto yy104;
- goto yy117;
+ if (yych <= '-') goto yy109;
+ goto yy122;
} else {
- if (yych <= '/') goto yy104;
- if (yych <= '9') goto yy119;
- goto yy104;
+ if (yych <= '/') goto yy109;
+ if (yych <= '9') goto yy124;
+ goto yy109;
}
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy98;
- goto yy104;
+ if (yych <= ';') goto yy103;
+ goto yy109;
} else {
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
- goto yy104;
+ if (yych <= '\\') goto yy111;
+ if (yych <= ']') goto yy103;
+ goto yy109;
}
}
}
-yy121:
- YYDEBUG(121, *YYCURSOR);
+yy126:
+ YYDEBUG(126, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(122, *YYCURSOR);
+ YYDEBUG(127, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy104;
- goto yy98;
+ if (yych == '\n') goto yy103;
+ if (yych <= '\f') goto yy109;
+ goto yy103;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy104;
- goto yy98;
+ if (yych <= '!') goto yy109;
+ goto yy103;
} else {
- if (yych == '$') goto yy107;
- goto yy104;
+ if (yych == '$') goto yy112;
+ goto yy109;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy98;
- if (yych <= '/') goto yy104;
- if (yych <= '9') goto yy121;
- goto yy104;
+ if (yych <= '\'') goto yy103;
+ if (yych <= '/') goto yy109;
+ if (yych <= '9') goto yy126;
+ goto yy109;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy98;
- goto yy104;
+ if (yych <= ';') goto yy103;
+ goto yy109;
} else {
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
- goto yy104;
+ if (yych <= '\\') goto yy111;
+ if (yych <= ']') goto yy103;
+ goto yy109;
}
}
}
-yy123:
- YYDEBUG(123, *YYCURSOR);
+yy128:
+ YYDEBUG(128, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(124, *YYCURSOR);
+ YYDEBUG(129, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy104;
- goto yy98;
+ if (yych == '\n') goto yy103;
+ if (yych <= '\f') goto yy109;
+ goto yy103;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy104;
- goto yy98;
+ if (yych <= '!') goto yy109;
+ goto yy103;
} else {
- if (yych == '$') goto yy107;
- goto yy104;
+ if (yych == '$') goto yy112;
+ goto yy109;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy98;
- if (yych <= '/') goto yy104;
- if (yych <= '9') goto yy123;
- goto yy104;
+ if (yych <= '\'') goto yy103;
+ if (yych <= '/') goto yy109;
+ if (yych <= '9') goto yy128;
+ goto yy109;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy98;
- goto yy104;
+ if (yych <= ';') goto yy103;
+ goto yy109;
} else {
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
- goto yy104;
+ if (yych <= '\\') goto yy111;
+ if (yych <= ']') goto yy103;
+ goto yy109;
}
}
}
-yy125:
- YYDEBUG(125, *YYCURSOR);
+yy130:
+ YYDEBUG(130, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(126, *YYCURSOR);
+ YYDEBUG(131, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy125;
+ goto yy130;
}
- YYDEBUG(127, *YYCURSOR);
+ YYDEBUG(132, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(128, *YYCURSOR);
+ YYDEBUG(133, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 365 "Zend/zend_ini_scanner.l"
+#line 412 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -1767,59 +1871,59 @@ yy125:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 1771 "Zend/zend_ini_scanner.c"
-yy129:
- YYDEBUG(129, *YYCURSOR);
+#line 1875 "Zend/zend_ini_scanner.c"
+yy134:
+ YYDEBUG(134, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(130, *YYCURSOR);
+ YYDEBUG(135, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 398 "Zend/zend_ini_scanner.l"
+#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 1782 "Zend/zend_ini_scanner.c"
-yy131:
- YYDEBUG(131, *YYCURSOR);
+#line 1886 "Zend/zend_ini_scanner.c"
+yy136:
+ YYDEBUG(136, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(132, *YYCURSOR);
+ YYDEBUG(137, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy131;
+ goto yy136;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy87;
- if (yych <= '\f') goto yy104;
- goto yy87;
+ if (yych == '\n') goto yy92;
+ if (yych <= '\f') goto yy109;
+ goto yy92;
} else {
- if (yych == '"') goto yy133;
- if (yych <= '#') goto yy104;
- goto yy107;
+ if (yych == '"') goto yy138;
+ if (yych <= '#') goto yy109;
+ goto yy112;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy87;
- if (yych <= ':') goto yy104;
- goto yy87;
+ if (yych == '\'') goto yy92;
+ if (yych <= ':') goto yy109;
+ goto yy92;
} else {
- if (yych <= '[') goto yy104;
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy134;
- goto yy104;
+ if (yych <= '[') goto yy109;
+ if (yych <= '\\') goto yy111;
+ if (yych <= ']') goto yy139;
+ goto yy109;
}
}
-yy133:
- YYDEBUG(133, *YYCURSOR);
+yy138:
+ YYDEBUG(138, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy92;
-yy134:
- YYDEBUG(134, *YYCURSOR);
+ goto yy97;
+yy139:
+ YYDEBUG(139, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy103;
+ goto yy108;
}
/* *********************************** */
yyc_ST_RAW:
@@ -1858,44 +1962,44 @@ yyc_ST_RAW:
64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64,
};
- YYDEBUG(135, *YYCURSOR);
+ YYDEBUG(140, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '\f') {
if (yych <= 0x08) {
- if (yych >= 0x01) goto yy139;
+ if (yych >= 0x01) goto yy144;
} else {
- if (yych <= '\t') goto yy141;
- if (yych <= '\n') goto yy142;
- goto yy139;
+ if (yych <= '\t') goto yy146;
+ if (yych <= '\n') goto yy147;
+ goto yy144;
}
} else {
if (yych <= ' ') {
- if (yych <= '\r') goto yy144;
- if (yych <= 0x1F) goto yy139;
- goto yy141;
+ if (yych <= '\r') goto yy149;
+ if (yych <= 0x1F) goto yy144;
+ goto yy146;
} else {
- if (yych == ';') goto yy145;
- goto yy139;
+ if (yych == ';') goto yy150;
+ goto yy144;
}
}
- YYDEBUG(137, *YYCURSOR);
+ YYDEBUG(142, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(138, *YYCURSOR);
+ YYDEBUG(143, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 595 "Zend/zend_ini_scanner.l"
+#line 646 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 1892 "Zend/zend_ini_scanner.c"
-yy139:
- YYDEBUG(139, *YYCURSOR);
+#line 1996 "Zend/zend_ini_scanner.c"
+yy144:
+ YYDEBUG(144, *YYCURSOR);
++YYCURSOR;
-yy140:
- YYDEBUG(140, *YYCURSOR);
+yy145:
+ YYDEBUG(145, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 445 "Zend/zend_ini_scanner.l"
+#line 496 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
unsigned char *sc = NULL;
while (YYCURSOR < YYLIMIT) {
@@ -1932,111 +2036,111 @@ end_raw_value_chars:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 1936 "Zend/zend_ini_scanner.c"
-yy141:
- YYDEBUG(141, *YYCURSOR);
+#line 2040 "Zend/zend_ini_scanner.c"
+yy146:
+ YYDEBUG(146, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '\r') {
- if (yych <= 0x08) goto yy140;
- if (yych <= '\n') goto yy153;
- if (yych <= '\f') goto yy140;
- goto yy153;
+ if (yych <= 0x08) goto yy145;
+ if (yych <= '\n') goto yy158;
+ if (yych <= '\f') goto yy145;
+ goto yy158;
} else {
if (yych <= ' ') {
- if (yych <= 0x1F) goto yy140;
- goto yy153;
+ if (yych <= 0x1F) goto yy145;
+ goto yy158;
} else {
- if (yych == ';') goto yy153;
- goto yy140;
+ if (yych == ';') goto yy158;
+ goto yy145;
}
}
-yy142:
- YYDEBUG(142, *YYCURSOR);
+yy147:
+ YYDEBUG(147, *YYCURSOR);
++YYCURSOR;
-yy143:
- YYDEBUG(143, *YYCURSOR);
+yy148:
+ YYDEBUG(148, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 486 "Zend/zend_ini_scanner.l"
+#line 537 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 1967 "Zend/zend_ini_scanner.c"
-yy144:
- YYDEBUG(144, *YYCURSOR);
+#line 2071 "Zend/zend_ini_scanner.c"
+yy149:
+ YYDEBUG(149, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy151;
- goto yy143;
-yy145:
- YYDEBUG(145, *YYCURSOR);
+ if (yych == '\n') goto yy156;
+ goto yy148;
+yy150:
+ YYDEBUG(150, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy147;
-yy146:
- YYDEBUG(146, *YYCURSOR);
+ goto yy152;
+yy151:
+ YYDEBUG(151, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy147:
- YYDEBUG(147, *YYCURSOR);
+yy152:
+ YYDEBUG(152, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy146;
+ goto yy151;
}
- if (yych >= '\r') goto yy150;
-yy148:
- YYDEBUG(148, *YYCURSOR);
+ if (yych >= '\r') goto yy155;
+yy153:
+ YYDEBUG(153, *YYCURSOR);
++YYCURSOR;
-yy149:
- YYDEBUG(149, *YYCURSOR);
+yy154:
+ YYDEBUG(154, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 582 "Zend/zend_ini_scanner.l"
+#line 633 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 2001 "Zend/zend_ini_scanner.c"
-yy150:
- YYDEBUG(150, *YYCURSOR);
+#line 2105 "Zend/zend_ini_scanner.c"
+yy155:
+ YYDEBUG(155, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy148;
- goto yy149;
-yy151:
- YYDEBUG(151, *YYCURSOR);
+ if (yych == '\n') goto yy153;
+ goto yy154;
+yy156:
+ YYDEBUG(156, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy143;
-yy152:
- YYDEBUG(152, *YYCURSOR);
+ goto yy148;
+yy157:
+ YYDEBUG(157, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy153:
- YYDEBUG(153, *YYCURSOR);
+yy158:
+ YYDEBUG(158, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy152;
+ goto yy157;
}
if (yych <= '\f') {
- if (yych == '\n') goto yy151;
+ if (yych == '\n') goto yy156;
} else {
- if (yych <= '\r') goto yy155;
- if (yych == ';') goto yy146;
+ if (yych <= '\r') goto yy160;
+ if (yych == ';') goto yy151;
}
- YYDEBUG(154, *YYCURSOR);
+ YYDEBUG(159, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 572 "Zend/zend_ini_scanner.l"
+#line 623 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
-#line 2035 "Zend/zend_ini_scanner.c"
-yy155:
- YYDEBUG(155, *YYCURSOR);
+#line 2139 "Zend/zend_ini_scanner.c"
+yy160:
+ YYDEBUG(160, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy151;
- goto yy143;
+ if ((yych = *YYCURSOR) == '\n') goto yy156;
+ goto yy148;
}
/* *********************************** */
yyc_ST_SECTION_RAW:
@@ -2075,85 +2179,85 @@ yyc_ST_SECTION_RAW:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
- YYDEBUG(156, *YYCURSOR);
+ YYDEBUG(161, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '\f') {
- if (yych == '\n') goto yy160;
+ if (yych == '\n') goto yy165;
} else {
- if (yych <= '\r') goto yy160;
- if (yych == ']') goto yy162;
+ if (yych <= '\r') goto yy165;
+ if (yych == ']') goto yy167;
}
- YYDEBUG(158, *YYCURSOR);
+ YYDEBUG(163, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy169;
-yy159:
- YYDEBUG(159, *YYCURSOR);
+ goto yy174;
+yy164:
+ YYDEBUG(164, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 482 "Zend/zend_ini_scanner.l"
+#line 533 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 2099 "Zend/zend_ini_scanner.c"
-yy160:
- YYDEBUG(160, *YYCURSOR);
+#line 2203 "Zend/zend_ini_scanner.c"
+yy165:
+ YYDEBUG(165, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(161, *YYCURSOR);
+ YYDEBUG(166, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 600 "Zend/zend_ini_scanner.l"
+#line 651 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 2109 "Zend/zend_ini_scanner.c"
-yy162:
- YYDEBUG(162, *YYCURSOR);
+#line 2213 "Zend/zend_ini_scanner.c"
+yy167:
+ YYDEBUG(167, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy165;
-yy163:
- YYDEBUG(163, *YYCURSOR);
+ goto yy170;
+yy168:
+ YYDEBUG(168, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 374 "Zend/zend_ini_scanner.l"
+#line 421 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
-#line 2124 "Zend/zend_ini_scanner.c"
-yy164:
- YYDEBUG(164, *YYCURSOR);
+#line 2228 "Zend/zend_ini_scanner.c"
+yy169:
+ YYDEBUG(169, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy165:
- YYDEBUG(165, *YYCURSOR);
+yy170:
+ YYDEBUG(170, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy164;
+ goto yy169;
}
- if (yych == '\n') goto yy166;
- if (yych == '\r') goto yy167;
- goto yy163;
-yy166:
- YYDEBUG(166, *YYCURSOR);
+ if (yych == '\n') goto yy171;
+ if (yych == '\r') goto yy172;
+ goto yy168;
+yy171:
+ YYDEBUG(171, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy163;
-yy167:
- YYDEBUG(167, *YYCURSOR);
+ goto yy168;
+yy172:
+ YYDEBUG(172, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy166;
- goto yy163;
-yy168:
- YYDEBUG(168, *YYCURSOR);
+ if (yych == '\n') goto yy171;
+ goto yy168;
+yy173:
+ YYDEBUG(173, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy169:
- YYDEBUG(169, *YYCURSOR);
+yy174:
+ YYDEBUG(174, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy168;
+ goto yy173;
}
- goto yy159;
+ goto yy164;
}
/* *********************************** */
yyc_ST_SECTION_VALUE:
@@ -2192,523 +2296,523 @@ yyc_ST_SECTION_VALUE:
132, 132, 132, 132, 132, 132, 132, 132,
132, 132, 132, 132, 132, 132, 132, 132,
};
- YYDEBUG(170, *YYCURSOR);
+ YYDEBUG(175, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '-') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy172;
- if (yych <= '\t') goto yy174;
- goto yy175;
+ if (yych <= 0x08) goto yy177;
+ if (yych <= '\t') goto yy179;
+ goto yy180;
} else {
- if (yych == '\r') goto yy175;
- if (yych >= ' ') goto yy174;
+ if (yych == '\r') goto yy180;
+ if (yych >= ' ') goto yy179;
}
} else {
if (yych <= '$') {
- if (yych == '"') goto yy177;
- if (yych >= '$') goto yy179;
+ if (yych == '"') goto yy182;
+ if (yych >= '$') goto yy184;
} else {
- if (yych == '\'') goto yy180;
- if (yych >= '-') goto yy181;
+ if (yych == '\'') goto yy185;
+ if (yych >= '-') goto yy186;
}
}
} else {
if (yych <= 'Z') {
if (yych <= '9') {
- if (yych <= '.') goto yy182;
- if (yych >= '0') goto yy183;
+ if (yych <= '.') goto yy187;
+ if (yych >= '0') goto yy188;
} else {
- if (yych == ';') goto yy175;
- if (yych >= 'A') goto yy185;
+ if (yych == ';') goto yy180;
+ if (yych >= 'A') goto yy190;
}
} else {
if (yych <= '^') {
- if (yych <= '[') goto yy172;
- if (yych <= '\\') goto yy187;
- if (yych <= ']') goto yy188;
+ if (yych <= '[') goto yy177;
+ if (yych <= '\\') goto yy192;
+ if (yych <= ']') goto yy193;
} else {
- if (yych == '`') goto yy172;
- if (yych <= 'z') goto yy185;
+ if (yych == '`') goto yy177;
+ if (yych <= 'z') goto yy190;
}
}
}
-yy172:
- YYDEBUG(172, *YYCURSOR);
+yy177:
+ YYDEBUG(177, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy195;
-yy173:
- YYDEBUG(173, *YYCURSOR);
+ goto yy200;
+yy178:
+ YYDEBUG(178, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 518 "Zend/zend_ini_scanner.l"
+#line 569 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 2250 "Zend/zend_ini_scanner.c"
-yy174:
- YYDEBUG(174, *YYCURSOR);
+#line 2354 "Zend/zend_ini_scanner.c"
+yy179:
+ YYDEBUG(179, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x1F) {
- if (yych == '\t') goto yy221;
- goto yy195;
+ if (yych == '\t') goto yy226;
+ goto yy200;
} else {
- if (yych <= ' ') goto yy221;
- if (yych == '"') goto yy223;
- goto yy195;
+ if (yych <= ' ') goto yy226;
+ if (yych == '"') goto yy228;
+ goto yy200;
}
-yy175:
- YYDEBUG(175, *YYCURSOR);
+yy180:
+ YYDEBUG(180, *YYCURSOR);
++YYCURSOR;
-yy176:
- YYDEBUG(176, *YYCURSOR);
+yy181:
+ YYDEBUG(181, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 600 "Zend/zend_ini_scanner.l"
+#line 651 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 2273 "Zend/zend_ini_scanner.c"
-yy177:
- YYDEBUG(177, *YYCURSOR);
+#line 2377 "Zend/zend_ini_scanner.c"
+yy182:
+ YYDEBUG(182, *YYCURSOR);
++YYCURSOR;
-yy178:
- YYDEBUG(178, *YYCURSOR);
+yy183:
+ YYDEBUG(183, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 522 "Zend/zend_ini_scanner.l"
+#line 573 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 2285 "Zend/zend_ini_scanner.c"
-yy179:
- YYDEBUG(179, *YYCURSOR);
+#line 2389 "Zend/zend_ini_scanner.c"
+yy184:
+ YYDEBUG(184, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy176;
- if (yych <= '[') goto yy194;
- goto yy199;
+ if (yych <= 0x00) goto yy181;
+ if (yych <= '[') goto yy199;
+ goto yy204;
} else {
- if (yych == '{') goto yy219;
- goto yy194;
+ if (yych == '{') goto yy224;
+ goto yy199;
}
-yy180:
- YYDEBUG(180, *YYCURSOR);
+yy185:
+ YYDEBUG(185, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy215;
+ goto yy220;
}
- goto yy176;
-yy181:
- YYDEBUG(181, *YYCURSOR);
+ goto yy181;
+yy186:
+ YYDEBUG(186, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy195;
- if (yych <= '9') goto yy213;
- goto yy195;
-yy182:
- YYDEBUG(182, *YYCURSOR);
+ if (yych <= '/') goto yy200;
+ if (yych <= '9') goto yy218;
+ goto yy200;
+yy187:
+ YYDEBUG(187, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy195;
- if (yych <= '9') goto yy211;
- goto yy195;
-yy183:
- YYDEBUG(183, *YYCURSOR);
+ if (yych <= '/') goto yy200;
+ if (yych <= '9') goto yy216;
+ goto yy200;
+yy188:
+ YYDEBUG(188, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '\'') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy195;
+ if (yych == '\n') goto yy189;
+ if (yych <= '\f') goto yy200;
} else {
- if (yych == '"') goto yy184;
- if (yych <= '&') goto yy195;
+ if (yych == '"') goto yy189;
+ if (yych <= '&') goto yy200;
}
} else {
if (yych <= '9') {
- if (yych == '.') goto yy207;
- if (yych <= '/') goto yy195;
- goto yy209;
+ if (yych == '.') goto yy212;
+ if (yych <= '/') goto yy200;
+ goto yy214;
} else {
if (yych <= ';') {
- if (yych <= ':') goto yy195;
+ if (yych <= ':') goto yy200;
} else {
- if (yych != ']') goto yy195;
+ if (yych != ']') goto yy200;
}
}
}
-yy184:
- YYDEBUG(184, *YYCURSOR);
+yy189:
+ YYDEBUG(189, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 496 "Zend/zend_ini_scanner.l"
+#line 547 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 2351 "Zend/zend_ini_scanner.c"
-yy185:
- YYDEBUG(185, *YYCURSOR);
+#line 2455 "Zend/zend_ini_scanner.c"
+yy190:
+ YYDEBUG(190, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy205;
+ goto yy210;
}
if (yych <= '"') {
if (yych <= '\f') {
- if (yych != '\n') goto yy195;
+ if (yych != '\n') goto yy200;
} else {
- if (yych <= '\r') goto yy186;
- if (yych <= '!') goto yy195;
+ if (yych <= '\r') goto yy191;
+ if (yych <= '!') goto yy200;
}
} else {
if (yych <= ':') {
- if (yych != '\'') goto yy195;
+ if (yych != '\'') goto yy200;
} else {
- if (yych <= ';') goto yy186;
- if (yych != ']') goto yy195;
+ if (yych <= ';') goto yy191;
+ if (yych != ']') goto yy200;
}
}
-yy186:
- YYDEBUG(186, *YYCURSOR);
+yy191:
+ YYDEBUG(191, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 492 "Zend/zend_ini_scanner.l"
+#line 543 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 2381 "Zend/zend_ini_scanner.c"
-yy187:
- YYDEBUG(187, *YYCURSOR);
+#line 2485 "Zend/zend_ini_scanner.c"
+yy192:
+ YYDEBUG(192, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy194;
-yy188:
- YYDEBUG(188, *YYCURSOR);
+ goto yy199;
+yy193:
+ YYDEBUG(193, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy191;
-yy189:
- YYDEBUG(189, *YYCURSOR);
+ goto yy196;
+yy194:
+ YYDEBUG(194, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 374 "Zend/zend_ini_scanner.l"
+#line 421 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
-#line 2400 "Zend/zend_ini_scanner.c"
-yy190:
- YYDEBUG(190, *YYCURSOR);
+#line 2504 "Zend/zend_ini_scanner.c"
+yy195:
+ YYDEBUG(195, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy191:
- YYDEBUG(191, *YYCURSOR);
+yy196:
+ YYDEBUG(196, *YYCURSOR);
if (yybm[0+yych] & 2) {
- goto yy190;
+ goto yy195;
}
- if (yych == '\n') goto yy192;
- if (yych == '\r') goto yy193;
- goto yy189;
-yy192:
- YYDEBUG(192, *YYCURSOR);
+ if (yych == '\n') goto yy197;
+ if (yych == '\r') goto yy198;
+ goto yy194;
+yy197:
+ YYDEBUG(197, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy189;
-yy193:
- YYDEBUG(193, *YYCURSOR);
+ goto yy194;
+yy198:
+ YYDEBUG(198, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy192;
- goto yy189;
-yy194:
- YYDEBUG(194, *YYCURSOR);
+ if (yych == '\n') goto yy197;
+ goto yy194;
+yy199:
+ YYDEBUG(199, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy195:
- YYDEBUG(195, *YYCURSOR);
+yy200:
+ YYDEBUG(200, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy194;
+ goto yy199;
}
- if (yych == '$') goto yy197;
- if (yych != '\\') goto yy173;
-yy196:
- YYDEBUG(196, *YYCURSOR);
+ if (yych == '$') goto yy202;
+ if (yych != '\\') goto yy178;
+yy201:
+ YYDEBUG(201, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- goto yy194;
-yy197:
- YYDEBUG(197, *YYCURSOR);
+ goto yy199;
+yy202:
+ YYDEBUG(202, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy198;
- if (yych <= '[') goto yy194;
- goto yy199;
+ if (yych <= 0x00) goto yy203;
+ if (yych <= '[') goto yy199;
+ goto yy204;
} else {
- if (yych != '{') goto yy194;
+ if (yych != '{') goto yy199;
}
-yy198:
- YYDEBUG(198, *YYCURSOR);
+yy203:
+ YYDEBUG(203, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 1) {
if (yyaccept <= 0) {
- goto yy173;
+ goto yy178;
} else {
- goto yy176;
+ goto yy181;
}
} else {
if (yyaccept <= 2) {
- goto yy184;
+ goto yy189;
} else {
- goto yy186;
+ goto yy191;
}
}
-yy199:
- YYDEBUG(199, *YYCURSOR);
+yy204:
+ YYDEBUG(204, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy205;
}
- if (yych == '\\') goto yy202;
- goto yy194;
-yy200:
- YYDEBUG(200, *YYCURSOR);
+ if (yych == '\\') goto yy207;
+ goto yy199;
+yy205:
+ YYDEBUG(205, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(201, *YYCURSOR);
+ YYDEBUG(206, *YYCURSOR);
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy205;
}
- if (yych == '\\') goto yy204;
- goto yy194;
-yy202:
- YYDEBUG(202, *YYCURSOR);
+ if (yych == '\\') goto yy209;
+ goto yy199;
+yy207:
+ YYDEBUG(207, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(203, *YYCURSOR);
+ YYDEBUG(208, *YYCURSOR);
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy205;
}
- if (yych == '\\') goto yy202;
- goto yy194;
-yy204:
- YYDEBUG(204, *YYCURSOR);
+ if (yych == '\\') goto yy207;
+ goto yy199;
+yy209:
+ YYDEBUG(209, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy205;
}
- if (yych == '\\') goto yy202;
- goto yy194;
-yy205:
- YYDEBUG(205, *YYCURSOR);
+ if (yych == '\\') goto yy207;
+ goto yy199;
+yy210:
+ YYDEBUG(210, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(206, *YYCURSOR);
+ YYDEBUG(211, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy205;
+ goto yy210;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy186;
- if (yych <= '\f') goto yy194;
- goto yy186;
+ if (yych == '\n') goto yy191;
+ if (yych <= '\f') goto yy199;
+ goto yy191;
} else {
- if (yych == '"') goto yy186;
- if (yych <= '#') goto yy194;
- goto yy197;
+ if (yych == '"') goto yy191;
+ if (yych <= '#') goto yy199;
+ goto yy202;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy186;
- if (yych <= ':') goto yy194;
- goto yy186;
+ if (yych == '\'') goto yy191;
+ if (yych <= ':') goto yy199;
+ goto yy191;
} else {
- if (yych <= '[') goto yy194;
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy186;
- goto yy194;
+ if (yych <= '[') goto yy199;
+ if (yych <= '\\') goto yy201;
+ if (yych <= ']') goto yy191;
+ goto yy199;
}
}
-yy207:
- YYDEBUG(207, *YYCURSOR);
+yy212:
+ YYDEBUG(212, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(208, *YYCURSOR);
+ YYDEBUG(213, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy207;
+ goto yy212;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy194;
- goto yy184;
+ if (yych == '\n') goto yy189;
+ if (yych <= '\f') goto yy199;
+ goto yy189;
} else {
- if (yych == '"') goto yy184;
- if (yych <= '#') goto yy194;
- goto yy197;
+ if (yych == '"') goto yy189;
+ if (yych <= '#') goto yy199;
+ goto yy202;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy184;
- if (yych <= ':') goto yy194;
- goto yy184;
+ if (yych == '\'') goto yy189;
+ if (yych <= ':') goto yy199;
+ goto yy189;
} else {
- if (yych <= '[') goto yy194;
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '[') goto yy199;
+ if (yych <= '\\') goto yy201;
+ if (yych <= ']') goto yy189;
+ goto yy199;
}
}
-yy209:
- YYDEBUG(209, *YYCURSOR);
+yy214:
+ YYDEBUG(214, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(210, *YYCURSOR);
+ YYDEBUG(215, *YYCURSOR);
if (yych <= '\'') {
if (yych <= '!') {
if (yych <= '\n') {
- if (yych <= '\t') goto yy194;
- goto yy184;
+ if (yych <= '\t') goto yy199;
+ goto yy189;
} else {
- if (yych == '\r') goto yy184;
- goto yy194;
+ if (yych == '\r') goto yy189;
+ goto yy199;
}
} else {
if (yych <= '#') {
- if (yych <= '"') goto yy184;
- goto yy194;
+ if (yych <= '"') goto yy189;
+ goto yy199;
} else {
- if (yych <= '$') goto yy197;
- if (yych <= '&') goto yy194;
- goto yy184;
+ if (yych <= '$') goto yy202;
+ if (yych <= '&') goto yy199;
+ goto yy189;
}
}
} else {
if (yych <= ':') {
if (yych <= '.') {
- if (yych <= '-') goto yy194;
- goto yy207;
+ if (yych <= '-') goto yy199;
+ goto yy212;
} else {
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy209;
- goto yy194;
+ if (yych <= '/') goto yy199;
+ if (yych <= '9') goto yy214;
+ goto yy199;
}
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy184;
- goto yy194;
+ if (yych <= ';') goto yy189;
+ goto yy199;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '\\') goto yy201;
+ if (yych <= ']') goto yy189;
+ goto yy199;
}
}
}
-yy211:
- YYDEBUG(211, *YYCURSOR);
+yy216:
+ YYDEBUG(216, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(212, *YYCURSOR);
+ YYDEBUG(217, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy194;
- goto yy184;
+ if (yych == '\n') goto yy189;
+ if (yych <= '\f') goto yy199;
+ goto yy189;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy194;
- goto yy184;
+ if (yych <= '!') goto yy199;
+ goto yy189;
} else {
- if (yych == '$') goto yy197;
- goto yy194;
+ if (yych == '$') goto yy202;
+ goto yy199;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy184;
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy211;
- goto yy194;
+ if (yych <= '\'') goto yy189;
+ if (yych <= '/') goto yy199;
+ if (yych <= '9') goto yy216;
+ goto yy199;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy184;
- goto yy194;
+ if (yych <= ';') goto yy189;
+ goto yy199;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '\\') goto yy201;
+ if (yych <= ']') goto yy189;
+ goto yy199;
}
}
}
-yy213:
- YYDEBUG(213, *YYCURSOR);
+yy218:
+ YYDEBUG(218, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(214, *YYCURSOR);
+ YYDEBUG(219, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy194;
- goto yy184;
+ if (yych == '\n') goto yy189;
+ if (yych <= '\f') goto yy199;
+ goto yy189;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy194;
- goto yy184;
+ if (yych <= '!') goto yy199;
+ goto yy189;
} else {
- if (yych == '$') goto yy197;
- goto yy194;
+ if (yych == '$') goto yy202;
+ goto yy199;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy184;
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy213;
- goto yy194;
+ if (yych <= '\'') goto yy189;
+ if (yych <= '/') goto yy199;
+ if (yych <= '9') goto yy218;
+ goto yy199;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy184;
- goto yy194;
+ if (yych <= ';') goto yy189;
+ goto yy199;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '\\') goto yy201;
+ if (yych <= ']') goto yy189;
+ goto yy199;
}
}
}
-yy215:
- YYDEBUG(215, *YYCURSOR);
+yy220:
+ YYDEBUG(220, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(216, *YYCURSOR);
+ YYDEBUG(221, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy215;
+ goto yy220;
}
- YYDEBUG(217, *YYCURSOR);
+ YYDEBUG(222, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(218, *YYCURSOR);
+ YYDEBUG(223, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 365 "Zend/zend_ini_scanner.l"
+#line 412 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -2717,65 +2821,65 @@ yy215:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 2721 "Zend/zend_ini_scanner.c"
-yy219:
- YYDEBUG(219, *YYCURSOR);
+#line 2825 "Zend/zend_ini_scanner.c"
+yy224:
+ YYDEBUG(224, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(220, *YYCURSOR);
+ YYDEBUG(225, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 398 "Zend/zend_ini_scanner.l"
+#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 2732 "Zend/zend_ini_scanner.c"
-yy221:
- YYDEBUG(221, *YYCURSOR);
+#line 2836 "Zend/zend_ini_scanner.c"
+yy226:
+ YYDEBUG(226, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(222, *YYCURSOR);
+ YYDEBUG(227, *YYCURSOR);
if (yych <= '"') {
if (yych <= '\f') {
- if (yych <= 0x08) goto yy194;
- if (yych <= '\t') goto yy221;
- if (yych <= '\n') goto yy173;
- goto yy194;
+ if (yych <= 0x08) goto yy199;
+ if (yych <= '\t') goto yy226;
+ if (yych <= '\n') goto yy178;
+ goto yy199;
} else {
if (yych <= 0x1F) {
- if (yych <= '\r') goto yy173;
- goto yy194;
+ if (yych <= '\r') goto yy178;
+ goto yy199;
} else {
- if (yych <= ' ') goto yy221;
- if (yych <= '!') goto yy194;
+ if (yych <= ' ') goto yy226;
+ if (yych <= '!') goto yy199;
}
}
} else {
if (yych <= ':') {
if (yych <= '$') {
- if (yych <= '#') goto yy194;
- goto yy197;
+ if (yych <= '#') goto yy199;
+ goto yy202;
} else {
- if (yych == '\'') goto yy173;
- goto yy194;
+ if (yych == '\'') goto yy178;
+ goto yy199;
}
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy173;
- goto yy194;
+ if (yych <= ';') goto yy178;
+ goto yy199;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy173;
- goto yy194;
+ if (yych <= '\\') goto yy201;
+ if (yych <= ']') goto yy178;
+ goto yy199;
}
}
}
-yy223:
- YYDEBUG(223, *YYCURSOR);
+yy228:
+ YYDEBUG(228, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy178;
+ goto yy183;
}
/* *********************************** */
yyc_ST_VALUE:
@@ -2814,28 +2918,28 @@ yyc_ST_VALUE:
162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162,
};
- YYDEBUG(224, *YYCURSOR);
+ YYDEBUG(229, *YYCURSOR);
YYFILL(6);
yych = *YYCURSOR;
YYDEBUG(-1, yych);
switch (yych) {
- case 0x00: goto yy226;
+ case 0x00: goto yy231;
case '\t':
- case ' ': goto yy230;
- case '\n': goto yy232;
- case '\r': goto yy234;
+ case ' ': goto yy235;
+ case '\n': goto yy237;
+ case '\r': goto yy239;
case '!':
case '&':
case '(':
case ')':
case '^':
case '|':
- case '~': goto yy235;
- case '"': goto yy237;
- case '$': goto yy239;
- case '\'': goto yy240;
- case '-': goto yy241;
- case '.': goto yy242;
+ case '~': goto yy240;
+ case '"': goto yy242;
+ case '$': goto yy244;
+ case '\'': goto yy245;
+ case '-': goto yy246;
+ case '.': goto yy247;
case '0':
case '1':
case '2':
@@ -2845,9 +2949,9 @@ yyc_ST_VALUE:
case '6':
case '7':
case '8':
- case '9': goto yy243;
- case ';': goto yy245;
- case '=': goto yy246;
+ case '9': goto yy248;
+ case ';': goto yy250;
+ case '=': goto yy251;
case 'A':
case 'B':
case 'C':
@@ -2890,1576 +2994,1637 @@ yyc_ST_VALUE:
case 'v':
case 'w':
case 'x':
- case 'z': goto yy248;
+ case 'z': goto yy253;
case 'F':
- case 'f': goto yy250;
+ case 'f': goto yy255;
case 'N':
- case 'n': goto yy251;
+ case 'n': goto yy256;
case 'O':
- case 'o': goto yy252;
+ case 'o': goto yy257;
case 'T':
- case 't': goto yy253;
+ case 't': goto yy258;
case 'Y':
- case 'y': goto yy254;
- default: goto yy228;
+ case 'y': goto yy259;
+ default: goto yy233;
}
-yy226:
- YYDEBUG(226, *YYCURSOR);
+yy231:
+ YYDEBUG(231, *YYCURSOR);
++YYCURSOR;
-yy227:
- YYDEBUG(227, *YYCURSOR);
+yy232:
+ YYDEBUG(232, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 595 "Zend/zend_ini_scanner.l"
+#line 646 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 2918 "Zend/zend_ini_scanner.c"
-yy228:
- YYDEBUG(228, *YYCURSOR);
+#line 3022 "Zend/zend_ini_scanner.c"
+yy233:
+ YYDEBUG(233, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy256;
-yy229:
- YYDEBUG(229, *YYCURSOR);
+ goto yy261;
+yy234:
+ YYDEBUG(234, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 514 "Zend/zend_ini_scanner.l"
+#line 565 "Zend/zend_ini_scanner.l"
{ /* Get everything else as option/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 2931 "Zend/zend_ini_scanner.c"
-yy230:
- YYDEBUG(230, *YYCURSOR);
+#line 3035 "Zend/zend_ini_scanner.c"
+yy235:
+ YYDEBUG(235, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy306;
-yy231:
- YYDEBUG(231, *YYCURSOR);
+ goto yy315;
+yy236:
+ YYDEBUG(236, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 568 "Zend/zend_ini_scanner.l"
+#line 619 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
}
-#line 2944 "Zend/zend_ini_scanner.c"
-yy232:
- YYDEBUG(232, *YYCURSOR);
+#line 3048 "Zend/zend_ini_scanner.c"
+yy237:
+ YYDEBUG(237, *YYCURSOR);
++YYCURSOR;
-yy233:
- YYDEBUG(233, *YYCURSOR);
+yy238:
+ YYDEBUG(238, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 486 "Zend/zend_ini_scanner.l"
+#line 537 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 2957 "Zend/zend_ini_scanner.c"
-yy234:
- YYDEBUG(234, *YYCURSOR);
+#line 3061 "Zend/zend_ini_scanner.c"
+yy239:
+ YYDEBUG(239, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy304;
- goto yy233;
-yy235:
- YYDEBUG(235, *YYCURSOR);
+ if (yych == '\n') goto yy313;
+ goto yy238;
+yy240:
+ YYDEBUG(240, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy303;
-yy236:
- YYDEBUG(236, *YYCURSOR);
+ goto yy312;
+yy241:
+ YYDEBUG(241, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 504 "Zend/zend_ini_scanner.l"
+#line 555 "Zend/zend_ini_scanner.l"
{ /* Boolean operators */
return yytext[0];
}
-#line 2975 "Zend/zend_ini_scanner.c"
-yy237:
- YYDEBUG(237, *YYCURSOR);
+#line 3079 "Zend/zend_ini_scanner.c"
+yy242:
+ YYDEBUG(242, *YYCURSOR);
++YYCURSOR;
-yy238:
- YYDEBUG(238, *YYCURSOR);
+yy243:
+ YYDEBUG(243, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 522 "Zend/zend_ini_scanner.l"
+#line 573 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 2987 "Zend/zend_ini_scanner.c"
-yy239:
- YYDEBUG(239, *YYCURSOR);
+#line 3091 "Zend/zend_ini_scanner.c"
+yy244:
+ YYDEBUG(244, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy227;
- if (yych <= '[') goto yy255;
- goto yy262;
+ if (yych <= 0x00) goto yy232;
+ if (yych <= '[') goto yy260;
+ goto yy267;
} else {
- if (yych == '{') goto yy300;
- goto yy255;
+ if (yych == '{') goto yy309;
+ goto yy260;
}
-yy240:
- YYDEBUG(240, *YYCURSOR);
+yy245:
+ YYDEBUG(245, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy296;
+ goto yy305;
}
- goto yy227;
-yy241:
- YYDEBUG(241, *YYCURSOR);
+ goto yy232;
+yy246:
+ YYDEBUG(246, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy294;
- goto yy256;
-yy242:
- YYDEBUG(242, *YYCURSOR);
+ if (yych <= '/') goto yy261;
+ if (yych <= '9') goto yy303;
+ goto yy261;
+yy247:
+ YYDEBUG(247, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy292;
- goto yy256;
-yy243:
- YYDEBUG(243, *YYCURSOR);
+ if (yych <= '/') goto yy261;
+ if (yych <= '9') goto yy301;
+ goto yy261;
+yy248:
+ YYDEBUG(248, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy256;
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy261;
} else {
- if (yych != '\r') goto yy256;
+ if (yych != '\r') goto yy261;
}
} else {
if (yych <= ')') {
- if (yych <= '"') goto yy244;
- if (yych <= '%') goto yy256;
+ if (yych <= '"') goto yy249;
+ if (yych <= '%') goto yy261;
} else {
- if (yych == '.') goto yy288;
- goto yy256;
+ if (yych == '.') goto yy297;
+ goto yy261;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= '9') goto yy290;
- if (yych <= ':') goto yy256;
+ if (yych <= '9') goto yy299;
+ if (yych <= ':') goto yy261;
} else {
- if (yych != '=') goto yy256;
+ if (yych != '=') goto yy261;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '{') goto yy261;
} else {
- if (yych != '~') goto yy256;
+ if (yych != '~') goto yy261;
}
}
}
-yy244:
- YYDEBUG(244, *YYCURSOR);
+yy249:
+ YYDEBUG(249, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 496 "Zend/zend_ini_scanner.l"
+#line 547 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 3066 "Zend/zend_ini_scanner.c"
-yy245:
- YYDEBUG(245, *YYCURSOR);
+#line 3170 "Zend/zend_ini_scanner.c"
+yy250:
+ YYDEBUG(250, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy284;
-yy246:
- YYDEBUG(246, *YYCURSOR);
+ goto yy293;
+yy251:
+ YYDEBUG(251, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(247, *YYCURSOR);
+ YYDEBUG(252, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 508 "Zend/zend_ini_scanner.l"
+#line 559 "Zend/zend_ini_scanner.l"
{ /* Make = used in option value to trigger error */
yyless(0);
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 3083 "Zend/zend_ini_scanner.c"
-yy248:
- YYDEBUG(248, *YYCURSOR);
+#line 3187 "Zend/zend_ini_scanner.c"
+yy253:
+ YYDEBUG(253, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy257;
+ goto yy262;
}
if (yych <= ':') {
if (yych <= '\r') {
if (yych <= 0x08) {
- if (yych >= 0x01) goto yy256;
+ if (yych >= 0x01) goto yy261;
} else {
- if (yych <= '\n') goto yy249;
- if (yych <= '\f') goto yy256;
+ if (yych <= '\n') goto yy254;
+ if (yych <= '\f') goto yy261;
}
} else {
if (yych <= '"') {
- if (yych <= 0x1F) goto yy256;
+ if (yych <= 0x1F) goto yy261;
} else {
- if (yych <= '%') goto yy256;
- if (yych >= '*') goto yy256;
+ if (yych <= '%') goto yy261;
+ if (yych >= '*') goto yy261;
}
}
} else {
if (yych <= '^') {
if (yych <= '<') {
- if (yych >= '<') goto yy256;
+ if (yych >= '<') goto yy261;
} else {
- if (yych <= '=') goto yy249;
- if (yych <= ']') goto yy256;
+ if (yych <= '=') goto yy254;
+ if (yych <= ']') goto yy261;
}
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
+ if (yych <= '{') goto yy261;
} else {
- if (yych != '~') goto yy256;
+ if (yych != '~') goto yy261;
}
}
}
-yy249:
- YYDEBUG(249, *YYCURSOR);
+yy254:
+ YYDEBUG(254, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 492 "Zend/zend_ini_scanner.l"
+#line 543 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 3130 "Zend/zend_ini_scanner.c"
-yy250:
- YYDEBUG(250, *YYCURSOR);
+#line 3234 "Zend/zend_ini_scanner.c"
+yy255:
+ YYDEBUG(255, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '<') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '/') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- goto yy256;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ goto yy261;
} else {
- if (yych <= '9') goto yy257;
- if (yych == ';') goto yy249;
- goto yy256;
+ if (yych <= '9') goto yy262;
+ if (yych == ';') goto yy254;
+ goto yy261;
}
}
} else {
if (yych <= '_') {
if (yych <= 'A') {
- if (yych <= '=') goto yy249;
- if (yych <= '@') goto yy256;
- goto yy280;
+ if (yych <= '=') goto yy254;
+ if (yych <= '@') goto yy261;
+ goto yy289;
} else {
- if (yych <= 'Z') goto yy257;
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- goto yy257;
+ if (yych <= 'Z') goto yy262;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych <= '`') goto yy256;
- if (yych <= 'a') goto yy280;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych <= '`') goto yy261;
+ if (yych <= 'a') goto yy289;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy251:
- YYDEBUG(251, *YYCURSOR);
+yy256:
+ YYDEBUG(256, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'N') {
if (yych <= '%') {
if (yych <= '\f') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- if (yych <= '\n') goto yy249;
- goto yy256;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ if (yych <= '\n') goto yy254;
+ goto yy261;
} else {
- if (yych <= '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- if (yych <= '"') goto yy249;
- goto yy256;
+ if (yych <= '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ if (yych <= '"') goto yy254;
+ goto yy261;
}
} else {
if (yych <= ':') {
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy257;
- goto yy256;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ if (yych <= '9') goto yy262;
+ goto yy261;
} else {
if (yych <= '<') {
- if (yych <= ';') goto yy249;
- goto yy256;
+ if (yych <= ';') goto yy254;
+ goto yy261;
} else {
- if (yych <= '=') goto yy249;
- if (yych <= '@') goto yy256;
- goto yy257;
+ if (yych <= '=') goto yy254;
+ if (yych <= '@') goto yy261;
+ goto yy262;
}
}
}
} else {
if (yych <= 'n') {
if (yych <= 'Z') {
- if (yych <= 'O') goto yy276;
- if (yych == 'U') goto yy277;
- goto yy257;
+ if (yych <= 'O') goto yy281;
+ if (yych == 'U') goto yy282;
+ goto yy262;
} else {
if (yych <= '^') {
- if (yych <= ']') goto yy256;
- goto yy249;
+ if (yych <= ']') goto yy261;
+ goto yy254;
} else {
- if (yych == '`') goto yy256;
- goto yy257;
+ if (yych == '`') goto yy261;
+ goto yy262;
}
}
} else {
if (yych <= 'z') {
- if (yych <= 'o') goto yy276;
- if (yych == 'u') goto yy277;
- goto yy257;
+ if (yych <= 'o') goto yy281;
+ if (yych == 'u') goto yy282;
+ goto yy262;
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
- goto yy249;
+ if (yych <= '{') goto yy261;
+ goto yy254;
} else {
- if (yych == '~') goto yy249;
- goto yy256;
+ if (yych == '~') goto yy254;
+ goto yy261;
}
}
}
}
-yy252:
- YYDEBUG(252, *YYCURSOR);
+yy257:
+ YYDEBUG(257, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'E') {
if (yych <= '%') {
if (yych <= '\f') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- if (yych <= '\n') goto yy249;
- goto yy256;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ if (yych <= '\n') goto yy254;
+ goto yy261;
} else {
- if (yych <= '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- if (yych <= '"') goto yy249;
- goto yy256;
+ if (yych <= '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ if (yych <= '"') goto yy254;
+ goto yy261;
}
} else {
if (yych <= ':') {
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy257;
- goto yy256;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ if (yych <= '9') goto yy262;
+ goto yy261;
} else {
if (yych <= '<') {
- if (yych <= ';') goto yy249;
- goto yy256;
+ if (yych <= ';') goto yy254;
+ goto yy261;
} else {
- if (yych <= '=') goto yy249;
- if (yych <= '@') goto yy256;
- goto yy257;
+ if (yych <= '=') goto yy254;
+ if (yych <= '@') goto yy261;
+ goto yy262;
}
}
}
} else {
if (yych <= 'e') {
if (yych <= 'Z') {
- if (yych <= 'F') goto yy271;
- if (yych == 'N') goto yy265;
- goto yy257;
+ if (yych <= 'F') goto yy276;
+ if (yych == 'N') goto yy270;
+ goto yy262;
} else {
if (yych <= '^') {
- if (yych <= ']') goto yy256;
- goto yy249;
+ if (yych <= ']') goto yy261;
+ goto yy254;
} else {
- if (yych == '`') goto yy256;
- goto yy257;
+ if (yych == '`') goto yy261;
+ goto yy262;
}
}
} else {
if (yych <= 'z') {
- if (yych <= 'f') goto yy271;
- if (yych == 'n') goto yy265;
- goto yy257;
+ if (yych <= 'f') goto yy276;
+ if (yych == 'n') goto yy270;
+ goto yy262;
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
- goto yy249;
+ if (yych <= '{') goto yy261;
+ goto yy254;
} else {
- if (yych == '~') goto yy249;
- goto yy256;
+ if (yych == '~') goto yy254;
+ goto yy261;
}
}
}
}
-yy253:
- YYDEBUG(253, *YYCURSOR);
+yy258:
+ YYDEBUG(258, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'R') goto yy269;
- goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych == 'R') goto yy274;
+ goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'r') goto yy269;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'r') goto yy274;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy254:
- YYDEBUG(254, *YYCURSOR);
+yy259:
+ YYDEBUG(259, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy259;
- goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych == 'E') goto yy264;
+ goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy259;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy264;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy255:
- YYDEBUG(255, *YYCURSOR);
+yy260:
+ YYDEBUG(260, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy256:
- YYDEBUG(256, *YYCURSOR);
+yy261:
+ YYDEBUG(261, *YYCURSOR);
if (yybm[0+yych] & 2) {
- goto yy255;
+ goto yy260;
}
- if (yych == '$') goto yy260;
- goto yy229;
-yy257:
- YYDEBUG(257, *YYCURSOR);
+ if (yych == '$') goto yy265;
+ goto yy234;
+yy262:
+ YYDEBUG(262, *YYCURSOR);
yyaccept = 4;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(258, *YYCURSOR);
+ YYDEBUG(263, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy257;
+ goto yy262;
}
if (yych <= ')') {
if (yych <= '\r') {
if (yych <= 0x08) {
- if (yych <= 0x00) goto yy249;
- goto yy255;
+ if (yych <= 0x00) goto yy254;
+ goto yy260;
} else {
- if (yych <= '\n') goto yy249;
- if (yych <= '\f') goto yy255;
- goto yy249;
+ if (yych <= '\n') goto yy254;
+ if (yych <= '\f') goto yy260;
+ goto yy254;
}
} else {
if (yych <= '#') {
- if (yych <= 0x1F) goto yy255;
- if (yych <= '"') goto yy249;
- goto yy255;
+ if (yych <= 0x1F) goto yy260;
+ if (yych <= '"') goto yy254;
+ goto yy260;
} else {
- if (yych <= '$') goto yy260;
- if (yych <= '%') goto yy255;
- goto yy249;
+ if (yych <= '$') goto yy265;
+ if (yych <= '%') goto yy260;
+ goto yy254;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= ':') goto yy255;
- goto yy249;
+ if (yych <= ':') goto yy260;
+ goto yy254;
} else {
- if (yych == '=') goto yy249;
- goto yy255;
+ if (yych == '=') goto yy254;
+ goto yy260;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy249;
- if (yych <= '{') goto yy255;
- goto yy249;
+ if (yych <= '^') goto yy254;
+ if (yych <= '{') goto yy260;
+ goto yy254;
} else {
- if (yych == '~') goto yy249;
- goto yy255;
+ if (yych == '~') goto yy254;
+ goto yy260;
}
}
}
-yy259:
- YYDEBUG(259, *YYCURSOR);
+yy264:
+ YYDEBUG(264, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'S') goto yy265;
- goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych == 'S') goto yy270;
+ goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 's') goto yy265;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 's') goto yy270;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy260:
- YYDEBUG(260, *YYCURSOR);
+yy265:
+ YYDEBUG(265, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy261;
- if (yych <= '[') goto yy255;
- goto yy262;
+ if (yych <= 0x00) goto yy266;
+ if (yych <= '[') goto yy260;
+ goto yy267;
} else {
- if (yych != '{') goto yy255;
+ if (yych != '{') goto yy260;
}
-yy261:
- YYDEBUG(261, *YYCURSOR);
+yy266:
+ YYDEBUG(266, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 3) {
if (yyaccept <= 1) {
if (yyaccept <= 0) {
- goto yy229;
+ goto yy234;
} else {
- goto yy231;
+ goto yy236;
}
} else {
if (yyaccept <= 2) {
- goto yy227;
+ goto yy232;
} else {
- goto yy244;
+ goto yy249;
}
}
} else {
if (yyaccept <= 5) {
if (yyaccept <= 4) {
- goto yy249;
+ goto yy254;
} else {
- goto yy266;
+ goto yy271;
}
} else {
- goto yy273;
+ if (yyaccept <= 6) {
+ goto yy278;
+ } else {
+ goto yy285;
+ }
}
}
-yy262:
- YYDEBUG(262, *YYCURSOR);
+yy267:
+ YYDEBUG(267, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 8) {
- goto yy263;
+ goto yy268;
}
- goto yy255;
-yy263:
- YYDEBUG(263, *YYCURSOR);
+ goto yy260;
+yy268:
+ YYDEBUG(268, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(264, *YYCURSOR);
+ YYDEBUG(269, *YYCURSOR);
if (yybm[0+yych] & 8) {
- goto yy263;
+ goto yy268;
}
- if (yych <= 0x00) goto yy229;
- if (yych == '\\') goto yy262;
- goto yy255;
-yy265:
- YYDEBUG(265, *YYCURSOR);
+ if (yych <= 0x00) goto yy234;
+ if (yych == '\\') goto yy267;
+ goto yy260;
+yy270:
+ YYDEBUG(270, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy267;
+ goto yy272;
}
if (yych <= ';') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy266;
- if (yych <= '\t') goto yy256;
+ if (yych <= 0x00) goto yy271;
+ if (yych <= '\t') goto yy261;
} else {
- if (yych != '\r') goto yy256;
+ if (yych != '\r') goto yy261;
}
} else {
if (yych <= ')') {
- if (yych <= '"') goto yy266;
- if (yych <= '%') goto yy256;
+ if (yych <= '"') goto yy271;
+ if (yych <= '%') goto yy261;
} else {
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy257;
- if (yych <= ':') goto yy256;
+ if (yych <= '/') goto yy261;
+ if (yych <= '9') goto yy262;
+ if (yych <= ':') goto yy261;
}
}
} else {
if (yych <= '_') {
if (yych <= '@') {
- if (yych != '=') goto yy256;
+ if (yych != '=') goto yy261;
} else {
- if (yych <= 'Z') goto yy257;
- if (yych <= ']') goto yy256;
- if (yych >= '_') goto yy257;
+ if (yych <= 'Z') goto yy262;
+ if (yych <= ']') goto yy261;
+ if (yych >= '_') goto yy262;
}
} else {
if (yych <= '{') {
- if (yych <= '`') goto yy256;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych <= '`') goto yy261;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych >= 0x7F) goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych >= 0x7F) goto yy261;
}
}
}
-yy266:
- YYDEBUG(266, *YYCURSOR);
+yy271:
+ YYDEBUG(271, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 418 "Zend/zend_ini_scanner.l"
+#line 465 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-#line 3642 "Zend/zend_ini_scanner.c"
-yy267:
- YYDEBUG(267, *YYCURSOR);
+#line 3750 "Zend/zend_ini_scanner.c"
+yy272:
+ YYDEBUG(272, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(268, *YYCURSOR);
+ YYDEBUG(273, *YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy267;
+ goto yy272;
}
- goto yy266;
-yy269:
- YYDEBUG(269, *YYCURSOR);
+ goto yy271;
+yy274:
+ YYDEBUG(274, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'U') goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych != 'U') goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'u') goto yy270;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'u') goto yy275;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy270:
- YYDEBUG(270, *YYCURSOR);
+yy275:
+ YYDEBUG(275, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy265;
- goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych == 'E') goto yy270;
+ goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy265;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy270;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy271:
- YYDEBUG(271, *YYCURSOR);
+yy276:
+ YYDEBUG(276, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'F') goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych != 'F') goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'f') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'f') goto yy277;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy272:
- YYDEBUG(272, *YYCURSOR);
+yy277:
+ YYDEBUG(277, *YYCURSOR);
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy257;
+ goto yy262;
}
if (yych <= ')') {
if (yych <= '\f') {
if (yych <= 0x08) {
- if (yych >= 0x01) goto yy256;
+ if (yych >= 0x01) goto yy261;
} else {
- if (yych <= '\t') goto yy274;
- if (yych >= '\v') goto yy256;
+ if (yych <= '\t') goto yy279;
+ if (yych >= '\v') goto yy261;
}
} else {
if (yych <= ' ') {
- if (yych <= '\r') goto yy273;
- if (yych <= 0x1F) goto yy256;
- goto yy274;
+ if (yych <= '\r') goto yy278;
+ if (yych <= 0x1F) goto yy261;
+ goto yy279;
} else {
- if (yych <= '"') goto yy273;
- if (yych <= '%') goto yy256;
+ if (yych <= '"') goto yy278;
+ if (yych <= '%') goto yy261;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= ':') goto yy256;
+ if (yych <= ':') goto yy261;
} else {
- if (yych != '=') goto yy256;
+ if (yych != '=') goto yy261;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy273;
- if (yych <= '{') goto yy256;
+ if (yych <= '^') goto yy278;
+ if (yych <= '{') goto yy261;
} else {
- if (yych != '~') goto yy256;
+ if (yych != '~') goto yy261;
}
}
}
-yy273:
- YYDEBUG(273, *YYCURSOR);
+yy278:
+ YYDEBUG(278, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 422 "Zend/zend_ini_scanner.l"
+#line 469 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
-#line 3852 "Zend/zend_ini_scanner.c"
-yy274:
- YYDEBUG(274, *YYCURSOR);
+#line 3960 "Zend/zend_ini_scanner.c"
+yy279:
+ YYDEBUG(279, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(275, *YYCURSOR);
- if (yych == '\t') goto yy274;
- if (yych == ' ') goto yy274;
- goto yy273;
-yy276:
- YYDEBUG(276, *YYCURSOR);
+ YYDEBUG(280, *YYCURSOR);
+ if (yych == '\t') goto yy279;
+ if (yych == ' ') goto yy279;
+ goto yy278;
+yy281:
+ YYDEBUG(281, *YYCURSOR);
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '<') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy273;
- if (yych <= 0x08) goto yy256;
- if (yych <= '\t') goto yy274;
- goto yy273;
+ if (yych <= 0x00) goto yy278;
+ if (yych <= 0x08) goto yy261;
+ if (yych <= '\t') goto yy279;
+ goto yy278;
} else {
- if (yych == '\r') goto yy273;
- if (yych <= 0x1F) goto yy256;
- goto yy274;
+ if (yych == '\r') goto yy278;
+ if (yych <= 0x1F) goto yy261;
+ goto yy279;
}
} else {
if (yych <= '/') {
- if (yych <= '"') goto yy273;
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy273;
- goto yy256;
+ if (yych <= '"') goto yy278;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy278;
+ goto yy261;
} else {
- if (yych <= '9') goto yy257;
- if (yych == ';') goto yy273;
- goto yy256;
+ if (yych <= '9') goto yy262;
+ if (yych == ';') goto yy278;
+ goto yy261;
}
}
} else {
if (yych <= '_') {
if (yych <= 'N') {
- if (yych <= '=') goto yy273;
- if (yych <= '@') goto yy256;
- if (yych <= 'M') goto yy257;
- goto yy279;
+ if (yych <= '=') goto yy278;
+ if (yych <= '@') goto yy261;
+ if (yych <= 'M') goto yy262;
+ goto yy288;
} else {
- if (yych <= 'Z') goto yy257;
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy273;
- goto yy257;
+ if (yych <= 'Z') goto yy262;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy278;
+ goto yy262;
}
} else {
if (yych <= 'z') {
- if (yych <= '`') goto yy256;
- if (yych == 'n') goto yy279;
- goto yy257;
+ if (yych <= '`') goto yy261;
+ if (yych == 'n') goto yy288;
+ goto yy262;
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
- goto yy273;
+ if (yych <= '{') goto yy261;
+ goto yy278;
} else {
- if (yych == '~') goto yy273;
- goto yy256;
+ if (yych == '~') goto yy278;
+ goto yy261;
}
}
}
}
-yy277:
- YYDEBUG(277, *YYCURSOR);
+yy282:
+ YYDEBUG(282, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'L') goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych != 'L') goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'l') goto yy278;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'l') goto yy283;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy278:
- YYDEBUG(278, *YYCURSOR);
+yy283:
+ YYDEBUG(283, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'L') goto yy272;
- goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych != 'L') goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'l') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'l') goto yy284;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy279:
- YYDEBUG(279, *YYCURSOR);
+yy284:
+ YYDEBUG(284, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy262;
+ }
+ if (yych <= ')') {
+ if (yych <= '\f') {
+ if (yych <= 0x08) {
+ if (yych >= 0x01) goto yy261;
+ } else {
+ if (yych <= '\t') goto yy286;
+ if (yych >= '\v') goto yy261;
+ }
+ } else {
+ if (yych <= ' ') {
+ if (yych <= '\r') goto yy285;
+ if (yych <= 0x1F) goto yy261;
+ goto yy286;
+ } else {
+ if (yych <= '"') goto yy285;
+ if (yych <= '%') goto yy261;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= ':') goto yy261;
+ } else {
+ if (yych != '=') goto yy261;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy285;
+ if (yych <= '{') goto yy261;
+ } else {
+ if (yych != '~') goto yy261;
+ }
+ }
+ }
+yy285:
+ YYDEBUG(285, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 473 "Zend/zend_ini_scanner.l"
+ {
+ RETURN_TOKEN(NULL_NULL, "", 0);
+}
+#line 4175 "Zend/zend_ini_scanner.c"
+yy286:
+ YYDEBUG(286, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(287, *YYCURSOR);
+ if (yych == '\t') goto yy286;
+ if (yych == ' ') goto yy286;
+ goto yy285;
+yy288:
+ YYDEBUG(288, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy272;
- goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych == 'E') goto yy277;
+ goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy277;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy280:
- YYDEBUG(280, *YYCURSOR);
+yy289:
+ YYDEBUG(289, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'L') goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych != 'L') goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'l') goto yy281;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'l') goto yy290;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy281:
- YYDEBUG(281, *YYCURSOR);
+yy290:
+ YYDEBUG(290, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'S') goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych != 'S') goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 's') goto yy282;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 's') goto yy291;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy282:
- YYDEBUG(282, *YYCURSOR);
+yy291:
+ YYDEBUG(291, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy254;
+ if (yych <= 0x08) goto yy261;
+ goto yy254;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy254;
+ if (yych <= 0x1F) goto yy261;
+ goto yy254;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy254;
+ if (yych <= '/') goto yy261;
+ goto yy262;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy254;
+ if (yych <= '<') goto yy261;
+ goto yy254;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy272;
- goto yy257;
+ if (yych <= '@') goto yy261;
+ if (yych == 'E') goto yy277;
+ goto yy262;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy261;
+ if (yych <= '^') goto yy254;
+ if (yych <= '_') goto yy262;
+ goto yy261;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy277;
+ if (yych <= 'z') goto yy262;
+ goto yy261;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy254;
+ goto yy261;
}
}
}
-yy283:
- YYDEBUG(283, *YYCURSOR);
+yy292:
+ YYDEBUG(292, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy284:
- YYDEBUG(284, *YYCURSOR);
+yy293:
+ YYDEBUG(293, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy283;
+ goto yy292;
}
- if (yych >= '\r') goto yy287;
-yy285:
- YYDEBUG(285, *YYCURSOR);
+ if (yych >= '\r') goto yy296;
+yy294:
+ YYDEBUG(294, *YYCURSOR);
++YYCURSOR;
-yy286:
- YYDEBUG(286, *YYCURSOR);
+yy295:
+ YYDEBUG(295, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 582 "Zend/zend_ini_scanner.l"
+#line 633 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 4245 "Zend/zend_ini_scanner.c"
-yy287:
- YYDEBUG(287, *YYCURSOR);
+#line 4410 "Zend/zend_ini_scanner.c"
+yy296:
+ YYDEBUG(296, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy285;
- goto yy286;
-yy288:
- YYDEBUG(288, *YYCURSOR);
+ if (yych == '\n') goto yy294;
+ goto yy295;
+yy297:
+ YYDEBUG(297, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(289, *YYCURSOR);
+ YYDEBUG(298, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy288;
+ goto yy297;
}
if (yych <= ')') {
if (yych <= '\r') {
if (yych <= 0x08) {
- if (yych <= 0x00) goto yy244;
- goto yy255;
+ if (yych <= 0x00) goto yy249;
+ goto yy260;
} else {
- if (yych <= '\n') goto yy244;
- if (yych <= '\f') goto yy255;
- goto yy244;
+ if (yych <= '\n') goto yy249;
+ if (yych <= '\f') goto yy260;
+ goto yy249;
}
} else {
if (yych <= '#') {
- if (yych <= 0x1F) goto yy255;
- if (yych <= '"') goto yy244;
- goto yy255;
+ if (yych <= 0x1F) goto yy260;
+ if (yych <= '"') goto yy249;
+ goto yy260;
} else {
- if (yych <= '$') goto yy260;
- if (yych <= '%') goto yy255;
- goto yy244;
+ if (yych <= '$') goto yy265;
+ if (yych <= '%') goto yy260;
+ goto yy249;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= ':') goto yy255;
- goto yy244;
+ if (yych <= ':') goto yy260;
+ goto yy249;
} else {
- if (yych == '=') goto yy244;
- goto yy255;
+ if (yych == '=') goto yy249;
+ goto yy260;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy255;
- goto yy244;
+ if (yych <= '^') goto yy249;
+ if (yych <= '{') goto yy260;
+ goto yy249;
} else {
- if (yych == '~') goto yy244;
- goto yy255;
+ if (yych == '~') goto yy249;
+ goto yy260;
}
}
}
-yy290:
- YYDEBUG(290, *YYCURSOR);
+yy299:
+ YYDEBUG(299, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(291, *YYCURSOR);
+ YYDEBUG(300, *YYCURSOR);
if (yych <= '.') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy255;
- goto yy244;
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy260;
+ goto yy249;
} else {
- if (yych == '\r') goto yy244;
- goto yy255;
+ if (yych == '\r') goto yy249;
+ goto yy260;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy244;
- if (yych <= '#') goto yy255;
- goto yy260;
+ if (yych <= '"') goto yy249;
+ if (yych <= '#') goto yy260;
+ goto yy265;
} else {
- if (yych <= '%') goto yy255;
- if (yych <= ')') goto yy244;
- if (yych <= '-') goto yy255;
- goto yy288;
+ if (yych <= '%') goto yy260;
+ if (yych <= ')') goto yy249;
+ if (yych <= '-') goto yy260;
+ goto yy297;
}
}
} else {
if (yych <= '=') {
if (yych <= ':') {
- if (yych <= '/') goto yy255;
- if (yych <= '9') goto yy290;
- goto yy255;
+ if (yych <= '/') goto yy260;
+ if (yych <= '9') goto yy299;
+ goto yy260;
} else {
- if (yych == '<') goto yy255;
- goto yy244;
+ if (yych == '<') goto yy260;
+ goto yy249;
}
} else {
if (yych <= '{') {
- if (yych == '^') goto yy244;
- goto yy255;
+ if (yych == '^') goto yy249;
+ goto yy260;
} else {
- if (yych == '}') goto yy255;
- if (yych <= '~') goto yy244;
- goto yy255;
+ if (yych == '}') goto yy260;
+ if (yych <= '~') goto yy249;
+ goto yy260;
}
}
}
-yy292:
- YYDEBUG(292, *YYCURSOR);
+yy301:
+ YYDEBUG(301, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(293, *YYCURSOR);
+ YYDEBUG(302, *YYCURSOR);
if (yych <= '/') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy255;
- goto yy244;
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy260;
+ goto yy249;
} else {
- if (yych == '\r') goto yy244;
- goto yy255;
+ if (yych == '\r') goto yy249;
+ goto yy260;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy244;
- if (yych <= '#') goto yy255;
- goto yy260;
+ if (yych <= '"') goto yy249;
+ if (yych <= '#') goto yy260;
+ goto yy265;
} else {
- if (yych <= '%') goto yy255;
- if (yych <= ')') goto yy244;
- goto yy255;
+ if (yych <= '%') goto yy260;
+ if (yych <= ')') goto yy249;
+ goto yy260;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= '9') goto yy292;
- if (yych <= ':') goto yy255;
- goto yy244;
+ if (yych <= '9') goto yy301;
+ if (yych <= ':') goto yy260;
+ goto yy249;
} else {
- if (yych == '=') goto yy244;
- goto yy255;
+ if (yych == '=') goto yy249;
+ goto yy260;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy255;
- goto yy244;
+ if (yych <= '^') goto yy249;
+ if (yych <= '{') goto yy260;
+ goto yy249;
} else {
- if (yych == '~') goto yy244;
- goto yy255;
+ if (yych == '~') goto yy249;
+ goto yy260;
}
}
}
-yy294:
- YYDEBUG(294, *YYCURSOR);
+yy303:
+ YYDEBUG(303, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(295, *YYCURSOR);
+ YYDEBUG(304, *YYCURSOR);
if (yych <= '/') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy255;
- goto yy244;
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy260;
+ goto yy249;
} else {
- if (yych == '\r') goto yy244;
- goto yy255;
+ if (yych == '\r') goto yy249;
+ goto yy260;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy244;
- if (yych <= '#') goto yy255;
- goto yy260;
+ if (yych <= '"') goto yy249;
+ if (yych <= '#') goto yy260;
+ goto yy265;
} else {
- if (yych <= '%') goto yy255;
- if (yych <= ')') goto yy244;
- goto yy255;
+ if (yych <= '%') goto yy260;
+ if (yych <= ')') goto yy249;
+ goto yy260;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= '9') goto yy294;
- if (yych <= ':') goto yy255;
- goto yy244;
+ if (yych <= '9') goto yy303;
+ if (yych <= ':') goto yy260;
+ goto yy249;
} else {
- if (yych == '=') goto yy244;
- goto yy255;
+ if (yych == '=') goto yy249;
+ goto yy260;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy255;
- goto yy244;
+ if (yych <= '^') goto yy249;
+ if (yych <= '{') goto yy260;
+ goto yy249;
} else {
- if (yych == '~') goto yy244;
- goto yy255;
+ if (yych == '~') goto yy249;
+ goto yy260;
}
}
}
-yy296:
- YYDEBUG(296, *YYCURSOR);
+yy305:
+ YYDEBUG(305, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(297, *YYCURSOR);
+ YYDEBUG(306, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy296;
+ goto yy305;
}
- YYDEBUG(298, *YYCURSOR);
+ YYDEBUG(307, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(299, *YYCURSOR);
+ YYDEBUG(308, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 365 "Zend/zend_ini_scanner.l"
+#line 412 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -4468,66 +4633,66 @@ yy296:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 4472 "Zend/zend_ini_scanner.c"
-yy300:
- YYDEBUG(300, *YYCURSOR);
+#line 4637 "Zend/zend_ini_scanner.c"
+yy309:
+ YYDEBUG(309, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(301, *YYCURSOR);
+ YYDEBUG(310, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 398 "Zend/zend_ini_scanner.l"
+#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 4483 "Zend/zend_ini_scanner.c"
-yy302:
- YYDEBUG(302, *YYCURSOR);
+#line 4648 "Zend/zend_ini_scanner.c"
+yy311:
+ YYDEBUG(311, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy303:
- YYDEBUG(303, *YYCURSOR);
- if (yych == '\t') goto yy302;
- if (yych == ' ') goto yy302;
- goto yy236;
-yy304:
- YYDEBUG(304, *YYCURSOR);
+yy312:
+ YYDEBUG(312, *YYCURSOR);
+ if (yych == '\t') goto yy311;
+ if (yych == ' ') goto yy311;
+ goto yy241;
+yy313:
+ YYDEBUG(313, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy233;
-yy305:
- YYDEBUG(305, *YYCURSOR);
+ goto yy238;
+yy314:
+ YYDEBUG(314, *YYCURSOR);
yyaccept = 1;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy306:
- YYDEBUG(306, *YYCURSOR);
+yy315:
+ YYDEBUG(315, *YYCURSOR);
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy231;
- if (yych <= '\t') goto yy305;
- goto yy304;
+ if (yych <= 0x08) goto yy236;
+ if (yych <= '\t') goto yy314;
+ goto yy313;
} else {
- if (yych == '\r') goto yy308;
- goto yy231;
+ if (yych == '\r') goto yy317;
+ goto yy236;
}
} else {
if (yych <= '"') {
- if (yych <= ' ') goto yy305;
- if (yych <= '!') goto yy231;
+ if (yych <= ' ') goto yy314;
+ if (yych <= '!') goto yy236;
} else {
- if (yych == ';') goto yy283;
- goto yy231;
+ if (yych == ';') goto yy292;
+ goto yy236;
}
}
- YYDEBUG(307, *YYCURSOR);
+ YYDEBUG(316, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy238;
-yy308:
- YYDEBUG(308, *YYCURSOR);
+ goto yy243;
+yy317:
+ YYDEBUG(317, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy304;
- goto yy233;
+ if ((yych = *YYCURSOR) == '\n') goto yy313;
+ goto yy238;
}
/* *********************************** */
yyc_ST_VARNAME:
@@ -4566,51 +4731,51 @@ yyc_ST_VARNAME:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
- YYDEBUG(309, *YYCURSOR);
+ YYDEBUG(318, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= ')') {
if (yych <= '"') {
if (yych <= '\f') {
- if (yych <= 0x08) goto yy311;
- if (yych <= '\n') goto yy313;
+ if (yych <= 0x08) goto yy320;
+ if (yych <= '\n') goto yy322;
} else {
- if (yych <= '\r') goto yy313;
- if (yych >= '!') goto yy313;
+ if (yych <= '\r') goto yy322;
+ if (yych >= '!') goto yy322;
}
} else {
if (yych <= '%') {
- if (yych == '$') goto yy313;
+ if (yych == '$') goto yy322;
} else {
- if (yych != '\'') goto yy313;
+ if (yych != '\'') goto yy322;
}
}
} else {
if (yych <= '[') {
if (yych <= '<') {
- if (yych == ';') goto yy313;
+ if (yych == ';') goto yy322;
} else {
- if (yych <= '=') goto yy313;
- if (yych >= '[') goto yy313;
+ if (yych <= '=') goto yy322;
+ if (yych >= '[') goto yy322;
}
} else {
if (yych <= 'z') {
- if (yych == '^') goto yy313;
+ if (yych == '^') goto yy322;
} else {
- if (yych == '}') goto yy315;
- if (yych <= '~') goto yy313;
+ if (yych == '}') goto yy324;
+ if (yych <= '~') goto yy322;
}
}
}
-yy311:
- YYDEBUG(311, *YYCURSOR);
+yy320:
+ YYDEBUG(320, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy318;
-yy312:
- YYDEBUG(312, *YYCURSOR);
+ goto yy327;
+yy321:
+ YYDEBUG(321, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 403 "Zend/zend_ini_scanner.l"
+#line 450 "Zend/zend_ini_scanner.l"
{ /* Variable name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -4620,41 +4785,41 @@ yy312:
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
}
-#line 4624 "Zend/zend_ini_scanner.c"
-yy313:
- YYDEBUG(313, *YYCURSOR);
+#line 4789 "Zend/zend_ini_scanner.c"
+yy322:
+ YYDEBUG(322, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(314, *YYCURSOR);
+ YYDEBUG(323, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 600 "Zend/zend_ini_scanner.l"
+#line 651 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 4634 "Zend/zend_ini_scanner.c"
-yy315:
- YYDEBUG(315, *YYCURSOR);
+#line 4799 "Zend/zend_ini_scanner.c"
+yy324:
+ YYDEBUG(324, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(316, *YYCURSOR);
+ YYDEBUG(325, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 413 "Zend/zend_ini_scanner.l"
+#line 460 "Zend/zend_ini_scanner.l"
{ /* Variable end */
yy_pop_state(TSRMLS_C);
return '}';
}
-#line 4645 "Zend/zend_ini_scanner.c"
-yy317:
- YYDEBUG(317, *YYCURSOR);
+#line 4810 "Zend/zend_ini_scanner.c"
+yy326:
+ YYDEBUG(326, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy318:
- YYDEBUG(318, *YYCURSOR);
+yy327:
+ YYDEBUG(327, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy317;
+ goto yy326;
}
- goto yy312;
+ goto yy321;
}
}
-#line 604 "Zend/zend_ini_scanner.l"
+#line 655 "Zend/zend_ini_scanner.l"
}
diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h
index aafe7efdde..c81e3605d8 100644
--- a/Zend/zend_ini_scanner.h
+++ b/Zend/zend_ini_scanner.h
@@ -25,6 +25,7 @@
/* Scanner modes */
#define ZEND_INI_SCANNER_NORMAL 0 /* Normal mode. [DEFAULT] */
#define ZEND_INI_SCANNER_RAW 1 /* Raw mode. Option values are not parsed */
+#define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */
BEGIN_EXTERN_C()
int zend_ini_scanner_get_lineno(TSRMLS_D);
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index 1ed800ce52..3bfb1557b1 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -24,6 +24,7 @@
#include <errno.h>
#include "zend.h"
+#include "zend_API.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
@@ -135,9 +136,55 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
ZVAL_NEW_STR(retval, zend_string_init(str, len, 1))
-#define RETURN_TOKEN(type, str, len) { \
- zend_ini_copy_value(ini_lval, str, len); \
- return type; \
+#define RETURN_TOKEN(type, str, len) { \
+ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
+ zend_ini_copy_typed_value(ini_lval, type, str, len); \
+ } else { \
+ zend_ini_copy_value(ini_lval, str, len); \
+ } \
+ return type; \
+}
+
+static inline int convert_to_number(zval *retval, const char *str, const int str_len)
+{
+ zend_uchar type;
+ int overflow;
+ zend_long lval;
+ double dval;
+
+ if ((type = is_numeric_string_ex(str, str_len, &lval, &dval, 0, &overflow)) != 0) {
+ if (type == IS_LONG) {
+ ZVAL_LONG(retval, lval);
+ return SUCCESS;
+ } else if (type == IS_DOUBLE && !overflow) {
+ ZVAL_DOUBLE(retval, dval);
+ return SUCCESS;
+ }
+ }
+
+ return FAILURE;
+}
+
+static void zend_ini_copy_typed_value(zval *retval, const int type, const char *str, int len)
+{
+ switch (type) {
+ case BOOL_FALSE:
+ case BOOL_TRUE:
+ ZVAL_BOOL(retval, type == BOOL_TRUE);
+ break;
+
+ case NULL_NULL:
+ ZVAL_NULL(retval);
+ break;
+
+ case TC_NUMBER:
+ if (convert_to_number(retval, str, len) == SUCCESS) {
+ break;
+ }
+ /* intentional fall-through */
+ default:
+ zend_ini_copy_value(retval, str, len);
+ }
}
static void _yy_push_state(int new_state TSRMLS_DC)
@@ -169,7 +216,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
{
/* Sanity check */
- if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
+ if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
zend_error(E_WARNING, "Invalid scanner mode");
return FAILURE;
}
@@ -419,10 +466,14 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-<INITIAL,ST_VALUE>("false"|"off"|"no"|"none"|"null"){TABS_AND_SPACES}* { /* FALSE value (when used outside option value/offset this causes parse error!)*/
+<INITIAL,ST_VALUE>("false"|"off"|"no"|"none"){TABS_AND_SPACES}* { /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
+<INITIAL,ST_VALUE>("null"){TABS_AND_SPACES}* {
+ RETURN_TOKEN(NULL_NULL, "", 0);
+}
+
<INITIAL>{LABEL} { /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index 8c55f3d7c1..26507ad23b 100644
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -325,7 +325,8 @@ static int zend_implement_traversable(zend_class_entry *interface, zend_class_en
/* {{{ zend_implement_aggregate */
static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
{
- int i, t = -1;
+ uint32_t i;
+ int t = -1;
if (class_type->get_iterator) {
if (class_type->type == ZEND_INTERNAL_CLASS) {
@@ -406,7 +407,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en
/* }}}*/
/* {{{ zend_user_serialize */
-ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC)
+ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC)
{
zend_class_entry * ce = Z_OBJCE_P(object);
zval retval;
@@ -443,7 +444,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t
/* }}} */
/* {{{ zend_user_unserialize */
-ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC)
+ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC)
{
zval zdata;
@@ -463,7 +464,7 @@ ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const uns
}
/* }}} */
-ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
+ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name->val);
@@ -471,7 +472,7 @@ ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uin
}
/* }}} */
-ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
+ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
{
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name->val);
return FAILURE;
diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h
index 88e1dfe05b..9bfef0990d 100644
--- a/Zend/zend_interfaces.h
+++ b/Zend/zend_interfaces.h
@@ -61,11 +61,11 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c
ZEND_API void zend_register_interfaces(TSRMLS_D);
-ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);
-ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);
+ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
+ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
-ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);
-ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);
+ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
+ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
END_EXTERN_C()
diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c
index 7c08ac59b5..c2f51c4dd6 100644
--- a/Zend/zend_iterators.c
+++ b/Zend/zend_iterators.c
@@ -84,29 +84,13 @@ ZEND_API void zend_iterator_dtor(zend_object_iterator *iter TSRMLS_DC)
zend_objects_store_del(&iter->std TSRMLS_CC);
}
-ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(
- zval *array_ptr, zend_object_iterator **iter TSRMLS_DC)
+ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr TSRMLS_DC)
{
- switch (Z_TYPE_P(array_ptr)) {
- case IS_OBJECT:
- if (Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) {
- *iter = (zend_object_iterator *)Z_OBJ_P(array_ptr);
- return ZEND_ITER_OBJECT;
- }
- if (Z_OBJPROP_P(array_ptr)) {
- return ZEND_ITER_PLAIN_OBJECT;
- }
- return ZEND_ITER_INVALID;
-
- case IS_ARRAY:
- if (Z_ARRVAL_P(array_ptr)) {
- return ZEND_ITER_PLAIN_ARRAY;
- }
- return ZEND_ITER_INVALID;
-
- default:
- return ZEND_ITER_INVALID;
+ if (Z_TYPE_P(array_ptr) &&
+ Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) {
+ return (zend_object_iterator *)Z_OBJ_P(array_ptr);
}
+ return NULL;
}
/*
diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h
index b0105d52e2..a1148db214 100644
--- a/Zend/zend_iterators.h
+++ b/Zend/zend_iterators.h
@@ -71,16 +71,9 @@ typedef struct _zend_class_iterator_funcs {
union _zend_function *zf_rewind;
} zend_class_iterator_funcs;
-enum zend_object_iterator_kind {
- ZEND_ITER_INVALID,
- ZEND_ITER_PLAIN_ARRAY,
- ZEND_ITER_PLAIN_OBJECT,
- ZEND_ITER_OBJECT
-};
-
BEGIN_EXTERN_C()
/* given a zval, returns stuff that can be used to iterate it. */
-ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(zval *array_ptr, zend_object_iterator **iter TSRMLS_DC);
+ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr TSRMLS_DC);
/* given an iterator, wrap it up as a zval for use by the engine opcodes */
ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC);
diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 15af608381..5bd2798cde 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -128,7 +128,7 @@ BEGIN_EXTERN_C()
static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
+ ZEND_ASSERT(internal_encoding);
return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC);
}
@@ -146,7 +146,7 @@ LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC);
static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
+ ZEND_ASSERT(internal_encoding);
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
}
@@ -558,7 +558,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
zend_op_array *original_active_op_array = CG(active_op_array);
- zend_op_array *retval=NULL;
int compiler_result;
zend_bool compilation_successful=0;
zval retval_zv;
@@ -568,8 +567,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- retval = op_array; /* success oriented */
-
if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
if (type==ZEND_REQUIRE) {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
@@ -598,18 +595,17 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
compilation_successful=1;
}
- if (retval) {
- CG(active_op_array) = original_active_op_array;
- if (compilation_successful) {
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
- } else {
- efree_size(op_array, sizeof(zend_op_array));
- retval = NULL;
- }
+ CG(active_op_array) = original_active_op_array;
+ if (compilation_successful) {
+ pass_two(op_array TSRMLS_CC);
+ zend_release_labels(0 TSRMLS_CC);
+ } else {
+ efree_size(op_array, sizeof(zend_op_array));
+ op_array = NULL;
}
+
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- return retval;
+ return op_array;
}
@@ -849,7 +845,7 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start));
SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start));
SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start));
- SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start));
+ SCNG(yy_limit) = new_yy_start + length;
SCNG(yy_start) = new_yy_start;
}
@@ -998,7 +994,7 @@ restart:
yymore_restart:
-#line 1002 "Zend/zend_language_scanner.c"
+#line 998 "Zend/zend_language_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -1097,7 +1093,7 @@ yyc_INITIAL:
yy3:
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1667 "Zend/zend_language_scanner.l"
+#line 1663 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1158,7 +1154,7 @@ inline_html:
HANDLE_NEWLINES(yytext, yyleng);
return T_INLINE_HTML;
}
-#line 1162 "Zend/zend_language_scanner.c"
+#line 1158 "Zend/zend_language_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1176,7 +1172,7 @@ yy5:
yy6:
YYDEBUG(6, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1658 "Zend/zend_language_scanner.l"
+#line 1654 "Zend/zend_language_scanner.l"
{
if (CG(short_tags)) {
BEGIN(ST_IN_SCRIPTING);
@@ -1185,14 +1181,14 @@ yy6:
goto inline_char_handler;
}
}
-#line 1189 "Zend/zend_language_scanner.c"
+#line 1185 "Zend/zend_language_scanner.c"
yy7:
YYDEBUG(7, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy43;
YYDEBUG(8, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1641 "Zend/zend_language_scanner.l"
+#line 1637 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
BEGIN(ST_IN_SCRIPTING);
@@ -1201,7 +1197,7 @@ yy7:
goto inline_char_handler;
}
}
-#line 1205 "Zend/zend_language_scanner.c"
+#line 1201 "Zend/zend_language_scanner.c"
yy9:
YYDEBUG(9, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1387,7 +1383,7 @@ yy35:
++YYCURSOR;
YYDEBUG(38, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1610 "Zend/zend_language_scanner.l"
+#line 1606 "Zend/zend_language_scanner.l"
{
YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
@@ -1401,7 +1397,7 @@ yy35:
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
-#line 1405 "Zend/zend_language_scanner.c"
+#line 1401 "Zend/zend_language_scanner.c"
yy39:
YYDEBUG(39, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1428,7 +1424,7 @@ yy43:
++YYCURSOR;
YYDEBUG(44, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1625 "Zend/zend_language_scanner.l"
+#line 1621 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
BEGIN(ST_IN_SCRIPTING);
@@ -1437,18 +1433,18 @@ yy43:
goto inline_char_handler;
}
}
-#line 1441 "Zend/zend_language_scanner.c"
+#line 1437 "Zend/zend_language_scanner.c"
yy45:
YYDEBUG(45, *YYCURSOR);
++YYCURSOR;
YYDEBUG(46, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1635 "Zend/zend_language_scanner.l"
+#line 1631 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
}
-#line 1452 "Zend/zend_language_scanner.c"
+#line 1448 "Zend/zend_language_scanner.c"
yy47:
YYDEBUG(47, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1475,13 +1471,13 @@ yy50:
yy51:
YYDEBUG(51, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1651 "Zend/zend_language_scanner.l"
+#line 1647 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
-#line 1485 "Zend/zend_language_scanner.c"
+#line 1481 "Zend/zend_language_scanner.c"
yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
@@ -1552,7 +1548,7 @@ yyc_ST_BACKQUOTE:
yy56:
YYDEBUG(56, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2108 "Zend/zend_language_scanner.l"
+#line 2106 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1593,7 +1589,7 @@ yy56:
zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 1597 "Zend/zend_language_scanner.c"
+#line 1593 "Zend/zend_language_scanner.c"
yy57:
YYDEBUG(57, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1604,12 +1600,12 @@ yy58:
++YYCURSOR;
YYDEBUG(59, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2052 "Zend/zend_language_scanner.l"
+#line 2050 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '`';
}
-#line 1613 "Zend/zend_language_scanner.c"
+#line 1609 "Zend/zend_language_scanner.c"
yy60:
YYDEBUG(60, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1619,14 +1615,14 @@ yy61:
++YYCURSOR;
YYDEBUG(62, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2039 "Zend/zend_language_scanner.l"
+#line 2037 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
}
-#line 1630 "Zend/zend_language_scanner.c"
+#line 1626 "Zend/zend_language_scanner.c"
yy63:
YYDEBUG(63, *YYCURSOR);
yyaccept = 0;
@@ -1642,23 +1638,23 @@ yy63:
yy65:
YYDEBUG(65, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1744 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 1651 "Zend/zend_language_scanner.c"
+#line 1647 "Zend/zend_language_scanner.c"
yy66:
YYDEBUG(66, *YYCURSOR);
++YYCURSOR;
YYDEBUG(67, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1464 "Zend/zend_language_scanner.l"
+#line 1460 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
-#line 1662 "Zend/zend_language_scanner.c"
+#line 1658 "Zend/zend_language_scanner.c"
yy68:
YYDEBUG(68, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1672,14 +1668,14 @@ yy70:
++YYCURSOR;
YYDEBUG(71, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1741 "Zend/zend_language_scanner.l"
+#line 1737 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 1683 "Zend/zend_language_scanner.c"
+#line 1679 "Zend/zend_language_scanner.c"
yy72:
YYDEBUG(72, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1697,14 +1693,14 @@ yy73:
++YYCURSOR;
YYDEBUG(74, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1732 "Zend/zend_language_scanner.l"
+#line 1728 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 1708 "Zend/zend_language_scanner.c"
+#line 1704 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_DOUBLE_QUOTES:
@@ -1772,7 +1768,7 @@ yy77:
yy78:
YYDEBUG(78, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2058 "Zend/zend_language_scanner.l"
+#line 2056 "Zend/zend_language_scanner.l"
{
if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
@@ -1821,7 +1817,7 @@ double_quotes_scan_done:
zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 1825 "Zend/zend_language_scanner.c"
+#line 1821 "Zend/zend_language_scanner.c"
yy79:
YYDEBUG(79, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1832,12 +1828,12 @@ yy80:
++YYCURSOR;
YYDEBUG(81, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2047 "Zend/zend_language_scanner.l"
+#line 2045 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '"';
}
-#line 1841 "Zend/zend_language_scanner.c"
+#line 1837 "Zend/zend_language_scanner.c"
yy82:
YYDEBUG(82, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1847,14 +1843,14 @@ yy83:
++YYCURSOR;
YYDEBUG(84, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2039 "Zend/zend_language_scanner.l"
+#line 2037 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
}
-#line 1858 "Zend/zend_language_scanner.c"
+#line 1854 "Zend/zend_language_scanner.c"
yy85:
YYDEBUG(85, *YYCURSOR);
yyaccept = 0;
@@ -1870,23 +1866,23 @@ yy85:
yy87:
YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1744 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 1879 "Zend/zend_language_scanner.c"
+#line 1875 "Zend/zend_language_scanner.c"
yy88:
YYDEBUG(88, *YYCURSOR);
++YYCURSOR;
YYDEBUG(89, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1464 "Zend/zend_language_scanner.l"
+#line 1460 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
-#line 1890 "Zend/zend_language_scanner.c"
+#line 1886 "Zend/zend_language_scanner.c"
yy90:
YYDEBUG(90, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1900,14 +1896,14 @@ yy92:
++YYCURSOR;
YYDEBUG(93, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1741 "Zend/zend_language_scanner.l"
+#line 1737 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 1911 "Zend/zend_language_scanner.c"
+#line 1907 "Zend/zend_language_scanner.c"
yy94:
YYDEBUG(94, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1925,14 +1921,14 @@ yy95:
++YYCURSOR;
YYDEBUG(96, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1732 "Zend/zend_language_scanner.l"
+#line 1728 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 1936 "Zend/zend_language_scanner.c"
+#line 1932 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_END_HEREDOC:
@@ -1943,7 +1939,7 @@ yyc_ST_END_HEREDOC:
++YYCURSOR;
YYDEBUG(100, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2025 "Zend/zend_language_scanner.l"
+#line 2023 "Zend/zend_language_scanner.l"
{
zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack));
@@ -1956,7 +1952,7 @@ yyc_ST_END_HEREDOC:
BEGIN(ST_IN_SCRIPTING);
return T_END_HEREDOC;
}
-#line 1960 "Zend/zend_language_scanner.c"
+#line 1956 "Zend/zend_language_scanner.c"
/* *********************************** */
yyc_ST_HEREDOC:
{
@@ -2018,7 +2014,7 @@ yy103:
yy104:
YYDEBUG(104, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2150 "Zend/zend_language_scanner.l"
+#line 2148 "Zend/zend_language_scanner.l"
{
int newline = 0;
@@ -2091,7 +2087,7 @@ heredoc_scan_done:
zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 2095 "Zend/zend_language_scanner.c"
+#line 2091 "Zend/zend_language_scanner.c"
yy105:
YYDEBUG(105, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2106,14 +2102,14 @@ yy107:
++YYCURSOR;
YYDEBUG(108, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2039 "Zend/zend_language_scanner.l"
+#line 2037 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
}
-#line 2117 "Zend/zend_language_scanner.c"
+#line 2113 "Zend/zend_language_scanner.c"
yy109:
YYDEBUG(109, *YYCURSOR);
yyaccept = 0;
@@ -2129,23 +2125,23 @@ yy109:
yy111:
YYDEBUG(111, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1744 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 2138 "Zend/zend_language_scanner.c"
+#line 2134 "Zend/zend_language_scanner.c"
yy112:
YYDEBUG(112, *YYCURSOR);
++YYCURSOR;
YYDEBUG(113, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1464 "Zend/zend_language_scanner.l"
+#line 1460 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
-#line 2149 "Zend/zend_language_scanner.c"
+#line 2145 "Zend/zend_language_scanner.c"
yy114:
YYDEBUG(114, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2159,14 +2155,14 @@ yy116:
++YYCURSOR;
YYDEBUG(117, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1741 "Zend/zend_language_scanner.l"
+#line 1737 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 2170 "Zend/zend_language_scanner.c"
+#line 2166 "Zend/zend_language_scanner.c"
yy118:
YYDEBUG(118, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2184,14 +2180,14 @@ yy119:
++YYCURSOR;
YYDEBUG(120, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1732 "Zend/zend_language_scanner.l"
+#line 1728 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 2195 "Zend/zend_language_scanner.c"
+#line 2191 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_IN_SCRIPTING:
@@ -2374,12 +2370,12 @@ yy123:
yy124:
YYDEBUG(124, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1770 "Zend/zend_language_scanner.l"
+#line 1767 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
}
-#line 2383 "Zend/zend_language_scanner.c"
+#line 2379 "Zend/zend_language_scanner.c"
yy125:
YYDEBUG(125, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2611,11 +2607,11 @@ yy138:
yy139:
YYDEBUG(139, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1453 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
{
return yytext[0];
}
-#line 2619 "Zend/zend_language_scanner.c"
+#line 2615 "Zend/zend_language_scanner.c"
yy140:
YYDEBUG(140, *YYCURSOR);
++YYCURSOR;
@@ -2624,12 +2620,12 @@ yy140:
yy141:
YYDEBUG(141, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1176 "Zend/zend_language_scanner.l"
+#line 1172 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
-#line 2633 "Zend/zend_language_scanner.c"
+#line 2629 "Zend/zend_language_scanner.c"
yy142:
YYDEBUG(142, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2640,11 +2636,11 @@ yy143:
++YYCURSOR;
YYDEBUG(144, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1201 "Zend/zend_language_scanner.l"
+#line 1197 "Zend/zend_language_scanner.l"
{
return T_NS_SEPARATOR;
}
-#line 2648 "Zend/zend_language_scanner.c"
+#line 2644 "Zend/zend_language_scanner.c"
yy145:
YYDEBUG(145, *YYCURSOR);
yyaccept = 1;
@@ -2878,18 +2874,18 @@ yy168:
++YYCURSOR;
YYDEBUG(169, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1458 "Zend/zend_language_scanner.l"
+#line 1454 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return '{';
}
-#line 2887 "Zend/zend_language_scanner.c"
+#line 2883 "Zend/zend_language_scanner.c"
yy170:
YYDEBUG(170, *YYCURSOR);
++YYCURSOR;
YYDEBUG(171, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1470 "Zend/zend_language_scanner.l"
+#line 1466 "Zend/zend_language_scanner.l"
{
RESET_DOC_COMMENT();
if (!zend_stack_is_empty(&SCNG(state_stack))) {
@@ -2897,7 +2893,7 @@ yy170:
}
return '}';
}
-#line 2901 "Zend/zend_language_scanner.c"
+#line 2897 "Zend/zend_language_scanner.c"
yy172:
YYDEBUG(172, *YYCURSOR);
yyaccept = 2;
@@ -2925,7 +2921,7 @@ yy172:
yy173:
YYDEBUG(173, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1518 "Zend/zend_language_scanner.l"
+#line 1514 "Zend/zend_language_scanner.l"
{
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, NULL, 0));
@@ -2943,7 +2939,7 @@ yy173:
}
return T_LNUMBER;
}
-#line 2947 "Zend/zend_language_scanner.c"
+#line 2943 "Zend/zend_language_scanner.c"
yy174:
YYDEBUG(174, *YYCURSOR);
yyaccept = 2;
@@ -2971,7 +2967,7 @@ yy176:
yy177:
YYDEBUG(177, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1776 "Zend/zend_language_scanner.l"
+#line 1773 "Zend/zend_language_scanner.l"
{
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
@@ -3005,14 +3001,14 @@ yy177:
return T_COMMENT;
}
-#line 3009 "Zend/zend_language_scanner.c"
+#line 3005 "Zend/zend_language_scanner.c"
yy178:
YYDEBUG(178, *YYCURSOR);
++YYCURSOR;
yy179:
YYDEBUG(179, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1860 "Zend/zend_language_scanner.l"
+#line 1857 "Zend/zend_language_scanner.l"
{
register char *s, *t;
char *end;
@@ -3034,6 +3030,7 @@ yy179:
/* Unclosed single quotes; treat similar to double quotes, but without a separate token
* for ' (unrecognized by parser), instead of old flex fallback to "Unexpected character..."
* rule, which continued in ST_IN_SCRIPTING state after the quote */
+ ZVAL_NULL(zendlval);
return T_ENCAPSED_AND_WHITESPACE;
}
}
@@ -3080,14 +3077,14 @@ yy179:
}
return T_CONSTANT_ENCAPSED_STRING;
}
-#line 3084 "Zend/zend_language_scanner.c"
+#line 3081 "Zend/zend_language_scanner.c"
yy180:
YYDEBUG(180, *YYCURSOR);
++YYCURSOR;
yy181:
YYDEBUG(181, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1929 "Zend/zend_language_scanner.l"
+#line 1927 "Zend/zend_language_scanner.l"
{
int bprefix = (yytext[0] != '"') ? 1 : 0;
@@ -3128,24 +3125,24 @@ yy181:
BEGIN(ST_DOUBLE_QUOTES);
return '"';
}
-#line 3132 "Zend/zend_language_scanner.c"
+#line 3129 "Zend/zend_language_scanner.c"
yy182:
YYDEBUG(182, *YYCURSOR);
++YYCURSOR;
YYDEBUG(183, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2019 "Zend/zend_language_scanner.l"
+#line 2017 "Zend/zend_language_scanner.l"
{
BEGIN(ST_BACKQUOTE);
return '`';
}
-#line 3143 "Zend/zend_language_scanner.c"
+#line 3140 "Zend/zend_language_scanner.c"
yy184:
YYDEBUG(184, *YYCURSOR);
++YYCURSOR;
YYDEBUG(185, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2281 "Zend/zend_language_scanner.l"
+#line 2279 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -3154,7 +3151,7 @@ yy184:
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
goto restart;
}
-#line 3158 "Zend/zend_language_scanner.c"
+#line 3155 "Zend/zend_language_scanner.c"
yy186:
YYDEBUG(186, *YYCURSOR);
++YYCURSOR;
@@ -3181,12 +3178,12 @@ yy188:
yy190:
YYDEBUG(190, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1573 "Zend/zend_language_scanner.l"
+#line 1569 "Zend/zend_language_scanner.l"
{
ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL));
return T_DNUMBER;
}
-#line 3190 "Zend/zend_language_scanner.c"
+#line 3187 "Zend/zend_language_scanner.c"
yy191:
YYDEBUG(191, *YYCURSOR);
yyaccept = 2;
@@ -3278,7 +3275,7 @@ yy200:
}
YYDEBUG(202, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1495 "Zend/zend_language_scanner.l"
+#line 1491 "Zend/zend_language_scanner.l"
{
char *bin = yytext + 2; /* Skip "0b" */
int len = yyleng - 2;
@@ -3301,7 +3298,7 @@ yy200:
return T_DNUMBER;
}
}
-#line 3305 "Zend/zend_language_scanner.c"
+#line 3302 "Zend/zend_language_scanner.c"
yy203:
YYDEBUG(203, *YYCURSOR);
++YYCURSOR;
@@ -3313,7 +3310,7 @@ yy203:
}
YYDEBUG(205, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1536 "Zend/zend_language_scanner.l"
+#line 1532 "Zend/zend_language_scanner.l"
{
char *hex = yytext + 2; /* Skip "0x" */
int len = yyleng - 2;
@@ -3336,7 +3333,7 @@ yy203:
return T_DNUMBER;
}
}
-#line 3340 "Zend/zend_language_scanner.c"
+#line 3337 "Zend/zend_language_scanner.c"
yy206:
YYDEBUG(206, *YYCURSOR);
++YYCURSOR;
@@ -3345,12 +3342,12 @@ yy206:
yy207:
YYDEBUG(207, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1843 "Zend/zend_language_scanner.l"
+#line 1840 "Zend/zend_language_scanner.l"
{
BEGIN(INITIAL);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
}
-#line 3354 "Zend/zend_language_scanner.c"
+#line 3351 "Zend/zend_language_scanner.c"
yy208:
YYDEBUG(208, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3384,12 +3381,12 @@ yy210:
yy212:
YYDEBUG(212, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1744 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 3393 "Zend/zend_language_scanner.c"
+#line 3390 "Zend/zend_language_scanner.c"
yy213:
YYDEBUG(213, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3403,11 +3400,11 @@ yy214:
}
YYDEBUG(215, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1441 "Zend/zend_language_scanner.l"
+#line 1437 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_XOR;
}
-#line 3411 "Zend/zend_language_scanner.c"
+#line 3408 "Zend/zend_language_scanner.c"
yy216:
YYDEBUG(216, *YYCURSOR);
++YYCURSOR;
@@ -3416,61 +3413,61 @@ yy216:
}
YYDEBUG(217, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1433 "Zend/zend_language_scanner.l"
+#line 1429 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_OR;
}
-#line 3424 "Zend/zend_language_scanner.c"
+#line 3421 "Zend/zend_language_scanner.c"
yy218:
YYDEBUG(218, *YYCURSOR);
++YYCURSOR;
YYDEBUG(219, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1421 "Zend/zend_language_scanner.l"
+#line 1417 "Zend/zend_language_scanner.l"
{
return T_XOR_EQUAL;
}
-#line 3434 "Zend/zend_language_scanner.c"
+#line 3431 "Zend/zend_language_scanner.c"
yy220:
YYDEBUG(220, *YYCURSOR);
++YYCURSOR;
YYDEBUG(221, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1425 "Zend/zend_language_scanner.l"
+#line 1421 "Zend/zend_language_scanner.l"
{
return T_BOOLEAN_OR;
}
-#line 3444 "Zend/zend_language_scanner.c"
+#line 3441 "Zend/zend_language_scanner.c"
yy222:
YYDEBUG(222, *YYCURSOR);
++YYCURSOR;
YYDEBUG(223, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1417 "Zend/zend_language_scanner.l"
+#line 1413 "Zend/zend_language_scanner.l"
{
return T_OR_EQUAL;
}
-#line 3454 "Zend/zend_language_scanner.c"
+#line 3451 "Zend/zend_language_scanner.c"
yy224:
YYDEBUG(224, *YYCURSOR);
++YYCURSOR;
YYDEBUG(225, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1429 "Zend/zend_language_scanner.l"
+#line 1425 "Zend/zend_language_scanner.l"
{
return T_BOOLEAN_AND;
}
-#line 3464 "Zend/zend_language_scanner.c"
+#line 3461 "Zend/zend_language_scanner.c"
yy226:
YYDEBUG(226, *YYCURSOR);
++YYCURSOR;
YYDEBUG(227, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1413 "Zend/zend_language_scanner.l"
+#line 1409 "Zend/zend_language_scanner.l"
{
return T_AND_EQUAL;
}
-#line 3474 "Zend/zend_language_scanner.c"
+#line 3471 "Zend/zend_language_scanner.c"
yy228:
YYDEBUG(228, *YYCURSOR);
++YYCURSOR;
@@ -3479,7 +3476,7 @@ yy228:
yy229:
YYDEBUG(229, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1849 "Zend/zend_language_scanner.l"
+#line 1846 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
BEGIN(INITIAL);
@@ -3489,17 +3486,17 @@ yy229:
return yytext[0];
}
}
-#line 3493 "Zend/zend_language_scanner.c"
+#line 3490 "Zend/zend_language_scanner.c"
yy230:
YYDEBUG(230, *YYCURSOR);
++YYCURSOR;
YYDEBUG(231, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1401 "Zend/zend_language_scanner.l"
+#line 1397 "Zend/zend_language_scanner.l"
{
return T_MOD_EQUAL;
}
-#line 3503 "Zend/zend_language_scanner.c"
+#line 3500 "Zend/zend_language_scanner.c"
yy232:
YYDEBUG(232, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3517,7 +3514,7 @@ yy234:
yy235:
YYDEBUG(235, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1810 "Zend/zend_language_scanner.l"
+#line 1807 "Zend/zend_language_scanner.l"
{
int doc_com;
@@ -3550,7 +3547,7 @@ yy235:
return T_COMMENT;
}
-#line 3554 "Zend/zend_language_scanner.c"
+#line 3551 "Zend/zend_language_scanner.c"
yy236:
YYDEBUG(236, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3560,11 +3557,11 @@ yy237:
++YYCURSOR;
YYDEBUG(238, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1393 "Zend/zend_language_scanner.l"
+#line 1389 "Zend/zend_language_scanner.l"
{
return T_DIV_EQUAL;
}
-#line 3568 "Zend/zend_language_scanner.c"
+#line 3565 "Zend/zend_language_scanner.c"
yy239:
YYDEBUG(239, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3588,62 +3585,62 @@ yy242:
if ((yych = *YYCURSOR) == '=') goto yy246;
YYDEBUG(243, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1385 "Zend/zend_language_scanner.l"
+#line 1381 "Zend/zend_language_scanner.l"
{
return T_POW;
}
-#line 3596 "Zend/zend_language_scanner.c"
+#line 3593 "Zend/zend_language_scanner.c"
yy244:
YYDEBUG(244, *YYCURSOR);
++YYCURSOR;
YYDEBUG(245, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1381 "Zend/zend_language_scanner.l"
+#line 1377 "Zend/zend_language_scanner.l"
{
return T_MUL_EQUAL;
}
-#line 3606 "Zend/zend_language_scanner.c"
+#line 3603 "Zend/zend_language_scanner.c"
yy246:
YYDEBUG(246, *YYCURSOR);
++YYCURSOR;
YYDEBUG(247, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1389 "Zend/zend_language_scanner.l"
+#line 1385 "Zend/zend_language_scanner.l"
{
return T_POW_EQUAL;
}
-#line 3616 "Zend/zend_language_scanner.c"
+#line 3613 "Zend/zend_language_scanner.c"
yy248:
YYDEBUG(248, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy252;
YYDEBUG(249, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1449 "Zend/zend_language_scanner.l"
+#line 1445 "Zend/zend_language_scanner.l"
{
return T_SR;
}
-#line 3627 "Zend/zend_language_scanner.c"
+#line 3624 "Zend/zend_language_scanner.c"
yy250:
YYDEBUG(250, *YYCURSOR);
++YYCURSOR;
YYDEBUG(251, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1369 "Zend/zend_language_scanner.l"
+#line 1365 "Zend/zend_language_scanner.l"
{
return T_IS_GREATER_OR_EQUAL;
}
-#line 3637 "Zend/zend_language_scanner.c"
+#line 3634 "Zend/zend_language_scanner.c"
yy252:
YYDEBUG(252, *YYCURSOR);
++YYCURSOR;
YYDEBUG(253, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1409 "Zend/zend_language_scanner.l"
+#line 1405 "Zend/zend_language_scanner.l"
{
return T_SR_EQUAL;
}
-#line 3647 "Zend/zend_language_scanner.c"
+#line 3644 "Zend/zend_language_scanner.c"
yy254:
YYDEBUG(254, *YYCURSOR);
yyaccept = 5;
@@ -3654,11 +3651,11 @@ yy254:
yy255:
YYDEBUG(255, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1445 "Zend/zend_language_scanner.l"
+#line 1441 "Zend/zend_language_scanner.l"
{
return T_SL;
}
-#line 3662 "Zend/zend_language_scanner.c"
+#line 3659 "Zend/zend_language_scanner.c"
yy256:
YYDEBUG(256, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3670,22 +3667,22 @@ yy257:
++YYCURSOR;
YYDEBUG(258, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1365 "Zend/zend_language_scanner.l"
+#line 1361 "Zend/zend_language_scanner.l"
{
return T_IS_SMALLER_OR_EQUAL;
}
-#line 3678 "Zend/zend_language_scanner.c"
+#line 3675 "Zend/zend_language_scanner.c"
yy259:
YYDEBUG(259, *YYCURSOR);
++YYCURSOR;
yy260:
YYDEBUG(260, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1361 "Zend/zend_language_scanner.l"
+#line 1357 "Zend/zend_language_scanner.l"
{
return T_IS_NOT_EQUAL;
}
-#line 3689 "Zend/zend_language_scanner.c"
+#line 3686 "Zend/zend_language_scanner.c"
yy261:
YYDEBUG(261, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3736,11 +3733,11 @@ yy268:
++YYCURSOR;
YYDEBUG(269, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1405 "Zend/zend_language_scanner.l"
+#line 1401 "Zend/zend_language_scanner.l"
{
return T_SL_EQUAL;
}
-#line 3744 "Zend/zend_language_scanner.c"
+#line 3741 "Zend/zend_language_scanner.c"
yy270:
YYDEBUG(270, *YYCURSOR);
++YYCURSOR;
@@ -3845,7 +3842,7 @@ yy279:
yy280:
YYDEBUG(280, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1971 "Zend/zend_language_scanner.l"
+#line 1969 "Zend/zend_language_scanner.l"
{
char *s;
int bprefix = (yytext[0] != '<') ? 1 : 0;
@@ -3892,7 +3889,7 @@ yy280:
return T_START_HEREDOC;
}
-#line 3896 "Zend/zend_language_scanner.c"
+#line 3893 "Zend/zend_language_scanner.c"
yy281:
YYDEBUG(281, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3932,31 +3929,31 @@ yy284:
++YYCURSOR;
YYDEBUG(286, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1353 "Zend/zend_language_scanner.l"
+#line 1349 "Zend/zend_language_scanner.l"
{
return T_IS_NOT_IDENTICAL;
}
-#line 3940 "Zend/zend_language_scanner.c"
+#line 3937 "Zend/zend_language_scanner.c"
yy287:
YYDEBUG(287, *YYCURSOR);
++YYCURSOR;
YYDEBUG(288, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1373 "Zend/zend_language_scanner.l"
+#line 1369 "Zend/zend_language_scanner.l"
{
return T_PLUS_EQUAL;
}
-#line 3950 "Zend/zend_language_scanner.c"
+#line 3947 "Zend/zend_language_scanner.c"
yy289:
YYDEBUG(289, *YYCURSOR);
++YYCURSOR;
YYDEBUG(290, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1341 "Zend/zend_language_scanner.l"
+#line 1337 "Zend/zend_language_scanner.l"
{
return T_INC;
}
-#line 3960 "Zend/zend_language_scanner.c"
+#line 3957 "Zend/zend_language_scanner.c"
yy291:
YYDEBUG(291, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3975,42 +3972,42 @@ yy293:
}
YYDEBUG(294, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1329 "Zend/zend_language_scanner.l"
+#line 1325 "Zend/zend_language_scanner.l"
{
return T_LIST;
}
-#line 3983 "Zend/zend_language_scanner.c"
+#line 3980 "Zend/zend_language_scanner.c"
yy295:
YYDEBUG(295, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy299;
YYDEBUG(296, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1357 "Zend/zend_language_scanner.l"
+#line 1353 "Zend/zend_language_scanner.l"
{
return T_IS_EQUAL;
}
-#line 3994 "Zend/zend_language_scanner.c"
+#line 3991 "Zend/zend_language_scanner.c"
yy297:
YYDEBUG(297, *YYCURSOR);
++YYCURSOR;
YYDEBUG(298, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1325 "Zend/zend_language_scanner.l"
+#line 1321 "Zend/zend_language_scanner.l"
{
return T_DOUBLE_ARROW;
}
-#line 4004 "Zend/zend_language_scanner.c"
+#line 4001 "Zend/zend_language_scanner.c"
yy299:
YYDEBUG(299, *YYCURSOR);
++YYCURSOR;
YYDEBUG(300, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1349 "Zend/zend_language_scanner.l"
+#line 1345 "Zend/zend_language_scanner.l"
{
return T_IS_IDENTICAL;
}
-#line 4014 "Zend/zend_language_scanner.c"
+#line 4011 "Zend/zend_language_scanner.c"
yy301:
YYDEBUG(301, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4140,11 +4137,11 @@ yy317:
}
YYDEBUG(320, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1606 "Zend/zend_language_scanner.l"
+#line 1602 "Zend/zend_language_scanner.l"
{
return T_NS_C;
}
-#line 4148 "Zend/zend_language_scanner.c"
+#line 4145 "Zend/zend_language_scanner.c"
yy321:
YYDEBUG(321, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4164,11 +4161,11 @@ yy322:
}
YYDEBUG(325, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1602 "Zend/zend_language_scanner.l"
+#line 1598 "Zend/zend_language_scanner.l"
{
return T_DIR;
}
-#line 4172 "Zend/zend_language_scanner.c"
+#line 4169 "Zend/zend_language_scanner.c"
yy326:
YYDEBUG(326, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4193,11 +4190,11 @@ yy328:
}
YYDEBUG(331, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1594 "Zend/zend_language_scanner.l"
+#line 1590 "Zend/zend_language_scanner.l"
{
return T_LINE;
}
-#line 4201 "Zend/zend_language_scanner.c"
+#line 4198 "Zend/zend_language_scanner.c"
yy332:
YYDEBUG(332, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4232,11 +4229,11 @@ yy336:
}
YYDEBUG(339, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1590 "Zend/zend_language_scanner.l"
+#line 1586 "Zend/zend_language_scanner.l"
{
return T_METHOD_C;
}
-#line 4240 "Zend/zend_language_scanner.c"
+#line 4237 "Zend/zend_language_scanner.c"
yy340:
YYDEBUG(340, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4287,11 +4284,11 @@ yy347:
}
YYDEBUG(350, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1586 "Zend/zend_language_scanner.l"
+#line 1582 "Zend/zend_language_scanner.l"
{
return T_FUNC_C;
}
-#line 4295 "Zend/zend_language_scanner.c"
+#line 4292 "Zend/zend_language_scanner.c"
yy351:
YYDEBUG(351, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4311,11 +4308,11 @@ yy352:
}
YYDEBUG(355, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1598 "Zend/zend_language_scanner.l"
+#line 1594 "Zend/zend_language_scanner.l"
{
return T_FILE;
}
-#line 4319 "Zend/zend_language_scanner.c"
+#line 4316 "Zend/zend_language_scanner.c"
yy356:
YYDEBUG(356, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4345,11 +4342,11 @@ yy359:
}
YYDEBUG(362, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1582 "Zend/zend_language_scanner.l"
+#line 1578 "Zend/zend_language_scanner.l"
{
return T_TRAIT_C;
}
-#line 4353 "Zend/zend_language_scanner.c"
+#line 4350 "Zend/zend_language_scanner.c"
yy363:
YYDEBUG(363, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4379,11 +4376,11 @@ yy366:
}
YYDEBUG(369, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1578 "Zend/zend_language_scanner.l"
+#line 1574 "Zend/zend_language_scanner.l"
{
return T_CLASS_C;
}
-#line 4387 "Zend/zend_language_scanner.c"
+#line 4384 "Zend/zend_language_scanner.c"
yy370:
YYDEBUG(370, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4445,11 +4442,11 @@ yy381:
}
YYDEBUG(382, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1293 "Zend/zend_language_scanner.l"
+#line 1289 "Zend/zend_language_scanner.l"
{
return T_HALT_COMPILER;
}
-#line 4453 "Zend/zend_language_scanner.c"
+#line 4450 "Zend/zend_language_scanner.c"
yy383:
YYDEBUG(383, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4469,11 +4466,11 @@ yy385:
}
YYDEBUG(386, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1273 "Zend/zend_language_scanner.l"
+#line 1269 "Zend/zend_language_scanner.l"
{
return T_USE;
}
-#line 4477 "Zend/zend_language_scanner.c"
+#line 4474 "Zend/zend_language_scanner.c"
yy387:
YYDEBUG(387, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4492,11 +4489,11 @@ yy389:
}
YYDEBUG(390, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1321 "Zend/zend_language_scanner.l"
+#line 1317 "Zend/zend_language_scanner.l"
{
return T_UNSET;
}
-#line 4500 "Zend/zend_language_scanner.c"
+#line 4497 "Zend/zend_language_scanner.c"
yy391:
YYDEBUG(391, *YYCURSOR);
++YYCURSOR;
@@ -4668,11 +4665,11 @@ yy406:
++YYCURSOR;
YYDEBUG(408, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1221 "Zend/zend_language_scanner.l"
+#line 1217 "Zend/zend_language_scanner.l"
{
return T_INT_CAST;
}
-#line 4676 "Zend/zend_language_scanner.c"
+#line 4673 "Zend/zend_language_scanner.c"
yy409:
YYDEBUG(409, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4716,11 +4713,11 @@ yy414:
++YYCURSOR;
YYDEBUG(417, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1225 "Zend/zend_language_scanner.l"
+#line 1221 "Zend/zend_language_scanner.l"
{
return T_DOUBLE_CAST;
}
-#line 4724 "Zend/zend_language_scanner.c"
+#line 4721 "Zend/zend_language_scanner.c"
yy418:
YYDEBUG(418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4790,11 +4787,11 @@ yy428:
++YYCURSOR;
YYDEBUG(431, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1229 "Zend/zend_language_scanner.l"
+#line 1225 "Zend/zend_language_scanner.l"
{
return T_STRING_CAST;
}
-#line 4798 "Zend/zend_language_scanner.c"
+#line 4795 "Zend/zend_language_scanner.c"
yy432:
YYDEBUG(432, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4827,11 +4824,11 @@ yy435:
++YYCURSOR;
YYDEBUG(438, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1233 "Zend/zend_language_scanner.l"
+#line 1229 "Zend/zend_language_scanner.l"
{
return T_ARRAY_CAST;
}
-#line 4835 "Zend/zend_language_scanner.c"
+#line 4832 "Zend/zend_language_scanner.c"
yy439:
YYDEBUG(439, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4869,11 +4866,11 @@ yy443:
++YYCURSOR;
YYDEBUG(446, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1237 "Zend/zend_language_scanner.l"
+#line 1233 "Zend/zend_language_scanner.l"
{
return T_OBJECT_CAST;
}
-#line 4877 "Zend/zend_language_scanner.c"
+#line 4874 "Zend/zend_language_scanner.c"
yy447:
YYDEBUG(447, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4914,11 +4911,11 @@ yy452:
++YYCURSOR;
YYDEBUG(454, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1241 "Zend/zend_language_scanner.l"
+#line 1237 "Zend/zend_language_scanner.l"
{
return T_BOOL_CAST;
}
-#line 4922 "Zend/zend_language_scanner.c"
+#line 4919 "Zend/zend_language_scanner.c"
yy455:
YYDEBUG(455, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4978,11 +4975,11 @@ yy463:
++YYCURSOR;
YYDEBUG(466, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1245 "Zend/zend_language_scanner.l"
+#line 1241 "Zend/zend_language_scanner.l"
{
return T_UNSET_CAST;
}
-#line 4986 "Zend/zend_language_scanner.c"
+#line 4983 "Zend/zend_language_scanner.c"
yy467:
YYDEBUG(467, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4996,11 +4993,11 @@ yy468:
}
YYDEBUG(469, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1217 "Zend/zend_language_scanner.l"
+#line 1213 "Zend/zend_language_scanner.l"
{
return T_VAR;
}
-#line 5004 "Zend/zend_language_scanner.c"
+#line 5001 "Zend/zend_language_scanner.c"
yy470:
YYDEBUG(470, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5020,11 +5017,11 @@ yy472:
}
YYDEBUG(473, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1209 "Zend/zend_language_scanner.l"
+#line 1205 "Zend/zend_language_scanner.l"
{
return T_NEW;
}
-#line 5028 "Zend/zend_language_scanner.c"
+#line 5025 "Zend/zend_language_scanner.c"
yy474:
YYDEBUG(474, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5063,11 +5060,11 @@ yy480:
}
YYDEBUG(481, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1269 "Zend/zend_language_scanner.l"
+#line 1265 "Zend/zend_language_scanner.l"
{
return T_NAMESPACE;
}
-#line 5071 "Zend/zend_language_scanner.c"
+#line 5068 "Zend/zend_language_scanner.c"
yy482:
YYDEBUG(482, *YYCURSOR);
yyaccept = 3;
@@ -5089,11 +5086,11 @@ yy484:
++YYCURSOR;
YYDEBUG(485, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1397 "Zend/zend_language_scanner.l"
+#line 1393 "Zend/zend_language_scanner.l"
{
return T_CONCAT_EQUAL;
}
-#line 5097 "Zend/zend_language_scanner.c"
+#line 5094 "Zend/zend_language_scanner.c"
yy486:
YYDEBUG(486, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5102,21 +5099,21 @@ yy486:
++YYCURSOR;
YYDEBUG(488, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1205 "Zend/zend_language_scanner.l"
+#line 1201 "Zend/zend_language_scanner.l"
{
return T_ELLIPSIS;
}
-#line 5110 "Zend/zend_language_scanner.c"
+#line 5107 "Zend/zend_language_scanner.c"
yy489:
YYDEBUG(489, *YYCURSOR);
++YYCURSOR;
YYDEBUG(490, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1197 "Zend/zend_language_scanner.l"
+#line 1193 "Zend/zend_language_scanner.l"
{
return T_PAAMAYIM_NEKUDOTAYIM;
}
-#line 5120 "Zend/zend_language_scanner.c"
+#line 5117 "Zend/zend_language_scanner.c"
yy491:
YYDEBUG(491, *YYCURSOR);
++YYCURSOR;
@@ -5138,32 +5135,32 @@ yy493:
++YYCURSOR;
YYDEBUG(494, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1377 "Zend/zend_language_scanner.l"
+#line 1373 "Zend/zend_language_scanner.l"
{
return T_MINUS_EQUAL;
}
-#line 5146 "Zend/zend_language_scanner.c"
+#line 5143 "Zend/zend_language_scanner.c"
yy495:
YYDEBUG(495, *YYCURSOR);
++YYCURSOR;
YYDEBUG(496, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1345 "Zend/zend_language_scanner.l"
+#line 1341 "Zend/zend_language_scanner.l"
{
return T_DEC;
}
-#line 5156 "Zend/zend_language_scanner.c"
+#line 5153 "Zend/zend_language_scanner.c"
yy497:
YYDEBUG(497, *YYCURSOR);
++YYCURSOR;
YYDEBUG(498, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1171 "Zend/zend_language_scanner.l"
+#line 1167 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
return T_OBJECT_OPERATOR;
}
-#line 5167 "Zend/zend_language_scanner.c"
+#line 5164 "Zend/zend_language_scanner.c"
yy499:
YYDEBUG(499, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5208,11 +5205,11 @@ yy504:
}
YYDEBUG(505, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1317 "Zend/zend_language_scanner.l"
+#line 1313 "Zend/zend_language_scanner.l"
{
return T_PUBLIC;
}
-#line 5216 "Zend/zend_language_scanner.c"
+#line 5213 "Zend/zend_language_scanner.c"
yy506:
YYDEBUG(506, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5267,11 +5264,11 @@ yy513:
}
YYDEBUG(514, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1313 "Zend/zend_language_scanner.l"
+#line 1309 "Zend/zend_language_scanner.l"
{
return T_PROTECTED;
}
-#line 5275 "Zend/zend_language_scanner.c"
+#line 5272 "Zend/zend_language_scanner.c"
yy515:
YYDEBUG(515, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5301,11 +5298,11 @@ yy519:
}
YYDEBUG(520, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1309 "Zend/zend_language_scanner.l"
+#line 1305 "Zend/zend_language_scanner.l"
{
return T_PRIVATE;
}
-#line 5309 "Zend/zend_language_scanner.c"
+#line 5306 "Zend/zend_language_scanner.c"
yy521:
YYDEBUG(521, *YYCURSOR);
++YYCURSOR;
@@ -5314,11 +5311,11 @@ yy521:
}
YYDEBUG(522, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1147 "Zend/zend_language_scanner.l"
+#line 1143 "Zend/zend_language_scanner.l"
{
return T_PRINT;
}
-#line 5322 "Zend/zend_language_scanner.c"
+#line 5319 "Zend/zend_language_scanner.c"
yy523:
YYDEBUG(523, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5343,11 +5340,11 @@ yy526:
}
YYDEBUG(527, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1139 "Zend/zend_language_scanner.l"
+#line 1135 "Zend/zend_language_scanner.l"
{
return T_GOTO;
}
-#line 5351 "Zend/zend_language_scanner.c"
+#line 5348 "Zend/zend_language_scanner.c"
yy528:
YYDEBUG(528, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5371,11 +5368,11 @@ yy531:
}
YYDEBUG(532, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1281 "Zend/zend_language_scanner.l"
+#line 1277 "Zend/zend_language_scanner.l"
{
return T_GLOBAL;
}
-#line 5379 "Zend/zend_language_scanner.c"
+#line 5376 "Zend/zend_language_scanner.c"
yy533:
YYDEBUG(533, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5412,11 +5409,11 @@ yy539:
}
YYDEBUG(540, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1131 "Zend/zend_language_scanner.l"
+#line 1127 "Zend/zend_language_scanner.l"
{
return T_BREAK;
}
-#line 5420 "Zend/zend_language_scanner.c"
+#line 5417 "Zend/zend_language_scanner.c"
yy541:
YYDEBUG(541, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5456,11 +5453,11 @@ yy547:
}
YYDEBUG(548, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1115 "Zend/zend_language_scanner.l"
+#line 1111 "Zend/zend_language_scanner.l"
{
return T_SWITCH;
}
-#line 5464 "Zend/zend_language_scanner.c"
+#line 5461 "Zend/zend_language_scanner.c"
yy549:
YYDEBUG(549, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5484,11 +5481,11 @@ yy552:
}
YYDEBUG(553, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1297 "Zend/zend_language_scanner.l"
+#line 1293 "Zend/zend_language_scanner.l"
{
return T_STATIC;
}
-#line 5492 "Zend/zend_language_scanner.c"
+#line 5489 "Zend/zend_language_scanner.c"
yy554:
YYDEBUG(554, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5515,11 +5512,11 @@ yy557:
}
YYDEBUG(558, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1111 "Zend/zend_language_scanner.l"
+#line 1107 "Zend/zend_language_scanner.l"
{
return T_AS;
}
-#line 5523 "Zend/zend_language_scanner.c"
+#line 5520 "Zend/zend_language_scanner.c"
yy559:
YYDEBUG(559, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5538,11 +5535,11 @@ yy561:
}
YYDEBUG(562, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1333 "Zend/zend_language_scanner.l"
+#line 1329 "Zend/zend_language_scanner.l"
{
return T_ARRAY;
}
-#line 5546 "Zend/zend_language_scanner.c"
+#line 5543 "Zend/zend_language_scanner.c"
yy563:
YYDEBUG(563, *YYCURSOR);
++YYCURSOR;
@@ -5551,11 +5548,11 @@ yy563:
}
YYDEBUG(564, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1437 "Zend/zend_language_scanner.l"
+#line 1433 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_AND;
}
-#line 5559 "Zend/zend_language_scanner.c"
+#line 5556 "Zend/zend_language_scanner.c"
yy565:
YYDEBUG(565, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5589,11 +5586,11 @@ yy570:
}
YYDEBUG(571, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1301 "Zend/zend_language_scanner.l"
+#line 1297 "Zend/zend_language_scanner.l"
{
return T_ABSTRACT;
}
-#line 5597 "Zend/zend_language_scanner.c"
+#line 5594 "Zend/zend_language_scanner.c"
yy572:
YYDEBUG(572, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5617,11 +5614,11 @@ yy575:
}
YYDEBUG(576, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1071 "Zend/zend_language_scanner.l"
+#line 1067 "Zend/zend_language_scanner.l"
{
return T_WHILE;
}
-#line 5625 "Zend/zend_language_scanner.c"
+#line 5622 "Zend/zend_language_scanner.c"
yy577:
YYDEBUG(577, *YYCURSOR);
++YYCURSOR;
@@ -5630,11 +5627,11 @@ yy577:
}
YYDEBUG(578, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1055 "Zend/zend_language_scanner.l"
+#line 1051 "Zend/zend_language_scanner.l"
{
return T_IF;
}
-#line 5638 "Zend/zend_language_scanner.c"
+#line 5635 "Zend/zend_language_scanner.c"
yy579:
YYDEBUG(579, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5686,11 +5683,11 @@ yy584:
}
YYDEBUG(585, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1285 "Zend/zend_language_scanner.l"
+#line 1281 "Zend/zend_language_scanner.l"
{
return T_ISSET;
}
-#line 5694 "Zend/zend_language_scanner.c"
+#line 5691 "Zend/zend_language_scanner.c"
yy586:
YYDEBUG(586, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5744,11 +5741,11 @@ yy592:
yy593:
YYDEBUG(593, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1253 "Zend/zend_language_scanner.l"
+#line 1249 "Zend/zend_language_scanner.l"
{
return T_INCLUDE;
}
-#line 5752 "Zend/zend_language_scanner.c"
+#line 5749 "Zend/zend_language_scanner.c"
yy594:
YYDEBUG(594, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5777,11 +5774,11 @@ yy598:
}
YYDEBUG(599, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1257 "Zend/zend_language_scanner.l"
+#line 1253 "Zend/zend_language_scanner.l"
{
return T_INCLUDE_ONCE;
}
-#line 5785 "Zend/zend_language_scanner.c"
+#line 5782 "Zend/zend_language_scanner.c"
yy600:
YYDEBUG(600, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5815,11 +5812,11 @@ yy605:
}
YYDEBUG(606, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1155 "Zend/zend_language_scanner.l"
+#line 1151 "Zend/zend_language_scanner.l"
{
return T_INTERFACE;
}
-#line 5823 "Zend/zend_language_scanner.c"
+#line 5820 "Zend/zend_language_scanner.c"
yy607:
YYDEBUG(607, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5869,11 +5866,11 @@ yy613:
}
YYDEBUG(614, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1277 "Zend/zend_language_scanner.l"
+#line 1273 "Zend/zend_language_scanner.l"
{
return T_INSTEADOF;
}
-#line 5877 "Zend/zend_language_scanner.c"
+#line 5874 "Zend/zend_language_scanner.c"
yy615:
YYDEBUG(615, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5902,11 +5899,11 @@ yy619:
}
YYDEBUG(620, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1107 "Zend/zend_language_scanner.l"
+#line 1103 "Zend/zend_language_scanner.l"
{
return T_INSTANCEOF;
}
-#line 5910 "Zend/zend_language_scanner.c"
+#line 5907 "Zend/zend_language_scanner.c"
yy621:
YYDEBUG(621, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5950,11 +5947,11 @@ yy628:
}
YYDEBUG(629, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1167 "Zend/zend_language_scanner.l"
+#line 1163 "Zend/zend_language_scanner.l"
{
return T_IMPLEMENTS;
}
-#line 5958 "Zend/zend_language_scanner.c"
+#line 5955 "Zend/zend_language_scanner.c"
yy630:
YYDEBUG(630, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5982,11 +5979,11 @@ yy631:
}
YYDEBUG(633, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1039 "Zend/zend_language_scanner.l"
+#line 1035 "Zend/zend_language_scanner.l"
{
return T_TRY;
}
-#line 5990 "Zend/zend_language_scanner.c"
+#line 5987 "Zend/zend_language_scanner.c"
yy634:
YYDEBUG(634, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6005,11 +6002,11 @@ yy636:
}
YYDEBUG(637, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1159 "Zend/zend_language_scanner.l"
+#line 1155 "Zend/zend_language_scanner.l"
{
return T_TRAIT;
}
-#line 6013 "Zend/zend_language_scanner.c"
+#line 6010 "Zend/zend_language_scanner.c"
yy638:
YYDEBUG(638, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6028,11 +6025,11 @@ yy640:
}
YYDEBUG(641, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1051 "Zend/zend_language_scanner.l"
+#line 1047 "Zend/zend_language_scanner.l"
{
return T_THROW;
}
-#line 6036 "Zend/zend_language_scanner.c"
+#line 6033 "Zend/zend_language_scanner.c"
yy642:
YYDEBUG(642, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6056,11 +6053,11 @@ yy645:
}
YYDEBUG(646, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1035 "Zend/zend_language_scanner.l"
+#line 1031 "Zend/zend_language_scanner.l"
{
return T_YIELD;
}
-#line 6064 "Zend/zend_language_scanner.c"
+#line 6061 "Zend/zend_language_scanner.c"
yy647:
YYDEBUG(647, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6121,11 +6118,11 @@ yy653:
yy654:
YYDEBUG(654, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1261 "Zend/zend_language_scanner.l"
+#line 1257 "Zend/zend_language_scanner.l"
{
return T_REQUIRE;
}
-#line 6129 "Zend/zend_language_scanner.c"
+#line 6126 "Zend/zend_language_scanner.c"
yy655:
YYDEBUG(655, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6154,11 +6151,11 @@ yy659:
}
YYDEBUG(660, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1265 "Zend/zend_language_scanner.l"
+#line 1261 "Zend/zend_language_scanner.l"
{
return T_REQUIRE_ONCE;
}
-#line 6162 "Zend/zend_language_scanner.c"
+#line 6159 "Zend/zend_language_scanner.c"
yy661:
YYDEBUG(661, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6177,11 +6174,11 @@ yy663:
}
YYDEBUG(664, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1031 "Zend/zend_language_scanner.l"
+#line 1027 "Zend/zend_language_scanner.l"
{
return T_RETURN;
}
-#line 6185 "Zend/zend_language_scanner.c"
+#line 6182 "Zend/zend_language_scanner.c"
yy665:
YYDEBUG(665, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6271,11 +6268,11 @@ yy674:
}
YYDEBUG(675, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1135 "Zend/zend_language_scanner.l"
+#line 1131 "Zend/zend_language_scanner.l"
{
return T_CONTINUE;
}
-#line 6279 "Zend/zend_language_scanner.c"
+#line 6276 "Zend/zend_language_scanner.c"
yy676:
YYDEBUG(676, *YYCURSOR);
++YYCURSOR;
@@ -6284,11 +6281,11 @@ yy676:
}
YYDEBUG(677, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1027 "Zend/zend_language_scanner.l"
+#line 1023 "Zend/zend_language_scanner.l"
{
return T_CONST;
}
-#line 6292 "Zend/zend_language_scanner.c"
+#line 6289 "Zend/zend_language_scanner.c"
yy678:
YYDEBUG(678, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6313,11 +6310,11 @@ yy681:
}
YYDEBUG(682, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1213 "Zend/zend_language_scanner.l"
+#line 1209 "Zend/zend_language_scanner.l"
{
return T_CLONE;
}
-#line 6321 "Zend/zend_language_scanner.c"
+#line 6318 "Zend/zend_language_scanner.c"
yy683:
YYDEBUG(683, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6331,11 +6328,11 @@ yy684:
}
YYDEBUG(685, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1151 "Zend/zend_language_scanner.l"
+#line 1147 "Zend/zend_language_scanner.l"
{
return T_CLASS;
}
-#line 6339 "Zend/zend_language_scanner.c"
+#line 6336 "Zend/zend_language_scanner.c"
yy686:
YYDEBUG(686, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6381,11 +6378,11 @@ yy693:
}
YYDEBUG(694, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1337 "Zend/zend_language_scanner.l"
+#line 1333 "Zend/zend_language_scanner.l"
{
return T_CALLABLE;
}
-#line 6389 "Zend/zend_language_scanner.c"
+#line 6386 "Zend/zend_language_scanner.c"
yy695:
YYDEBUG(695, *YYCURSOR);
++YYCURSOR;
@@ -6394,11 +6391,11 @@ yy695:
}
YYDEBUG(696, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1123 "Zend/zend_language_scanner.l"
+#line 1119 "Zend/zend_language_scanner.l"
{
return T_CASE;
}
-#line 6402 "Zend/zend_language_scanner.c"
+#line 6399 "Zend/zend_language_scanner.c"
yy697:
YYDEBUG(697, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6412,11 +6409,11 @@ yy698:
}
YYDEBUG(699, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1043 "Zend/zend_language_scanner.l"
+#line 1039 "Zend/zend_language_scanner.l"
{
return T_CATCH;
}
-#line 6420 "Zend/zend_language_scanner.c"
+#line 6417 "Zend/zend_language_scanner.c"
yy700:
YYDEBUG(700, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6467,11 +6464,11 @@ yy708:
}
YYDEBUG(709, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1023 "Zend/zend_language_scanner.l"
+#line 1019 "Zend/zend_language_scanner.l"
{
return T_FUNCTION;
}
-#line 6475 "Zend/zend_language_scanner.c"
+#line 6472 "Zend/zend_language_scanner.c"
yy710:
YYDEBUG(710, *YYCURSOR);
++YYCURSOR;
@@ -6495,11 +6492,11 @@ yy710:
yy711:
YYDEBUG(711, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1083 "Zend/zend_language_scanner.l"
+#line 1079 "Zend/zend_language_scanner.l"
{
return T_FOR;
}
-#line 6503 "Zend/zend_language_scanner.c"
+#line 6500 "Zend/zend_language_scanner.c"
yy712:
YYDEBUG(712, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6523,11 +6520,11 @@ yy715:
}
YYDEBUG(716, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1091 "Zend/zend_language_scanner.l"
+#line 1087 "Zend/zend_language_scanner.l"
{
return T_FOREACH;
}
-#line 6531 "Zend/zend_language_scanner.c"
+#line 6528 "Zend/zend_language_scanner.c"
yy717:
YYDEBUG(717, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6561,11 +6558,11 @@ yy719:
yy720:
YYDEBUG(720, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1305 "Zend/zend_language_scanner.l"
+#line 1301 "Zend/zend_language_scanner.l"
{
return T_FINAL;
}
-#line 6569 "Zend/zend_language_scanner.c"
+#line 6566 "Zend/zend_language_scanner.c"
yy721:
YYDEBUG(721, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6579,11 +6576,11 @@ yy722:
}
YYDEBUG(723, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1047 "Zend/zend_language_scanner.l"
+#line 1043 "Zend/zend_language_scanner.l"
{
return T_FINALLY;
}
-#line 6587 "Zend/zend_language_scanner.c"
+#line 6584 "Zend/zend_language_scanner.c"
yy724:
YYDEBUG(724, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6614,11 +6611,11 @@ yy726:
}
YYDEBUG(727, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1079 "Zend/zend_language_scanner.l"
+#line 1075 "Zend/zend_language_scanner.l"
{
return T_DO;
}
-#line 6622 "Zend/zend_language_scanner.c"
+#line 6619 "Zend/zend_language_scanner.c"
yy728:
YYDEBUG(728, *YYCURSOR);
++YYCURSOR;
@@ -6627,11 +6624,11 @@ yy728:
}
YYDEBUG(729, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1019 "Zend/zend_language_scanner.l"
+#line 1015 "Zend/zend_language_scanner.l"
{
return T_EXIT;
}
-#line 6635 "Zend/zend_language_scanner.c"
+#line 6632 "Zend/zend_language_scanner.c"
yy730:
YYDEBUG(730, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6666,11 +6663,11 @@ yy735:
}
YYDEBUG(736, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1127 "Zend/zend_language_scanner.l"
+#line 1123 "Zend/zend_language_scanner.l"
{
return T_DEFAULT;
}
-#line 6674 "Zend/zend_language_scanner.c"
+#line 6671 "Zend/zend_language_scanner.c"
yy737:
YYDEBUG(737, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6694,11 +6691,11 @@ yy740:
}
YYDEBUG(741, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1099 "Zend/zend_language_scanner.l"
+#line 1095 "Zend/zend_language_scanner.l"
{
return T_DECLARE;
}
-#line 6702 "Zend/zend_language_scanner.c"
+#line 6699 "Zend/zend_language_scanner.c"
yy742:
YYDEBUG(742, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6778,11 +6775,11 @@ yy753:
}
YYDEBUG(754, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1163 "Zend/zend_language_scanner.l"
+#line 1159 "Zend/zend_language_scanner.l"
{
return T_EXTENDS;
}
-#line 6786 "Zend/zend_language_scanner.c"
+#line 6783 "Zend/zend_language_scanner.c"
yy755:
YYDEBUG(755, *YYCURSOR);
++YYCURSOR;
@@ -6791,11 +6788,11 @@ yy755:
}
YYDEBUG(756, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1015 "Zend/zend_language_scanner.l"
+#line 1011 "Zend/zend_language_scanner.l"
{
return T_EXIT;
}
-#line 6799 "Zend/zend_language_scanner.c"
+#line 6796 "Zend/zend_language_scanner.c"
yy757:
YYDEBUG(757, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6809,11 +6806,11 @@ yy758:
}
YYDEBUG(759, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1249 "Zend/zend_language_scanner.l"
+#line 1245 "Zend/zend_language_scanner.l"
{
return T_EVAL;
}
-#line 6817 "Zend/zend_language_scanner.c"
+#line 6814 "Zend/zend_language_scanner.c"
yy760:
YYDEBUG(760, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6883,11 +6880,11 @@ yy769:
}
YYDEBUG(770, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1075 "Zend/zend_language_scanner.l"
+#line 1071 "Zend/zend_language_scanner.l"
{
return T_ENDWHILE;
}
-#line 6891 "Zend/zend_language_scanner.c"
+#line 6888 "Zend/zend_language_scanner.c"
yy771:
YYDEBUG(771, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6916,11 +6913,11 @@ yy775:
}
YYDEBUG(776, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1119 "Zend/zend_language_scanner.l"
+#line 1115 "Zend/zend_language_scanner.l"
{
return T_ENDSWITCH;
}
-#line 6924 "Zend/zend_language_scanner.c"
+#line 6921 "Zend/zend_language_scanner.c"
yy777:
YYDEBUG(777, *YYCURSOR);
++YYCURSOR;
@@ -6929,11 +6926,11 @@ yy777:
}
YYDEBUG(778, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1063 "Zend/zend_language_scanner.l"
+#line 1059 "Zend/zend_language_scanner.l"
{
return T_ENDIF;
}
-#line 6937 "Zend/zend_language_scanner.c"
+#line 6934 "Zend/zend_language_scanner.c"
yy779:
YYDEBUG(779, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6962,11 +6959,11 @@ yy780:
yy781:
YYDEBUG(781, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1087 "Zend/zend_language_scanner.l"
+#line 1083 "Zend/zend_language_scanner.l"
{
return T_ENDFOR;
}
-#line 6970 "Zend/zend_language_scanner.c"
+#line 6967 "Zend/zend_language_scanner.c"
yy782:
YYDEBUG(782, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6990,11 +6987,11 @@ yy785:
}
YYDEBUG(786, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1095 "Zend/zend_language_scanner.l"
+#line 1091 "Zend/zend_language_scanner.l"
{
return T_ENDFOREACH;
}
-#line 6998 "Zend/zend_language_scanner.c"
+#line 6995 "Zend/zend_language_scanner.c"
yy787:
YYDEBUG(787, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7028,11 +7025,11 @@ yy792:
}
YYDEBUG(793, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1103 "Zend/zend_language_scanner.l"
+#line 1099 "Zend/zend_language_scanner.l"
{
return T_ENDDECLARE;
}
-#line 7036 "Zend/zend_language_scanner.c"
+#line 7033 "Zend/zend_language_scanner.c"
yy794:
YYDEBUG(794, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7051,11 +7048,11 @@ yy796:
}
YYDEBUG(797, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1289 "Zend/zend_language_scanner.l"
+#line 1285 "Zend/zend_language_scanner.l"
{
return T_EMPTY;
}
-#line 7059 "Zend/zend_language_scanner.c"
+#line 7056 "Zend/zend_language_scanner.c"
yy798:
YYDEBUG(798, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7084,11 +7081,11 @@ yy799:
yy800:
YYDEBUG(800, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1067 "Zend/zend_language_scanner.l"
+#line 1063 "Zend/zend_language_scanner.l"
{
return T_ELSE;
}
-#line 7092 "Zend/zend_language_scanner.c"
+#line 7089 "Zend/zend_language_scanner.c"
yy801:
YYDEBUG(801, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7102,11 +7099,11 @@ yy802:
}
YYDEBUG(803, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1059 "Zend/zend_language_scanner.l"
+#line 1055 "Zend/zend_language_scanner.l"
{
return T_ELSEIF;
}
-#line 7110 "Zend/zend_language_scanner.c"
+#line 7107 "Zend/zend_language_scanner.c"
yy804:
YYDEBUG(804, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7120,11 +7117,11 @@ yy805:
}
YYDEBUG(806, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1143 "Zend/zend_language_scanner.l"
+#line 1139 "Zend/zend_language_scanner.l"
{
return T_ECHO;
}
-#line 7128 "Zend/zend_language_scanner.c"
+#line 7125 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_LOOKING_FOR_PROPERTY:
@@ -7197,12 +7194,12 @@ yy809:
yy810:
YYDEBUG(810, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1176 "Zend/zend_language_scanner.l"
+#line 1172 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
-#line 7206 "Zend/zend_language_scanner.c"
+#line 7203 "Zend/zend_language_scanner.c"
yy811:
YYDEBUG(811, *YYCURSOR);
++YYCURSOR;
@@ -7210,13 +7207,13 @@ yy811:
yy812:
YYDEBUG(812, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1191 "Zend/zend_language_scanner.l"
+#line 1187 "Zend/zend_language_scanner.l"
{
yyless(0);
yy_pop_state(TSRMLS_C);
goto restart;
}
-#line 7220 "Zend/zend_language_scanner.c"
+#line 7217 "Zend/zend_language_scanner.c"
yy813:
YYDEBUG(813, *YYCURSOR);
++YYCURSOR;
@@ -7225,13 +7222,13 @@ yy813:
yy814:
YYDEBUG(814, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1185 "Zend/zend_language_scanner.l"
+#line 1181 "Zend/zend_language_scanner.l"
{
yy_pop_state(TSRMLS_C);
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
}
-#line 7235 "Zend/zend_language_scanner.c"
+#line 7232 "Zend/zend_language_scanner.c"
yy815:
YYDEBUG(815, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7252,11 +7249,11 @@ yy818:
++YYCURSOR;
YYDEBUG(819, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1181 "Zend/zend_language_scanner.l"
+#line 1177 "Zend/zend_language_scanner.l"
{
return T_OBJECT_OPERATOR;
}
-#line 7260 "Zend/zend_language_scanner.c"
+#line 7257 "Zend/zend_language_scanner.c"
yy820:
YYDEBUG(820, *YYCURSOR);
++YYCURSOR;
@@ -7341,14 +7338,14 @@ yy824:
yy825:
YYDEBUG(825, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1488 "Zend/zend_language_scanner.l"
+#line 1484 "Zend/zend_language_scanner.l"
{
yyless(0);
yy_pop_state(TSRMLS_C);
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
goto restart;
}
-#line 7352 "Zend/zend_language_scanner.c"
+#line 7349 "Zend/zend_language_scanner.c"
yy826:
YYDEBUG(826, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7373,7 +7370,7 @@ yy830:
++YYCURSOR;
YYDEBUG(831, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1479 "Zend/zend_language_scanner.l"
+#line 1475 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
zend_copy_value(zendlval, yytext, yyleng);
@@ -7381,7 +7378,7 @@ yy830:
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return T_STRING_VARNAME;
}
-#line 7385 "Zend/zend_language_scanner.c"
+#line 7382 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_NOWDOC:
@@ -7392,7 +7389,7 @@ yyc_ST_NOWDOC:
++YYCURSOR;
YYDEBUG(835, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2224 "Zend/zend_language_scanner.l"
+#line 2222 "Zend/zend_language_scanner.l"
{
int newline = 0;
@@ -7448,7 +7445,7 @@ nowdoc_scan_done:
HANDLE_NEWLINES(yytext, yyleng - newline);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 7452 "Zend/zend_language_scanner.c"
+#line 7449 "Zend/zend_language_scanner.c"
/* *********************************** */
yyc_ST_VAR_OFFSET:
{
@@ -7555,7 +7552,7 @@ yy838:
yy839:
YYDEBUG(839, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1559 "Zend/zend_language_scanner.l"
+#line 1555 "Zend/zend_language_scanner.l"
{ /* Offset could be treated as a long */
if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, NULL, 10));
@@ -7564,7 +7561,7 @@ yy839:
}
return T_NUM_STRING;
}
-#line 7568 "Zend/zend_language_scanner.c"
+#line 7565 "Zend/zend_language_scanner.c"
yy840:
YYDEBUG(840, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7584,23 +7581,23 @@ yy841:
yy842:
YYDEBUG(842, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1758 "Zend/zend_language_scanner.l"
+#line 1754 "Zend/zend_language_scanner.l"
{
/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
return yytext[0];
}
-#line 7593 "Zend/zend_language_scanner.c"
+#line 7590 "Zend/zend_language_scanner.c"
yy843:
YYDEBUG(843, *YYCURSOR);
++YYCURSOR;
YYDEBUG(844, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1753 "Zend/zend_language_scanner.l"
+#line 1749 "Zend/zend_language_scanner.l"
{
yy_pop_state(TSRMLS_C);
return ']';
}
-#line 7604 "Zend/zend_language_scanner.c"
+#line 7601 "Zend/zend_language_scanner.c"
yy845:
YYDEBUG(845, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7610,14 +7607,15 @@ yy846:
++YYCURSOR;
YYDEBUG(847, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1763 "Zend/zend_language_scanner.l"
+#line 1759 "Zend/zend_language_scanner.l"
{
/* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
yy_pop_state(TSRMLS_C);
+ ZVAL_NULL(zendlval);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 7621 "Zend/zend_language_scanner.c"
+#line 7619 "Zend/zend_language_scanner.c"
yy848:
YYDEBUG(848, *YYCURSOR);
++YYCURSOR;
@@ -7626,18 +7624,18 @@ yy848:
yy849:
YYDEBUG(849, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1770 "Zend/zend_language_scanner.l"
+#line 1767 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
}
-#line 7635 "Zend/zend_language_scanner.c"
+#line 7633 "Zend/zend_language_scanner.c"
yy850:
YYDEBUG(850, *YYCURSOR);
++YYCURSOR;
YYDEBUG(851, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2281 "Zend/zend_language_scanner.l"
+#line 2279 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -7646,7 +7644,7 @@ yy850:
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
goto restart;
}
-#line 7650 "Zend/zend_language_scanner.c"
+#line 7648 "Zend/zend_language_scanner.c"
yy852:
YYDEBUG(852, *YYCURSOR);
++YYCURSOR;
@@ -7682,12 +7680,12 @@ yy854:
yy856:
YYDEBUG(856, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1744 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 7691 "Zend/zend_language_scanner.c"
+#line 7689 "Zend/zend_language_scanner.c"
yy857:
YYDEBUG(857, *YYCURSOR);
++YYCURSOR;
@@ -7727,12 +7725,12 @@ yy862:
yy864:
YYDEBUG(864, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1568 "Zend/zend_language_scanner.l"
+#line 1564 "Zend/zend_language_scanner.l"
{ /* Offset must be treated as a string */
ZVAL_STRINGL(zendlval, yytext, yyleng);
return T_NUM_STRING;
}
-#line 7736 "Zend/zend_language_scanner.c"
+#line 7734 "Zend/zend_language_scanner.c"
yy865:
YYDEBUG(865, *YYCURSOR);
++YYCURSOR;
@@ -7755,6 +7753,6 @@ yy867:
goto yy864;
}
}
-#line 2290 "Zend/zend_language_scanner.l"
+#line 2288 "Zend/zend_language_scanner.l"
}
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 9035777261..bcc341e8a1 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -126,7 +126,7 @@ BEGIN_EXTERN_C()
static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
+ ZEND_ASSERT(internal_encoding);
return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC);
}
@@ -144,7 +144,7 @@ LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC);
static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
{
const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
+ ZEND_ASSERT(internal_encoding);
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
}
@@ -556,7 +556,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
zend_op_array *original_active_op_array = CG(active_op_array);
- zend_op_array *retval=NULL;
int compiler_result;
zend_bool compilation_successful=0;
zval retval_zv;
@@ -566,8 +565,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- retval = op_array; /* success oriented */
-
if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
if (type==ZEND_REQUIRE) {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
@@ -596,18 +593,17 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
compilation_successful=1;
}
- if (retval) {
- CG(active_op_array) = original_active_op_array;
- if (compilation_successful) {
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
- } else {
- efree_size(op_array, sizeof(zend_op_array));
- retval = NULL;
- }
+ CG(active_op_array) = original_active_op_array;
+ if (compilation_successful) {
+ pass_two(op_array TSRMLS_CC);
+ zend_release_labels(0 TSRMLS_CC);
+ } else {
+ efree_size(op_array, sizeof(zend_op_array));
+ op_array = NULL;
}
+
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- return retval;
+ return op_array;
}
@@ -847,7 +843,7 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start));
SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start));
SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start));
- SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start));
+ SCNG(yy_limit) = new_yy_start + length;
SCNG(yy_start) = new_yy_start;
}
@@ -1764,6 +1760,7 @@ inline_html:
/* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
yy_pop_state(TSRMLS_C);
+ ZVAL_NULL(zendlval);
return T_ENCAPSED_AND_WHITESPACE;
}
@@ -1878,6 +1875,7 @@ inline_html:
/* Unclosed single quotes; treat similar to double quotes, but without a separate token
* for ' (unrecognized by parser), instead of old flex fallback to "Unexpected character..."
* rule, which continued in ST_IN_SCRIPTING state after the quote */
+ ZVAL_NULL(zendlval);
return T_ENCAPSED_AND_WHITESPACE;
}
}
diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c
index ad74bd56cb..0fb49abf5b 100644
--- a/Zend/zend_llist.c
+++ b/Zend/zend_llist.c
@@ -126,32 +126,26 @@ ZEND_API void zend_llist_clean(zend_llist *l)
}
-ZEND_API void *zend_llist_remove_tail(zend_llist *l)
+ZEND_API void zend_llist_remove_tail(zend_llist *l)
{
- zend_llist_element *old_tail;
- void *data;
-
- if ((old_tail = l->tail)) {
- if (old_tail->prev) {
- old_tail->prev->next = NULL;
- } else {
- l->head = NULL;
- }
-
- data = old_tail->data;
-
- l->tail = old_tail->prev;
- if (l->dtor) {
- l->dtor(data);
- }
- pefree(old_tail, l->persistent);
-
- --l->count;
+ zend_llist_element *old_tail = l->tail;
+ if (!old_tail) {
+ return;
+ }
- return data;
+ if (old_tail->prev) {
+ old_tail->prev->next = NULL;
+ } else {
+ l->head = NULL;
}
- return NULL;
+ l->tail = old_tail->prev;
+ --l->count;
+
+ if (l->dtor) {
+ l->dtor(old_tail->data);
+ }
+ pefree(old_tail, l->persistent);
}
diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h
index b05ece8077..602884c27d 100644
--- a/Zend/zend_llist.h
+++ b/Zend/zend_llist.h
@@ -53,7 +53,7 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element);
ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2));
ZEND_API void zend_llist_destroy(zend_llist *l);
ZEND_API void zend_llist_clean(zend_llist *l);
-ZEND_API void *zend_llist_remove_tail(zend_llist *l);
+ZEND_API void zend_llist_remove_tail(zend_llist *l);
ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC);
ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data));
diff --git a/Zend/zend_long.h b/Zend/zend_long.h
index ac270c719b..0fcc3116ae 100644
--- a/Zend/zend_long.h
+++ b/Zend/zend_long.h
@@ -52,8 +52,8 @@ typedef int32_t zend_off_t;
# define ZEND_LONG_MAX INT32_MAX
# define ZEND_LONG_MIN INT32_MIN
# define ZEND_ULONG_MAX UINT32_MAX
-# define Z_L(i) i
-# define Z_UL(i) i
+# define Z_L(i) INT32_C(i)
+# define Z_UL(i) UINT32_C(i)
# define SIZEOF_ZEND_LONG 4
#endif
@@ -110,6 +110,17 @@ typedef int32_t zend_off_t;
# define ZEND_ABS abs
#endif
+#if SIZEOF_ZEND_LONG == 4
+# define MAX_LENGTH_OF_LONG 11
+# define LONG_MIN_DIGITS "2147483648"
+#elif SIZEOF_ZEND_LONG == 8
+# define MAX_LENGTH_OF_LONG 20
+# define LONG_MIN_DIGITS "9223372036854775808"
+#else
+# error "Unknown SIZEOF_ZEND_LONG"
+#endif
+
+static const char long_min_digits[] = LONG_MIN_DIGITS;
#endif /* ZEND_LONG_H */
diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
index 11744c2699..158be22007 100644
--- a/Zend/zend_multiply.h
+++ b/Zend/zend_multiply.h
@@ -19,6 +19,9 @@
/* $Id$ */
+#ifndef ZEND_MULTIPLY_H
+#define ZEND_MULTIPLY_H
+
#if defined(__i386__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
@@ -108,3 +111,138 @@
} while (0)
#endif
+
+#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
+
+static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
+{
+ size_t res = nmemb;
+ zend_ulong m_overflow = 0;
+
+ __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
+ : "=&a"(res), "=&d" (m_overflow)
+ : "%0"(res),
+ "rm"(size),
+ "rm"(offset));
+
+ if (UNEXPECTED(m_overflow)) {
+ *overflow = 1;
+ return 0;
+ }
+ *overflow = 0;
+ return res;
+}
+
+#elif defined(__GNUC__) && defined(__x86_64__)
+
+static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
+{
+ size_t res = nmemb;
+ zend_ulong m_overflow = 0;
+
+#ifdef __ILP32__ /* x32 */
+# define LP_SUFF "l"
+#else /* amd64 */
+# define LP_SUFF "q"
+#endif
+
+ __asm__ ("mul" LP_SUFF " %3\n\t"
+ "add %4,%0\n\t"
+ "adc $0,%1"
+ : "=&a"(res), "=&d" (m_overflow)
+ : "%0"(res),
+ "rm"(size),
+ "rm"(offset));
+
+#undef LP_SUFF
+ if (UNEXPECTED(m_overflow)) {
+ *overflow = 1;
+ return 0;
+ }
+ *overflow = 0;
+ return res;
+}
+
+#elif defined(__GNUC__) && defined(__arm__)
+
+static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
+{
+ size_t res;
+ zend_ulong m_overflow;
+
+ __asm__ ("umlal %0,%1,%2,%3"
+ : "=r"(res), "=r"(m_overflow)
+ : "r"(nmemb),
+ "r"(size),
+ "0"(offset),
+ "1"(0));
+
+ if (UNEXPECTED(m_overflow)) {
+ *overflow = 1;
+ return 0;
+ }
+ *overflow = 0;
+ return res;
+}
+
+#elif defined(__GNUC__) && defined(__aarch64__)
+
+static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
+{
+ size_t res;
+ zend_ulong m_overflow;
+
+ __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr"
+ : "=&r"(res), "=&r"(m_overflow)
+ : "r"(nmemb),
+ "r"(size),
+ "r"(offset));
+
+ if (UNEXPECTED(m_overflow)) {
+ *overflow = 1;
+ return 0;
+ }
+ *overflow = 0;
+ return res;
+}
+
+#elif SIZEOF_SIZE_T == 4 && defined(HAVE_ZEND_LONG64)
+
+static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
+{
+ zend_ulong64 res = (zend_ulong64)nmemb * (zend_ulong64)size + (zend_ulong64)offset;
+
+ if (UNEXPECTED(res > (zend_ulong64)0xFFFFFFFFL)) {
+ *overflow = 1;
+ return 0;
+ }
+ *overflow = 0;
+ return (size_t) res;
+}
+
+#else
+
+static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
+{
+ size_t res = nmemb * size + offset;
+ double _d = (double)nmemb * (double)size + (double)offset;
+ double _delta = (double)res - _d;
+
+ if (UNEXPECTED((_d + _delta ) != _d)) {
+ *overflow = 1;
+ return 0;
+ }
+ *overflow = 0;
+ return res;
+}
+#endif
+
+#endif /* ZEND_MULTIPLY_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index ea32244b1b..f831d2fadd 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -385,9 +385,9 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
}
/* }}} */
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) /* {{{ */
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC) /* {{{ */
{
- return zend_get_property_info_quick(ce, Z_STR_P(member), silent, NULL TSRMLS_CC);
+ return zend_get_property_info_quick(ce, member, silent, NULL TSRMLS_CC);
}
/* }}} */
@@ -397,10 +397,10 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
const char *class_name = NULL;
const char *prop_name;
zend_string *member;
- int prop_name_len;
+ size_t prop_name_len;
if (prop_info_name->val[0] == 0) {
- zend_unmangle_property_name_ex(prop_info_name->val, prop_info_name->len, &class_name, &prop_name, &prop_name_len);
+ zend_unmangle_property_name_ex(prop_info_name, &class_name, &prop_name, &prop_name_len);
member = zend_string_init(prop_name, prop_name_len, 0);
} else {
member = zend_string_copy(prop_info_name);
@@ -434,10 +434,12 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_property_info
info.name = Z_STR_P(member);
} else if(property_info->name->val[0] == '\0'){
const char *class_name = NULL, *prop_name = NULL;
- zend_unmangle_property_name(property_info->name->val, property_info->name->len, &class_name, &prop_name);
+ size_t prop_name_len;
+ zend_unmangle_property_name_ex(property_info->name, &class_name,
+ &prop_name, &prop_name_len);
if (class_name) {
/* use unmangled name for protected properties */
- str = info.name = zend_string_init(prop_name, strlen(prop_name), 0);
+ str = info.name = zend_string_init(prop_name, prop_name_len, 0);
property_info = &info;
}
}
@@ -659,12 +661,12 @@ found:
}
}
} else if (EXPECTED(property_info != NULL)) {
+ zval tmp;
+
write_std_property:
- /* if we assign referenced variable, we should separate it */
if (Z_REFCOUNTED_P(value)) {
if (Z_ISREF_P(value)) {
- zval tmp;
-
+ /* if we assign referenced variable, we should separate it */
ZVAL_DUP(&tmp, Z_REFVAL_P(value));
value = &tmp;
} else {
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index ee6c9d9e5b..bc8500c3ec 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -159,7 +159,7 @@ ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce,
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object TSRMLS_DC);
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC);
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC);
ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC);
ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC);
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 9eea73deaf..40d37b3d36 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -154,7 +154,7 @@ ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *o
if (!new_object->properties) {
ALLOC_HASHTABLE(new_object->properties);
- zend_hash_init(new_object->properties, 8, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(new_object->properties, zend_hash_num_elements(old_object->properties), NULL, ZVAL_PTR_DTOR, 0);
}
ZEND_HASH_FOREACH_KEY_VAL(old_object->properties, num_key, key, prop) {
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index d5c4693b7f..d57721e58b 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -343,7 +343,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
if (literal) {
end = literal + op_array->last_literal;
while (literal < end) {
- zval_dtor(literal);
+ zval_ptr_dtor_nogc(literal);
literal++;
}
efree(op_array->literals);
@@ -444,7 +444,7 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a
static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num TSRMLS_DC)
{
- uint32_t i;
+ int i;
for (i = 0; i < op_array->last_try_catch; i++) {
if ((op_num < op_array->try_catch_array[i].finally_op ||
@@ -738,7 +738,6 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
case ZEND_NEW:
case ZEND_FE_RESET:
case ZEND_FE_FETCH:
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 5dcd0c62e4..8047aa6019 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -135,52 +135,6 @@ ZEND_API zend_long zend_atol(const char *str, int str_len) /* {{{ */
}
/* }}} */
-ZEND_API double zend_string_to_double(const char *number, uint32_t length) /* {{{ */
-{
- double divisor = 10.0;
- double result = 0.0;
- double exponent;
- const char *end = number+length;
- const char *digit = number;
-
- if (!length) {
- return result;
- }
-
- while (digit < end) {
- if ((*digit <= '9' && *digit >= '0')) {
- result *= 10;
- result += *digit - '0';
- } else if (*digit == '.') {
- digit++;
- break;
- } else if (toupper(*digit) == 'E') {
- exponent = (double) atoi(digit+1);
- result *= pow(10.0, exponent);
- return result;
- } else {
- return result;
- }
- digit++;
- }
-
- while (digit < end) {
- if ((*digit <= '9' && *digit >= '0')) {
- result += (*digit - '0') / divisor;
- divisor *= 10;
- } else if (toupper(*digit) == 'E') {
- exponent = (double) atoi(digit+1);
- result *= pow(10.0, exponent);
- return result;
- } else {
- return result;
- }
- digit++;
- }
- return result;
-}
-/* }}} */
-
ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) /* {{{ */
{
try_again:
@@ -405,7 +359,7 @@ ZEND_API void convert_to_long_base(zval *op, int base) /* {{{ */
{
zend_string *str = Z_STR_P(op);
- ZVAL_LONG(op, strtol(str->val, NULL, base));
+ ZVAL_LONG(op, ZEND_STRTOL(str->val, NULL, base));
zend_string_release(str);
}
break;
@@ -586,6 +540,7 @@ ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
{
switch (Z_TYPE_P(op)) {
+ case IS_UNDEF:
case IS_NULL:
case IS_FALSE: {
TSRMLS_FETCH();
@@ -868,6 +823,7 @@ ZEND_API zend_string *_zval_get_string_func(zval *op TSRMLS_DC) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op)) {
+ case IS_UNDEF:
case IS_NULL:
case IS_FALSE:
return STR_EMPTY_ALLOC();
@@ -1575,29 +1531,33 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
op2 = &op2_copy;
}
- if (result==op1 && !IS_INTERNED(Z_STR_P(op1))) { /* special case, perform operations on result */
+ {
size_t op1_len = Z_STRLEN_P(op1);
size_t op2_len = Z_STRLEN_P(op2);
- size_t res_len = op1_len + op2_len;
+ size_t result_len = op1_len + op2_len;
+ zend_string *result_str;
- if (Z_STRLEN_P(result) < 0 || (size_t) (op1_len + op2_len) < 0) {
- ZVAL_EMPTY_STRING(result);
- zend_error(E_ERROR, "String size overflow");
+ if (op1_len > SIZE_MAX - op2_len) {
+ zend_error_noreturn(E_ERROR, "String size overflow");
}
- Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), res_len, 0 );
- Z_TYPE_INFO_P(result) = IS_STRING_EX;
- memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), op2_len);
- Z_STRVAL_P(result)[res_len]=0;
- } else {
- size_t length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
- zend_string *buf = zend_string_alloc(length, 0);
+ if (result == op1 && Z_REFCOUNTED_P(result)) {
+ /* special case, perform operations on result */
+ result_str = zend_string_realloc(Z_STR_P(result), result_len, 0);
+ } else {
+ result_str = zend_string_alloc(result_len, 0);
+ memcpy(result_str->val, Z_STRVAL_P(op1), op1_len);
+ }
- memcpy(buf->val, Z_STRVAL_P(op1), Z_STRLEN_P(op1));
- memcpy(buf->val + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
- buf->val[length] = 0;
- ZVAL_NEW_STR(result, buf);
+ /* This has to happen first to account for the cases where result == op1 == op2 and
+ * the realloc is done. In this case this line will also update Z_STRVAL_P(op2) to
+ * point to the new string. The first op2_len bytes of result will still be the same. */
+ ZVAL_NEW_STR(result, result_str);
+
+ memcpy(result_str->val + op1_len, Z_STRVAL_P(op2), op2_len);
+ result_str->val[result_len] = '\0';
}
+
if (UNEXPECTED(use_copy1)) {
zval_dtor(op1);
}
@@ -2059,7 +2019,7 @@ static void increment_string(zval *str) /* {{{ */
return;
}
- if (IS_INTERNED(Z_STR_P(str))) {
+ if (!Z_REFCOUNTED_P(str)) {
Z_STR_P(str) = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0);
Z_TYPE_INFO_P(str) = IS_STRING_EX;
} else if (Z_REFCOUNT_P(str) > 1) {
@@ -2070,7 +2030,7 @@ static void increment_string(zval *str) /* {{{ */
}
s = Z_STRVAL_P(str);
- while (pos >= 0) {
+ do {
ch = s[pos];
if (ch >= 'a' && ch <= 'z') {
if (ch == 'z') {
@@ -2106,8 +2066,7 @@ static void increment_string(zval *str) /* {{{ */
if (carry == 0) {
break;
}
- pos--;
- }
+ } while (pos-- > 0);
if (carry) {
t = zend_string_alloc(Z_STRLEN_P(str)+1, 0);
@@ -2561,8 +2520,7 @@ ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) /* {{{ */
ZEND_API zend_string *zend_long_to_str(zend_long num) /* {{{ */
{
char buf[MAX_LENGTH_OF_LONG + 1];
- char *res;
- _zend_print_signed_to_buf(buf + sizeof(buf) - 1, num, zend_ulong, res);
+ char *res = zend_print_long_to_buf(buf + sizeof(buf) - 1, num);
return zend_string_init(res, buf + sizeof(buf) - 1 - res, 0);
}
/* }}} */
@@ -2571,6 +2529,143 @@ ZEND_API zend_uchar is_numeric_str_function(const zend_string *str, zend_long *l
return is_numeric_string_ex(str->val, str->len, lval, dval, -1, NULL);
}
+ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info)
+{
+ const char *ptr;
+ int base = 10, digits = 0, dp_or_e = 0;
+ double local_dval = 0.0;
+ zend_uchar type;
+
+ if (!length) {
+ return 0;
+ }
+
+ if (oflow_info != NULL) {
+ *oflow_info = 0;
+ }
+
+ /* Skip any whitespace
+ * This is much faster than the isspace() function */
+ while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r' || *str == '\v' || *str == '\f') {
+ str++;
+ length--;
+ }
+ ptr = str;
+
+ if (*ptr == '-' || *ptr == '+') {
+ ptr++;
+ }
+
+ if (ZEND_IS_DIGIT(*ptr)) {
+ /* Handle hex numbers
+ * str is used instead of ptr to disallow signs and keep old behavior */
+ if (length > 2 && *str == '0' && (str[1] == 'x' || str[1] == 'X')) {
+ base = 16;
+ ptr += 2;
+ }
+
+ /* Skip any leading 0s */
+ while (*ptr == '0') {
+ ptr++;
+ }
+
+ /* Count the number of digits. If a decimal point/exponent is found,
+ * it's a double. Otherwise, if there's a dval or no need to check for
+ * a full match, stop when there are too many digits for a long */
+ for (type = IS_LONG; !(digits >= MAX_LENGTH_OF_LONG && (dval || allow_errors == 1)); digits++, ptr++) {
+check_digits:
+ if (ZEND_IS_DIGIT(*ptr) || (base == 16 && ZEND_IS_XDIGIT(*ptr))) {
+ continue;
+ } else if (base == 10) {
+ if (*ptr == '.' && dp_or_e < 1) {
+ goto process_double;
+ } else if ((*ptr == 'e' || *ptr == 'E') && dp_or_e < 2) {
+ const char *e = ptr + 1;
+
+ if (*e == '-' || *e == '+') {
+ ptr = e++;
+ }
+ if (ZEND_IS_DIGIT(*e)) {
+ goto process_double;
+ }
+ }
+ }
+
+ break;
+ }
+
+ if (base == 10) {
+ if (digits >= MAX_LENGTH_OF_LONG) {
+ if (oflow_info != NULL) {
+ *oflow_info = *str == '-' ? -1 : 1;
+ }
+ dp_or_e = -1;
+ goto process_double;
+ }
+ } else if (!(digits < SIZEOF_ZEND_LONG * 2 || (digits == SIZEOF_ZEND_LONG * 2 && ptr[-digits] <= '7'))) {
+ if (dval) {
+ local_dval = zend_hex_strtod(str, &ptr);
+ }
+ if (oflow_info != NULL) {
+ *oflow_info = 1;
+ }
+ type = IS_DOUBLE;
+ }
+ } else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) {
+process_double:
+ type = IS_DOUBLE;
+
+ /* If there's a dval, do the conversion; else continue checking
+ * the digits if we need to check for a full match */
+ if (dval) {
+ local_dval = zend_strtod(str, &ptr);
+ } else if (allow_errors != 1 && dp_or_e != -1) {
+ dp_or_e = (*ptr++ == '.') ? 1 : 2;
+ goto check_digits;
+ }
+ } else {
+ return 0;
+ }
+
+ if (ptr != str + length) {
+ if (!allow_errors) {
+ return 0;
+ }
+ if (allow_errors == -1) {
+ zend_error(E_NOTICE, "A non well formed numeric value encountered");
+ }
+ }
+
+ if (type == IS_LONG) {
+ if (digits == MAX_LENGTH_OF_LONG - 1) {
+ int cmp = strcmp(&ptr[-digits], long_min_digits);
+
+ if (!(cmp < 0 || (cmp == 0 && *str == '-'))) {
+ if (dval) {
+ *dval = zend_strtod(str, NULL);
+ }
+ if (oflow_info != NULL) {
+ *oflow_info = *str == '-' ? -1 : 1;
+ }
+
+ return IS_DOUBLE;
+ }
+ }
+
+ if (lval) {
+ *lval = ZEND_STRTOL(str, NULL, base);
+ }
+
+ return IS_LONG;
+ } else {
+ if (dval) {
+ *dval = local_dval;
+ }
+
+ return IS_DOUBLE;
+ }
+}
+
/*
* Local variables:
* tab-width: 4
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index c308777e95..ddec162174 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -129,150 +129,23 @@ static zend_always_inline zend_long zend_dval_to_lval(double d)
* could not be represented as such due to overflow. It writes 1 to oflow_info
* if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN.
*/
-static inline zend_uchar is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info)
-{
- const char *ptr;
- int base = 10, digits = 0, dp_or_e = 0;
- double local_dval = 0.0;
- zend_uchar type;
-
- if (!length) {
- return 0;
- }
-
- if (oflow_info != NULL) {
- *oflow_info = 0;
- }
-
- /* Skip any whitespace
- * This is much faster than the isspace() function */
- while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r' || *str == '\v' || *str == '\f') {
- str++;
- length--;
- }
- ptr = str;
-
- if (*ptr == '-' || *ptr == '+') {
- ptr++;
- }
-
- if (ZEND_IS_DIGIT(*ptr)) {
- /* Handle hex numbers
- * str is used instead of ptr to disallow signs and keep old behavior */
- if (length > 2 && *str == '0' && (str[1] == 'x' || str[1] == 'X')) {
- base = 16;
- ptr += 2;
- }
-
- /* Skip any leading 0s */
- while (*ptr == '0') {
- ptr++;
- }
-
- /* Count the number of digits. If a decimal point/exponent is found,
- * it's a double. Otherwise, if there's a dval or no need to check for
- * a full match, stop when there are too many digits for a long */
- for (type = IS_LONG; !(digits >= MAX_LENGTH_OF_LONG && (dval || allow_errors == 1)); digits++, ptr++) {
-check_digits:
- if (ZEND_IS_DIGIT(*ptr) || (base == 16 && ZEND_IS_XDIGIT(*ptr))) {
- continue;
- } else if (base == 10) {
- if (*ptr == '.' && dp_or_e < 1) {
- goto process_double;
- } else if ((*ptr == 'e' || *ptr == 'E') && dp_or_e < 2) {
- const char *e = ptr + 1;
-
- if (*e == '-' || *e == '+') {
- ptr = e++;
- }
- if (ZEND_IS_DIGIT(*e)) {
- goto process_double;
- }
- }
- }
+ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info);
- break;
- }
-
- if (base == 10) {
- if (digits >= MAX_LENGTH_OF_LONG) {
- if (oflow_info != NULL) {
- *oflow_info = *str == '-' ? -1 : 1;
- }
- dp_or_e = -1;
- goto process_double;
- }
- } else if (!(digits < SIZEOF_ZEND_LONG * 2 || (digits == SIZEOF_ZEND_LONG * 2 && ptr[-digits] <= '7'))) {
- if (dval) {
- local_dval = zend_hex_strtod(str, &ptr);
- }
- if (oflow_info != NULL) {
- *oflow_info = 1;
- }
- type = IS_DOUBLE;
- }
- } else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) {
-process_double:
- type = IS_DOUBLE;
-
- /* If there's a dval, do the conversion; else continue checking
- * the digits if we need to check for a full match */
- if (dval) {
- local_dval = zend_strtod(str, &ptr);
- } else if (allow_errors != 1 && dp_or_e != -1) {
- dp_or_e = (*ptr++ == '.') ? 1 : 2;
- goto check_digits;
- }
- } else {
+static zend_always_inline zend_uchar is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info)
+{
+ if (*str > '9') {
return 0;
}
-
- if (ptr != str + length) {
- if (!allow_errors) {
- return 0;
- }
- if (allow_errors == -1) {
- zend_error(E_NOTICE, "A non well formed numeric value encountered");
- }
- }
-
- if (type == IS_LONG) {
- if (digits == MAX_LENGTH_OF_LONG - 1) {
- int cmp = strcmp(&ptr[-digits], long_min_digits);
-
- if (!(cmp < 0 || (cmp == 0 && *str == '-'))) {
- if (dval) {
- *dval = zend_strtod(str, NULL);
- }
- if (oflow_info != NULL) {
- *oflow_info = *str == '-' ? -1 : 1;
- }
-
- return IS_DOUBLE;
- }
- }
-
- if (lval) {
- *lval = ZEND_STRTOL(str, NULL, base);
- }
-
- return IS_LONG;
- } else {
- if (dval) {
- *dval = local_dval;
- }
-
- return IS_DOUBLE;
- }
+ return _is_numeric_string_ex(str, length, lval, dval, allow_errors, oflow_info);
}
-static inline zend_uchar is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors) {
+static zend_always_inline zend_uchar is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors) {
return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL);
}
ZEND_API zend_uchar is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval);
-static inline const char *
+static zend_always_inline const char *
zend_memnstr(const char *haystack, const char *needle, size_t needle_len, char *end)
{
const char *p = haystack;
@@ -309,7 +182,7 @@ zend_memnstr(const char *haystack, const char *needle, size_t needle_len, char *
return NULL;
}
-static inline const void *zend_memrchr(const void *s, int c, size_t n)
+static zend_always_inline const void *zend_memrchr(const void *s, int c, size_t n)
{
register const unsigned char *e;
@@ -367,8 +240,6 @@ ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2
#define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }
#define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
-ZEND_API double zend_string_to_double(const char *number, uint32_t length);
-
ZEND_API int zval_is_true(zval *op);
ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
@@ -1023,27 +894,26 @@ static zend_always_inline void fast_is_not_identical_function(zval *result, zval
return SUCCESS; \
}
-/* input: buf points to the END of the buffer */
-#define _zend_print_unsigned_to_buf(buf, num, vartype, result) do { \
- char *__p = (buf); \
- vartype __num = (num); \
- *__p = '\0'; \
- do { \
- *--__p = (char) (__num % 10) + '0'; \
- __num /= 10; \
- } while (__num > 0); \
- result = __p; \
-} while (0)
+/* buf points to the END of the buffer */
+static zend_always_inline char *zend_print_ulong_to_buf(char *buf, zend_ulong num) {
+ *buf = '\0';
+ do {
+ *--buf = (char) (num % 10) + '0';
+ num /= 10;
+ } while (num > 0);
+ return buf;
+}
/* buf points to the END of the buffer */
-#define _zend_print_signed_to_buf(buf, num, vartype, result) do { \
- if (num < 0) { \
- _zend_print_unsigned_to_buf((buf), -(vartype)(num), vartype, (result)); \
- *--(result) = '-'; \
- } else { \
- _zend_print_unsigned_to_buf((buf), (num), vartype, (result)); \
- } \
-} while (0)
+static zend_always_inline char *zend_print_long_to_buf(char *buf, zend_long num) {
+ if (num < 0) {
+ char *result = zend_print_ulong_to_buf(buf, ~((zend_ulong) num) + 1);
+ *--result = '-';
+ return result;
+ } else {
+ return zend_print_ulong_to_buf(buf, num);
+ }
+}
ZEND_API zend_string *zend_long_to_str(zend_long num);
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
new file mode 100644
index 0000000000..1705965c6b
--- /dev/null
+++ b/Zend/zend_portability.h
@@ -0,0 +1,399 @@
+/*
+ +----------------------------------------------------------------------+
+ | Zend Engine |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 2.00 of the Zend license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.zend.com/license/2_00.txt. |
+ | If you did not receive a copy of the Zend license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@zend.com so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Andi Gutmans <andi@zend.com> |
+ | Zeev Suraski <zeev@zend.com> |
+ | Dmitry Stogov <zeev@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#ifndef ZEND_PORTABILITY_H
+#define ZEND_PORTABILITY_H
+
+#ifdef __cplusplus
+#define BEGIN_EXTERN_C() extern "C" {
+#define END_EXTERN_C() }
+#else
+#define BEGIN_EXTERN_C()
+#define END_EXTERN_C()
+#endif
+
+/*
+ * general definitions
+ */
+
+#ifdef ZEND_WIN32
+# include "zend_config.w32.h"
+# define ZEND_PATHS_SEPARATOR ';'
+#elif defined(NETWARE)
+# include <zend_config.h>
+# define ZEND_PATHS_SEPARATOR ';'
+#elif defined(__riscos__)
+# include <zend_config.h>
+# define ZEND_PATHS_SEPARATOR ';'
+#else
+# include <zend_config.h>
+# define ZEND_PATHS_SEPARATOR ':'
+#endif
+
+#include "../TSRM/TSRM.h"
+
+#include <stdio.h>
+#include <assert.h>
+
+#ifdef HAVE_UNIX_H
+# include <unix.h>
+#endif
+
+#ifdef HAVE_STDARG_H
+# include <stdarg.h>
+#endif
+
+#ifdef HAVE_DLFCN_H
+# include <dlfcn.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#if HAVE_ALLOCA_H && !defined(_ALLOCA_H)
+# include <alloca.h>
+#endif
+
+/* Only use this macro if you know for sure that all of the switches values
+ are covered by its case statements */
+#if ZEND_DEBUG
+# define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_ASSERT(0); break;
+#elif defined(ZEND_WIN32)
+# define EMPTY_SWITCH_DEFAULT_CASE() default: __assume(0); break;
+#else
+# define EMPTY_SWITCH_DEFAULT_CASE()
+#endif
+
+/* all HAVE_XXX test have to be after the include of zend_config above */
+
+#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
+
+# ifndef RTLD_LAZY
+# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
+# endif
+
+# ifndef RTLD_GLOBAL
+# define RTLD_GLOBAL 0
+# endif
+
+# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
+# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
+# elif defined(RTLD_DEEPBIND)
+# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
+# else
+# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
+# endif
+# define DL_UNLOAD dlclose
+# if defined(DLSYM_NEEDS_UNDERSCORE)
+# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" s)
+# else
+# define DL_FETCH_SYMBOL dlsym
+# endif
+# define DL_ERROR dlerror
+# define DL_HANDLE void *
+# define ZEND_EXTENSIONS_SUPPORT 1
+#elif defined(ZEND_WIN32)
+# define DL_LOAD(libname) LoadLibrary(libname)
+# define DL_FETCH_SYMBOL GetProcAddress
+# define DL_UNLOAD FreeLibrary
+# define DL_HANDLE HMODULE
+# define ZEND_EXTENSIONS_SUPPORT 1
+#else
+# define DL_HANDLE void *
+# define ZEND_EXTENSIONS_SUPPORT 0
+#endif
+
+/* AIX requires this to be the first thing in the file. */
+#ifndef __GNUC__
+# ifndef HAVE_ALLOCA_H
+# ifdef _AIX
+# pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca();
+# endif
+# endif
+# endif
+#endif
+
+/* Compatibility with non-clang compilers */
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+
+/* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */
+#ifdef __GNUC__
+# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+#else
+# define ZEND_GCC_VERSION 0
+#endif
+
+#if ZEND_GCC_VERSION >= 2096
+# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define ZEND_ATTRIBUTE_MALLOC
+#endif
+
+#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size)
+# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X)))
+# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y)))
+#else
+# define ZEND_ATTRIBUTE_ALLOC_SIZE(X)
+# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y)
+#endif
+
+/* Format string checks are disabled by default, because we use custom format modifiers (like %p),
+ * which cause a large amount of false positives. You can enable format checks by adding
+ * -DZEND_CHECK_FORMAT_STRINGS to CFLAGS. */
+
+#if defined(ZEND_CHECK_FORMAT_STRINGS) && (ZEND_GCC_VERSION >= 2007 || __has_attribute(format))
+# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
+#else
+# define ZEND_ATTRIBUTE_FORMAT(type, idx, first)
+#endif
+
+#if defined(ZEND_CHECK_FORMAT_STRINGS) && ((ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)) || __has_attribute(format))
+# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
+#else
+# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first)
+#endif
+
+#if ZEND_GCC_VERSION >= 3001 || __has_attribute(deprecated)
+# define ZEND_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
+#elif defined(ZEND_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1300
+# define ZEND_ATTRIBUTE_DEPRECATED __declspec(deprecated)
+#else
+# define ZEND_ATTRIBUTE_DEPRECATED
+#endif
+
+#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003
+# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused))
+# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
+#else
+# define ZEND_ATTRIBUTE_UNUSED
+# define ZEND_ATTRIBUTE_UNUSED_LABEL
+#endif
+
+#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)
+# define ZEND_FASTCALL __attribute__((fastcall))
+#elif defined(_MSC_VER) && defined(_M_IX86)
+# define ZEND_FASTCALL __fastcall
+#else
+# define ZEND_FASTCALL
+#endif
+
+#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
+#else
+# define __restrict__
+#endif
+#define restrict __restrict__
+
+#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
+# define HAVE_NORETURN
+# define ZEND_NORETURN __attribute__((noreturn))
+#elif defined(ZEND_WIN32)
+# define HAVE_NORETURN
+# define ZEND_NORETURN __declspec(noreturn)
+#else
+# define ZEND_NORETURN
+#endif
+
+#if ZEND_DEBUG
+# define zend_always_inline inline
+# define zend_never_inline
+#else
+# if defined(__GNUC__)
+# if __GNUC__ >= 3
+# define zend_always_inline inline __attribute__((always_inline))
+# define zend_never_inline __attribute__((noinline))
+# else
+# define zend_always_inline inline
+# define zend_never_inline
+# endif
+# elif defined(_MSC_VER)
+# define zend_always_inline __forceinline
+# define zend_never_inline
+# else
+# if __has_attribute(always_inline)
+# define zend_always_inline inline __attribute__((always_inline))
+# else
+# define zend_always_inline inline
+# endif
+# if __has_attribute(noinline)
+# define zend_never_inline __attribute__((noinline))
+# else
+# define zend_never_inline
+# endif
+# endif
+#endif /* ZEND_DEBUG */
+
+#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
+# define EXPECTED(condition) __builtin_expect(!(!(condition)), 1)
+# define UNEXPECTED(condition) __builtin_expect(!(!(condition)), 0)
+#else
+# define EXPECTED(condition) (condition)
+# define UNEXPECTED(condition) (condition)
+#endif
+
+#ifndef XtOffsetOf
+# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
+# ifdef __STDC__
+# define XtOffset(p_type, field) _Offsetof(p_type, field)
+# else
+# ifdef CRAY2
+# define XtOffset(p_type, field) \
+ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
+
+# else /* !CRAY2 */
+
+# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
+
+# endif /* !CRAY2 */
+# endif /* __STDC__ */
+# else /* ! (CRAY || __arm) */
+
+# define XtOffset(p_type, field) \
+ ((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
+
+# endif /* !CRAY */
+
+# ifdef offsetof
+# define XtOffsetOf(s_type, field) offsetof(s_type, field)
+# else
+# define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
+# endif
+
+#endif
+
+#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
+# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
+# define ALLOCA_FLAG(name) \
+ zend_bool name;
+# define SET_ALLOCA_FLAG(name) \
+ name = 1
+# define do_alloca_ex(size, limit, use_heap) \
+ ((use_heap = (UNEXPECTED((size) > (limit)))) ? emalloc(size) : alloca(size))
+# define do_alloca(size, use_heap) \
+ do_alloca_ex(size, ZEND_ALLOCA_MAX_SIZE, use_heap)
+# define free_alloca(p, use_heap) \
+ do { if (UNEXPECTED(use_heap)) efree(p); } while (0)
+#else
+# define ALLOCA_FLAG(name)
+# define SET_ALLOCA_FLAG(name)
+# define do_alloca(p, use_heap) emalloc(p)
+# define free_alloca(p, use_heap) efree(p)
+#endif
+
+#ifdef HAVE_SIGSETJMP
+# define SETJMP(a) sigsetjmp(a, 0)
+# define LONGJMP(a,b) siglongjmp(a, b)
+# define JMP_BUF sigjmp_buf
+#else
+# define SETJMP(a) setjmp(a)
+# define LONGJMP(a,b) longjmp(a, b)
+# define JMP_BUF jmp_buf
+#endif
+
+#if ZEND_DEBUG
+# define ZEND_FILE_LINE_D const char *__zend_filename, const uint __zend_lineno
+# define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D
+# define ZEND_FILE_LINE_ORIG_D const char *__zend_orig_filename, const uint __zend_orig_lineno
+# define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D
+# define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno
+# define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C
+# define ZEND_FILE_LINE_C __FILE__, __LINE__
+# define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C
+# define ZEND_FILE_LINE_EMPTY_C NULL, 0
+# define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C
+# define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno
+# define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C
+# define ZEND_ASSERT(c) assert(c)
+#else
+# define ZEND_FILE_LINE_D
+# define ZEND_FILE_LINE_DC
+# define ZEND_FILE_LINE_ORIG_D
+# define ZEND_FILE_LINE_ORIG_DC
+# define ZEND_FILE_LINE_RELAY_C
+# define ZEND_FILE_LINE_RELAY_CC
+# define ZEND_FILE_LINE_C
+# define ZEND_FILE_LINE_CC
+# define ZEND_FILE_LINE_EMPTY_C
+# define ZEND_FILE_LINE_EMPTY_CC
+# define ZEND_FILE_LINE_ORIG_RELAY_C
+# define ZEND_FILE_LINE_ORIG_RELAY_CC
+# define ZEND_ASSERT(c)
+#endif /* ZEND_DEBUG */
+
+#if ZEND_DEBUG
+# define Z_DBG(expr) (expr)
+#else
+# define Z_DBG(expr)
+#endif
+
+#ifdef ZTS
+# define ZTS_V 1
+#else
+# define ZTS_V 0
+#endif
+
+#ifndef LONG_MAX
+# define LONG_MAX 2147483647L
+#endif
+
+#ifndef LONG_MIN
+# define LONG_MIN (- LONG_MAX - 1)
+#endif
+
+#define MAX_LENGTH_OF_DOUBLE 32
+
+#undef MIN
+#undef MAX
+#define MAX(a, b) (((a)>(b))?(a):(b))
+#define MIN(a, b) (((a)<(b))?(a):(b))
+#define ZEND_STRL(str) (str), (sizeof(str)-1)
+#define ZEND_STRS(str) (str), (sizeof(str))
+#define ZEND_NORMALIZE_BOOL(n) \
+ ((n) ? (((n)>0) ? 1 : -1) : 0)
+#define ZEND_TRUTH(x) ((x) ? 1 : 0)
+#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
+
+#define ZEND_MAX_RESERVED_RESOURCES 4
+
+/* excpt.h on Digital Unix 4.0 defines function_table */
+#undef function_table
+
+#ifdef ZEND_WIN32
+#define ZEND_SECURE_ZERO(var, size) RtlSecureZeroMemory((var), (size))
+#else
+#define ZEND_SECURE_ZERO(var, size) memset((var), 0, (size))
+#endif
+
+#endif /* ZEND_PORTABILITY_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h
index ecd7b7042a..8a3dede91e 100644
--- a/Zend/zend_ptr_stack.h
+++ b/Zend/zend_ptr_stack.h
@@ -111,7 +111,7 @@ static zend_always_inline void *zend_ptr_stack_pop(zend_ptr_stack *stack)
return *(--stack->top_element);
}
-static inline void *zend_ptr_stack_top(zend_ptr_stack *stack)
+static zend_always_inline void *zend_ptr_stack_top(zend_ptr_stack *stack)
{
return stack->elements[stack->top - 1];
}
diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h
index 10fa8d8a60..84dc2e00b8 100644
--- a/Zend/zend_stream.h
+++ b/Zend/zend_stream.h
@@ -63,14 +63,14 @@ typedef struct _zend_stream {
} zend_stream;
typedef struct _zend_file_handle {
- zend_stream_type type;
- const char *filename;
- char *opened_path;
union {
int fd;
FILE *fp;
zend_stream stream;
} handle;
+ const char *filename;
+ char *opened_path;
+ zend_stream_type type;
zend_bool free_filename;
} zend_file_handle;
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index a9148f2c4a..a4455e8da9 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -80,7 +80,7 @@ void zend_interned_strings_dtor(TSRMLS_D)
#ifndef ZTS
zend_hash_destroy(&CG(interned_strings));
#else
- free(CG(empty_string));
+ zend_string_release(CG(empty_string));
#endif
}
diff --git a/Zend/zend_string.h b/Zend/zend_string.h
index a2b5fb932e..d30e14b5b3 100644
--- a/Zend/zend_string.h
+++ b/Zend/zend_string.h
@@ -140,7 +140,7 @@ static zend_always_inline zend_string *zend_string_init(const char *str, size_t
static zend_always_inline zend_string *zend_string_copy(zend_string *s)
{
if (!IS_INTERNED(s)) {
- zend_string_addref(s);
+ GC_REFCOUNT(s)++;
}
return s;
}
@@ -161,14 +161,14 @@ static zend_always_inline zend_string *zend_string_realloc(zend_string *s, size_
if (IS_INTERNED(s)) {
ret = zend_string_alloc(len, persistent);
memcpy(ret->val, s->val, (len > s->len ? s->len : len) + 1);
- } else if (EXPECTED(zend_string_refcount(s) == 1)) {
+ } else if (EXPECTED(GC_REFCOUNT(s) == 1)) {
ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_STR_HEADER_SIZE + len + 1), persistent);
ret->len = len;
zend_string_forget_hash_val(ret);
} else {
ret = zend_string_alloc(len, persistent);
memcpy(ret->val, s->val, (len > s->len ? s->len : len) + 1);
- zend_string_delref(s);
+ GC_REFCOUNT(s)--;
}
return ret;
}
@@ -180,14 +180,14 @@ static zend_always_inline zend_string *zend_string_safe_realloc(zend_string *s,
if (IS_INTERNED(s)) {
ret = zend_string_safe_alloc(n, m, l, persistent);
memcpy(ret->val, s->val, ((n * m) + l > (size_t)s->len ? (size_t)s->len : ((n * m) + l)) + 1);
- } else if (zend_string_refcount(s) == 1) {
+ } else if (GC_REFCOUNT(s) == 1) {
ret = (zend_string *)safe_perealloc(s, n, m, ZEND_MM_ALIGNED_SIZE(_STR_HEADER_SIZE + l + 1), persistent);
ret->len = (n * m) + l;
zend_string_forget_hash_val(ret);
} else {
ret = zend_string_safe_alloc(n, m, l, persistent);
memcpy(ret->val, s->val, ((n * m) + l > (size_t)s->len ? (size_t)s->len : ((n * m) + l)) + 1);
- zend_string_delref(s);
+ GC_REFCOUNT(s)--;
}
return ret;
}
@@ -195,7 +195,7 @@ static zend_always_inline zend_string *zend_string_safe_realloc(zend_string *s,
static zend_always_inline void zend_string_free(zend_string *s)
{
if (!IS_INTERNED(s)) {
- ZEND_ASSERT(zend_string_refcount(s) <= 1);
+ ZEND_ASSERT(GC_REFCOUNT(s) <= 1);
pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT);
}
}
@@ -203,7 +203,7 @@ static zend_always_inline void zend_string_free(zend_string *s)
static zend_always_inline void zend_string_release(zend_string *s)
{
if (!IS_INTERNED(s)) {
- if (zend_string_delref(s) == 0) {
+ if (--GC_REFCOUNT(s) == 0) {
pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT);
}
}
@@ -253,7 +253,7 @@ static zend_always_inline zend_bool zend_string_equals(zend_string *s1, zend_str
* -- Ralf S. Engelschall <rse@engelschall.com>
*/
-static inline zend_ulong zend_inline_hash_func(const char *str, size_t len)
+static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size_t len)
{
register zend_ulong hash = Z_UL(5381);
diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c
index b289ae17c9..43f02b48f8 100644
--- a/Zend/zend_ts_hash.c
+++ b/Zend/zend_ts_hash.c
@@ -110,12 +110,12 @@ ZEND_API zval *_zend_ts_hash_add_or_update(TsHashTable *ht, zend_string *key, zv
return retval;
}
-ZEND_API zval *_zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC)
+ZEND_API zval *_zend_ts_hash_index_add_or_update(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC)
{
zval *retval;
begin_write(ht);
- retval = _zend_hash_index_update_or_next_insert(TS_HASH(ht), h, pData, flag ZEND_FILE_LINE_RELAY_CC);
+ retval = _zend_hash_index_add_or_update(TS_HASH(ht), h, pData, flag ZEND_FILE_LINE_RELAY_CC);
end_write(ht);
return retval;
diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h
index 0adedff437..6cb36410b8 100644
--- a/Zend/zend_ts_hash.h
+++ b/Zend/zend_ts_hash.h
@@ -55,11 +55,11 @@ ZEND_API zval *_zend_ts_hash_add_or_update(TsHashTable *ht, zend_string *key, zv
#define zend_ts_hash_add(ht, key, pData) \
_zend_ts_hash_add_or_update(ht, key, pData, HASH_ADD ZEND_FILE_LINE_CC)
-ZEND_API zval *_zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC);
+ZEND_API zval *_zend_ts_hash_index_add_or_update(TsHashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC);
#define zend_ts_hash_index_update(ht, h, pData) \
- _zend_ts_hash_index_update_or_next_insert(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_CC)
+ _zend_ts_hash_index_add_or_update(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_ts_hash_next_index_insert(ht, pData) \
- _zend_ts_hash_index_update_or_next_insert(ht, 0, pData, HASH_NEXT_INSERT ZEND_FILE_LINE_CC)
+ _zend_ts_hash_index_add_or_update(ht, ht->nNextFreeElement, pData, HASH_ADD ZEND_FILE_LINE_CC)
ZEND_API zval* zend_ts_hash_add_empty_element(TsHashTable *ht, zend_string *key);
@@ -111,7 +111,7 @@ ZEND_API zval *_zend_ts_hash_str_add(TsHashTable *ht, const char *key, int len,
#define zend_ts_hash_str_add(ht, key, len, pData) \
_zend_ts_hash_str_add(ht, key, len, pData ZEND_FILE_LINE_CC)
-static inline void *zend_ts_hash_str_find_ptr(TsHashTable *ht, const char *str, int len)
+static zend_always_inline void *zend_ts_hash_str_find_ptr(TsHashTable *ht, const char *str, int len)
{
zval *zv;
@@ -119,7 +119,7 @@ static inline void *zend_ts_hash_str_find_ptr(TsHashTable *ht, const char *str,
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_ts_hash_str_update_ptr(TsHashTable *ht, const char *str, int len, void *pData)
+static zend_always_inline void *zend_ts_hash_str_update_ptr(TsHashTable *ht, const char *str, int len, void *pData)
{
zval tmp, *zv;
@@ -128,7 +128,7 @@ static inline void *zend_ts_hash_str_update_ptr(TsHashTable *ht, const char *str
return zv ? Z_PTR_P(zv) : NULL;
}
-static inline void *zend_ts_hash_str_add_ptr(TsHashTable *ht, const char *str, int len, void *pData)
+static zend_always_inline void *zend_ts_hash_str_add_ptr(TsHashTable *ht, const char *str, int len, void *pData)
{
zval tmp, *zv;
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 47f408f4b3..c654106192 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -14,6 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -22,6 +23,7 @@
#ifndef ZEND_TYPES_H
#define ZEND_TYPES_H
+#include "zend_portability.h"
#include "zend_long.h"
#ifdef WORDS_BIGENDIAN
@@ -43,6 +45,11 @@
typedef unsigned char zend_bool;
typedef unsigned char zend_uchar;
+typedef enum {
+ SUCCESS = 0,
+ FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */
+} ZEND_RESULT_CODE;
+
#ifdef ZEND_ENABLE_ZVAL_LONG64
# ifdef ZEND_WIN32
# define ZEND_SIZE_MAX _UI64_MAX
@@ -101,7 +108,7 @@ typedef void (*dtor_func_t)(zval *pDest);
typedef void (*copy_ctor_func_t)(zval *pElement);
typedef union _zend_value {
- zend_long lval; /* long value */
+ zend_long lval; /* long value */
double dval; /* double value */
zend_refcounted *counted;
zend_string *str;
@@ -131,9 +138,9 @@ struct _zval_struct {
union {
uint32_t var_flags;
uint32_t next; /* hash collision chain */
- uint32_t str_offset; /* string offset */
uint32_t cache_slot; /* literal cache slot */
uint32_t lineno; /* line number (for ast nodes) */
+ uint32_t silence_num; /* BEGIN_SILENCE op number */
} u2;
};
@@ -144,7 +151,7 @@ struct _zend_refcounted {
ZEND_ENDIAN_LOHI_3(
zend_uchar type,
zend_uchar flags, /* used for strings & objects */
- uint16_t gc_info) /* keeps GC root number (or 0) and color */
+ uint16_t gc_info) /* keeps GC root number (or 0) and color */
} v;
uint32_t type_info;
} u;
@@ -152,33 +159,33 @@ struct _zend_refcounted {
struct _zend_string {
zend_refcounted gc;
- zend_ulong h; /* hash value */
- size_t len;
+ zend_ulong h; /* hash value */
+ size_t len;
char val[1];
};
typedef struct _Bucket {
- zend_ulong h; /* hash value (or numeric index) */
+ zend_ulong h; /* hash value (or numeric index) */
zend_string *key; /* string key or NULL for numerics */
zval val;
} Bucket;
typedef struct _HashTable {
- uint32_t nTableSize;
- uint32_t nTableMask;
- uint32_t nNumUsed;
- uint32_t nNumOfElements;
- zend_long nNextFreeElement;
+ uint32_t nTableSize;
+ uint32_t nTableMask;
+ uint32_t nNumUsed;
+ uint32_t nNumOfElements;
+ zend_long nNextFreeElement;
Bucket *arData;
- uint32_t *arHash;
+ uint32_t *arHash;
dtor_func_t pDestructor;
- uint32_t nInternalPointer;
+ uint32_t nInternalPointer;
union {
struct {
ZEND_ENDIAN_LOHI_3(
zend_uchar flags,
zend_uchar nApplyCount,
- uint16_t reserve)
+ uint16_t reserve)
} v;
uint32_t flags;
} u;
@@ -191,7 +198,7 @@ struct _zend_array {
struct _zend_object {
zend_refcounted gc;
- uint32_t handle; // TODO: may be removed ???
+ uint32_t handle; // TODO: may be removed ???
zend_class_entry *ce;
const zend_object_handlers *handlers;
HashTable *properties;
@@ -201,7 +208,7 @@ struct _zend_object {
struct _zend_resource {
zend_refcounted gc;
- zend_long handle; // TODO: may be removed ???
+ zend_long handle; // TODO: may be removed ???
int type;
void *ptr;
};
@@ -239,10 +246,9 @@ struct _zend_ast_ref {
/* internal types */
#define IS_INDIRECT 15
-#define IS_STR_OFFSET 16
#define IS_PTR 17
-static inline zend_uchar zval_get_type(const zval* pz) {
+static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
return pz->u1.v.type;
}
@@ -520,10 +526,10 @@ static inline zend_uchar zval_get_type(const zval* pz) {
IS_STRING_EX; \
} while (0)
-#define ZVAL_INTERNED_STR(z, s) do { \
- zval *__z = (z); \
- zend_string *__s = (s); \
- Z_STR_P(__z) = __s; \
+#define ZVAL_INTERNED_STR(z, s) do { \
+ zval *__z = (z); \
+ zend_string *__s = (s); \
+ Z_STR_P(__z) = __s; \
Z_TYPE_INFO_P(__z) = IS_INTERNED_STRING_EX; \
} while (0)
@@ -531,10 +537,22 @@ static inline zend_uchar zval_get_type(const zval* pz) {
zval *__z = (z); \
zend_string *__s = (s); \
Z_STR_P(__z) = __s; \
- /* interned strings support */ \
Z_TYPE_INFO_P(__z) = IS_STRING_EX; \
} while (0)
+#define ZVAL_STR_COPY(z, s) do { \
+ zval *__z = (z); \
+ zend_string *__s = (s); \
+ Z_STR_P(__z) = __s; \
+ /* interned strings support */ \
+ if (IS_INTERNED(__s)) { \
+ Z_TYPE_INFO_P(__z) = IS_INTERNED_STRING_EX; \
+ } else { \
+ GC_REFCOUNT(__s)++; \
+ Z_TYPE_INFO_P(__z) = IS_STRING_EX; \
+ } \
+ } while (0)
+
#define ZVAL_ARR(z, a) do { \
zval *__z = (z); \
Z_ARR_P(__z) = (a); \
@@ -573,26 +591,26 @@ static inline zend_uchar zval_get_type(const zval* pz) {
#define ZVAL_NEW_RES(z, h, p, t) do { \
zend_resource *_res = emalloc(sizeof(zend_resource)); \
- zval *__z; \
+ zval *__z; \
GC_REFCOUNT(_res) = 1; \
GC_TYPE_INFO(_res) = IS_RESOURCE; \
_res->handle = (h); \
_res->type = (t); \
_res->ptr = (p); \
- __z = (z); \
+ __z = (z); \
Z_RES_P(__z) = _res; \
Z_TYPE_INFO_P(__z) = IS_RESOURCE_EX; \
} while (0)
#define ZVAL_NEW_PERSISTENT_RES(z, h, p, t) do { \
zend_resource *_res = malloc(sizeof(zend_resource)); \
- zval *__z; \
+ zval *__z; \
GC_REFCOUNT(_res) = 1; \
GC_TYPE_INFO(_res) = IS_RESOURCE; \
_res->handle = (h); \
_res->type = (t); \
_res->ptr = (p); \
- __z = (z); \
+ __z = (z); \
Z_RES_P(__z) = _res; \
Z_TYPE_INFO_P(__z) = IS_RESOURCE_EX; \
} while (0)
@@ -651,17 +669,168 @@ static inline zend_uchar zval_get_type(const zval* pz) {
Z_TYPE_INFO_P(z) = IS_PTR; \
} while (0)
+#define Z_REFCOUNT_P(pz) zval_refcount_p(pz)
+#define Z_SET_REFCOUNT_P(pz, rc) zval_set_refcount_p(pz, rc)
+#define Z_ADDREF_P(pz) zval_addref_p(pz)
+#define Z_DELREF_P(pz) zval_delref_p(pz)
+
+#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z))
+#define Z_SET_REFCOUNT(z, rc) Z_SET_REFCOUNT_P(&(z), rc)
+#define Z_ADDREF(z) Z_ADDREF_P(&(z))
+#define Z_DELREF(z) Z_DELREF_P(&(z))
+
+#define Z_TRY_ADDREF_P(pz) do { \
+ if (Z_REFCOUNTED_P((pz))) { \
+ Z_ADDREF_P((pz)); \
+ } \
+} while (0)
+
+#define Z_TRY_DELREF_P(pz) do { \
+ if (Z_REFCOUNTED_P((pz))) { \
+ Z_DELREF_P((pz)); \
+ } \
+} while (0)
+
+#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z))
+#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z))
+
+static zend_always_inline uint32_t zval_refcount_p(zval* pz) {
+ ZEND_ASSERT(Z_REFCOUNTED_P(pz) || Z_IMMUTABLE_P(pz));
+ return GC_REFCOUNT(Z_COUNTED_P(pz));
+}
+
+static zend_always_inline uint32_t zval_set_refcount_p(zval* pz, uint32_t rc) {
+ ZEND_ASSERT(Z_REFCOUNTED_P(pz));
+ return GC_REFCOUNT(Z_COUNTED_P(pz)) = rc;
+}
+
+static zend_always_inline uint32_t zval_addref_p(zval* pz) {
+ ZEND_ASSERT(Z_REFCOUNTED_P(pz));
+ return ++GC_REFCOUNT(Z_COUNTED_P(pz));
+}
+
+static zend_always_inline uint32_t zval_delref_p(zval* pz) {
+ ZEND_ASSERT(Z_REFCOUNTED_P(pz));
+ return --GC_REFCOUNT(Z_COUNTED_P(pz));
+}
+
+#define ZVAL_COPY_VALUE(z, v) \
+ do { \
+ zval *_z1 = (z); \
+ zval *_z2 = (v); \
+ (_z1)->value = (_z2)->value; \
+ Z_TYPE_INFO_P(_z1) = Z_TYPE_INFO_P(_z2); \
+ } while (0)
+
+#define ZVAL_COPY(z, v) \
+ do { \
+ zval *__z1 = (z); \
+ zval *__z2 = (v); \
+ ZVAL_COPY_VALUE(__z1, __z2); \
+ if (Z_OPT_REFCOUNTED_P(__z1)) { \
+ Z_ADDREF_P(__z1); \
+ } \
+ } while (0)
-#define Z_STR_OFFSET_STR(zval) Z_INDIRECT(zval)
-#define Z_STR_OFFSET_STR_P(zval_p) Z_STR_OFFSET_STR(*(zval_p))
+#define ZVAL_DUP(z, v) \
+ do { \
+ zval *__z1 = (z); \
+ zval *__z2 = (v); \
+ ZVAL_COPY_VALUE(__z1, __z2); \
+ zval_opt_copy_ctor(__z1); \
+ } while (0)
-#define Z_STR_OFFSET_IDX(zval) (zval).u2.str_offset
-#define Z_STR_OFFSET_IDX_P(zval_p) Z_STR_OFFSET_IDX(*(zval_p))
+#define ZVAL_DEREF(z) do { \
+ if (UNEXPECTED(Z_ISREF_P(z))) { \
+ (z) = Z_REFVAL_P(z); \
+ } \
+ } while (0)
+
+#define ZVAL_MAKE_REF(zv) do { \
+ zval *__zv = (zv); \
+ if (!Z_ISREF_P(__zv)) { \
+ ZVAL_NEW_REF(__zv, __zv); \
+ } \
+ } while (0)
+
+#define ZVAL_UNREF(z) do { \
+ zval *_z = (z); \
+ zend_reference *ref; \
+ ZEND_ASSERT(Z_ISREF_P(_z)); \
+ ref = Z_REF_P(_z); \
+ ZVAL_COPY_VALUE(_z, &ref->val); \
+ efree_size(ref, sizeof(zend_reference)); \
+ } while (0)
+
+#define SEPARATE_STRING(zv) do { \
+ zval *_zv = (zv); \
+ if (Z_REFCOUNTED_P(_zv) && \
+ Z_REFCOUNT_P(_zv) > 1) { \
+ Z_DELREF_P(_zv); \
+ zval_copy_ctor_func(_zv); \
+ } \
+ } while (0)
+
+#define SEPARATE_ARRAY(zv) do { \
+ zval *_zv = (zv); \
+ if (Z_REFCOUNT_P(_zv) > 1) { \
+ if (!Z_IMMUTABLE_P(_zv)) { \
+ Z_DELREF_P(_zv); \
+ } \
+ zval_copy_ctor_func(_zv); \
+ } \
+ } while (0)
+
+#define SEPARATE_ZVAL_NOREF(zv) do { \
+ zval *_zv = (zv); \
+ if (Z_COPYABLE_P(_zv) || \
+ Z_IMMUTABLE_P(_zv)) { \
+ if (Z_REFCOUNT_P(_zv) > 1) { \
+ if (!Z_IMMUTABLE_P(_zv)) { \
+ Z_DELREF_P(_zv); \
+ } \
+ zval_copy_ctor_func(_zv); \
+ } \
+ } \
+ } while (0)
+
+#define SEPARATE_ZVAL(zv) do { \
+ zval *_zv = (zv); \
+ if (Z_REFCOUNTED_P(_zv) || \
+ Z_IMMUTABLE_P(_zv)) { \
+ if (Z_REFCOUNT_P(_zv) > 1) { \
+ if (Z_COPYABLE_P(_zv) || \
+ Z_IMMUTABLE_P(_zv)) { \
+ if (!Z_IMMUTABLE_P(_zv)) { \
+ Z_DELREF_P(_zv); \
+ } \
+ zval_copy_ctor_func(_zv); \
+ } else if (Z_ISREF_P(_zv)) { \
+ Z_DELREF_P(_zv); \
+ ZVAL_DUP(_zv, Z_REFVAL_P(_zv)); \
+ } \
+ } \
+ } \
+ } while (0)
+
+#define SEPARATE_ZVAL_IF_NOT_REF(zv) do { \
+ zval *_zv = (zv); \
+ if (Z_COPYABLE_P(_zv) || \
+ Z_IMMUTABLE_P(_zv)) { \
+ if (Z_REFCOUNT_P(_zv) > 1) { \
+ if (!Z_IMMUTABLE_P(_zv)) { \
+ Z_DELREF_P(_zv); \
+ } \
+ zval_copy_ctor_func(_zv); \
+ } \
+ } \
+ } while (0)
-#define ZVAL_STR_OFFSET(z, s, i) do { \
- Z_STR_OFFSET_STR_P(z) = (s); \
- Z_STR_OFFSET_IDX_P(z) = (i); \
- Z_TYPE_INFO_P(z) = IS_STR_OFFSET; \
+#define SEPARATE_ARG_IF_REF(varptr) do { \
+ ZVAL_DEREF(varptr); \
+ if (Z_REFCOUNTED_P(varptr)) { \
+ Z_ADDREF_P(varptr); \
+ } \
} while (0)
#endif /* ZEND_TYPES_H */
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index c55ce233a5..94ae438e9d 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -36,6 +36,13 @@ static zend_always_inline void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
_zval_dtor_func(Z_COUNTED_P(zvalue) ZEND_FILE_LINE_RELAY_CC);
}
+static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC)
+{
+ if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) {
+ _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
+ }
+}
+
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)
@@ -98,6 +105,7 @@ ZEND_API void _zval_dtor_wrapper(zval *zvalue);
#define zval_opt_copy_ctor_no_imm(zvalue) _zval_opt_copy_ctor_no_imm((zvalue) ZEND_FILE_LINE_CC)
#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
+#define zval_ptr_dtor_nogc(zval_ptr) _zval_ptr_dtor_nogc((zval_ptr) ZEND_FILE_LINE_CC)
#define zval_internal_dtor(zvalue) _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_internal_ptr_dtor(zvalue) _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_dtor_wrapper _zval_dtor_wrapper
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 665829d685..9f5a74aff6 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h
index b439d3eaa7..f40a2deb7e 100644
--- a/Zend/zend_virtual_cwd.h
+++ b/Zend/zend_virtual_cwd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -70,7 +70,7 @@ typedef unsigned short mode_t;
#define IS_UNC_PATH(path, len) \
(len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
#define IS_ABSOLUTE_PATH(path, len) \
- (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len)))
+ (len >= 2 && ((/* is local */isalpha(path[0]) && path[1] == ':') || /* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1])))
#elif defined(NETWARE)
#ifdef HAVE_DIRENT_H
@@ -213,18 +213,18 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
typedef struct _realpath_cache_bucket {
zend_ulong key;
char *path;
- int path_len;
char *realpath;
+ struct _realpath_cache_bucket *next;
+ time_t expires;
+ int path_len;
int realpath_len;
int is_dir;
- time_t expires;
#ifdef PHP_WIN32
unsigned char is_rvalid;
unsigned char is_readable;
unsigned char is_wvalid;
unsigned char is_writable;
#endif
- struct _realpath_cache_bucket *next;
} realpath_cache_bucket;
typedef struct _virtual_cwd_globals {
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 230c84194e..b4f8c83f1b 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -335,7 +335,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
zval *value;
int have_get_ptr = 0;
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -430,7 +430,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMP|VAR
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (OP1_TYPE == IS_VAR && !OP1_FREE) {
@@ -445,7 +445,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMP|VAR
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -497,7 +497,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
value = GET_OP2_ZVAL_PTR(BP_VAR_R);
var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -692,7 +692,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
retval = EX_VAR(opline->result.var);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -784,7 +784,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
retval = EX_VAR(opline->result.var);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -867,6 +867,10 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
SAVE_OPLINE();
var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
fast_increment_function(var_ptr);
if (RETURN_VALUE_USED(opline)) {
@@ -875,9 +879,6 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
ZEND_VM_NEXT_OPCODE();
}
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -922,6 +923,10 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
SAVE_OPLINE();
var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
fast_decrement_function(var_ptr);
if (RETURN_VALUE_USED(opline)) {
@@ -930,9 +935,6 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
ZEND_VM_NEXT_OPCODE();
}
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -977,15 +979,16 @@ ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY)
SAVE_OPLINE();
var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr);
fast_increment_function(var_ptr);
ZEND_VM_NEXT_OPCODE();
}
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
ZVAL_NULL(EX_VAR(opline->result.var));
FREE_OP1_VAR_PTR();
@@ -1031,15 +1034,16 @@ ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY)
SAVE_OPLINE();
var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr);
fast_decrement_function(var_ptr);
ZEND_VM_NEXT_OPCODE();
}
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (OP1_TYPE == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
ZVAL_NULL(EX_VAR(opline->result.var));
FREE_OP1_VAR_PTR();
@@ -1154,8 +1158,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -1175,8 +1178,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -1279,7 +1281,7 @@ ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
SAVE_OPLINE();
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -1305,7 +1307,7 @@ ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
SAVE_OPLINE();
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R), OP2_TYPE TSRMLS_CC);
@@ -1377,7 +1379,7 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV)
SAVE_OPLINE();
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_UNSET);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R), OP2_TYPE TSRMLS_CC);
@@ -1439,7 +1441,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -1464,7 +1466,7 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -1526,7 +1528,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|
if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -1552,7 +1554,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -1598,7 +1600,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
object = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
property_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((OP2_TYPE == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
@@ -1619,7 +1621,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
SAVE_OPLINE();
object_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -1637,35 +1639,30 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
zval *dim = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R);
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, OP2_TYPE TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, OP2_TYPE TSRMLS_CC);
FREE_OP2();
-
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
FREE_OP1_VAR_PTR();
/* assign_dim has two opcodes! */
@@ -1682,12 +1679,10 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
zval *variable_ptr;
SAVE_OPLINE();
- value = GET_OP2_ZVAL_PTR(BP_VAR_R);
+ value = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R);
variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, OP2_TYPE, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_OP2_TMP_FREE()) {
zval_dtor(value);
}
@@ -1695,13 +1690,7 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (OP2_TYPE == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (OP2_TYPE == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, OP2_TYPE TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -1750,8 +1739,8 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
UNEXPECTED(!Z_ISREF_P(variable_ptr))) {
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
}
- if ((OP2_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) ||
- (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET))) {
+ if ((OP2_TYPE == IS_VAR && UNEXPECTED(value_ptr == NULL)) ||
+ (OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
if ((OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) ||
@@ -2880,7 +2869,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
retval_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
}
@@ -3116,7 +3105,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
SAVE_OPLINE();
varptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(varptr) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(varptr == NULL)) {
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
@@ -3189,7 +3178,7 @@ ZEND_VM_C_LABEL(send_again):
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht) TSRMLS_CC);
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
- int i;
+ uint32_t i;
int separate = 0;
/* check if any of arguments are going to be passed by reference */
@@ -3894,8 +3883,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
ZVAL_DUP(EX_VAR(opline->result.var), value);
} else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
- ZVAL_STR(EX_VAR(opline->result.var), ce->name);
- zend_string_addref(ce->name);
+ ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
@@ -3915,7 +3903,7 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS
if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -4165,9 +4153,9 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
- failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path));
+ failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
resolved_path = Z_STRVAL_P(inc_filename);
}
@@ -4180,7 +4168,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
file_handle.opened_path = estrdup(resolved_path);
}
- if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) {
+ if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
@@ -4339,6 +4327,9 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ }
if (OP1_TYPE != IS_UNUSED) {
ZVAL_DEREF(container);
SEPARATE_ZVAL_NOREF(container);
@@ -4417,7 +4408,6 @@ ZEND_VM_C_LABEL(numeric_index_dim):
FREE_OP2();
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -4438,7 +4428,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
- if (OP1_TYPE == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
@@ -4475,17 +4465,15 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
ZVAL_DEREF(array_ptr);
if (Z_TYPE_P(array_ptr) == IS_ARRAY) {
if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
+ SEPARATE_ARRAY(array_ptr);
array_ref = array_ptr;
if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
ZVAL_NEW_REF(array_ptr, array_ptr);
array_ref = array_ptr;
array_ptr = Z_REFVAL_P(array_ptr);
}
- } else if (Z_IMMUTABLE_P(array_ptr)) {
+ } else if (Z_IMMUTABLE_P(array_ptr) || Z_REFCOUNT_P(array_ptr) > 1) {
zval_copy_ctor(array_ptr);
- } else {
- SEPARATE_ZVAL_NOREF(array_ptr);
}
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
@@ -4496,9 +4484,6 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
ce = Z_OBJCE_P(array_ptr);
if (!ce || ce->get_iterator == NULL) {
- if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
- }
Z_ADDREF_P(array_ptr);
}
array_ref = array_ptr;
@@ -4611,25 +4596,37 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
}
iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
- zend_hash_internal_pointer_reset(fe_ht);
- if (ce) {
- zend_object *zobj = Z_OBJ_P(array_ptr);
- while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
- zend_string *str_key;
- zend_ulong int_key;
- zend_uchar key_type;
-
- key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0);
- if (key_type != HASH_KEY_NON_EXISTENT &&
- (key_type == HASH_KEY_IS_LONG ||
- zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) {
- break;
+ HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var);
+ HashPosition pos = 0;
+ Bucket *p;
+
+ while (1) {
+ if (pos >= fe_ht->nNumUsed) {
+ is_empty = 1;
+ if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
}
- zend_hash_move_forward(fe_ht);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ }
+ p = fe_ht->arData + pos;
+ if (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
+ pos++;
+ continue;
+ }
+ if (!ce ||
+ !p->key ||
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ break;
}
+ pos++;
}
- is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var));
+ fe_ht->nInternalPointer = pos;
+ ptr->pos = pos;
+ ptr->ht = fe_ht;
+ ptr->h = fe_ht->arData[pos].h;
+ is_empty = 0;
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -4653,8 +4650,9 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
zval *array, *array_ref;
zval *value;
HashTable *fe_ht;
- zend_object_iterator *iter = NULL;
- zval *key = NULL;
+ HashPointer *ptr;
+ HashPosition pos;
+ Bucket *p;
array = array_ref = EX_VAR(opline->op1.var);
if (Z_ISREF_P(array)) {
@@ -4664,81 +4662,174 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
zval_copy_ctor(array);
}
}
- if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
- key = EX_VAR((opline+1)->result.var);
- }
SAVE_OPLINE();
- switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) {
- default:
- case ZEND_ITER_INVALID:
- zend_error(E_WARNING, "Invalid argument supplied for foreach()");
+ if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
+ fe_ht = Z_ARRVAL_P(array);
+ ptr = (HashPointer*)EX_VAR((opline+1)->op1.var);
+ pos = ptr->pos;
+ if (UNEXPECTED(pos == INVALID_IDX)) {
+ /* reached end of iteration */
ZEND_VM_JMP(opline->op2.jmp_addr);
-
- case ZEND_ITER_PLAIN_OBJECT: {
- zend_object *zobj = Z_OBJ_P(array);
- int key_type;
- zend_string *str_key;
- zend_ulong int_key;
-
- fe_ht = Z_OBJPROP_P(array);
- zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
+ } else if (UNEXPECTED(ptr->ht != fe_ht)) {
+ ptr->ht = fe_ht;
+ pos = 0;
+ } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) {
+ if (fe_ht->u.flags & HASH_FLAG_PACKED) {
+ pos = ptr->h;
+ } else {
+ pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask];
+ while (pos != INVALID_IDX) {
+ if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) {
+ break;
+ }
+ pos = Z_NEXT(fe_ht->arData[pos].val);
+ }
+ }
+ }
+ while (1) {
+ if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
+ /* reached end of iteration */
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ }
+ p = fe_ht->arData + pos;
+ value = &p->val;
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
+ continue;
+ } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
+ value = Z_INDIRECT_P(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
+ continue;
+ }
+ }
+ if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
+ ZVAL_MAKE_REF(value);
+ Z_ADDREF_P(value);
+ ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ } else {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ if (!p->key) {
+ ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h);
+ } else {
+ ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key);
+ }
+ }
+ break;
+ }
+ do {
+ pos++;
+ if (pos >= fe_ht->nNumUsed) {
+ fe_ht->nInternalPointer = ptr->pos = INVALID_IDX;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ p = fe_ht->arData + pos;
+ } while (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF));
+ fe_ht->nInternalPointer = ptr->pos = pos;
+ ptr->h = fe_ht->arData[pos].h;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ } else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) {
+ zend_object_iterator *iter;
+
+ if ((iter = zend_iterator_unwrap(array TSRMLS_CC)) == NULL) {
+ /* plain object */
+ zend_object *zobj = Z_OBJ_P(array);
+
+ fe_ht = Z_OBJPROP_P(array);
+ ptr = (HashPointer*)EX_VAR((opline+1)->op1.var);
+ pos = ptr->pos;
+ if (pos == INVALID_IDX) {
+ /* reached end of iteration */
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ } else if (UNEXPECTED(ptr->ht != fe_ht)) {
+ ptr->ht = fe_ht;
+ pos = 0;
+ } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) {
+ if (fe_ht->u.flags & HASH_FLAG_PACKED) {
+ pos = ptr->h;
+ } else {
+ pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask];
+ while (pos != INVALID_IDX) {
+ if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) {
+ break;
+ }
+ pos = Z_NEXT(fe_ht->arData[pos].val);
+ }
+ }
+ }
while (1) {
- if ((value = zend_hash_get_current_data(fe_ht)) == NULL) {
+ if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
/* reached end of iteration */
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- if (Z_TYPE_P(value) == IS_INDIRECT) {
+ p = fe_ht->arData + pos;
+ value = &p->val;
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
+ continue;
+ } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
value = Z_INDIRECT_P(value);
- if (Z_TYPE_P(value) == IS_UNDEF) {
- zend_hash_move_forward(fe_ht);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
continue;
}
}
- key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0);
-
- zend_hash_move_forward(fe_ht);
- if (key_type == HASH_KEY_IS_LONG ||
- zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
+ if (UNEXPECTED(!p->key)) {
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h);
+ }
+ break;
+ } else if (zend_check_property_access(zobj, p->key TSRMLS_CC) == SUCCESS) {
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ if (p->key->val[0]) {
+ ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key);
+ } else {
+ const char *class_name, *prop_name;
+ size_t prop_name_len;
+ zend_unmangle_property_name_ex(
+ p->key, &class_name, &prop_name, &prop_name_len);
+ ZVAL_STRINGL(EX_VAR((opline+1)->result.var), prop_name, prop_name_len);
+ }
+ }
break;
}
+ pos++;
}
-
- if (key) {
- if (key_type == HASH_KEY_IS_LONG) {
- ZVAL_LONG(key, int_key);
- } else {
- const char *class_name, *prop_name;
- int prop_name_len;
- zend_unmangle_property_name_ex(
- str_key->val, str_key->len, &class_name, &prop_name, &prop_name_len
- );
- ZVAL_STRINGL(key, prop_name, prop_name_len);
- }
- }
-
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
- break;
- }
-
- case ZEND_ITER_PLAIN_ARRAY:
- fe_ht = Z_ARRVAL_P(array);
- zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
- if ((value = zend_hash_get_current_data(fe_ht)) == NULL) {
- /* reached end of iteration */
- ZEND_VM_JMP(opline->op2.jmp_addr);
- }
- if (key) {
- zend_hash_get_current_key_zval(fe_ht, key);
+ if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
+ ZVAL_MAKE_REF(value);
+ Z_ADDREF_P(value);
+ ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ } else {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
}
- zend_hash_move_forward(fe_ht);
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
- break;
-
- case ZEND_ITER_OBJECT:
+ do {
+ pos++;
+ if (pos >= fe_ht->nNumUsed) {
+ fe_ht->nInternalPointer = ptr->pos = INVALID_IDX;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ p = fe_ht->arData + pos;
+ } while (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF) ||
+ (EXPECTED(p->key != NULL) &&
+ zend_check_property_access(zobj, p->key TSRMLS_CC) == FAILURE));
+ fe_ht->nInternalPointer = ptr->pos = pos;
+ ptr->h = fe_ht->arData[pos].h;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ } else {
/* !iter happens from exception */
if (iter && ++iter->index > 0) {
/* This could cause an endless loop if index becomes zero again.
@@ -4767,31 +4858,31 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
/* failure in get_current_data */
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- if (key) {
+ if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
+ ZVAL_MAKE_REF(value);
+ Z_ADDREF_P(value);
+ ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ } else {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
if (iter->funcs->get_current_key) {
- iter->funcs->get_current_key(iter, key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var) TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
}
} else {
- ZVAL_LONG(key, iter->index);
+ ZVAL_LONG(EX_VAR((opline+1)->result.var), iter->index);
}
}
- break;
- }
-
- if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
- ZVAL_MAKE_REF(value);
- Z_ADDREF_P(value);
- ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ }
} else {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ zend_error(E_WARNING, "Invalid argument supplied for foreach()");
+ ZEND_VM_JMP(opline->op2.jmp_addr);
}
-
- CHECK_EXCEPTION();
- ZEND_VM_INC_OPCODE();
- ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
@@ -4967,7 +5058,7 @@ ZEND_VM_C_LABEL(num_index_prop):
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -5051,6 +5142,7 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
ZVAL_LONG(&EX(old_error_reporting), EG(error_reporting));
+ EX(old_error_reporting).u2.silence_num = opline->op2.num;
}
if (EG(error_reporting)) {
@@ -5071,15 +5163,10 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
}
if (EXPECTED(zend_hash_str_add_ptr(EG(modified_ini_directives), "error_reporting", sizeof("error_reporting")-1, EG(error_reporting_ini_entry)) != NULL)) {
EG(error_reporting_ini_entry)->orig_value = EG(error_reporting_ini_entry)->value;
- EG(error_reporting_ini_entry)->orig_value_length = EG(error_reporting_ini_entry)->value_length;
EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable;
EG(error_reporting_ini_entry)->modified = 1;
}
- } else if (EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) {
- efree(EG(error_reporting_ini_entry)->value);
}
- EG(error_reporting_ini_entry)->value = estrndup("0", sizeof("0")-1);
- EG(error_reporting_ini_entry)->value_length = sizeof("0")-1;
} while (0);
}
CHECK_EXCEPTION();
@@ -5096,26 +5183,15 @@ ZEND_VM_HANDLER(142, ZEND_RAISE_ABSTRACT_ERROR, ANY, ANY)
ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
{
USE_OPLINE
- char buf[MAX_LENGTH_OF_LONG + 1];
- char *res;
SAVE_OPLINE();
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
- _zend_print_signed_to_buf(buf + sizeof(buf) - 1, EG(error_reporting), zend_ulong, res);
- if (EXPECTED(EG(error_reporting_ini_entry) != NULL)) {
- if (EXPECTED(EG(error_reporting_ini_entry)->modified &&
- EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value)) {
- efree(EG(error_reporting_ini_entry)->value);
- }
- EG(error_reporting_ini_entry)->value_length = buf + sizeof(buf) - 1 - res;
- EG(error_reporting_ini_entry)->value = estrndup(res, EG(error_reporting_ini_entry)->value_length);
- }
}
-//??? if (EX(old_error_reporting) == EX_VAR(opline->op1.var)) {
-//??? EX(old_error_reporting) = NULL;
-//??? }
- CHECK_EXCEPTION();
+ if (Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
+ EX(old_error_reporting).u2.silence_num == opline->op2.num) {
+ ZVAL_UNDEF(&EX(old_error_reporting));
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -5124,10 +5200,15 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
USE_OPLINE
zend_free_op free_op1;
zval *value;
+ int is_ref = 0;
SAVE_OPLINE();
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
+ if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) {
+ is_ref = 1;
+ value = Z_REFVAL_P(value);
+ }
if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (OP1_TYPE == IS_CONST) {
@@ -5136,6 +5217,9 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
}
} else if (OP1_TYPE == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ } else if (OP1_TYPE == IS_VAR && is_ref) {
+ if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ FREE_OP1();
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
@@ -5145,7 +5229,7 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HANDLER(158, ZEND_JMP_SET_VAR, CONST|TMP|VAR|CV, ANY)
+ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY)
{
USE_OPLINE
zend_free_op free_op1;
@@ -5154,7 +5238,10 @@ ZEND_VM_HANDLER(158, ZEND_JMP_SET_VAR, CONST|TMP|VAR|CV, ANY)
SAVE_OPLINE();
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
+ FREE_OP1();
+ } else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (OP1_TYPE == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -5163,50 +5250,6 @@ ZEND_VM_HANDLER(158, ZEND_JMP_SET_VAR, CONST|TMP|VAR|CV, ANY)
} else if (OP1_TYPE == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- ZEND_VM_JMP(opline->op2.jmp_addr);
- }
-
- FREE_OP1();
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
-}
-
-ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY)
-{
- USE_OPLINE
- zend_free_op free_op1;
- zval *value;
-
- SAVE_OPLINE();
- value = GET_OP1_ZVAL_PTR(BP_VAR_R);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (OP1_TYPE == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (OP1_TYPE == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- }
- ZEND_VM_NEXT_OPCODE();
-}
-
-ZEND_VM_HANDLER(157, ZEND_QM_ASSIGN_VAR, CONST|TMP|VAR|CV, ANY)
-{
- USE_OPLINE
- zend_free_op free_op1;
- zval *value;
-
- SAVE_OPLINE();
- value = GET_OP1_ZVAL_PTR(BP_VAR_R);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (OP1_TYPE == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (OP1_TYPE == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
ZEND_VM_NEXT_OPCODE();
}
@@ -5472,15 +5515,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
/* restore previous error_reporting value */
if (!EG(error_reporting) && Z_TYPE(EX(old_error_reporting)) != IS_UNDEF && Z_LVAL(EX(old_error_reporting)) != 0) {
- zval restored_error_reporting;
- zend_string *key;
-
- ZVAL_LONG(&restored_error_reporting, Z_LVAL(EX(old_error_reporting)));
- convert_to_string(&restored_error_reporting);
- key = zend_string_init("error_reporting", sizeof("error_reporting")-1, 0);
- zend_alter_ini_entry_ex(key, Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
- zend_string_free(key);
- zval_dtor(&restored_error_reporting);
+ EG(error_reporting) = Z_LVAL(EX(old_error_reporting));
}
ZVAL_UNDEF(&EX(old_error_reporting));
@@ -5672,7 +5707,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
} else {
zval *value_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
- if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (OP1_TYPE == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -5847,19 +5882,46 @@ ZEND_VM_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST)
zval *varname;
zval *value;
zval *variable_ptr;
- zend_string *name;
+ Bucket *p;
+ uint32_t idx;
SAVE_OPLINE();
varname = GET_OP2_ZVAL_PTR(BP_VAR_R);
- name = Z_STR_P(varname);
- value = zend_hash_find(&EG(symbol_table).ht, name);
- if (value == NULL) {
- value = zend_hash_add_new(&EG(symbol_table).ht, name, &EG(uninitialized_zval));
+ idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname));
+ /* index 0 can't be cached (NULL is a mark of uninitialized cache slot) */
+ p = EG(symbol_table).ht.arData + idx;
+ if (EXPECTED(idx > 0) &&
+ EXPECTED(idx < EG(symbol_table).ht.nNumUsed) &&
+ EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
+ (EXPECTED(p->key == Z_STR_P(varname)) ||
+ (EXPECTED(p->h == Z_STR_P(varname)->h) &&
+ EXPECTED(p->key != NULL) &&
+ EXPECTED(p->key->len == Z_STRLEN_P(varname)) &&
+ EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) {
+ value = &EG(symbol_table).ht.arData[idx].val;
/* GLOBAL variable may be an INDIRECT pointer to CV */
- } else if (Z_TYPE_P(value) == IS_INDIRECT) {
- value = Z_INDIRECT_P(value);
- if (Z_TYPE_P(value) == IS_UNDEF) {
- ZVAL_NULL(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
+ value = Z_INDIRECT_P(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ ZVAL_NULL(value);
+ }
+ }
+ } else {
+ value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname));
+ if (UNEXPECTED(value == NULL)) {
+ value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval));
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
+ } else {
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
+ /* GLOBAL variable may be an INDIRECT pointer to CV */
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
+ value = Z_INDIRECT_P(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ ZVAL_NULL(value);
+ }
+ }
}
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index f1ab7e85c4..d575db0018 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -736,7 +736,7 @@ send_again:
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht) TSRMLS_CC);
if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
- int i;
+ uint32_t i;
int separate = 0;
/* check if any of arguments are going to be passed by reference */
@@ -1111,6 +1111,7 @@ static int ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
ZVAL_LONG(&EX(old_error_reporting), EG(error_reporting));
+ EX(old_error_reporting).u2.silence_num = opline->op2.num;
}
if (EG(error_reporting)) {
@@ -1131,15 +1132,10 @@ static int ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
}
if (EXPECTED(zend_hash_str_add_ptr(EG(modified_ini_directives), "error_reporting", sizeof("error_reporting")-1, EG(error_reporting_ini_entry)) != NULL)) {
EG(error_reporting_ini_entry)->orig_value = EG(error_reporting_ini_entry)->value;
- EG(error_reporting_ini_entry)->orig_value_length = EG(error_reporting_ini_entry)->value_length;
EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable;
EG(error_reporting_ini_entry)->modified = 1;
}
- } else if (EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) {
- efree(EG(error_reporting_ini_entry)->value);
}
- EG(error_reporting_ini_entry)->value = estrndup("0", sizeof("0")-1);
- EG(error_reporting_ini_entry)->value_length = sizeof("0")-1;
} while (0);
}
CHECK_EXCEPTION();
@@ -1366,15 +1362,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
/* restore previous error_reporting value */
if (!EG(error_reporting) && Z_TYPE(EX(old_error_reporting)) != IS_UNDEF && Z_LVAL(EX(old_error_reporting)) != 0) {
- zval restored_error_reporting;
- zend_string *key;
-
- ZVAL_LONG(&restored_error_reporting, Z_LVAL(EX(old_error_reporting)));
- convert_to_string(&restored_error_reporting);
- key = zend_string_init("error_reporting", sizeof("error_reporting")-1, 0);
- zend_alter_ini_entry_ex(key, Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
- zend_string_free(key);
- zval_dtor(&restored_error_reporting);
+ EG(error_reporting) = Z_LVAL(EX(old_error_reporting));
}
ZVAL_UNDEF(&EX(old_error_reporting));
@@ -2665,7 +2653,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
retval_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
}
@@ -2972,9 +2960,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
- failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path));
+ failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
resolved_path = Z_STRVAL_P(inc_filename);
}
@@ -2987,7 +2975,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
file_handle.opened_path = estrdup(resolved_path);
}
- if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) {
+ if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
@@ -3082,17 +3070,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
ZVAL_DEREF(array_ptr);
if (Z_TYPE_P(array_ptr) == IS_ARRAY) {
if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
+ SEPARATE_ARRAY(array_ptr);
array_ref = array_ptr;
if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
ZVAL_NEW_REF(array_ptr, array_ptr);
array_ref = array_ptr;
array_ptr = Z_REFVAL_P(array_ptr);
}
- } else if (Z_IMMUTABLE_P(array_ptr)) {
+ } else if (Z_IMMUTABLE_P(array_ptr) || Z_REFCOUNT_P(array_ptr) > 1) {
zval_copy_ctor(array_ptr);
- } else {
- SEPARATE_ZVAL_NOREF(array_ptr);
}
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
@@ -3103,9 +3089,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
ce = Z_OBJCE_P(array_ptr);
if (!ce || ce->get_iterator == NULL) {
- if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
- }
Z_ADDREF_P(array_ptr);
}
array_ref = array_ptr;
@@ -3218,25 +3201,37 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
- zend_hash_internal_pointer_reset(fe_ht);
- if (ce) {
- zend_object *zobj = Z_OBJ_P(array_ptr);
- while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
- zend_string *str_key;
- zend_ulong int_key;
- zend_uchar key_type;
-
- key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0);
- if (key_type != HASH_KEY_NON_EXISTENT &&
- (key_type == HASH_KEY_IS_LONG ||
- zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) {
- break;
+ HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var);
+ HashPosition pos = 0;
+ Bucket *p;
+
+ while (1) {
+ if (pos >= fe_ht->nNumUsed) {
+ is_empty = 1;
+ if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
}
- zend_hash_move_forward(fe_ht);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ }
+ p = fe_ht->arData + pos;
+ if (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
+ pos++;
+ continue;
}
+ if (!ce ||
+ !p->key ||
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ break;
+ }
+ pos++;
}
- is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var));
+ fe_ht->nInternalPointer = pos;
+ ptr->pos = pos;
+ ptr->ht = fe_ht;
+ ptr->h = fe_ht->arData[pos].h;
+ is_empty = 0;
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -3280,10 +3275,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
USE_OPLINE
zval *value;
+ int is_ref = 0;
SAVE_OPLINE();
value = opline->op1.zv;
+ if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) {
+ is_ref = 1;
+ value = Z_REFVAL_P(value);
+ }
if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_CONST == IS_CONST) {
@@ -3292,6 +3292,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
}
} else if (IS_CONST == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ } else if (IS_CONST == IS_VAR && is_ref) {
+ if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
@@ -3300,7 +3303,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -3309,7 +3312,10 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
value = opline->op1.zv;
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
+
+ } else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -3318,49 +3324,6 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
} else if (IS_CONST == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- ZEND_VM_JMP(opline->op2.jmp_addr);
- }
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
-
- zval *value;
-
- SAVE_OPLINE();
- value = opline->op1.zv;
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_CONST == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_CONST == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- }
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
-
- zval *value;
-
- SAVE_OPLINE();
- value = opline->op1.zv;
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_CONST == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_CONST == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
ZEND_VM_NEXT_OPCODE();
}
@@ -3803,8 +3766,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -3824,8 +3786,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -4054,7 +4015,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -4350,8 +4311,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
ZVAL_DUP(EX_VAR(opline->result.var), value);
} else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
- ZVAL_STR(EX_VAR(opline->result.var), ce->name);
- zend_string_addref(ce->name);
+ ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
@@ -4371,7 +4331,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -4725,7 +4685,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -4850,7 +4810,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE
} else {
zval *value_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -5384,7 +5344,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMP_HANDLER(ZEND_OP
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -5584,7 +5544,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -5786,7 +5746,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -5880,7 +5840,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_
} else {
zval *value_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -6314,8 +6274,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -6335,8 +6294,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -6567,7 +6525,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OP
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -6767,7 +6725,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -7121,7 +7079,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -7215,7 +7173,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
} else {
zval *value_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -7374,8 +7332,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -7395,8 +7352,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -7634,7 +7590,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -7960,7 +7916,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL
} else {
zval *value_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -8477,7 +8433,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -8728,7 +8684,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -8930,7 +8886,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -9022,7 +8978,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
} else {
zval *value_ptr = NULL;
- if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -9415,7 +9371,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
retval_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
}
@@ -9724,9 +9680,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
- failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path));
+ failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
resolved_path = Z_STRVAL_P(inc_filename);
}
@@ -9739,7 +9695,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
file_handle.opened_path = estrdup(resolved_path);
}
- if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) {
+ if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
@@ -9834,17 +9790,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_DEREF(array_ptr);
if (Z_TYPE_P(array_ptr) == IS_ARRAY) {
if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
+ SEPARATE_ARRAY(array_ptr);
array_ref = array_ptr;
if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
ZVAL_NEW_REF(array_ptr, array_ptr);
array_ref = array_ptr;
array_ptr = Z_REFVAL_P(array_ptr);
}
- } else if (Z_IMMUTABLE_P(array_ptr)) {
+ } else if (Z_IMMUTABLE_P(array_ptr) || Z_REFCOUNT_P(array_ptr) > 1) {
zval_copy_ctor(array_ptr);
- } else {
- SEPARATE_ZVAL_NOREF(array_ptr);
}
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
@@ -9855,9 +9809,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
ce = Z_OBJCE_P(array_ptr);
if (!ce || ce->get_iterator == NULL) {
- if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
- }
Z_ADDREF_P(array_ptr);
}
array_ref = array_ptr;
@@ -9970,25 +9921,37 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
- zend_hash_internal_pointer_reset(fe_ht);
- if (ce) {
- zend_object *zobj = Z_OBJ_P(array_ptr);
- while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
- zend_string *str_key;
- zend_ulong int_key;
- zend_uchar key_type;
-
- key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0);
- if (key_type != HASH_KEY_NON_EXISTENT &&
- (key_type == HASH_KEY_IS_LONG ||
- zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) {
- break;
+ HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var);
+ HashPosition pos = 0;
+ Bucket *p;
+
+ while (1) {
+ if (pos >= fe_ht->nNumUsed) {
+ is_empty = 1;
+ if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
}
- zend_hash_move_forward(fe_ht);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ }
+ p = fe_ht->arData + pos;
+ if (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
+ pos++;
+ continue;
+ }
+ if (!ce ||
+ !p->key ||
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ break;
}
+ pos++;
}
- is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var));
+ fe_ht->nInternalPointer = pos;
+ ptr->pos = pos;
+ ptr->ht = fe_ht;
+ ptr->h = fe_ht->arData[pos].h;
+ is_empty = 0;
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -10030,26 +9993,15 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- char buf[MAX_LENGTH_OF_LONG + 1];
- char *res;
SAVE_OPLINE();
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
- _zend_print_signed_to_buf(buf + sizeof(buf) - 1, EG(error_reporting), zend_ulong, res);
- if (EXPECTED(EG(error_reporting_ini_entry) != NULL)) {
- if (EXPECTED(EG(error_reporting_ini_entry)->modified &&
- EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value)) {
- efree(EG(error_reporting_ini_entry)->value);
- }
- EG(error_reporting_ini_entry)->value_length = buf + sizeof(buf) - 1 - res;
- EG(error_reporting_ini_entry)->value = estrndup(res, EG(error_reporting_ini_entry)->value_length);
- }
}
-//??? if (EX(old_error_reporting) == EX_VAR(opline->op1.var)) {
-//??? EX(old_error_reporting) = NULL;
-//??? }
- CHECK_EXCEPTION();
+ if (Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
+ EX(old_error_reporting).u2.silence_num == opline->op2.num) {
+ ZVAL_UNDEF(&EX(old_error_reporting));
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -10058,10 +10010,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
USE_OPLINE
zend_free_op free_op1;
zval *value;
+ int is_ref = 0;
SAVE_OPLINE();
value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) {
+ is_ref = 1;
+ value = Z_REFVAL_P(value);
+ }
if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_TMP_VAR == IS_CONST) {
@@ -10070,6 +10027,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
} else if (IS_TMP_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ } else if (IS_TMP_VAR == IS_VAR && is_ref) {
+ if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ zval_dtor(free_op1.var);
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
@@ -10079,7 +10039,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1;
@@ -10088,7 +10048,10 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
+ zval_dtor(free_op1.var);
+ } else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_TMP_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -10097,50 +10060,6 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
} else if (IS_TMP_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- ZEND_VM_JMP(opline->op2.jmp_addr);
- }
-
- zval_dtor(free_op1.var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
- zend_free_op free_op1;
- zval *value;
-
- SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_TMP_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_TMP_VAR == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- }
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
- zend_free_op free_op1;
- zval *value;
-
- SAVE_OPLINE();
- value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_TMP_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_TMP_VAR == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
ZEND_VM_NEXT_OPCODE();
}
@@ -10586,8 +10505,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -10607,8 +10525,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -10837,7 +10754,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_TMP_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, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -11008,7 +10925,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -11362,7 +11279,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -11454,7 +11371,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
} else {
zval *value_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -11988,7 +11905,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMP_HANDLER(ZEND_OPCO
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_TMP_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, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -12145,7 +12062,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -12347,7 +12264,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -12441,7 +12358,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
} else {
zval *value_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -12875,8 +12792,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -12896,8 +12812,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -13128,7 +13043,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCO
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_TMP_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, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -13285,7 +13200,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -13639,7 +13554,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -13733,7 +13648,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
} else {
zval *value_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -13892,8 +13807,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -13913,8 +13827,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -14036,7 +13949,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -14337,7 +14250,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
} else {
zval *value_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -14854,7 +14767,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_TMP_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, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -15008,7 +14921,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -15210,7 +15123,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -15302,7 +15215,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else {
zval *value_ptr = NULL;
- if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_TMP_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -15442,6 +15355,10 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
fast_increment_function(var_ptr);
if (RETURN_VALUE_USED(opline)) {
@@ -15450,9 +15367,6 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE();
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -15497,6 +15411,10 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
fast_decrement_function(var_ptr);
if (RETURN_VALUE_USED(opline)) {
@@ -15505,9 +15423,6 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE();
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -15552,15 +15467,16 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr);
fast_increment_function(var_ptr);
ZEND_VM_NEXT_OPCODE();
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
ZVAL_NULL(EX_VAR(opline->result.var));
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
@@ -15606,15 +15522,16 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr);
fast_decrement_function(var_ptr);
ZEND_VM_NEXT_OPCODE();
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
ZVAL_NULL(EX_VAR(opline->result.var));
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
@@ -15913,7 +15830,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
retval_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
}
@@ -16043,7 +15960,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
varptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(varptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(varptr == NULL)) {
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
@@ -16398,9 +16315,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
- failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path));
+ failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
resolved_path = Z_STRVAL_P(inc_filename);
}
@@ -16413,7 +16330,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
file_handle.opened_path = estrdup(resolved_path);
}
- if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) {
+ if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
@@ -16508,17 +16425,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_DEREF(array_ptr);
if (Z_TYPE_P(array_ptr) == IS_ARRAY) {
if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
+ SEPARATE_ARRAY(array_ptr);
array_ref = array_ptr;
if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
ZVAL_NEW_REF(array_ptr, array_ptr);
array_ref = array_ptr;
array_ptr = Z_REFVAL_P(array_ptr);
}
- } else if (Z_IMMUTABLE_P(array_ptr)) {
+ } else if (Z_IMMUTABLE_P(array_ptr) || Z_REFCOUNT_P(array_ptr) > 1) {
zval_copy_ctor(array_ptr);
- } else {
- SEPARATE_ZVAL_NOREF(array_ptr);
}
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
@@ -16529,9 +16444,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ce = Z_OBJCE_P(array_ptr);
if (!ce || ce->get_iterator == NULL) {
- if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
- }
Z_ADDREF_P(array_ptr);
}
array_ref = array_ptr;
@@ -16644,25 +16556,37 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
- zend_hash_internal_pointer_reset(fe_ht);
- if (ce) {
- zend_object *zobj = Z_OBJ_P(array_ptr);
- while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
- zend_string *str_key;
- zend_ulong int_key;
- zend_uchar key_type;
-
- key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0);
- if (key_type != HASH_KEY_NON_EXISTENT &&
- (key_type == HASH_KEY_IS_LONG ||
- zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) {
- break;
+ HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var);
+ HashPosition pos = 0;
+ Bucket *p;
+
+ while (1) {
+ if (pos >= fe_ht->nNumUsed) {
+ is_empty = 1;
+ if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
}
- zend_hash_move_forward(fe_ht);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ }
+ p = fe_ht->arData + pos;
+ if (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
+ pos++;
+ continue;
+ }
+ if (!ce ||
+ !p->key ||
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ break;
}
+ pos++;
}
- is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var));
+ fe_ht->nInternalPointer = pos;
+ ptr->pos = pos;
+ ptr->ht = fe_ht;
+ ptr->h = fe_ht->arData[pos].h;
+ is_empty = 0;
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -16686,8 +16610,9 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *array, *array_ref;
zval *value;
HashTable *fe_ht;
- zend_object_iterator *iter = NULL;
- zval *key = NULL;
+ HashPointer *ptr;
+ HashPosition pos;
+ Bucket *p;
array = array_ref = EX_VAR(opline->op1.var);
if (Z_ISREF_P(array)) {
@@ -16697,81 +16622,174 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval_copy_ctor(array);
}
}
- if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
- key = EX_VAR((opline+1)->result.var);
- }
SAVE_OPLINE();
- switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) {
- default:
- case ZEND_ITER_INVALID:
- zend_error(E_WARNING, "Invalid argument supplied for foreach()");
+ if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
+ fe_ht = Z_ARRVAL_P(array);
+ ptr = (HashPointer*)EX_VAR((opline+1)->op1.var);
+ pos = ptr->pos;
+ if (UNEXPECTED(pos == INVALID_IDX)) {
+ /* reached end of iteration */
ZEND_VM_JMP(opline->op2.jmp_addr);
+ } else if (UNEXPECTED(ptr->ht != fe_ht)) {
+ ptr->ht = fe_ht;
+ pos = 0;
+ } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) {
+ if (fe_ht->u.flags & HASH_FLAG_PACKED) {
+ pos = ptr->h;
+ } else {
+ pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask];
+ while (pos != INVALID_IDX) {
+ if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) {
+ break;
+ }
+ pos = Z_NEXT(fe_ht->arData[pos].val);
+ }
+ }
+ }
+ while (1) {
+ if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
+ /* reached end of iteration */
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ }
+ p = fe_ht->arData + pos;
+ value = &p->val;
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
+ continue;
+ } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
+ value = Z_INDIRECT_P(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
+ continue;
+ }
+ }
+ if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
+ ZVAL_MAKE_REF(value);
+ Z_ADDREF_P(value);
+ ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ } else {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ if (!p->key) {
+ ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h);
+ } else {
+ ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key);
+ }
+ }
+ break;
+ }
+ do {
+ pos++;
+ if (pos >= fe_ht->nNumUsed) {
+ fe_ht->nInternalPointer = ptr->pos = INVALID_IDX;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ p = fe_ht->arData + pos;
+ } while (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF));
+ fe_ht->nInternalPointer = ptr->pos = pos;
+ ptr->h = fe_ht->arData[pos].h;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ } else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) {
+ zend_object_iterator *iter;
- case ZEND_ITER_PLAIN_OBJECT: {
- zend_object *zobj = Z_OBJ_P(array);
- int key_type;
- zend_string *str_key;
- zend_ulong int_key;
+ if ((iter = zend_iterator_unwrap(array TSRMLS_CC)) == NULL) {
+ /* plain object */
+ zend_object *zobj = Z_OBJ_P(array);
- fe_ht = Z_OBJPROP_P(array);
- zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
+ fe_ht = Z_OBJPROP_P(array);
+ ptr = (HashPointer*)EX_VAR((opline+1)->op1.var);
+ pos = ptr->pos;
+ if (pos == INVALID_IDX) {
+ /* reached end of iteration */
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ } else if (UNEXPECTED(ptr->ht != fe_ht)) {
+ ptr->ht = fe_ht;
+ pos = 0;
+ } else if (UNEXPECTED(fe_ht->nInternalPointer != ptr->pos)) {
+ if (fe_ht->u.flags & HASH_FLAG_PACKED) {
+ pos = ptr->h;
+ } else {
+ pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask];
+ while (pos != INVALID_IDX) {
+ if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) {
+ break;
+ }
+ pos = Z_NEXT(fe_ht->arData[pos].val);
+ }
+ }
+ }
while (1) {
- if ((value = zend_hash_get_current_data(fe_ht)) == NULL) {
+ if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
/* reached end of iteration */
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- if (Z_TYPE_P(value) == IS_INDIRECT) {
+ p = fe_ht->arData + pos;
+ value = &p->val;
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
+ continue;
+ } else if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
value = Z_INDIRECT_P(value);
- if (Z_TYPE_P(value) == IS_UNDEF) {
- zend_hash_move_forward(fe_ht);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ pos++;
continue;
}
}
- key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0);
-
- zend_hash_move_forward(fe_ht);
- if (key_type == HASH_KEY_IS_LONG ||
- zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
+ if (UNEXPECTED(!p->key)) {
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h);
+ }
+ break;
+ } else if (zend_check_property_access(zobj, p->key TSRMLS_CC) == SUCCESS) {
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
+ if (p->key->val[0]) {
+ ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key);
+ } else {
+ const char *class_name, *prop_name;
+ size_t prop_name_len;
+ zend_unmangle_property_name_ex(
+ p->key, &class_name, &prop_name, &prop_name_len);
+ ZVAL_STRINGL(EX_VAR((opline+1)->result.var), prop_name, prop_name_len);
+ }
+ }
break;
}
+ pos++;
}
-
- if (key) {
- if (key_type == HASH_KEY_IS_LONG) {
- ZVAL_LONG(key, int_key);
- } else {
- const char *class_name, *prop_name;
- int prop_name_len;
- zend_unmangle_property_name_ex(
- str_key->val, str_key->len, &class_name, &prop_name, &prop_name_len
- );
- ZVAL_STRINGL(key, prop_name, prop_name_len);
- }
- }
-
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
- break;
- }
-
- case ZEND_ITER_PLAIN_ARRAY:
- fe_ht = Z_ARRVAL_P(array);
- zend_hash_set_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
- if ((value = zend_hash_get_current_data(fe_ht)) == NULL) {
- /* reached end of iteration */
- ZEND_VM_JMP(opline->op2.jmp_addr);
- }
- if (key) {
- zend_hash_get_current_key_zval(fe_ht, key);
+ if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
+ ZVAL_MAKE_REF(value);
+ Z_ADDREF_P(value);
+ ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ } else {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
}
- zend_hash_move_forward(fe_ht);
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+1)->op1.var));
- break;
-
- case ZEND_ITER_OBJECT:
+ do {
+ pos++;
+ if (pos >= fe_ht->nNumUsed) {
+ fe_ht->nInternalPointer = ptr->pos = INVALID_IDX;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ p = fe_ht->arData + pos;
+ } while (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF) ||
+ (EXPECTED(p->key != NULL) &&
+ zend_check_property_access(zobj, p->key TSRMLS_CC) == FAILURE));
+ fe_ht->nInternalPointer = ptr->pos = pos;
+ ptr->h = fe_ht->arData[pos].h;
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ } else {
/* !iter happens from exception */
if (iter && ++iter->index > 0) {
/* This could cause an endless loop if index becomes zero again.
@@ -16800,31 +16818,31 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* failure in get_current_data */
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- if (key) {
+ if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
+ ZVAL_MAKE_REF(value);
+ Z_ADDREF_P(value);
+ ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ } else {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
if (iter->funcs->get_current_key) {
- iter->funcs->get_current_key(iter, key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var) TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
}
} else {
- ZVAL_LONG(key, iter->index);
+ ZVAL_LONG(EX_VAR((opline+1)->result.var), iter->index);
}
}
- break;
- }
-
- if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
- ZVAL_MAKE_REF(value);
- Z_ADDREF_P(value);
- ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(value));
+ ZEND_VM_INC_OPCODE();
+ ZEND_VM_NEXT_OPCODE();
+ }
} else {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ zend_error(E_WARNING, "Invalid argument supplied for foreach()");
+ ZEND_VM_JMP(opline->op2.jmp_addr);
}
-
- CHECK_EXCEPTION();
- ZEND_VM_INC_OPCODE();
- ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16854,10 +16872,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
USE_OPLINE
zend_free_op free_op1;
zval *value;
+ int is_ref = 0;
SAVE_OPLINE();
value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) {
+ is_ref = 1;
+ value = Z_REFVAL_P(value);
+ }
if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_VAR == IS_CONST) {
@@ -16866,6 +16889,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
} else if (IS_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ } else if (IS_VAR == IS_VAR && is_ref) {
+ if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ zval_ptr_dtor_nogc(free_op1.var);
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
@@ -16875,7 +16901,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1;
@@ -16884,7 +16910,10 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
+ zval_ptr_dtor_nogc(free_op1.var);
+ } else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -16893,50 +16922,6 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
} else if (IS_VAR == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- ZEND_VM_JMP(opline->op2.jmp_addr);
- }
-
- zval_ptr_dtor_nogc(free_op1.var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
- zend_free_op free_op1;
- zval *value;
-
- SAVE_OPLINE();
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_VAR == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- }
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
- zend_free_op free_op1;
- zval *value;
-
- SAVE_OPLINE();
- value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_VAR == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
ZEND_VM_NEXT_OPCODE();
}
@@ -17337,7 +17322,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
zval *value;
int have_get_ptr = 0;
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -17431,7 +17416,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
@@ -17446,7 +17431,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -17498,7 +17483,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
value = opline->op2.zv;
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ 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");
}
@@ -17693,7 +17678,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -17784,7 +17769,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -17911,8 +17896,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -17932,8 +17916,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -18036,7 +18019,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -18062,7 +18045,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
@@ -18134,7 +18117,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
@@ -18195,7 +18178,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
property = opline->op2.zv;
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -18220,7 +18203,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
property = opline->op2.zv;
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -18281,7 +18264,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_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");
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -18307,7 +18290,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
property = opline->op2.zv;
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -18331,7 +18314,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
property_name = opline->op2.zv;
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -18352,7 +18335,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -18370,34 +18353,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
zval *dim = opline->op2.zv;
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CONST TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CONST TSRMLS_CC);
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_dim has two opcodes! */
@@ -18417,9 +18396,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
value = opline->op2.zv;
variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_CONST, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (0) {
zval_dtor(value);
}
@@ -18427,13 +18404,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_CONST == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_CONST == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_CONST TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -18734,8 +18705,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
ZVAL_DUP(EX_VAR(opline->result.var), value);
} else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
- ZVAL_STR(EX_VAR(opline->result.var), ce->name);
- zend_string_addref(ce->name);
+ ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
@@ -18755,7 +18725,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ 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);
@@ -18946,6 +18916,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ 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);
@@ -19024,7 +18997,6 @@ numeric_index_dim:
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -19045,7 +19017,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = opline->op2.zv;
@@ -19237,7 +19209,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -19329,7 +19301,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
} else {
zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -19724,7 +19696,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
zval *value;
int have_get_ptr = 0;
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -19819,7 +19791,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMP(int (*bin
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
@@ -19834,7 +19806,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMP(int (*bin
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -19886,7 +19858,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ 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");
}
@@ -20081,7 +20053,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -20173,7 +20145,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -20273,7 +20245,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -20299,7 +20271,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
@@ -20371,7 +20343,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
@@ -20433,7 +20405,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -20458,7 +20430,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -20520,7 +20492,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_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");
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -20546,7 +20518,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -20570,7 +20542,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -20591,7 +20563,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -20609,35 +20581,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR TSRMLS_CC);
zval_dtor(free_op2.var);
-
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_dim has two opcodes! */
@@ -20657,9 +20624,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_TMP_VAR, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (1) {
zval_dtor(value);
}
@@ -20667,13 +20632,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_TMP_VAR == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_TMP_VAR == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -20900,7 +20859,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ 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);
@@ -21019,6 +20978,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ 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);
@@ -21097,7 +21059,6 @@ numeric_index_dim:
zval_dtor(free_op2.var);
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -21118,7 +21079,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -21230,7 +21191,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -21324,7 +21285,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
} else {
zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -21719,7 +21680,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
zval *value;
int have_get_ptr = 0;
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -21814,7 +21775,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_VAR(int (*bin
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
@@ -21829,7 +21790,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_VAR(int (*bin
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -21881,7 +21842,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_
value = _get_zval_ptr_var(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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ 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");
}
@@ -22076,7 +22037,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -22168,7 +22129,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -22296,8 +22257,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -22317,8 +22277,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -22421,7 +22380,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -22447,7 +22406,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
@@ -22519,7 +22478,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
@@ -22581,7 +22540,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -22606,7 +22565,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -22668,7 +22627,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_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");
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -22694,7 +22653,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -22718,7 +22677,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -22739,7 +22698,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -22757,35 +22716,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_VAR TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_VAR TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
-
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_dim has two opcodes! */
@@ -22802,12 +22756,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_VAR, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (0) {
zval_dtor(value);
}
@@ -22815,13 +22767,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_VAR == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_VAR == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_VAR TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -22870,8 +22816,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
UNEXPECTED(!Z_ISREF_P(variable_ptr))) {
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
}
- if ((IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) ||
- (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET))) {
+ if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) ||
+ (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
if ((IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) ||
@@ -23112,7 +23058,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ 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);
@@ -23303,6 +23249,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ 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);
@@ -23381,7 +23330,6 @@ numeric_index_dim:
zval_ptr_dtor_nogc(free_op2.var);
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -23402,7 +23350,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -23594,7 +23542,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -23688,7 +23636,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
} else {
zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -23808,7 +23756,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
zval *value;
int have_get_ptr = 0;
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -23902,7 +23850,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
@@ -23917,7 +23865,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -23969,7 +23917,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina
value = NULL;
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ 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");
}
@@ -24204,8 +24152,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -24225,8 +24172,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -24312,7 +24258,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -24338,7 +24284,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
@@ -24395,7 +24341,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -24413,34 +24359,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
zval *dim = NULL;
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_UNUSED TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_UNUSED TSRMLS_CC);
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_dim has two opcodes! */
@@ -24575,7 +24517,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ 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);
@@ -24894,7 +24836,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
} else {
zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -25274,7 +25216,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
zval *value;
int have_get_ptr = 0;
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -25368,7 +25310,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
@@ -25383,7 +25325,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -25435,7 +25377,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o
value = _get_zval_ptr_cv_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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ 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");
}
@@ -25630,7 +25572,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -25721,7 +25663,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -25820,7 +25762,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -25846,7 +25788,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
@@ -25918,7 +25860,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
@@ -25979,7 +25921,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -26004,7 +25946,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -26065,7 +26007,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_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");
}
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -26091,7 +26033,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -26115,7 +26057,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -26136,7 +26078,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -26154,34 +26096,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *dim = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CV TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CV TSRMLS_CC);
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_dim has two opcodes! */
@@ -26198,12 +26136,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_CV, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (0) {
zval_dtor(value);
}
@@ -26211,13 +26147,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_CV == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_CV == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_CV TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -26265,8 +26195,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
UNEXPECTED(!Z_ISREF_P(variable_ptr))) {
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
}
- if ((IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) ||
- (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET))) {
+ if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) ||
+ (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
if ((IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) ||
@@ -26504,7 +26434,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE
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);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ 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);
@@ -26623,6 +26553,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ 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);
@@ -26701,7 +26634,6 @@ numeric_index_dim:
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -26722,7 +26654,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -26834,7 +26766,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -26926,7 +26858,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else {
zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -27126,7 +27058,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
zval *value;
int have_get_ptr = 0;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -27219,7 +27151,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
@@ -27234,7 +27166,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -27286,7 +27218,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*bi
value = opline->op2.zv;
var_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -27481,7 +27413,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -27572,7 +27504,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -27693,7 +27625,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE
property = opline->op2.zv;
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -27718,7 +27650,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
property = opline->op2.zv;
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -27779,7 +27711,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -27805,7 +27737,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OP
container = _get_obj_zval_ptr_unused(TSRMLS_C);
property = opline->op2.zv;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -27829,7 +27761,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_
object = _get_obj_zval_ptr_unused(TSRMLS_C);
property_name = opline->op2.zv;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
@@ -28035,8 +27967,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
ZVAL_DUP(EX_VAR(opline->result.var), value);
} else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
- ZVAL_STR(EX_VAR(opline->result.var), ce->name);
- zend_string_addref(ce->name);
+ ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
@@ -28087,6 +28018,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
+ 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);
@@ -28165,7 +28099,6 @@ numeric_index_dim:
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -28186,7 +28119,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = opline->op2.zv;
@@ -28298,7 +28231,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -28390,7 +28323,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL
} else {
zval *value_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -28494,7 +28427,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
zval *value;
int have_get_ptr = 0;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -28588,7 +28521,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (*
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
@@ -28603,7 +28536,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (*
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -28655,7 +28588,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina
value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
var_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -28850,7 +28783,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -28942,7 +28875,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -29065,7 +28998,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -29090,7 +29023,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -29152,7 +29085,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -29178,7 +29111,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCO
container = _get_obj_zval_ptr_unused(TSRMLS_C);
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -29202,7 +29135,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HA
object = _get_obj_zval_ptr_unused(TSRMLS_C);
property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
@@ -29370,6 +29303,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
+ 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);
@@ -29448,7 +29384,6 @@ numeric_index_dim:
zval_dtor(free_op2.var);
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -29469,7 +29404,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -29581,7 +29516,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -29675,7 +29610,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER
} else {
zval *value_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -29779,7 +29714,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
zval *value;
int have_get_ptr = 0;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -29873,7 +29808,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_VAR(int (*
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
@@ -29888,7 +29823,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_VAR(int (*
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -29940,7 +29875,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina
value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
var_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -30135,7 +30070,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -30227,7 +30162,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -30350,7 +30285,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -30375,7 +30310,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -30437,7 +30372,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -30463,7 +30398,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO
container = _get_obj_zval_ptr_unused(TSRMLS_C);
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -30487,7 +30422,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA
object = _get_obj_zval_ptr_unused(TSRMLS_C);
property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
@@ -30655,6 +30590,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
+ 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);
@@ -30733,7 +30671,6 @@ numeric_index_dim:
zval_ptr_dtor_nogc(free_op2.var);
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -30754,7 +30691,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -30866,7 +30803,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -30960,7 +30897,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
} else {
zval *value_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -31064,7 +31001,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
zval *value;
int have_get_ptr = 0;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -31157,7 +31094,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
@@ -31172,7 +31109,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -31224,7 +31161,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*b
value = NULL;
var_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -31476,7 +31413,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND
} else {
zval *value_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -31580,7 +31517,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
zval *value;
int have_get_ptr = 0;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -31673,7 +31610,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
@@ -31688,7 +31625,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -31740,7 +31677,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binar
value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
var_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -31935,7 +31872,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -32026,7 +31963,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -32147,7 +32084,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -32172,7 +32109,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -32233,7 +32170,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -32259,7 +32196,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD
container = _get_obj_zval_ptr_unused(TSRMLS_C);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -32283,7 +32220,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN
object = _get_obj_zval_ptr_unused(TSRMLS_C);
property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
@@ -32449,6 +32386,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
+ 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);
@@ -32527,7 +32467,6 @@ numeric_index_dim:
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -32548,7 +32487,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (IS_UNUSED == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -32660,7 +32599,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -32752,7 +32691,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_
} else {
zval *value_ptr = NULL;
- if (IS_UNUSED == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_UNUSED == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -32882,6 +32821,10 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
fast_increment_function(var_ptr);
if (RETURN_VALUE_USED(opline)) {
@@ -32890,9 +32833,6 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE();
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -32936,6 +32876,10 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
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)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
fast_decrement_function(var_ptr);
if (RETURN_VALUE_USED(opline)) {
@@ -32944,9 +32888,6 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE();
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -32990,15 +32931,16 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr);
fast_increment_function(var_ptr);
ZEND_VM_NEXT_OPCODE();
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -33043,15 +32985,16 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
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)) {
+ zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
+ }
+
if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr);
fast_decrement_function(var_ptr);
ZEND_VM_NEXT_OPCODE();
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
- zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
- }
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == &EG(error_zval))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -33334,7 +33277,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
retval_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
}
@@ -33463,7 +33406,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
varptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(varptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(varptr == NULL)) {
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
@@ -33802,9 +33745,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
- failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, strlen(resolved_path));
+ failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
resolved_path = Z_STRVAL_P(inc_filename);
}
@@ -33817,7 +33760,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
file_handle.opened_path = estrdup(resolved_path);
}
- if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path))) {
+ if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
@@ -33912,17 +33855,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZVAL_DEREF(array_ptr);
if (Z_TYPE_P(array_ptr) == IS_ARRAY) {
if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
+ SEPARATE_ARRAY(array_ptr);
array_ref = array_ptr;
if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
ZVAL_NEW_REF(array_ptr, array_ptr);
array_ref = array_ptr;
array_ptr = Z_REFVAL_P(array_ptr);
}
- } else if (Z_IMMUTABLE_P(array_ptr)) {
+ } else if (Z_IMMUTABLE_P(array_ptr) || Z_REFCOUNT_P(array_ptr) > 1) {
zval_copy_ctor(array_ptr);
- } else {
- SEPARATE_ZVAL_NOREF(array_ptr);
}
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
@@ -33933,9 +33874,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ce = Z_OBJCE_P(array_ptr);
if (!ce || ce->get_iterator == NULL) {
- if (!Z_ISREF_P(array_ref)) {
- SEPARATE_ZVAL_NOREF(array_ptr);
- }
Z_ADDREF_P(array_ptr);
}
array_ref = array_ptr;
@@ -34048,25 +33986,37 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
- zend_hash_internal_pointer_reset(fe_ht);
- if (ce) {
- zend_object *zobj = Z_OBJ_P(array_ptr);
- while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
- zend_string *str_key;
- zend_ulong int_key;
- zend_uchar key_type;
-
- key_type = zend_hash_get_current_key(fe_ht, &str_key, &int_key, 0);
- if (key_type != HASH_KEY_NON_EXISTENT &&
- (key_type == HASH_KEY_IS_LONG ||
- zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS)) {
- break;
+ HashPointer *ptr = (HashPointer*)EX_VAR((opline+2)->op1.var);
+ HashPosition pos = 0;
+ Bucket *p;
+
+ while (1) {
+ if (pos >= fe_ht->nNumUsed) {
+ is_empty = 1;
+ if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
}
- zend_hash_move_forward(fe_ht);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
+ }
+ p = fe_ht->arData + pos;
+ if (Z_TYPE(p->val) == IS_UNDEF ||
+ (Z_TYPE(p->val) == IS_INDIRECT &&
+ Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
+ pos++;
+ continue;
+ }
+ if (!ce ||
+ !p->key ||
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ break;
}
+ pos++;
}
- is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, (HashPointer*)EX_VAR((opline+2)->op1.var));
+ fe_ht->nInternalPointer = pos;
+ ptr->pos = pos;
+ ptr->ht = fe_ht;
+ ptr->h = fe_ht->arData[pos].h;
+ is_empty = 0;
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -34110,10 +34060,15 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
USE_OPLINE
zval *value;
+ int is_ref = 0;
SAVE_OPLINE();
value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) {
+ is_ref = 1;
+ value = Z_REFVAL_P(value);
+ }
if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_CV == IS_CONST) {
@@ -34122,6 +34077,9 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} else if (IS_CV == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+ } else if (IS_CV == IS_VAR && is_ref) {
+ if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
+
}
ZEND_VM_JMP(opline->op2.jmp_addr);
}
@@ -34130,7 +34088,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -34139,7 +34097,10 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
+
+ } else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_CV == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -34148,49 +34109,6 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
} else if (IS_CV == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- ZEND_VM_JMP(opline->op2.jmp_addr);
- }
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
-
- zval *value;
-
- SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_CV == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_CV == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- }
- ZEND_VM_NEXT_OPCODE();
-}
-
-static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- USE_OPLINE
-
- zval *value;
-
- SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
-
- ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
- if (IS_CV == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- zval_copy_ctor_func(EX_VAR(opline->result.var));
- }
- } else if (IS_CV == IS_CV) {
- if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
ZEND_VM_NEXT_OPCODE();
}
@@ -34591,7 +34509,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
zval *value;
int have_get_ptr = 0;
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -34684,7 +34602,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*bi
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
@@ -34699,7 +34617,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*bi
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -34751,7 +34669,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary
value = opline->op2.zv;
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -34946,7 +34864,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -35037,7 +34955,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
property = opline->op2.zv;
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -35164,8 +35082,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -35185,8 +35102,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -35289,7 +35205,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -35315,7 +35231,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
@@ -35387,7 +35303,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, opline->op2.zv, IS_CONST TSRMLS_CC);
@@ -35448,7 +35364,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
property = opline->op2.zv;
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -35473,7 +35389,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
property = opline->op2.zv;
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -35534,7 +35450,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -35560,7 +35476,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
property = opline->op2.zv;
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -35584,7 +35500,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
object = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
property_name = opline->op2.zv;
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -35605,7 +35521,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
object_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -35623,34 +35539,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
zval *dim = opline->op2.zv;
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CONST TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CONST TSRMLS_CC);
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
/* assign_dim has two opcodes! */
@@ -35670,9 +35582,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
value = opline->op2.zv;
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_CONST, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (0) {
zval_dtor(value);
}
@@ -35680,13 +35590,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_CONST == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_CONST == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_CONST TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -35794,7 +35698,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -35985,6 +35889,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ }
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
SEPARATE_ZVAL_NOREF(container);
@@ -36063,7 +35970,6 @@ numeric_index_dim:
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -36084,7 +35990,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
offset = opline->op2.zv;
@@ -36276,7 +36182,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -36368,7 +36274,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
} else {
zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -36485,19 +36391,46 @@ static int ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zval *varname;
zval *value;
zval *variable_ptr;
- zend_string *name;
+ Bucket *p;
+ uint32_t idx;
SAVE_OPLINE();
varname = opline->op2.zv;
- name = Z_STR_P(varname);
- value = zend_hash_find(&EG(symbol_table).ht, name);
- if (value == NULL) {
- value = zend_hash_add_new(&EG(symbol_table).ht, name, &EG(uninitialized_zval));
+ idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname));
+ /* index 0 can't be cached (NULL is a mark of uninitialized cache slot) */
+ p = EG(symbol_table).ht.arData + idx;
+ if (EXPECTED(idx > 0) &&
+ EXPECTED(idx < EG(symbol_table).ht.nNumUsed) &&
+ EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
+ (EXPECTED(p->key == Z_STR_P(varname)) ||
+ (EXPECTED(p->h == Z_STR_P(varname)->h) &&
+ EXPECTED(p->key != NULL) &&
+ EXPECTED(p->key->len == Z_STRLEN_P(varname)) &&
+ EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) {
+ value = &EG(symbol_table).ht.arData[idx].val;
/* GLOBAL variable may be an INDIRECT pointer to CV */
- } else if (Z_TYPE_P(value) == IS_INDIRECT) {
- value = Z_INDIRECT_P(value);
- if (Z_TYPE_P(value) == IS_UNDEF) {
- ZVAL_NULL(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
+ value = Z_INDIRECT_P(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ ZVAL_NULL(value);
+ }
+ }
+ } else {
+ value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname));
+ if (UNEXPECTED(value == NULL)) {
+ value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval));
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
+ } else {
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
+ /* GLOBAL variable may be an INDIRECT pointer to CV */
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
+ value = Z_INDIRECT_P(value);
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
+ ZVAL_NULL(value);
+ }
+ }
}
}
@@ -36792,7 +36725,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
zval *value;
int have_get_ptr = 0;
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -36886,7 +36819,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMP(int (*bina
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
@@ -36901,7 +36834,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMP(int (*bina
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -36953,7 +36886,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o
value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -37148,7 +37081,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -37240,7 +37173,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -37340,7 +37273,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -37366,7 +37299,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
@@ -37438,7 +37371,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_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);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR TSRMLS_CC);
@@ -37500,7 +37433,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -37525,7 +37458,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -37587,7 +37520,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -37613,7 +37546,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H
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);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -37637,7 +37570,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
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);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -37658,7 +37591,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
object_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -37676,35 +37609,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR TSRMLS_CC);
zval_dtor(free_op2.var);
-
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
/* assign_dim has two opcodes! */
@@ -37724,9 +37652,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_TMP_VAR, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (1) {
zval_dtor(value);
}
@@ -37734,13 +37660,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_TMP_VAR == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_TMP_VAR == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -37850,7 +37770,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -37969,6 +37889,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ }
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
SEPARATE_ZVAL_NOREF(container);
@@ -38047,7 +37970,6 @@ numeric_index_dim:
zval_dtor(free_op2.var);
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -38068,7 +37990,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -38180,7 +38102,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -38274,7 +38196,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else {
zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -38668,7 +38590,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
zval *value;
int have_get_ptr = 0;
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -38762,7 +38684,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_VAR(int (*bina
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
@@ -38777,7 +38699,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_VAR(int (*bina
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -38829,7 +38751,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o
value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -39024,7 +38946,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -39116,7 +39038,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -39244,8 +39166,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -39265,8 +39186,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -39369,7 +39289,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -39395,7 +39315,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
@@ -39467,7 +39387,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_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);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR TSRMLS_CC);
@@ -39529,7 +39449,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -39554,7 +39474,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -39616,7 +39536,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -39642,7 +39562,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H
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);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -39666,7 +39586,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
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);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -39687,7 +39607,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
object_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -39705,35 +39625,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
zval *dim = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_VAR TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_VAR TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
-
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
/* assign_dim has two opcodes! */
@@ -39750,12 +39665,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_VAR, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (0) {
zval_dtor(value);
}
@@ -39763,13 +39676,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_VAR == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_VAR == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_VAR TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -39818,8 +39725,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
UNEXPECTED(!Z_ISREF_P(variable_ptr))) {
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
}
- if ((IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) ||
- (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET))) {
+ if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) ||
+ (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
if ((IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) ||
@@ -39942,7 +39849,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -40133,6 +40040,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ }
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
SEPARATE_ZVAL_NOREF(container);
@@ -40211,7 +40121,6 @@ numeric_index_dim:
zval_ptr_dtor_nogc(free_op2.var);
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -40232,7 +40141,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ 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);
@@ -40424,7 +40333,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -40518,7 +40427,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else {
zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -40637,7 +40546,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
zval *value;
int have_get_ptr = 0;
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -40730,7 +40639,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*b
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
@@ -40745,7 +40654,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*b
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -40797,7 +40706,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binar
value = NULL;
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -41032,8 +40941,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -41053,8 +40961,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
/* break missing intentionally */
case BP_VAR_IS:
- retval = EX_VAR(opline->result.var);
- ZVAL_NULL(retval);
+ retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", name->val);
@@ -41140,7 +41047,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -41166,7 +41073,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
@@ -41223,7 +41130,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
object_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -41241,34 +41148,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN
zval *dim = NULL;
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_UNUSED TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_UNUSED TSRMLS_CC);
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
/* assign_dim has two opcodes! */
@@ -41287,7 +41190,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -41588,7 +41491,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
} else {
zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -41967,7 +41870,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
zval *value;
int have_get_ptr = 0;
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -42060,7 +41963,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binar
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
@@ -42075,7 +41978,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binar
var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
}
- if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -42127,7 +42030,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op
value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
}
@@ -42322,7 +42225,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -42413,7 +42316,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
retval = EX_VAR(opline->result.var);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
@@ -42512,7 +42415,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (EXPECTED(opline->extended_value == 0)) {
@@ -42538,7 +42441,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
@@ -42610,7 +42513,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
@@ -42671,7 +42574,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
container = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
@@ -42696,7 +42599,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
@@ -42757,7 +42660,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
@@ -42783,7 +42686,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(container) == IS_STR_OFFSET)) {
+ 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, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
@@ -42807,7 +42710,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
object = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object) == IS_STR_OFFSET)) {
+ 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, 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);
@@ -42828,7 +42731,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
object_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (UNEXPECTED(Z_ISREF_P(object_ptr)) && Z_TYPE_P(Z_REFVAL_P(object_ptr)) == IS_OBJECT) {
@@ -42846,34 +42749,30 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
zval *dim = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
zval *variable_ptr;
- zend_fetch_dimension_address_W(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CV TSRMLS_CC);
+ variable_ptr = zend_fetch_dimension_address_W_str(EX_VAR((opline+1)->op2.var), object_ptr, dim, IS_CV TSRMLS_CC);
- value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
- if (IS_TMP_FREE(free_op_data1)) {
- zval_dtor(value);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_NULL(EX_VAR(opline->result.var));
- }
- FREE_OP_VAR_PTR(free_op_data2);
+ value = get_zval_ptr_deref((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+ if (UNEXPECTED(variable_ptr != NULL)) {
+ zend_assign_to_string_offset(variable_ptr, Z_LVAL_P(EX_VAR((opline+1)->op2.var)), value, (opline+1)->op1_type, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
} else {
- if ((opline+1)->op1_type == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if ((opline+1)->op1_type == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
+ if (UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_TMP_FREE(free_op_data1)) {
+ zval_dtor(value);
+ }
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
} else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
- if (RETURN_VALUE_USED(opline)) {
- ZVAL_COPY(EX_VAR(opline->result.var), value);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), value);
+ }
+ FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_VAR_PTR(free_op_data2);
}
- FREE_OP_IF_VAR(free_op_data1);
+ FREE_OP_IF_VAR(free_op_data1);
}
/* assign_dim has two opcodes! */
@@ -42890,12 +42789,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET)) {
- zend_assign_to_string_offset(variable_ptr, value, IS_CV, (RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
- } else if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
+ if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (0) {
zval_dtor(value);
}
@@ -42903,13 +42800,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- if (IS_CV == IS_TMP_VAR) {
- value = zend_assign_tmp_to_variable(variable_ptr, value TSRMLS_CC);
- } else if (IS_CV == IS_CONST) {
- value = zend_assign_const_to_variable(variable_ptr, value TSRMLS_CC);
- } else {
- value = zend_assign_to_variable(variable_ptr, value TSRMLS_CC);
- }
+ value = zend_assign_to_variable(variable_ptr, value, IS_CV TSRMLS_CC);
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -42957,8 +42848,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
UNEXPECTED(!Z_ISREF_P(variable_ptr))) {
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
}
- if ((IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) ||
- (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(variable_ptr) == IS_STR_OFFSET))) {
+ if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) ||
+ (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
if ((IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) ||
@@ -43078,7 +42969,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
ZVAL_MAKE_REF(expr_ptr);
@@ -43197,6 +43088,9 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ }
if (IS_CV != IS_UNUSED) {
ZVAL_DEREF(container);
SEPARATE_ZVAL_NOREF(container);
@@ -43275,7 +43169,6 @@ numeric_index_dim:
break;
case IS_STRING:
- case IS_STR_OFFSET:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
@@ -43296,7 +43189,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && Z_TYPE_P(container) == IS_STR_OFFSET) {
+ if (IS_CV == 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);
@@ -43408,7 +43301,7 @@ num_index_prop:
}
}
if (Z_TYPE_P(offset) == IS_LONG) {
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
+ if (offset->value.lval >= 0 && (size_t)offset->value.lval < Z_STRLEN_P(container)) {
if ((opline->extended_value & ZEND_ISSET) ||
Z_STRVAL_P(container)[offset->value.lval] != '0') {
result = 1;
@@ -43500,7 +43393,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
} else {
zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(value_ptr) == IS_STR_OFFSET)) {
+ if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
}
@@ -47545,56 +47438,56 @@ void zend_init_opcodes_handlers(void)
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CONST_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
- ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
- ZEND_JMP_SET_VAR_SPEC_CV_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
ZEND_DISCARD_EXCEPTION_SPEC_HANDLER,
ZEND_DISCARD_EXCEPTION_SPEC_HANDLER,
ZEND_DISCARD_EXCEPTION_SPEC_HANDLER,
diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c
index 729f922963..8d86ce23f1 100644
--- a/Zend/zend_vm_opcodes.c
+++ b/Zend/zend_vm_opcodes.c
@@ -179,8 +179,8 @@ const char *zend_vm_opcodes_map[169] = {
"ZEND_ADD_TRAIT",
"ZEND_BIND_TRAITS",
"ZEND_SEPARATE",
- "ZEND_QM_ASSIGN_VAR",
- "ZEND_JMP_SET_VAR",
+ NULL,
+ NULL,
"ZEND_DISCARD_EXCEPTION",
"ZEND_YIELD",
"ZEND_GENERATOR_RETURN",
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index 9274d3e044..70721b874b 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -170,8 +170,6 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
#define ZEND_ADD_TRAIT 154
#define ZEND_BIND_TRAITS 155
#define ZEND_SEPARATE 156
-#define ZEND_QM_ASSIGN_VAR 157
-#define ZEND_JMP_SET_VAR 158
#define ZEND_DISCARD_EXCEPTION 159
#define ZEND_YIELD 160
#define ZEND_GENERATOR_RETURN 161
diff --git a/build/build.mk b/build/build.mk
index 5dd81ee0e9..007f081f19 100644
--- a/build/build.mk
+++ b/build/build.mk
@@ -1,5 +1,5 @@
# +----------------------------------------------------------------------+
-# | PHP Version 5 |
+# | PHP Version 7 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2014 The PHP Group |
# +----------------------------------------------------------------------+
diff --git a/build/build2.mk b/build/build2.mk
index be103fc322..2d9e684ec0 100644
--- a/build/build2.mk
+++ b/build/build2.mk
@@ -1,5 +1,5 @@
# +----------------------------------------------------------------------+
-# | PHP Version 5 |
+# | PHP Version 7 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2007 The PHP Group |
# +----------------------------------------------------------------------+
diff --git a/build/buildcheck.sh b/build/buildcheck.sh
index 8ff3531825..f8f827d671 100755
--- a/build/buildcheck.sh
+++ b/build/buildcheck.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# +----------------------------------------------------------------------+
-# | PHP Version 5 |
+# | PHP Version 7 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2007 The PHP Group |
# +----------------------------------------------------------------------+
diff --git a/build/mkdep.awk b/build/mkdep.awk
index 06547c79c1..c1adefe612 100644
--- a/build/mkdep.awk
+++ b/build/mkdep.awk
@@ -1,5 +1,5 @@
# +----------------------------------------------------------------------+
-# | PHP Version 5 |
+# | PHP Version 7 |
# +----------------------------------------------------------------------+
# | Copyright (c) 2000-2006 The PHP Group |
# +----------------------------------------------------------------------+
diff --git a/configure.in b/configure.in
index bef88cd1f7..38b32a5eaf 100644
--- a/configure.in
+++ b/configure.in
@@ -95,10 +95,10 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
-#ifdef HAVE_FINITE
-#define zend_finite(a) finite(a)
-#elif defined(HAVE_ISFINITE) || defined(isfinite)
+#if defined(HAVE_ISFINITE) || defined(isfinite)
#define zend_finite(a) isfinite(a)
+#elif defined(HAVE_FINITE)
+#define zend_finite(a) finite(a)
#elif defined(fpclassify)
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
#else
@@ -787,7 +787,12 @@ if test "$PHP_GCOV" = "yes"; then
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
fi
- ltp_version_list="1.5 1.6 1.7 1.9 1.10"
+ dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
+ ltp_version_min="105"
+ dnl non-working versions, e.g. "1.8 1.18";
+ dnl remove "none" when introducing the first incompatible LTP version an
+ dnl separate any following additions by spaces
+ ltp_version_exclude="1.8"
AC_CHECK_PROG(LTP, lcov, lcov)
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
@@ -797,21 +802,30 @@ if test "$PHP_GCOV" = "yes"; then
if test "$LTP"; then
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
php_cv_ltp_version=invalid
- ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
- for ltp_check_version in $ltp_version_list; do
- if test "$ltp_version" = "$ltp_check_version"; then
- php_cv_ltp_version="$ltp_check_version (ok)"
+ ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
+ if test -n "$ltp_version_vars"; then
+ set $ltp_version_vars
+ ltp_version="${1}.${2}"
+ ltp_version_num="`expr ${1} \* 100 + ${2}`"
+ if test $ltp_version_num -ge $ltp_version_min; then
+ php_cv_ltp_version="$ltp_version (ok)"
+ for ltp_check_version in $ltp_version_exclude; do
+ if test "$ltp_version" = "$ltp_check_version"; then
+ php_cv_ltp_version=invalid
+ break
+ fi
+ done
fi
- done
+ fi
])
else
- ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
+ ltp_msg="To enable code coverage reporting you must have LTP installed"
AC_MSG_ERROR([$ltp_msg])
fi
case $php_cv_ltp_version in
""|invalid[)]
- ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
+ ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
AC_MSG_ERROR([$ltp_msg])
LTP="exit 0;"
;;
@@ -1476,11 +1490,8 @@ PHP_ADD_SOURCES(Zend, \
zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \
zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \
zend_closures.c zend_float.c zend_string.c zend_signal.c zend_generators.c \
- zend_virtual_cwd.c zend_ast.c)
-
-if test -r "$abs_srcdir/Zend/zend_objects.c"; then
- PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c)
-fi
+ zend_virtual_cwd.c zend_ast.c zend_objects.c zend_object_handlers.c zend_objects_API.c \
+ zend_default_classes.c zend_inheritance.c)
dnl Selectively disable optimization due to high RAM usage during
dnl compiling the executor.
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 53d85a541b..7ef30cad5e 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h
index df16410004..12098cff89 100644
--- a/ext/bcmath/php_bcmath.h
+++ b/ext/bcmath/php_bcmath.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index e04a75c1b5..6e6f2a95c3 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -359,12 +359,6 @@ static PHP_FUNCTION(bzread)
}
data = zend_string_alloc(len, 0);
data->len = php_stream_read(stream, data->val, data->len);
-
- if (data->len < 0) {
- zend_string_free(data);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream");
- RETURN_FALSE;
- }
data->val[data->len] = '\0';
RETURN_STR(data);
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c
index b19b46eb57..1c1d6ccfb6 100644
--- a/ext/bz2/bz2_filter.c
+++ b/ext/bz2/bz2_filter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -34,17 +34,17 @@ enum strm_status {
};
typedef struct _php_bz2_filter_data {
- int persistent;
bz_stream strm;
char *inbuf;
- size_t inbuf_len;
char *outbuf;
+ size_t inbuf_len;
size_t outbuf_len;
- /* Decompress options */
- enum strm_status status;
- unsigned int small_footprint : 1;
- unsigned int expect_concatenated : 1;
+ enum strm_status status; /* Decompress option */
+ unsigned int small_footprint : 1; /* Decompress option */
+ unsigned int expect_concatenated : 1; /* Decompress option */
+
+ int persistent;
} php_bz2_filter_data;
/* }}} */
diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h
index ceb151b9e4..6e90e8d67f 100644
--- a/ext/bz2/php_bz2.h
+++ b/ext/bz2/php_bz2.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c
index 31367c66e0..3dd16ce45b 100644
--- a/ext/calendar/cal_unix.c
+++ b/ext/calendar/cal_unix.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index 173cf076e1..50385482a7 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c
index d2b36f981a..b6dc135d33 100644
--- a/ext/calendar/easter.c
+++ b/ext/calendar/easter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 6731ea74aa..2e34cfd03b 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index eb13ba8ccd..ae2c6ee2f0 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index 2de35a58b1..f66119842e 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -272,7 +272,7 @@ static PHP_INI_MH(OnTypeLibFileUpdate)
char *strtok_buf = NULL;
int cached;
- if (!new_value || !new_value[0] || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL) {
+ if (NULL == new_value || !new_value->val[0] || (typelib_file = VCWD_FOPEN(new_value->val, "r"))==NULL) {
return FAILURE;
}
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index 3dec630721..2774593e1c 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c
index f6aa1a1980..a7614673f8 100644
--- a/ext/com_dotnet/com_iterator.c
+++ b/ext/com_dotnet/com_iterator.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c
index d83aeeb188..084a720ea1 100644
--- a/ext/com_dotnet/com_misc.c
+++ b/ext/com_dotnet/com_misc.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index d12120f54f..51cc7e8f1d 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index a1c2f77661..eb80e760c8 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index 2eac10f5a8..881ebfbaea 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index eefa28dd3a..33b1c65c9c 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 36b6e82116..dbd5529f6d 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index 409b8f9956..6112dfb4bf 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -482,7 +482,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
}
/* add the mappings */
- ZVAL_STR(&tmp2, zend_string_copy(name));
+ ZVAL_STR_COPY(&tmp2, name);
pid = zend_hash_next_free_element(disp->dispid_to_name);
zend_hash_index_update(disp->dispid_to_name, pid, &tmp2);
@@ -517,7 +517,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
}
/* add the mappings */
- ZVAL_STR(&tmp2, zend_string_copy(name));
+ ZVAL_STR_COPY(&tmp2, name);
pid = zend_hash_next_free_element(disp->dispid_to_name);
zend_hash_index_update(disp->dispid_to_name, pid, &tmp2);
diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h
index 51f621bd5f..cb60083289 100644
--- a/ext/com_dotnet/php_com_dotnet.h
+++ b/ext/com_dotnet/php_com_dotnet.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index f153883006..c7e3a5ad78 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -104,7 +104,7 @@ PHP_FUNCTION(com_get_active_object);
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC);
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
- int namelen, DISPID *dispid TSRMLS_DC);
+ size_t namelen, DISPID *dispid TSRMLS_DC);
int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC);
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index 8f116b86d3..41d5559c67 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h
index ab5ec44ec4..fc99a58c9b 100644
--- a/ext/ctype/php_ctype.h
+++ b/ext/ctype/php_ctype.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c
index 8e66445fb5..6b0e5462a1 100644
--- a/ext/curl/curl_file.c
+++ b/ext/curl/curl_file.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index d3e26bfe17..5c517d71a5 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1832,10 +1832,10 @@ static void _php_curl_set_default_options(php_curl *ch)
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
cainfo = INI_STR("openssl.cafile");
- if (!(cainfo && strlen(cainfo) > 0)) {
+ if (!(cainfo && cainfo[0] != '\0')) {
cainfo = INI_STR("curl.cainfo");
}
- if (cainfo && strlen(cainfo) > 0) {
+ if (cainfo && cainfo[0] != '\0') {
curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo);
}
@@ -2462,7 +2462,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
zval *current;
HashTable *postfields;
zend_string *string_key;
- ulong num_key;
+ zend_ulong num_key;
struct HttpPost *first = NULL;
struct HttpPost *last = NULL;
@@ -2534,11 +2534,11 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
"The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead");
name = estrndup(postval, Z_STRLEN_P(current));
- if ((type = php_memnstr(name, ";type=", sizeof(";type=") - 1,
+ if ((type = (char *)php_memnstr(name, ";type=", sizeof(";type=") - 1,
name + Z_STRLEN_P(current)))) {
*type = '\0';
}
- if ((filename = php_memnstr(name, ";filename=", sizeof(";filename=") - 1,
+ if ((filename = (char *)php_memnstr(name, ";filename=", sizeof(";filename=") - 1,
name + Z_STRLEN_P(current)))) {
*filename = '\0';
}
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index 72cfd29ca7..d9e6df2c98 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h
index c75d7f80d1..cc96a410f3 100644
--- a/ext/curl/php_curl.h
+++ b/ext/curl/php_curl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/curl/share.c b/ext/curl/share.c
index 90c869df02..94694e0b2e 100644
--- a/ext/curl/share.c
+++ b/ext/curl/share.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt
index 103f1cf692..d82fe6f41a 100644
--- a/ext/curl/tests/check_win_config.phpt
+++ b/ext/curl/tests/check_win_config.phpt
@@ -28,7 +28,7 @@ Features
AsynchDNS => Yes
CharConv => No
Debug => No
-GSS-Negotiate => Yes
+GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
diff --git a/ext/date/lib/astro.c b/ext/date/lib/astro.c
index 7f51c71d92..84e8a40021 100644
--- a/ext/date/lib/astro.c
+++ b/ext/date/lib/astro.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c
index a77fdd7182..1739566728 100644
--- a/ext/date/lib/dow.c
+++ b/ext/date/lib/dow.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c
index 86e98ea744..58a185d3be 100644
--- a/ext/date/lib/interval.c
+++ b/ext/date/lib/interval.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index 6c4819bde8..2a615559f6 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -2,7 +2,7 @@
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index c5cb15f797..cb5df16251 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
index f8a781a363..3b7580f9d1 100644
--- a/ext/date/lib/parse_iso_intervals.c
+++ b/ext/date/lib/parse_iso_intervals.c
@@ -2,7 +2,7 @@
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index efd822e84e..097488ec57 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index e7a31dd142..a503f9e01e 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 716975a90f..ea88a2256a 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -71,10 +71,11 @@ timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel)
void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr)
{
unsigned int i;
+ size_t tz_abbr_len = strlen(tz_abbr);
TIMELIB_TIME_FREE(tm->tz_abbr);
tm->tz_abbr = strdup(tz_abbr);
- for (i = 0; i < strlen(tz_abbr); i++) {
+ for (i = 0; i < tz_abbr_len; i++) {
tm->tz_abbr[i] = toupper(tz_abbr[i]);
}
}
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index 89c9dcbc2d..b7c49888cb 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
index e5780f6cca..3f9f5b07e7 100644
--- a/ext/date/lib/timelib_structs.h
+++ b/ext/date/lib/timelib_structs.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -173,10 +173,10 @@ typedef struct timelib_error_message {
} timelib_error_message;
typedef struct timelib_error_container {
- int warning_count;
+ struct timelib_error_message *error_messages;
struct timelib_error_message *warning_messages;
int error_count;
- struct timelib_error_message *error_messages;
+ int warning_count;
} timelib_error_container;
typedef struct _timelib_tz_lookup_table {
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index 5423a58d26..a23104f68c 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -30,13 +30,13 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = {
{ "Africa/Khartoum" , 0x001670 },
{ "Africa/Kigali" , 0x001783 },
{ "Africa/Kinshasa" , 0x0017D8 },
- { "Africa/Lagos" , 0x001833 },
- { "Africa/Libreville" , 0x001888 },
- { "Africa/Lome" , 0x0018DD },
- { "Africa/Luanda" , 0x001932 },
- { "Africa/Lubumbashi" , 0x001987 },
- { "Africa/Lusaka" , 0x0019E2 },
- { "Africa/Malabo" , 0x001A37 },
+ { "Africa/Lagos" , 0x001844 },
+ { "Africa/Libreville" , 0x001899 },
+ { "Africa/Lome" , 0x0018EE },
+ { "Africa/Luanda" , 0x001943 },
+ { "Africa/Lubumbashi" , 0x001998 },
+ { "Africa/Lusaka" , 0x0019F3 },
+ { "Africa/Malabo" , 0x001A48 },
{ "Africa/Maputo" , 0x001A9D },
{ "Africa/Maseru" , 0x001AF2 },
{ "Africa/Mbabane" , 0x001B5A },
@@ -45,545 +45,545 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = {
{ "Africa/Nairobi" , 0x001C71 },
{ "Africa/Ndjamena" , 0x001CF0 },
{ "Africa/Niamey" , 0x001D5C },
- { "Africa/Nouakchott" , 0x001DCF },
- { "Africa/Ouagadougou" , 0x001E24 },
- { "Africa/Porto-Novo" , 0x001E79 },
- { "Africa/Sao_Tome" , 0x001EDF },
- { "Africa/Timbuktu" , 0x001F34 },
- { "Africa/Tripoli" , 0x001F89 },
- { "Africa/Tunis" , 0x002092 },
- { "Africa/Windhoek" , 0x0021A4 },
- { "America/Adak" , 0x0023EB },
- { "America/Anchorage" , 0x002761 },
- { "America/Anguilla" , 0x002AD5 },
- { "America/Antigua" , 0x002B2A },
- { "America/Araguaina" , 0x002B90 },
- { "America/Argentina/Buenos_Aires" , 0x002CF5 },
- { "America/Argentina/Catamarca" , 0x002EA3 },
- { "America/Argentina/ComodRivadavia" , 0x003064 },
- { "America/Argentina/Cordoba" , 0x00320A },
- { "America/Argentina/Jujuy" , 0x0033DF },
- { "America/Argentina/La_Rioja" , 0x003593 },
- { "America/Argentina/Mendoza" , 0x00374B },
- { "America/Argentina/Rio_Gallegos" , 0x00390B },
- { "America/Argentina/Salta" , 0x003AC0 },
- { "America/Argentina/San_Juan" , 0x003C6C },
- { "America/Argentina/San_Luis" , 0x003E24 },
- { "America/Argentina/Tucuman" , 0x003FEA },
- { "America/Argentina/Ushuaia" , 0x0041A6 },
- { "America/Aruba" , 0x004361 },
- { "America/Asuncion" , 0x0043C7 },
- { "America/Atikokan" , 0x0046AC },
- { "America/Atka" , 0x004782 },
- { "America/Bahia" , 0x004AE8 },
- { "America/Bahia_Banderas" , 0x004C7B },
- { "America/Barbados" , 0x004EF4 },
- { "America/Belem" , 0x004F8E },
- { "America/Belize" , 0x005089 },
- { "America/Blanc-Sablon" , 0x005205 },
- { "America/Boa_Vista" , 0x0052B9 },
- { "America/Bogota" , 0x0053C2 },
- { "America/Boise" , 0x00542E },
- { "America/Buenos_Aires" , 0x0057C5 },
- { "America/Cambridge_Bay" , 0x00595E },
- { "America/Campo_Grande" , 0x005C86 },
- { "America/Cancun" , 0x005F75 },
- { "America/Caracas" , 0x0061B7 },
- { "America/Catamarca" , 0x00621E },
- { "America/Cayenne" , 0x0063C4 },
- { "America/Cayman" , 0x006426 },
- { "America/Chicago" , 0x00647B },
- { "America/Chihuahua" , 0x006992 },
- { "America/Coral_Harbour" , 0x006BFD },
- { "America/Cordoba" , 0x006C8F },
- { "America/Costa_Rica" , 0x006E35 },
- { "America/Creston" , 0x006EBF },
- { "America/Cuiaba" , 0x006F4B },
- { "America/Curacao" , 0x007229 },
- { "America/Danmarkshavn" , 0x00728F },
- { "America/Dawson" , 0x0073D3 },
- { "America/Dawson_Creek" , 0x0076F0 },
- { "America/Denver" , 0x0078CA },
- { "America/Detroit" , 0x007C50 },
- { "America/Dominica" , 0x007FAF },
- { "America/Edmonton" , 0x008004 },
- { "America/Eirunepe" , 0x0083BC },
- { "America/El_Salvador" , 0x0084D4 },
- { "America/Ensenada" , 0x008549 },
- { "America/Fort_Wayne" , 0x0089F0 },
- { "America/Fortaleza" , 0x0088B2 },
- { "America/Glace_Bay" , 0x008C5A },
- { "America/Godthab" , 0x008FD1 },
- { "America/Goose_Bay" , 0x009295 },
- { "America/Grand_Turk" , 0x009752 },
- { "America/Grenada" , 0x009A01 },
- { "America/Guadeloupe" , 0x009A56 },
- { "America/Guatemala" , 0x009AAB },
- { "America/Guayaquil" , 0x009B34 },
- { "America/Guyana" , 0x009B91 },
- { "America/Halifax" , 0x009C12 },
- { "America/Havana" , 0x00A128 },
- { "America/Hermosillo" , 0x00A49B },
- { "America/Indiana/Indianapolis" , 0x00A579 },
- { "America/Indiana/Knox" , 0x00A80A },
- { "America/Indiana/Marengo" , 0x00ABA1 },
- { "America/Indiana/Petersburg" , 0x00AE47 },
- { "America/Indiana/Tell_City" , 0x00B394 },
- { "America/Indiana/Vevay" , 0x00B62D },
- { "America/Indiana/Vincennes" , 0x00B868 },
- { "America/Indiana/Winamac" , 0x00BB1C },
- { "America/Indianapolis" , 0x00B12A },
- { "America/Inuvik" , 0x00BDD5 },
- { "America/Iqaluit" , 0x00C0CC },
- { "America/Jamaica" , 0x00C3EE },
- { "America/Jujuy" , 0x00C4B3 },
- { "America/Juneau" , 0x00C65D },
- { "America/Kentucky/Louisville" , 0x00C9DB },
- { "America/Kentucky/Monticello" , 0x00CDF9 },
- { "America/Knox_IN" , 0x00D17E },
- { "America/Kralendijk" , 0x00D4EF },
- { "America/La_Paz" , 0x00D555 },
- { "America/Lima" , 0x00D5BC },
- { "America/Los_Angeles" , 0x00D664 },
- { "America/Louisville" , 0x00DA75 },
- { "America/Lower_Princes" , 0x00DE6A },
- { "America/Maceio" , 0x00DED0 },
- { "America/Managua" , 0x00E00A },
- { "America/Manaus" , 0x00E0BD },
- { "America/Marigot" , 0x00E1BF },
- { "America/Martinique" , 0x00E214 },
- { "America/Matamoros" , 0x00E280 },
- { "America/Mazatlan" , 0x00E4D9 },
- { "America/Mendoza" , 0x00E746 },
- { "America/Menominee" , 0x00E8FA },
- { "America/Merida" , 0x00EC7B },
- { "America/Metlakatla" , 0x00EEB6 },
- { "America/Mexico_City" , 0x00EFF1 },
- { "America/Miquelon" , 0x00F26C },
- { "America/Moncton" , 0x00F4DE },
- { "America/Monterrey" , 0x00F975 },
- { "America/Montevideo" , 0x00FBD8 },
- { "America/Montreal" , 0x00FEEA },
- { "America/Montserrat" , 0x0103DA },
- { "America/Nassau" , 0x01042F },
- { "America/New_York" , 0x010774 },
- { "America/Nipigon" , 0x010C7F },
- { "America/Nome" , 0x010FD0 },
- { "America/Noronha" , 0x01134E },
- { "America/North_Dakota/Beulah" , 0x01147E },
- { "America/North_Dakota/Center" , 0x011812 },
- { "America/North_Dakota/New_Salem" , 0x011BA6 },
- { "America/Ojinaga" , 0x011F4F },
- { "America/Panama" , 0x0121B0 },
- { "America/Pangnirtung" , 0x012205 },
- { "America/Paramaribo" , 0x01253B },
- { "America/Phoenix" , 0x0125CD },
- { "America/Port-au-Prince" , 0x01268B },
- { "America/Port_of_Spain" , 0x0129AF },
- { "America/Porto_Acre" , 0x0128AB },
- { "America/Porto_Velho" , 0x012A04 },
- { "America/Puerto_Rico" , 0x012AFA },
- { "America/Rainy_River" , 0x012B65 },
- { "America/Rankin_Inlet" , 0x012E9D },
- { "America/Recife" , 0x013183 },
- { "America/Regina" , 0x0132AD },
- { "America/Resolute" , 0x01346B },
- { "America/Rio_Branco" , 0x013753 },
- { "America/Rosario" , 0x01385B },
- { "America/Santa_Isabel" , 0x013A01 },
- { "America/Santarem" , 0x013DA4 },
- { "America/Santiago" , 0x013EA9 },
- { "America/Santo_Domingo" , 0x014252 },
- { "America/Sao_Paulo" , 0x014318 },
- { "America/Scoresbysund" , 0x014627 },
- { "America/Shiprock" , 0x014915 },
- { "America/Sitka" , 0x014C8E },
- { "America/St_Barthelemy" , 0x015016 },
- { "America/St_Johns" , 0x01506B },
- { "America/St_Kitts" , 0x0155BE },
- { "America/St_Lucia" , 0x015613 },
- { "America/St_Thomas" , 0x015668 },
- { "America/St_Vincent" , 0x0156BD },
- { "America/Swift_Current" , 0x015712 },
- { "America/Tegucigalpa" , 0x015833 },
- { "America/Thule" , 0x0158B2 },
- { "America/Thunder_Bay" , 0x015AF9 },
- { "America/Tijuana" , 0x015E42 },
- { "America/Toronto" , 0x0161DB },
- { "America/Tortola" , 0x0166FB },
- { "America/Vancouver" , 0x016750 },
- { "America/Virgin" , 0x016B8D },
- { "America/Whitehorse" , 0x016BE2 },
- { "America/Winnipeg" , 0x016EFF },
- { "America/Yakutat" , 0x01733F },
- { "America/Yellowknife" , 0x0176AA },
- { "Antarctica/Casey" , 0x0179BA },
- { "Antarctica/Davis" , 0x017A58 },
- { "Antarctica/DumontDUrville" , 0x017AF9 },
- { "Antarctica/Macquarie" , 0x017B8B },
- { "Antarctica/Mawson" , 0x017DD8 },
- { "Antarctica/McMurdo" , 0x017E54 },
- { "Antarctica/Palmer" , 0x0181FF },
- { "Antarctica/Rothera" , 0x01851B },
- { "Antarctica/South_Pole" , 0x018591 },
- { "Antarctica/Syowa" , 0x01890F },
- { "Antarctica/Troll" , 0x01897D },
- { "Antarctica/Vostok" , 0x018B4F },
- { "Arctic/Longyearbyen" , 0x018BC0 },
- { "Asia/Aden" , 0x018EF2 },
- { "Asia/Almaty" , 0x018F47 },
- { "Asia/Amman" , 0x0190C6 },
- { "Asia/Anadyr" , 0x01937C },
- { "Asia/Aqtau" , 0x01957E },
- { "Asia/Aqtobe" , 0x01977D },
- { "Asia/Ashgabat" , 0x019935 },
- { "Asia/Ashkhabad" , 0x019A52 },
- { "Asia/Baghdad" , 0x019B6F },
- { "Asia/Bahrain" , 0x019CE4 },
- { "Asia/Baku" , 0x019D4A },
- { "Asia/Bangkok" , 0x01A032 },
- { "Asia/Beirut" , 0x01A087 },
- { "Asia/Bishkek" , 0x01A394 },
- { "Asia/Brunei" , 0x01A540 },
- { "Asia/Calcutta" , 0x01A5A2 },
- { "Asia/Chita" , 0x01A61B },
- { "Asia/Choibalsan" , 0x01A830 },
- { "Asia/Chongqing" , 0x01A9A9 },
- { "Asia/Chungking" , 0x01AA49 },
- { "Asia/Colombo" , 0x01AAE9 },
- { "Asia/Dacca" , 0x01AB85 },
- { "Asia/Damascus" , 0x01AC2B },
- { "Asia/Dhaka" , 0x01AF7B },
- { "Asia/Dili" , 0x01B021 },
- { "Asia/Dubai" , 0x01B0AB },
- { "Asia/Dushanbe" , 0x01B100 },
- { "Asia/Gaza" , 0x01B203 },
- { "Asia/Harbin" , 0x01B556 },
- { "Asia/Hebron" , 0x01B5F6 },
- { "Asia/Ho_Chi_Minh" , 0x01B952 },
- { "Asia/Hong_Kong" , 0x01B9CA },
- { "Asia/Hovd" , 0x01BB8C },
- { "Asia/Irkutsk" , 0x01BD04 },
- { "Asia/Istanbul" , 0x01BEEF },
- { "Asia/Jakarta" , 0x01C2DC },
- { "Asia/Jayapura" , 0x01C386 },
- { "Asia/Jerusalem" , 0x01C423 },
- { "Asia/Kabul" , 0x01C752 },
- { "Asia/Kamchatka" , 0x01C7A3 },
- { "Asia/Karachi" , 0x01C99C },
- { "Asia/Kashgar" , 0x01CA51 },
- { "Asia/Kathmandu" , 0x01CAA6 },
- { "Asia/Katmandu" , 0x01CB0C },
- { "Asia/Khandyga" , 0x01CB72 },
- { "Asia/Kolkata" , 0x01CD9C },
- { "Asia/Krasnoyarsk" , 0x01CE15 },
- { "Asia/Kuala_Lumpur" , 0x01D002 },
- { "Asia/Kuching" , 0x01D0BF },
- { "Asia/Kuwait" , 0x01D1AD },
- { "Asia/Macao" , 0x01D202 },
- { "Asia/Macau" , 0x01D33D },
- { "Asia/Magadan" , 0x01D478 },
- { "Asia/Makassar" , 0x01D67C },
- { "Asia/Manila" , 0x01D741 },
- { "Asia/Muscat" , 0x01D7C6 },
- { "Asia/Nicosia" , 0x01D81B },
- { "Asia/Novokuznetsk" , 0x01DB03 },
- { "Asia/Novosibirsk" , 0x01DD23 },
- { "Asia/Omsk" , 0x01DF13 },
- { "Asia/Oral" , 0x01E0FF },
- { "Asia/Phnom_Penh" , 0x01E2CF },
- { "Asia/Pontianak" , 0x01E347 },
- { "Asia/Pyongyang" , 0x01E409 },
- { "Asia/Qatar" , 0x01E499 },
- { "Asia/Qyzylorda" , 0x01E4FF },
- { "Asia/Rangoon" , 0x01E6D5 },
- { "Asia/Riyadh" , 0x01E74D },
- { "Asia/Saigon" , 0x01E7A2 },
- { "Asia/Sakhalin" , 0x01E81A },
- { "Asia/Samarkand" , 0x01EA17 },
- { "Asia/Seoul" , 0x01EB4D },
- { "Asia/Shanghai" , 0x01EC14 },
- { "Asia/Singapore" , 0x01ECC0 },
- { "Asia/Srednekolymsk" , 0x01ED77 },
- { "Asia/Taipei" , 0x01EF77 },
- { "Asia/Tashkent" , 0x01F0A8 },
- { "Asia/Tbilisi" , 0x01F1D9 },
- { "Asia/Tehran" , 0x01F393 },
- { "Asia/Tel_Aviv" , 0x01F601 },
- { "Asia/Thimbu" , 0x01F930 },
- { "Asia/Thimphu" , 0x01F996 },
- { "Asia/Tokyo" , 0x01F9FC },
- { "Asia/Ujung_Pandang" , 0x01FA86 },
- { "Asia/Ulaanbaatar" , 0x01FB03 },
- { "Asia/Ulan_Bator" , 0x01FC5E },
- { "Asia/Urumqi" , 0x01FDAB },
- { "Asia/Ust-Nera" , 0x01FE0D },
- { "Asia/Vientiane" , 0x02001F },
- { "Asia/Vladivostok" , 0x020097 },
- { "Asia/Yakutsk" , 0x020281 },
- { "Asia/Yekaterinburg" , 0x02046B },
- { "Asia/Yerevan" , 0x02067B },
- { "Atlantic/Azores" , 0x02087B },
- { "Atlantic/Bermuda" , 0x020D7E },
- { "Atlantic/Canary" , 0x02105F },
- { "Atlantic/Cape_Verde" , 0x021335 },
- { "Atlantic/Faeroe" , 0x0213AE },
- { "Atlantic/Faroe" , 0x021652 },
- { "Atlantic/Jan_Mayen" , 0x0218F6 },
- { "Atlantic/Madeira" , 0x021C28 },
- { "Atlantic/Reykjavik" , 0x022131 },
- { "Atlantic/South_Georgia" , 0x0222EA },
- { "Atlantic/St_Helena" , 0x0224FC },
- { "Atlantic/Stanley" , 0x02232E },
- { "Australia/ACT" , 0x022551 },
- { "Australia/Adelaide" , 0x022874 },
- { "Australia/Brisbane" , 0x022BA6 },
- { "Australia/Broken_Hill" , 0x022C73 },
- { "Australia/Canberra" , 0x022FB7 },
- { "Australia/Currie" , 0x0232DA },
- { "Australia/Darwin" , 0x023613 },
- { "Australia/Eucla" , 0x02369F },
- { "Australia/Hobart" , 0x02377B },
- { "Australia/LHI" , 0x023ADF },
- { "Australia/Lindeman" , 0x023D80 },
- { "Australia/Lord_Howe" , 0x023E67 },
- { "Australia/Melbourne" , 0x024118 },
- { "Australia/North" , 0x024443 },
- { "Australia/NSW" , 0x0244BD },
- { "Australia/Perth" , 0x0247E0 },
- { "Australia/Queensland" , 0x0248BE },
- { "Australia/South" , 0x024970 },
- { "Australia/Sydney" , 0x024C93 },
- { "Australia/Tasmania" , 0x024FD6 },
- { "Australia/Victoria" , 0x025321 },
- { "Australia/West" , 0x025644 },
- { "Australia/Yancowinna" , 0x025700 },
- { "Brazil/Acre" , 0x025A28 },
- { "Brazil/DeNoronha" , 0x025B2C },
- { "Brazil/East" , 0x025C4C },
- { "Brazil/West" , 0x025F29 },
- { "Canada/Atlantic" , 0x026021 },
- { "Canada/Central" , 0x026509 },
- { "Canada/East-Saskatchewan" , 0x026E13 },
- { "Canada/Eastern" , 0x026923 },
- { "Canada/Mountain" , 0x026F9C },
- { "Canada/Newfoundland" , 0x027312 },
- { "Canada/Pacific" , 0x02783D },
- { "Canada/Saskatchewan" , 0x027C56 },
- { "Canada/Yukon" , 0x027DDF },
- { "CET" , 0x0280E2 },
- { "Chile/Continental" , 0x0283EB },
- { "Chile/EasterIsland" , 0x028786 },
- { "CST6CDT" , 0x028AC8 },
- { "Cuba" , 0x028E19 },
- { "EET" , 0x02918C },
- { "Egypt" , 0x02943F },
- { "Eire" , 0x029826 },
- { "EST" , 0x029D37 },
- { "EST5EDT" , 0x029D7B },
- { "Etc/GMT" , 0x02A0CC },
- { "Etc/GMT+0" , 0x02A198 },
- { "Etc/GMT+1" , 0x02A222 },
- { "Etc/GMT+10" , 0x02A2AF },
- { "Etc/GMT+11" , 0x02A33D },
- { "Etc/GMT+12" , 0x02A3CB },
- { "Etc/GMT+2" , 0x02A4E6 },
- { "Etc/GMT+3" , 0x02A572 },
- { "Etc/GMT+4" , 0x02A5FE },
- { "Etc/GMT+5" , 0x02A68A },
- { "Etc/GMT+6" , 0x02A716 },
- { "Etc/GMT+7" , 0x02A7A2 },
- { "Etc/GMT+8" , 0x02A82E },
- { "Etc/GMT+9" , 0x02A8BA },
- { "Etc/GMT-0" , 0x02A154 },
- { "Etc/GMT-1" , 0x02A1DC },
- { "Etc/GMT-10" , 0x02A268 },
- { "Etc/GMT-11" , 0x02A2F6 },
- { "Etc/GMT-12" , 0x02A384 },
- { "Etc/GMT-13" , 0x02A412 },
- { "Etc/GMT-14" , 0x02A459 },
- { "Etc/GMT-2" , 0x02A4A0 },
- { "Etc/GMT-3" , 0x02A52C },
- { "Etc/GMT-4" , 0x02A5B8 },
- { "Etc/GMT-5" , 0x02A644 },
- { "Etc/GMT-6" , 0x02A6D0 },
- { "Etc/GMT-7" , 0x02A75C },
- { "Etc/GMT-8" , 0x02A7E8 },
- { "Etc/GMT-9" , 0x02A874 },
- { "Etc/GMT0" , 0x02A110 },
- { "Etc/Greenwich" , 0x02A900 },
- { "Etc/UCT" , 0x02A944 },
- { "Etc/Universal" , 0x02A988 },
- { "Etc/UTC" , 0x02A9CC },
- { "Etc/Zulu" , 0x02AA10 },
- { "Europe/Amsterdam" , 0x02AA54 },
- { "Europe/Andorra" , 0x02AE92 },
- { "Europe/Athens" , 0x02B10E },
- { "Europe/Belfast" , 0x02B451 },
- { "Europe/Belgrade" , 0x02B988 },
- { "Europe/Berlin" , 0x02BC51 },
- { "Europe/Bratislava" , 0x02BFB5 },
- { "Europe/Brussels" , 0x02C2E7 },
- { "Europe/Bucharest" , 0x02C71E },
- { "Europe/Budapest" , 0x02CA48 },
- { "Europe/Busingen" , 0x02CDB1 },
- { "Europe/Chisinau" , 0x02D068 },
- { "Europe/Copenhagen" , 0x02D3F6 },
- { "Europe/Dublin" , 0x02D700 },
- { "Europe/Gibraltar" , 0x02DC11 },
- { "Europe/Guernsey" , 0x02E068 },
- { "Europe/Helsinki" , 0x02E59F },
- { "Europe/Isle_of_Man" , 0x02E855 },
- { "Europe/Istanbul" , 0x02ED8C },
- { "Europe/Jersey" , 0x02F179 },
- { "Europe/Kaliningrad" , 0x02F6B0 },
- { "Europe/Kiev" , 0x02F91B },
- { "Europe/Lisbon" , 0x02FC37 },
- { "Europe/Ljubljana" , 0x03013B },
- { "Europe/London" , 0x030404 },
- { "Europe/Luxembourg" , 0x03093B },
- { "Europe/Madrid" , 0x030D91 },
- { "Europe/Malta" , 0x031157 },
- { "Europe/Mariehamn" , 0x031510 },
- { "Europe/Minsk" , 0x0317C6 },
- { "Europe/Monaco" , 0x0319D4 },
- { "Europe/Moscow" , 0x031E0F },
- { "Europe/Nicosia" , 0x032069 },
- { "Europe/Oslo" , 0x032351 },
- { "Europe/Paris" , 0x032683 },
- { "Europe/Podgorica" , 0x032AC9 },
- { "Europe/Prague" , 0x032D92 },
- { "Europe/Riga" , 0x0330C4 },
- { "Europe/Rome" , 0x033409 },
- { "Europe/Samara" , 0x0337CC },
- { "Europe/San_Marino" , 0x033A35 },
- { "Europe/Sarajevo" , 0x033DF8 },
- { "Europe/Simferopol" , 0x0340C1 },
- { "Europe/Skopje" , 0x034312 },
- { "Europe/Sofia" , 0x0345DB },
- { "Europe/Stockholm" , 0x0348E3 },
- { "Europe/Tallinn" , 0x034B92 },
- { "Europe/Tirane" , 0x034ECC },
- { "Europe/Tiraspol" , 0x0351D2 },
- { "Europe/Uzhgorod" , 0x035560 },
- { "Europe/Vaduz" , 0x035877 },
- { "Europe/Vatican" , 0x035B26 },
- { "Europe/Vienna" , 0x035EE9 },
- { "Europe/Vilnius" , 0x036216 },
- { "Europe/Volgograd" , 0x036555 },
- { "Europe/Warsaw" , 0x036776 },
- { "Europe/Zagreb" , 0x036B57 },
- { "Europe/Zaporozhye" , 0x036E20 },
- { "Europe/Zurich" , 0x037161 },
- { "Factory" , 0x037410 },
- { "GB" , 0x037481 },
- { "GB-Eire" , 0x0379B8 },
- { "GMT" , 0x037EEF },
- { "GMT+0" , 0x037FBB },
- { "GMT-0" , 0x037F77 },
- { "GMT0" , 0x037F33 },
- { "Greenwich" , 0x037FFF },
- { "Hongkong" , 0x038043 },
- { "HST" , 0x038205 },
- { "Iceland" , 0x038249 },
- { "Indian/Antananarivo" , 0x038402 },
- { "Indian/Chagos" , 0x038476 },
- { "Indian/Christmas" , 0x0384D8 },
- { "Indian/Cocos" , 0x03851C },
- { "Indian/Comoro" , 0x038560 },
- { "Indian/Kerguelen" , 0x0385B5 },
- { "Indian/Mahe" , 0x03860A },
- { "Indian/Maldives" , 0x03865F },
- { "Indian/Mauritius" , 0x0386B4 },
- { "Indian/Mayotte" , 0x03872A },
- { "Indian/Reunion" , 0x03877F },
- { "Iran" , 0x0387D4 },
- { "Israel" , 0x038A42 },
- { "Jamaica" , 0x038D71 },
- { "Japan" , 0x038E36 },
- { "Kwajalein" , 0x038EC0 },
- { "Libya" , 0x038F23 },
- { "MET" , 0x03902C },
- { "Mexico/BajaNorte" , 0x039335 },
- { "Mexico/BajaSur" , 0x03969E },
- { "Mexico/General" , 0x0398E3 },
- { "MST" , 0x039B41 },
- { "MST7MDT" , 0x039B85 },
- { "Navajo" , 0x039ED6 },
- { "NZ" , 0x03A24F },
- { "NZ-CHAT" , 0x03A5CD },
- { "Pacific/Apia" , 0x03A8B1 },
- { "Pacific/Auckland" , 0x03AA4D },
- { "Pacific/Chatham" , 0x03ADD9 },
- { "Pacific/Chuuk" , 0x03B0CC },
- { "Pacific/Easter" , 0x03B125 },
- { "Pacific/Efate" , 0x03B474 },
- { "Pacific/Enderbury" , 0x03B53A },
- { "Pacific/Fakaofo" , 0x03B5A8 },
- { "Pacific/Fiji" , 0x03B5F9 },
- { "Pacific/Funafuti" , 0x03B78C },
- { "Pacific/Galapagos" , 0x03B7D0 },
- { "Pacific/Gambier" , 0x03B848 },
- { "Pacific/Guadalcanal" , 0x03B8AD },
- { "Pacific/Guam" , 0x03B902 },
- { "Pacific/Honolulu" , 0x03B958 },
- { "Pacific/Johnston" , 0x03B9CF },
- { "Pacific/Kiritimati" , 0x03BA4E },
- { "Pacific/Kosrae" , 0x03BAB9 },
- { "Pacific/Kwajalein" , 0x03BB16 },
- { "Pacific/Majuro" , 0x03BB82 },
- { "Pacific/Marquesas" , 0x03BBE1 },
- { "Pacific/Midway" , 0x03BC48 },
- { "Pacific/Nauru" , 0x03BCD2 },
- { "Pacific/Niue" , 0x03BD4A },
- { "Pacific/Norfolk" , 0x03BDA8 },
- { "Pacific/Noumea" , 0x03BDFD },
- { "Pacific/Pago_Pago" , 0x03BE8D },
- { "Pacific/Palau" , 0x03BF04 },
- { "Pacific/Pitcairn" , 0x03BF48 },
- { "Pacific/Pohnpei" , 0x03BF9D },
- { "Pacific/Ponape" , 0x03BFF2 },
- { "Pacific/Port_Moresby" , 0x03C037 },
- { "Pacific/Rarotonga" , 0x03C07B },
- { "Pacific/Saipan" , 0x03C157 },
- { "Pacific/Samoa" , 0x03C1BA },
- { "Pacific/Tahiti" , 0x03C231 },
- { "Pacific/Tarawa" , 0x03C296 },
- { "Pacific/Tongatapu" , 0x03C2EA },
- { "Pacific/Truk" , 0x03C376 },
- { "Pacific/Wake" , 0x03C3BB },
- { "Pacific/Wallis" , 0x03C40B },
- { "Pacific/Yap" , 0x03C44F },
- { "Poland" , 0x03C494 },
- { "Portugal" , 0x03C875 },
- { "PRC" , 0x03CD71 },
- { "PST8PDT" , 0x03CE11 },
- { "ROC" , 0x03D162 },
- { "ROK" , 0x03D293 },
- { "Singapore" , 0x03D35A },
- { "Turkey" , 0x03D411 },
- { "UCT" , 0x03D7FE },
- { "Universal" , 0x03D842 },
- { "US/Alaska" , 0x03D886 },
- { "US/Aleutian" , 0x03DBEF },
- { "US/Arizona" , 0x03DF55 },
- { "US/Central" , 0x03DFE3 },
- { "US/East-Indiana" , 0x03E9ED },
- { "US/Eastern" , 0x03E4EE },
- { "US/Hawaii" , 0x03EC57 },
- { "US/Indiana-Starke" , 0x03ECC8 },
- { "US/Michigan" , 0x03F039 },
- { "US/Mountain" , 0x03F370 },
- { "US/Pacific" , 0x03F6E9 },
- { "US/Pacific-New" , 0x03FAEE },
- { "US/Samoa" , 0x03FEF3 },
- { "UTC" , 0x03FF6A },
- { "W-SU" , 0x040261 },
- { "WET" , 0x03FFAE },
- { "Zulu" , 0x0404A4 },
+ { "Africa/Nouakchott" , 0x001DB1 },
+ { "Africa/Ouagadougou" , 0x001E06 },
+ { "Africa/Porto-Novo" , 0x001E5B },
+ { "Africa/Sao_Tome" , 0x001EB0 },
+ { "Africa/Timbuktu" , 0x001F05 },
+ { "Africa/Tripoli" , 0x001F5A },
+ { "Africa/Tunis" , 0x002063 },
+ { "Africa/Windhoek" , 0x002175 },
+ { "America/Adak" , 0x0023BC },
+ { "America/Anchorage" , 0x002732 },
+ { "America/Anguilla" , 0x002AA6 },
+ { "America/Antigua" , 0x002AFB },
+ { "America/Araguaina" , 0x002B61 },
+ { "America/Argentina/Buenos_Aires" , 0x002CC6 },
+ { "America/Argentina/Catamarca" , 0x002E74 },
+ { "America/Argentina/ComodRivadavia" , 0x003035 },
+ { "America/Argentina/Cordoba" , 0x0031DB },
+ { "America/Argentina/Jujuy" , 0x0033B0 },
+ { "America/Argentina/La_Rioja" , 0x003564 },
+ { "America/Argentina/Mendoza" , 0x00371C },
+ { "America/Argentina/Rio_Gallegos" , 0x0038DC },
+ { "America/Argentina/Salta" , 0x003A91 },
+ { "America/Argentina/San_Juan" , 0x003C3D },
+ { "America/Argentina/San_Luis" , 0x003DF5 },
+ { "America/Argentina/Tucuman" , 0x003FBB },
+ { "America/Argentina/Ushuaia" , 0x004177 },
+ { "America/Aruba" , 0x004332 },
+ { "America/Asuncion" , 0x004398 },
+ { "America/Atikokan" , 0x00467D },
+ { "America/Atka" , 0x004753 },
+ { "America/Bahia" , 0x004AB9 },
+ { "America/Bahia_Banderas" , 0x004C4C },
+ { "America/Barbados" , 0x004EC5 },
+ { "America/Belem" , 0x004F5F },
+ { "America/Belize" , 0x00505A },
+ { "America/Blanc-Sablon" , 0x0051D6 },
+ { "America/Boa_Vista" , 0x00528A },
+ { "America/Bogota" , 0x005393 },
+ { "America/Boise" , 0x0053FF },
+ { "America/Buenos_Aires" , 0x005796 },
+ { "America/Cambridge_Bay" , 0x00592F },
+ { "America/Campo_Grande" , 0x005C57 },
+ { "America/Cancun" , 0x005F46 },
+ { "America/Caracas" , 0x006188 },
+ { "America/Catamarca" , 0x0061EF },
+ { "America/Cayenne" , 0x006395 },
+ { "America/Cayman" , 0x0063F7 },
+ { "America/Chicago" , 0x00644C },
+ { "America/Chihuahua" , 0x006963 },
+ { "America/Coral_Harbour" , 0x006BCE },
+ { "America/Cordoba" , 0x006C60 },
+ { "America/Costa_Rica" , 0x006E06 },
+ { "America/Creston" , 0x006E90 },
+ { "America/Cuiaba" , 0x006F1C },
+ { "America/Curacao" , 0x0071FA },
+ { "America/Danmarkshavn" , 0x007260 },
+ { "America/Dawson" , 0x0073A4 },
+ { "America/Dawson_Creek" , 0x0076C1 },
+ { "America/Denver" , 0x00789B },
+ { "America/Detroit" , 0x007C21 },
+ { "America/Dominica" , 0x007F80 },
+ { "America/Edmonton" , 0x007FD5 },
+ { "America/Eirunepe" , 0x00838D },
+ { "America/El_Salvador" , 0x0084A5 },
+ { "America/Ensenada" , 0x00851A },
+ { "America/Fort_Wayne" , 0x0089C1 },
+ { "America/Fortaleza" , 0x008883 },
+ { "America/Glace_Bay" , 0x008C2B },
+ { "America/Godthab" , 0x008FA2 },
+ { "America/Goose_Bay" , 0x009266 },
+ { "America/Grand_Turk" , 0x009723 },
+ { "America/Grenada" , 0x0098F8 },
+ { "America/Guadeloupe" , 0x00994D },
+ { "America/Guatemala" , 0x0099A2 },
+ { "America/Guayaquil" , 0x009A2B },
+ { "America/Guyana" , 0x009A88 },
+ { "America/Halifax" , 0x009B09 },
+ { "America/Havana" , 0x00A01F },
+ { "America/Hermosillo" , 0x00A392 },
+ { "America/Indiana/Indianapolis" , 0x00A470 },
+ { "America/Indiana/Knox" , 0x00A701 },
+ { "America/Indiana/Marengo" , 0x00AA98 },
+ { "America/Indiana/Petersburg" , 0x00AD3E },
+ { "America/Indiana/Tell_City" , 0x00B28B },
+ { "America/Indiana/Vevay" , 0x00B524 },
+ { "America/Indiana/Vincennes" , 0x00B75F },
+ { "America/Indiana/Winamac" , 0x00BA13 },
+ { "America/Indianapolis" , 0x00B021 },
+ { "America/Inuvik" , 0x00BCCC },
+ { "America/Iqaluit" , 0x00BFC3 },
+ { "America/Jamaica" , 0x00C2E5 },
+ { "America/Jujuy" , 0x00C3AA },
+ { "America/Juneau" , 0x00C554 },
+ { "America/Kentucky/Louisville" , 0x00C8D2 },
+ { "America/Kentucky/Monticello" , 0x00CCF0 },
+ { "America/Knox_IN" , 0x00D075 },
+ { "America/Kralendijk" , 0x00D3E6 },
+ { "America/La_Paz" , 0x00D44C },
+ { "America/Lima" , 0x00D4B3 },
+ { "America/Los_Angeles" , 0x00D55B },
+ { "America/Louisville" , 0x00D96C },
+ { "America/Lower_Princes" , 0x00DD61 },
+ { "America/Maceio" , 0x00DDC7 },
+ { "America/Managua" , 0x00DF01 },
+ { "America/Manaus" , 0x00DFB4 },
+ { "America/Marigot" , 0x00E0B6 },
+ { "America/Martinique" , 0x00E10B },
+ { "America/Matamoros" , 0x00E177 },
+ { "America/Mazatlan" , 0x00E3D0 },
+ { "America/Mendoza" , 0x00E63D },
+ { "America/Menominee" , 0x00E7F1 },
+ { "America/Merida" , 0x00EB72 },
+ { "America/Metlakatla" , 0x00EDAD },
+ { "America/Mexico_City" , 0x00EEE8 },
+ { "America/Miquelon" , 0x00F163 },
+ { "America/Moncton" , 0x00F3D5 },
+ { "America/Monterrey" , 0x00F86C },
+ { "America/Montevideo" , 0x00FACF },
+ { "America/Montreal" , 0x00FDE1 },
+ { "America/Montserrat" , 0x0102D1 },
+ { "America/Nassau" , 0x010326 },
+ { "America/New_York" , 0x01066B },
+ { "America/Nipigon" , 0x010B76 },
+ { "America/Nome" , 0x010EC7 },
+ { "America/Noronha" , 0x011245 },
+ { "America/North_Dakota/Beulah" , 0x011375 },
+ { "America/North_Dakota/Center" , 0x011709 },
+ { "America/North_Dakota/New_Salem" , 0x011A9D },
+ { "America/Ojinaga" , 0x011E46 },
+ { "America/Panama" , 0x0120A7 },
+ { "America/Pangnirtung" , 0x0120FC },
+ { "America/Paramaribo" , 0x012432 },
+ { "America/Phoenix" , 0x0124C4 },
+ { "America/Port-au-Prince" , 0x012582 },
+ { "America/Port_of_Spain" , 0x0128A6 },
+ { "America/Porto_Acre" , 0x0127A2 },
+ { "America/Porto_Velho" , 0x0128FB },
+ { "America/Puerto_Rico" , 0x0129F1 },
+ { "America/Rainy_River" , 0x012A5C },
+ { "America/Rankin_Inlet" , 0x012D94 },
+ { "America/Recife" , 0x01307A },
+ { "America/Regina" , 0x0131A4 },
+ { "America/Resolute" , 0x013362 },
+ { "America/Rio_Branco" , 0x01364A },
+ { "America/Rosario" , 0x013752 },
+ { "America/Santa_Isabel" , 0x0138F8 },
+ { "America/Santarem" , 0x013C9B },
+ { "America/Santiago" , 0x013DA0 },
+ { "America/Santo_Domingo" , 0x014149 },
+ { "America/Sao_Paulo" , 0x01420F },
+ { "America/Scoresbysund" , 0x01451E },
+ { "America/Shiprock" , 0x01480C },
+ { "America/Sitka" , 0x014B85 },
+ { "America/St_Barthelemy" , 0x014F0D },
+ { "America/St_Johns" , 0x014F62 },
+ { "America/St_Kitts" , 0x0154B5 },
+ { "America/St_Lucia" , 0x01550A },
+ { "America/St_Thomas" , 0x01555F },
+ { "America/St_Vincent" , 0x0155B4 },
+ { "America/Swift_Current" , 0x015609 },
+ { "America/Tegucigalpa" , 0x01572A },
+ { "America/Thule" , 0x0157A9 },
+ { "America/Thunder_Bay" , 0x0159F0 },
+ { "America/Tijuana" , 0x015D39 },
+ { "America/Toronto" , 0x0160D2 },
+ { "America/Tortola" , 0x0165F2 },
+ { "America/Vancouver" , 0x016647 },
+ { "America/Virgin" , 0x016A84 },
+ { "America/Whitehorse" , 0x016AD9 },
+ { "America/Winnipeg" , 0x016DF6 },
+ { "America/Yakutat" , 0x017236 },
+ { "America/Yellowknife" , 0x0175A1 },
+ { "Antarctica/Casey" , 0x0178B1 },
+ { "Antarctica/Davis" , 0x01794F },
+ { "Antarctica/DumontDUrville" , 0x0179F0 },
+ { "Antarctica/Macquarie" , 0x017A81 },
+ { "Antarctica/Mawson" , 0x017CCE },
+ { "Antarctica/McMurdo" , 0x017D4A },
+ { "Antarctica/Palmer" , 0x0180F5 },
+ { "Antarctica/Rothera" , 0x018411 },
+ { "Antarctica/South_Pole" , 0x018487 },
+ { "Antarctica/Syowa" , 0x018805 },
+ { "Antarctica/Troll" , 0x018873 },
+ { "Antarctica/Vostok" , 0x018A45 },
+ { "Arctic/Longyearbyen" , 0x018AB6 },
+ { "Asia/Aden" , 0x018DE8 },
+ { "Asia/Almaty" , 0x018E3D },
+ { "Asia/Amman" , 0x018FBC },
+ { "Asia/Anadyr" , 0x019272 },
+ { "Asia/Aqtau" , 0x019474 },
+ { "Asia/Aqtobe" , 0x019673 },
+ { "Asia/Ashgabat" , 0x01982B },
+ { "Asia/Ashkhabad" , 0x019948 },
+ { "Asia/Baghdad" , 0x019A65 },
+ { "Asia/Bahrain" , 0x019BDA },
+ { "Asia/Baku" , 0x019C40 },
+ { "Asia/Bangkok" , 0x019F28 },
+ { "Asia/Beirut" , 0x019F7D },
+ { "Asia/Bishkek" , 0x01A28A },
+ { "Asia/Brunei" , 0x01A436 },
+ { "Asia/Calcutta" , 0x01A498 },
+ { "Asia/Chita" , 0x01A511 },
+ { "Asia/Choibalsan" , 0x01A726 },
+ { "Asia/Chongqing" , 0x01A89F },
+ { "Asia/Chungking" , 0x01A93F },
+ { "Asia/Colombo" , 0x01A9DF },
+ { "Asia/Dacca" , 0x01AA7B },
+ { "Asia/Damascus" , 0x01AB21 },
+ { "Asia/Dhaka" , 0x01AE71 },
+ { "Asia/Dili" , 0x01AF17 },
+ { "Asia/Dubai" , 0x01AFA1 },
+ { "Asia/Dushanbe" , 0x01AFF6 },
+ { "Asia/Gaza" , 0x01B0F9 },
+ { "Asia/Harbin" , 0x01B44C },
+ { "Asia/Hebron" , 0x01B4EC },
+ { "Asia/Ho_Chi_Minh" , 0x01B848 },
+ { "Asia/Hong_Kong" , 0x01B8C0 },
+ { "Asia/Hovd" , 0x01BA82 },
+ { "Asia/Irkutsk" , 0x01BBFA },
+ { "Asia/Istanbul" , 0x01BDE5 },
+ { "Asia/Jakarta" , 0x01C1D2 },
+ { "Asia/Jayapura" , 0x01C27C },
+ { "Asia/Jerusalem" , 0x01C319 },
+ { "Asia/Kabul" , 0x01C648 },
+ { "Asia/Kamchatka" , 0x01C699 },
+ { "Asia/Karachi" , 0x01C892 },
+ { "Asia/Kashgar" , 0x01C947 },
+ { "Asia/Kathmandu" , 0x01C99C },
+ { "Asia/Katmandu" , 0x01CA02 },
+ { "Asia/Khandyga" , 0x01CA68 },
+ { "Asia/Kolkata" , 0x01CC92 },
+ { "Asia/Krasnoyarsk" , 0x01CD0B },
+ { "Asia/Kuala_Lumpur" , 0x01CEF8 },
+ { "Asia/Kuching" , 0x01CFB5 },
+ { "Asia/Kuwait" , 0x01D0A3 },
+ { "Asia/Macao" , 0x01D0F8 },
+ { "Asia/Macau" , 0x01D233 },
+ { "Asia/Magadan" , 0x01D36E },
+ { "Asia/Makassar" , 0x01D572 },
+ { "Asia/Manila" , 0x01D637 },
+ { "Asia/Muscat" , 0x01D6BC },
+ { "Asia/Nicosia" , 0x01D711 },
+ { "Asia/Novokuznetsk" , 0x01D9F9 },
+ { "Asia/Novosibirsk" , 0x01DC19 },
+ { "Asia/Omsk" , 0x01DE09 },
+ { "Asia/Oral" , 0x01DFF5 },
+ { "Asia/Phnom_Penh" , 0x01E1C5 },
+ { "Asia/Pontianak" , 0x01E23D },
+ { "Asia/Pyongyang" , 0x01E2FF },
+ { "Asia/Qatar" , 0x01E38F },
+ { "Asia/Qyzylorda" , 0x01E3F5 },
+ { "Asia/Rangoon" , 0x01E5CB },
+ { "Asia/Riyadh" , 0x01E643 },
+ { "Asia/Saigon" , 0x01E698 },
+ { "Asia/Sakhalin" , 0x01E710 },
+ { "Asia/Samarkand" , 0x01E90D },
+ { "Asia/Seoul" , 0x01EA43 },
+ { "Asia/Shanghai" , 0x01EB0A },
+ { "Asia/Singapore" , 0x01EBB6 },
+ { "Asia/Srednekolymsk" , 0x01EC6D },
+ { "Asia/Taipei" , 0x01EE6D },
+ { "Asia/Tashkent" , 0x01EF9E },
+ { "Asia/Tbilisi" , 0x01F0CF },
+ { "Asia/Tehran" , 0x01F289 },
+ { "Asia/Tel_Aviv" , 0x01F4F7 },
+ { "Asia/Thimbu" , 0x01F826 },
+ { "Asia/Thimphu" , 0x01F88C },
+ { "Asia/Tokyo" , 0x01F8F2 },
+ { "Asia/Ujung_Pandang" , 0x01F97C },
+ { "Asia/Ulaanbaatar" , 0x01F9F9 },
+ { "Asia/Ulan_Bator" , 0x01FB54 },
+ { "Asia/Urumqi" , 0x01FCA1 },
+ { "Asia/Ust-Nera" , 0x01FD03 },
+ { "Asia/Vientiane" , 0x01FF15 },
+ { "Asia/Vladivostok" , 0x01FF8D },
+ { "Asia/Yakutsk" , 0x020177 },
+ { "Asia/Yekaterinburg" , 0x020361 },
+ { "Asia/Yerevan" , 0x020582 },
+ { "Atlantic/Azores" , 0x020782 },
+ { "Atlantic/Bermuda" , 0x020C85 },
+ { "Atlantic/Canary" , 0x020F66 },
+ { "Atlantic/Cape_Verde" , 0x02123C },
+ { "Atlantic/Faeroe" , 0x0212B5 },
+ { "Atlantic/Faroe" , 0x021559 },
+ { "Atlantic/Jan_Mayen" , 0x0217FD },
+ { "Atlantic/Madeira" , 0x021B2F },
+ { "Atlantic/Reykjavik" , 0x022038 },
+ { "Atlantic/South_Georgia" , 0x0221F1 },
+ { "Atlantic/St_Helena" , 0x022403 },
+ { "Atlantic/Stanley" , 0x022235 },
+ { "Australia/ACT" , 0x022458 },
+ { "Australia/Adelaide" , 0x02277B },
+ { "Australia/Brisbane" , 0x022AAD },
+ { "Australia/Broken_Hill" , 0x022B7A },
+ { "Australia/Canberra" , 0x022EBE },
+ { "Australia/Currie" , 0x0231E1 },
+ { "Australia/Darwin" , 0x02351A },
+ { "Australia/Eucla" , 0x0235A6 },
+ { "Australia/Hobart" , 0x023682 },
+ { "Australia/LHI" , 0x0239E6 },
+ { "Australia/Lindeman" , 0x023C87 },
+ { "Australia/Lord_Howe" , 0x023D6E },
+ { "Australia/Melbourne" , 0x02401F },
+ { "Australia/North" , 0x02434A },
+ { "Australia/NSW" , 0x0243C4 },
+ { "Australia/Perth" , 0x0246E7 },
+ { "Australia/Queensland" , 0x0247C5 },
+ { "Australia/South" , 0x024877 },
+ { "Australia/Sydney" , 0x024B9A },
+ { "Australia/Tasmania" , 0x024EDD },
+ { "Australia/Victoria" , 0x025228 },
+ { "Australia/West" , 0x02554B },
+ { "Australia/Yancowinna" , 0x025607 },
+ { "Brazil/Acre" , 0x02592F },
+ { "Brazil/DeNoronha" , 0x025A33 },
+ { "Brazil/East" , 0x025B53 },
+ { "Brazil/West" , 0x025E30 },
+ { "Canada/Atlantic" , 0x025F28 },
+ { "Canada/Central" , 0x026410 },
+ { "Canada/East-Saskatchewan" , 0x026D1A },
+ { "Canada/Eastern" , 0x02682A },
+ { "Canada/Mountain" , 0x026EA3 },
+ { "Canada/Newfoundland" , 0x027219 },
+ { "Canada/Pacific" , 0x027744 },
+ { "Canada/Saskatchewan" , 0x027B5D },
+ { "Canada/Yukon" , 0x027CE6 },
+ { "CET" , 0x027FE9 },
+ { "Chile/Continental" , 0x0282F2 },
+ { "Chile/EasterIsland" , 0x02868D },
+ { "CST6CDT" , 0x0289CF },
+ { "Cuba" , 0x028D20 },
+ { "EET" , 0x029093 },
+ { "Egypt" , 0x029346 },
+ { "Eire" , 0x02972D },
+ { "EST" , 0x029C3E },
+ { "EST5EDT" , 0x029C82 },
+ { "Etc/GMT" , 0x029FD3 },
+ { "Etc/GMT+0" , 0x02A09F },
+ { "Etc/GMT+1" , 0x02A129 },
+ { "Etc/GMT+10" , 0x02A1B6 },
+ { "Etc/GMT+11" , 0x02A244 },
+ { "Etc/GMT+12" , 0x02A2D2 },
+ { "Etc/GMT+2" , 0x02A3ED },
+ { "Etc/GMT+3" , 0x02A479 },
+ { "Etc/GMT+4" , 0x02A505 },
+ { "Etc/GMT+5" , 0x02A591 },
+ { "Etc/GMT+6" , 0x02A61D },
+ { "Etc/GMT+7" , 0x02A6A9 },
+ { "Etc/GMT+8" , 0x02A735 },
+ { "Etc/GMT+9" , 0x02A7C1 },
+ { "Etc/GMT-0" , 0x02A05B },
+ { "Etc/GMT-1" , 0x02A0E3 },
+ { "Etc/GMT-10" , 0x02A16F },
+ { "Etc/GMT-11" , 0x02A1FD },
+ { "Etc/GMT-12" , 0x02A28B },
+ { "Etc/GMT-13" , 0x02A319 },
+ { "Etc/GMT-14" , 0x02A360 },
+ { "Etc/GMT-2" , 0x02A3A7 },
+ { "Etc/GMT-3" , 0x02A433 },
+ { "Etc/GMT-4" , 0x02A4BF },
+ { "Etc/GMT-5" , 0x02A54B },
+ { "Etc/GMT-6" , 0x02A5D7 },
+ { "Etc/GMT-7" , 0x02A663 },
+ { "Etc/GMT-8" , 0x02A6EF },
+ { "Etc/GMT-9" , 0x02A77B },
+ { "Etc/GMT0" , 0x02A017 },
+ { "Etc/Greenwich" , 0x02A807 },
+ { "Etc/UCT" , 0x02A84B },
+ { "Etc/Universal" , 0x02A88F },
+ { "Etc/UTC" , 0x02A8D3 },
+ { "Etc/Zulu" , 0x02A917 },
+ { "Europe/Amsterdam" , 0x02A95B },
+ { "Europe/Andorra" , 0x02AD99 },
+ { "Europe/Athens" , 0x02B015 },
+ { "Europe/Belfast" , 0x02B358 },
+ { "Europe/Belgrade" , 0x02B88F },
+ { "Europe/Berlin" , 0x02BB58 },
+ { "Europe/Bratislava" , 0x02BEBC },
+ { "Europe/Brussels" , 0x02C1EE },
+ { "Europe/Bucharest" , 0x02C625 },
+ { "Europe/Budapest" , 0x02C94F },
+ { "Europe/Busingen" , 0x02CCB8 },
+ { "Europe/Chisinau" , 0x02CF6F },
+ { "Europe/Copenhagen" , 0x02D2FD },
+ { "Europe/Dublin" , 0x02D607 },
+ { "Europe/Gibraltar" , 0x02DB18 },
+ { "Europe/Guernsey" , 0x02DF6F },
+ { "Europe/Helsinki" , 0x02E4A6 },
+ { "Europe/Isle_of_Man" , 0x02E75C },
+ { "Europe/Istanbul" , 0x02EC93 },
+ { "Europe/Jersey" , 0x02F080 },
+ { "Europe/Kaliningrad" , 0x02F5B7 },
+ { "Europe/Kiev" , 0x02F822 },
+ { "Europe/Lisbon" , 0x02FB3E },
+ { "Europe/Ljubljana" , 0x030042 },
+ { "Europe/London" , 0x03030B },
+ { "Europe/Luxembourg" , 0x030842 },
+ { "Europe/Madrid" , 0x030C98 },
+ { "Europe/Malta" , 0x03105E },
+ { "Europe/Mariehamn" , 0x031417 },
+ { "Europe/Minsk" , 0x0316CD },
+ { "Europe/Monaco" , 0x0318DB },
+ { "Europe/Moscow" , 0x031D16 },
+ { "Europe/Nicosia" , 0x031F70 },
+ { "Europe/Oslo" , 0x032258 },
+ { "Europe/Paris" , 0x03258A },
+ { "Europe/Podgorica" , 0x0329D0 },
+ { "Europe/Prague" , 0x032C99 },
+ { "Europe/Riga" , 0x032FCB },
+ { "Europe/Rome" , 0x033310 },
+ { "Europe/Samara" , 0x0336D3 },
+ { "Europe/San_Marino" , 0x03393C },
+ { "Europe/Sarajevo" , 0x033CFF },
+ { "Europe/Simferopol" , 0x033FC8 },
+ { "Europe/Skopje" , 0x034219 },
+ { "Europe/Sofia" , 0x0344E2 },
+ { "Europe/Stockholm" , 0x0347EA },
+ { "Europe/Tallinn" , 0x034A99 },
+ { "Europe/Tirane" , 0x034DD3 },
+ { "Europe/Tiraspol" , 0x0350D9 },
+ { "Europe/Uzhgorod" , 0x035467 },
+ { "Europe/Vaduz" , 0x03577E },
+ { "Europe/Vatican" , 0x035A2D },
+ { "Europe/Vienna" , 0x035DF0 },
+ { "Europe/Vilnius" , 0x03611D },
+ { "Europe/Volgograd" , 0x03645C },
+ { "Europe/Warsaw" , 0x03667D },
+ { "Europe/Zagreb" , 0x036A5E },
+ { "Europe/Zaporozhye" , 0x036D27 },
+ { "Europe/Zurich" , 0x037068 },
+ { "Factory" , 0x037317 },
+ { "GB" , 0x037388 },
+ { "GB-Eire" , 0x0378BF },
+ { "GMT" , 0x037DF6 },
+ { "GMT+0" , 0x037EC2 },
+ { "GMT-0" , 0x037E7E },
+ { "GMT0" , 0x037E3A },
+ { "Greenwich" , 0x037F06 },
+ { "Hongkong" , 0x037F4A },
+ { "HST" , 0x03810C },
+ { "Iceland" , 0x038150 },
+ { "Indian/Antananarivo" , 0x038309 },
+ { "Indian/Chagos" , 0x03837D },
+ { "Indian/Christmas" , 0x0383DF },
+ { "Indian/Cocos" , 0x038423 },
+ { "Indian/Comoro" , 0x038467 },
+ { "Indian/Kerguelen" , 0x0384BC },
+ { "Indian/Mahe" , 0x038511 },
+ { "Indian/Maldives" , 0x038566 },
+ { "Indian/Mauritius" , 0x0385BB },
+ { "Indian/Mayotte" , 0x038631 },
+ { "Indian/Reunion" , 0x038686 },
+ { "Iran" , 0x0386DB },
+ { "Israel" , 0x038949 },
+ { "Jamaica" , 0x038C78 },
+ { "Japan" , 0x038D3D },
+ { "Kwajalein" , 0x038DC7 },
+ { "Libya" , 0x038E2A },
+ { "MET" , 0x038F33 },
+ { "Mexico/BajaNorte" , 0x03923C },
+ { "Mexico/BajaSur" , 0x0395A5 },
+ { "Mexico/General" , 0x0397EA },
+ { "MST" , 0x039A48 },
+ { "MST7MDT" , 0x039A8C },
+ { "Navajo" , 0x039DDD },
+ { "NZ" , 0x03A156 },
+ { "NZ-CHAT" , 0x03A4D4 },
+ { "Pacific/Apia" , 0x03A7B8 },
+ { "Pacific/Auckland" , 0x03A954 },
+ { "Pacific/Chatham" , 0x03ACE0 },
+ { "Pacific/Chuuk" , 0x03AFD3 },
+ { "Pacific/Easter" , 0x03B02C },
+ { "Pacific/Efate" , 0x03B37B },
+ { "Pacific/Enderbury" , 0x03B441 },
+ { "Pacific/Fakaofo" , 0x03B4AF },
+ { "Pacific/Fiji" , 0x03B500 },
+ { "Pacific/Funafuti" , 0x03B693 },
+ { "Pacific/Galapagos" , 0x03B6D7 },
+ { "Pacific/Gambier" , 0x03B74F },
+ { "Pacific/Guadalcanal" , 0x03B7B4 },
+ { "Pacific/Guam" , 0x03B809 },
+ { "Pacific/Honolulu" , 0x03B85F },
+ { "Pacific/Johnston" , 0x03B8D6 },
+ { "Pacific/Kiritimati" , 0x03B955 },
+ { "Pacific/Kosrae" , 0x03B9C0 },
+ { "Pacific/Kwajalein" , 0x03BA1D },
+ { "Pacific/Majuro" , 0x03BA89 },
+ { "Pacific/Marquesas" , 0x03BAE8 },
+ { "Pacific/Midway" , 0x03BB4F },
+ { "Pacific/Nauru" , 0x03BBD9 },
+ { "Pacific/Niue" , 0x03BC51 },
+ { "Pacific/Norfolk" , 0x03BCAF },
+ { "Pacific/Noumea" , 0x03BD04 },
+ { "Pacific/Pago_Pago" , 0x03BD94 },
+ { "Pacific/Palau" , 0x03BE0B },
+ { "Pacific/Pitcairn" , 0x03BE4F },
+ { "Pacific/Pohnpei" , 0x03BEA4 },
+ { "Pacific/Ponape" , 0x03BEF9 },
+ { "Pacific/Port_Moresby" , 0x03BF3E },
+ { "Pacific/Rarotonga" , 0x03BF82 },
+ { "Pacific/Saipan" , 0x03C05E },
+ { "Pacific/Samoa" , 0x03C0C1 },
+ { "Pacific/Tahiti" , 0x03C138 },
+ { "Pacific/Tarawa" , 0x03C19D },
+ { "Pacific/Tongatapu" , 0x03C1F1 },
+ { "Pacific/Truk" , 0x03C27D },
+ { "Pacific/Wake" , 0x03C2C2 },
+ { "Pacific/Wallis" , 0x03C312 },
+ { "Pacific/Yap" , 0x03C356 },
+ { "Poland" , 0x03C39B },
+ { "Portugal" , 0x03C77C },
+ { "PRC" , 0x03CC78 },
+ { "PST8PDT" , 0x03CD18 },
+ { "ROC" , 0x03D069 },
+ { "ROK" , 0x03D19A },
+ { "Singapore" , 0x03D261 },
+ { "Turkey" , 0x03D318 },
+ { "UCT" , 0x03D705 },
+ { "Universal" , 0x03D749 },
+ { "US/Alaska" , 0x03D78D },
+ { "US/Aleutian" , 0x03DAF6 },
+ { "US/Arizona" , 0x03DE5C },
+ { "US/Central" , 0x03DEEA },
+ { "US/East-Indiana" , 0x03E8F4 },
+ { "US/Eastern" , 0x03E3F5 },
+ { "US/Hawaii" , 0x03EB5E },
+ { "US/Indiana-Starke" , 0x03EBCF },
+ { "US/Michigan" , 0x03EF40 },
+ { "US/Mountain" , 0x03F277 },
+ { "US/Pacific" , 0x03F5F0 },
+ { "US/Pacific-New" , 0x03F9F5 },
+ { "US/Samoa" , 0x03FDFA },
+ { "UTC" , 0x03FE71 },
+ { "W-SU" , 0x040168 },
+ { "WET" , 0x03FEB5 },
+ { "Zulu" , 0x0403AB },
};
/* This is a generated file, do not modify */
-const unsigned char timelib_timezone_db_data_builtin[263400] = {
+const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Africa/Abidjan */
@@ -673,8 +673,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Bangui */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x46, 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, 0x92, 0xE6, 0x7D, 0x14,
-0x01, 0x00, 0x00, 0x11, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0xFD, 0xFA, 0x01, 0x2F, 0x03,
0x9D, 0x00, 0x00, 0x00, 0x00,
@@ -689,7 +689,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Bissau */
0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x91, 0xC4, 0x93, 0x1C,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9D, 0x1C,
0x09, 0x67, 0x61, 0x10, 0x01, 0x02, 0xFF, 0xFF, 0xF1, 0x64, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00,
0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x69, 0x28, 0x00, 0xFA,
@@ -706,8 +706,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Brazzaville */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x47, 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, 0x92, 0xE6, 0x80, 0x2C,
-0x01, 0x00, 0x00, 0x0E, 0x54, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0xD1, 0x95, 0x01, 0x29, 0xFA,
0x8D, 0x00, 0x00, 0x00, 0x00,
@@ -911,8 +911,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Douala */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 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, 0x92, 0xE6, 0x85, 0x68,
-0x01, 0x00, 0x00, 0x09, 0x18, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x82, 0x48, 0x01, 0x21, 0x75,
0x90, 0x00, 0x00, 0x00, 0x00,
@@ -1047,11 +1047,12 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Kinshasa */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10,
-0x00, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x82, 0xC4, 0x90, 0x01, 0x2A, 0x01, 0x10,
-0x00, 0x00, 0x00, 0x17, 0x77, 0x65, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, 0x65,
-0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0xC4, 0x90, 0x01, 0x2A, 0x01,
+0x10, 0x00, 0x00, 0x00, 0x17, 0x77, 0x65, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52,
+0x65, 0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F,
/* Africa/Lagos */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1064,8 +1065,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Libreville */
0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x41, 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, 0x92, 0xE6, 0x85, 0xA4,
-0x01, 0x00, 0x00, 0x08, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xE9, 0xFD, 0x01, 0x21, 0x13,
0xE8, 0x00, 0x00, 0x00, 0x00,
@@ -1080,8 +1081,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Luanda */
0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 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, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xC4, 0x78, 0x4C,
-0x01, 0x00, 0x00, 0x0C, 0x34, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x41, 0x4F, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7B, 0xE6, 0xC0, 0x01, 0x26, 0xD9,
0xC5, 0x00, 0x00, 0x00, 0x00,
@@ -1103,12 +1104,11 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Malabo */
0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x51, 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, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x86, 0x44,
-0xF4, 0x9F, 0xBE, 0x80, 0x01, 0x02, 0x00, 0x00, 0x08, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00,
-0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x0D, 0x18, 0x01, 0x20,
-0x0F, 0x7D, 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, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x0D, 0x18, 0x01, 0x20, 0x0F,
+0x7D, 0x00, 0x00, 0x00, 0x00,
/* Africa/Maputo */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1173,13 +1173,11 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Niamey */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x45, 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, 0x0C, 0x92, 0xE6, 0x8C, 0x84,
-0xBC, 0x92, 0xC6, 0x90, 0xED, 0x30, 0x08, 0x80, 0x01, 0x02, 0x03, 0x00, 0x00, 0x01, 0xFC, 0x00,
-0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0E,
-0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0xF4, 0x32, 0x01, 0x15, 0xE3, 0x52, 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, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0xF4, 0x32, 0x01, 0x15, 0xE3,
+0x52, 0x00, 0x00, 0x00, 0x00,
/* Africa/Nouakchott */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1199,12 +1197,11 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Africa/Porto-Novo */
0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4A, 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, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x8C, 0x0C,
-0xBC, 0x92, 0xB8, 0x80, 0x01, 0x02, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00,
-0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x93, 0x38, 0xCD, 0x01, 0x16,
-0xA6, 0xA2, 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, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x93, 0x38, 0xCD, 0x01, 0x16, 0xA6,
+0xA2, 0x00, 0x00, 0x00, 0x00,
/* Africa/Sao_Tome */
0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -3305,8 +3302,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* 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, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF,
+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,
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,28 +3322,15 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
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, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
-0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
-0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
-0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
-0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
-0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
-0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
-0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
-0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
-0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
-0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
-0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 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, 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, 0xFF,
-0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00,
-0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, 0x0A, 0x00, 0x00, 0x00, 0x00,
+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,
/* America/Grenada */
0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -7221,10 +7205,10 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0xDE, 0x34, 0x60, 0x60, 0xE7, 0x3C, 0x02, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x08, 0x7A, 0x7A, 0x7A,
0x00, 0x50, 0x4D, 0x54, 0x00, 0x44, 0x44, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x23, 0x9A, 0x95, 0x01, 0xE8, 0x4E, 0x82, 0x00, 0x00, 0x00, 0x26, 0x44, 0x75, 0x6D, 0x6F,
+0x00, 0x23, 0x9A, 0x95, 0x01, 0xE8, 0x4E, 0x82, 0x00, 0x00, 0x00, 0x25, 0x44, 0x75, 0x6D, 0x6F,
0x6E, 0x74, 0x2D, 0x64, 0x27, 0x55, 0x72, 0x76, 0x69, 0x6C, 0x6C, 0x65, 0x20, 0x53, 0x74, 0x61,
-0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x54, 0x65, 0x72, 0x72, 0x65, 0x20, 0x41, 0x64, 0x65, 0x6C,
-0x69, 0x65,
+0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x41, 0x64, 0x65, 0x6C, 0x69, 0x65, 0x20, 0x4C, 0x61, 0x6E,
+0x64,
/* Antarctica/Macquarie */
0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8076,7 +8060,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1B, 0xCA, 0xDB, 0x86, 0xB0,
0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20,
-0x4A, 0x3B, 0xC4, 0x10, 0x4B, 0x3C, 0xD8, 0x54, 0x01, 0x02, 0x01, 0x03, 0x04, 0x05, 0x04, 0x00,
+0x4A, 0x3B, 0xC4, 0x10, 0x4B, 0x3C, 0xD8, 0x90, 0x01, 0x02, 0x01, 0x03, 0x04, 0x05, 0x04, 0x00,
0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x4D, 0x58, 0x00,
0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54, 0x60, 0x00, 0x12, 0x00, 0x00, 0x62,
0x70, 0x01, 0x16, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00,
@@ -8145,7 +8129,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1B, 0xCA, 0xDB, 0x86, 0xB0,
0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20,
-0x4A, 0x3B, 0xC4, 0x10, 0x4B, 0x3C, 0xD8, 0x54, 0x01, 0x02, 0x01, 0x03, 0x04, 0x05, 0x04, 0x00,
+0x4A, 0x3B, 0xC4, 0x10, 0x4B, 0x3C, 0xD8, 0x90, 0x01, 0x02, 0x01, 0x03, 0x04, 0x05, 0x04, 0x00,
0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x4D, 0x58, 0x00,
0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54, 0x60, 0x00, 0x12, 0x00, 0x00, 0x62,
0x70, 0x01, 0x16, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00,
@@ -8386,7 +8370,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Irkutsk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA2, 0x12, 0x0F, 0xB5,
+0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA2, 0x12, 0x0F, 0xBF,
0xB5, 0xA3, 0xD3, 0x10, 0x15, 0x27, 0x61, 0x80, 0x16, 0x18, 0x95, 0xF0, 0x17, 0x08, 0x95, 0x00,
0x17, 0xF9, 0xC9, 0x70, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80,
0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0,
@@ -8407,7 +8391,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x08,
-0x04, 0x00, 0x00, 0x61, 0xCB, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x7E,
+0x04, 0x00, 0x00, 0x61, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x7E,
0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00,
0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00,
0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x49, 0x4D, 0x54, 0x00, 0x49, 0x52, 0x4B, 0x54, 0x00,
@@ -8691,7 +8675,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Krasnoyarsk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xF9, 0x0D, 0xF8,
+0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xF9, 0x0D, 0xF2,
0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10,
0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90,
0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0,
@@ -8712,7 +8696,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x08,
-0x04, 0x00, 0x00, 0x57, 0x08, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x70,
+0x04, 0x00, 0x00, 0x57, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x70,
0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00,
0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00,
0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00,
@@ -8996,7 +8980,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Omsk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xB3, 0x40, 0xB0,
+0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xB3, 0x40, 0xB6,
0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20,
0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0,
0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0,
@@ -9017,7 +9001,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x08,
-0x04, 0x00, 0x00, 0x44, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62,
+0x04, 0x00, 0x00, 0x44, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62,
0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00,
0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00,
0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4F, 0x4D, 0x53, 0x54, 0x00,
@@ -9201,7 +9185,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Samarkand */
0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x1D, 0xAA, 0x19, 0x85, 0x60,
+0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x1D, 0xAA, 0x19, 0x85, 0x37,
0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20,
0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
@@ -9210,7 +9194,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50,
0x29, 0x60, 0xBE, 0x30, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x06, 0x05,
0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x08, 0x07, 0x09, 0x00, 0x00,
-0x3E, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04,
+0x3E, 0xC9, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04,
0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50,
0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x00, 0x00,
0x54, 0x60, 0x01, 0x18, 0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41,
@@ -9344,7 +9328,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Tbilisi */
0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x19, 0x9A, 0x06,
+0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x19, 0x9A, 0x01,
0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40,
0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0,
0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0,
@@ -9361,7 +9345,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x08, 0x07, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0B,
0x0A, 0x0B, 0x0A, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
-0x0B, 0x0A, 0x08, 0x07, 0x0B, 0x00, 0x00, 0x29, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x0B, 0x0A, 0x08, 0x07, 0x0B, 0x00, 0x00, 0x29, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00,
0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00, 0x38, 0x40, 0x00, 0x05, 0x00, 0x00, 0x38,
0x40, 0x00, 0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0A, 0x00,
0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x14, 0x00, 0x00, 0x2A, 0x30, 0x00,
@@ -9609,7 +9593,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Vladivostok */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA7, 0x59, 0x47, 0x5A,
+0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA7, 0x59, 0x47, 0x5D,
0xB5, 0xA3, 0xB6, 0xF0, 0x15, 0x27, 0x45, 0x60, 0x16, 0x18, 0x79, 0xD0, 0x17, 0x08, 0x78, 0xE0,
0x17, 0xF9, 0xAD, 0x50, 0x18, 0xE9, 0xAC, 0x60, 0x19, 0xDA, 0xE0, 0xD0, 0x1A, 0xCC, 0x31, 0x60,
0x1B, 0xBC, 0x3E, 0x80, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x20, 0x80, 0x1E, 0x8C, 0x11, 0x80,
@@ -9630,7 +9614,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x08,
-0x04, 0x00, 0x00, 0x7B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x9A,
+0x04, 0x00, 0x00, 0x7B, 0xA3, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x9A,
0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00,
0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00,
0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x56, 0x4C, 0x41, 0x54, 0x00,
@@ -9642,7 +9626,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Yakutsk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0xEA, 0x70,
+0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0xEA, 0x5E,
0xB5, 0xA3, 0xC5, 0x00, 0x15, 0x27, 0x53, 0x70, 0x16, 0x18, 0x87, 0xE0, 0x17, 0x08, 0x86, 0xF0,
0x17, 0xF9, 0xBB, 0x60, 0x18, 0xE9, 0xBA, 0x70, 0x19, 0xDA, 0xEE, 0xE0, 0x1A, 0xCC, 0x3F, 0x70,
0x1B, 0xBC, 0x4C, 0x90, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x2E, 0x90, 0x1E, 0x8C, 0x1F, 0x90,
@@ -9663,7 +9647,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x08,
-0x04, 0x00, 0x00, 0x79, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x8C,
+0x04, 0x00, 0x00, 0x79, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x8C,
0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00,
0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00,
0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x59, 0x41, 0x4B, 0x54, 0x00,
@@ -9674,39 +9658,40 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Asia/Yekaterinburg */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x12, 0xAD, 0xE7,
-0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30,
-0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
-0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
-0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
-0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0,
-0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x78, 0xA3, 0x60,
-0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50,
-0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50,
-0x31, 0x5D, 0xA0, 0xD0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0,
-0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x5C, 0x50,
-0x38, 0xDD, 0x28, 0xD0, 0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x20, 0x50,
-0x3C, 0xA6, 0x27, 0x50, 0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xE4, 0x50,
-0x40, 0x65, 0xEB, 0x50, 0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xCD, 0x50, 0x43, 0x63, 0xE2, 0xD0,
-0x44, 0x25, 0xAF, 0x50, 0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x91, 0x50, 0x47, 0x23, 0xA6, 0xD0,
-0x47, 0xEE, 0xAD, 0xD0, 0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x8F, 0xD0, 0x4A, 0xE3, 0x6A, 0xD0,
-0x4B, 0xAE, 0x71, 0xD0, 0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x53, 0xD0, 0x54, 0x4C, 0x01, 0x40,
-0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
-0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x0B, 0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
-0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
-0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0C,
-0x0B, 0x00, 0x00, 0x38, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54,
-0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00,
-0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00,
-0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x00, 0x00, 0x54,
-0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x00, 0x00, 0x54, 0x60, 0x00, 0x15, 0x4C,
-0x4D, 0x54, 0x00, 0x53, 0x56, 0x45, 0x54, 0x00, 0x53, 0x56, 0x45, 0x53, 0x54, 0x00, 0x59, 0x45,
-0x4B, 0x53, 0x54, 0x00, 0x59, 0x45, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1E, 0x9B, 0x5F, 0x09, 0x27,
+0xA1, 0x12, 0xB1, 0xFF, 0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20,
+0x17, 0x08, 0xBF, 0x30, 0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20,
+0x1A, 0xCC, 0x77, 0xB0, 0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0,
+0x1E, 0x8C, 0x57, 0xD0, 0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0,
+0x22, 0x4C, 0x1B, 0xD0, 0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0,
+0x26, 0x0B, 0xDF, 0xD0, 0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60,
+0x29, 0x78, 0xA3, 0x60, 0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50,
+0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50,
+0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xA0, 0xD0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0,
+0x34, 0x52, 0x5D, 0xD0, 0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0,
+0x38, 0x1B, 0x5C, 0x50, 0x38, 0xDD, 0x28, 0xD0, 0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0,
+0x3B, 0xDB, 0x20, 0x50, 0x3C, 0xA6, 0x27, 0x50, 0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50,
+0x3F, 0x9A, 0xE4, 0x50, 0x40, 0x65, 0xEB, 0x50, 0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xCD, 0x50,
+0x43, 0x63, 0xE2, 0xD0, 0x44, 0x25, 0xAF, 0x50, 0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x91, 0x50,
+0x47, 0x23, 0xA6, 0xD0, 0x47, 0xEE, 0xAD, 0xD0, 0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x8F, 0xD0,
+0x4A, 0xE3, 0x6A, 0xD0, 0x4B, 0xAE, 0x71, 0xD0, 0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x53, 0xD0,
+0x54, 0x4C, 0x01, 0x40, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x0C, 0x09, 0x0A,
+0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C,
+0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C,
+0x0B, 0x0C, 0x0B, 0x0C, 0x0D, 0x0C, 0x00, 0x00, 0x38, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x34, 0xC1,
+0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0D, 0x00, 0x00,
+0x46, 0x50, 0x00, 0x08, 0x00, 0x00, 0x46, 0x50, 0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0D,
+0x00, 0x00, 0x46, 0x50, 0x01, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x00, 0x08, 0x00, 0x00, 0x54, 0x60,
+0x01, 0x13, 0x00, 0x00, 0x46, 0x50, 0x00, 0x19, 0x00, 0x00, 0x54, 0x60, 0x01, 0x13, 0x00, 0x00,
+0x46, 0x50, 0x00, 0x19, 0x00, 0x00, 0x54, 0x60, 0x00, 0x19, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4D,
+0x54, 0x00, 0x53, 0x56, 0x45, 0x54, 0x00, 0x53, 0x56, 0x45, 0x53, 0x54, 0x00, 0x59, 0x45, 0x4B,
+0x53, 0x54, 0x00, 0x59, 0x45, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0xE0, 0x13, 0x48, 0x01, 0x6F, 0x20, 0x60, 0x00, 0x00, 0x00, 0x11, 0x4D,
-0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x32, 0x20, 0x2D, 0x20, 0x55, 0x72, 0x61, 0x6C, 0x73,
-
+0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x13, 0x48, 0x01, 0x6F, 0x20, 0x60, 0x00, 0x00, 0x00, 0x11,
+0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x32, 0x20, 0x2D, 0x20, 0x55, 0x72, 0x61, 0x6C,
+0x73,
/* Asia/Yerevan */
0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9746,7 +9731,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Atlantic/Azores */
0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0x91, 0xC1, 0xFC, 0x58,
+0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0x92, 0xE6, 0xA9, 0x58,
0x9B, 0x4B, 0x89, 0x90, 0x9B, 0xFE, 0xE3, 0xA0, 0x9C, 0x9D, 0x09, 0x90, 0x9D, 0xC9, 0x9F, 0x90,
0x9E, 0x7F, 0x8E, 0x90, 0x9F, 0xAA, 0xD3, 0x10, 0xA0, 0x5F, 0x70, 0x90, 0xA1, 0x8C, 0x06, 0x90,
0xA2, 0x41, 0xF5, 0x90, 0xA3, 0x6E, 0x8B, 0x90, 0xA4, 0x23, 0x29, 0x10, 0xA5, 0x4F, 0xBF, 0x10,
@@ -10080,7 +10065,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Atlantic/Madeira */
0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x91, 0xC1, 0xF1, 0x58,
+0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x92, 0xE6, 0x9E, 0x58,
0x9B, 0x4B, 0x7B, 0x80, 0x9B, 0xFE, 0xD5, 0x90, 0x9C, 0x9C, 0xFB, 0x80, 0x9D, 0xC9, 0x91, 0x80,
0x9E, 0x7F, 0x80, 0x80, 0x9F, 0xAA, 0xC5, 0x00, 0xA0, 0x5F, 0x62, 0x80, 0xA1, 0x8B, 0xF8, 0x80,
0xA2, 0x41, 0xE7, 0x80, 0xA3, 0x6E, 0x7D, 0x80, 0xA4, 0x23, 0x1B, 0x00, 0xA5, 0x4F, 0xB1, 0x00,
@@ -13945,7 +13930,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Europe/Lisbon */
0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10,
+0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x1D,
0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70,
0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70,
0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0,
@@ -14015,7 +14000,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7,
-0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
+0x63, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01,
0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C,
0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C,
@@ -14824,8 +14809,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Europe/Riga */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x22, 0x9E, 0xB9, 0x88, 0x04,
-0x9F, 0x84, 0x8F, 0x04, 0xA0, 0x88, 0x46, 0x84, 0xA0, 0xCB, 0x83, 0x04, 0xAD, 0xE7, 0xF1, 0xE4,
+0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x22, 0x9E, 0xB9, 0x87, 0xFE,
+0x9F, 0x84, 0x8E, 0xFE, 0xA0, 0x88, 0x46, 0x7E, 0xA0, 0xCB, 0x82, 0xFE, 0xAD, 0xE7, 0xF1, 0xDE,
0xC8, 0xAF, 0x64, 0x60, 0xCA, 0x62, 0x65, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD0, 0x90, 0x89, 0x70,
0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0,
@@ -14864,8 +14849,8 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
-0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x16, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x24,
-0xAC, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x16, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x24,
+0xB2, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00,
0x00, 0x0E, 0x10, 0x00, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x1C, 0x20, 0x01,
0x14, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00, 0x00, 0x38,
0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00,
@@ -14942,7 +14927,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Europe/Samara */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x2B, 0xA1, 0x00, 0x26, 0x9C,
+0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x2B, 0xA1, 0x00, 0x26, 0xAC,
0xB5, 0xA4, 0x0B, 0x50, 0xBE, 0x4C, 0x26, 0xC0, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30,
0x17, 0x08, 0xCD, 0x40, 0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30,
0x1A, 0xCC, 0x85, 0xC0, 0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0,
@@ -14963,7 +14948,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x09, 0x0B, 0x02, 0x0C, 0x02, 0x0D, 0x0E, 0x0D, 0x0E,
0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0F, 0x10,
-0x0E, 0x00, 0x00, 0x2F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38,
+0x0E, 0x00, 0x00, 0x2E, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38,
0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00,
0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01,
0x14, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x18, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1C, 0x00, 0x00, 0x1C,
@@ -17513,7 +17498,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
/* Portugal */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10,
+0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x1D,
0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70,
0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70,
0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0,
@@ -17583,7 +17568,7 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7,
-0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
+0x63, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01,
0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C,
0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C,
@@ -18545,4 +18530,4 @@ const unsigned char timelib_timezone_db_data_builtin[263400] = {
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.6", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2014.7", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c
index 7231dff093..40fbd6805a 100644
--- a/ext/date/lib/tm2unixtime.c
+++ b/ext/date/lib/tm2unixtime.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c
index 9870313fbc..93c4126d14 100644
--- a/ext/date/lib/unixtime2tm.c
+++ b/ext/date/lib/unixtime2tm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 2a17ab8d54..a93afab59b 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -932,7 +932,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
static PHP_INI_MH(OnUpdate_date_timezone)
{
- if (OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
+ if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
return FAILURE;
}
@@ -959,11 +959,11 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
/* Check config setting for default timezone */
if (!DATEG(default_timezone)) {
/* Special case: ext/date wasn't initialized yet */
- zval ztz;
+ zval *ztz;
- if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz)
- && Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
- return Z_STRVAL(ztz);
+ if (NULL != (ztz = cfg_get_entry("date.timezone", sizeof("date.timezone")))
+ && Z_TYPE_P(ztz) == IS_STRING && Z_STRLEN_P(ztz) > 0 && timelib_timezone_id_is_valid(Z_STRVAL_P(ztz), tzdb)) {
+ return Z_STRVAL_P(ztz);
}
} else if (*DATEG(default_timezone)) {
if (DATEG(timezone_valid) == 1) {
@@ -2220,7 +2220,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
abs(utc_offset / 60),
abs((utc_offset % 60)));
- ZVAL_STR(&zv, tmpstr);
+ ZVAL_NEW_STR(&zv, tmpstr);
}
break;
case TIMELIB_ZONETYPE_ABBR:
@@ -2312,7 +2312,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /*
abs(tzobj->tzi.utc_offset / 60),
abs((tzobj->tzi.utc_offset % 60)));
- ZVAL_STR(&zv, tmpstr);
+ ZVAL_NEW_STR(&zv, tmpstr);
}
break;
case TIMELIB_ZONETYPE_ABBR:
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index ad82666cd7..aa46aa1b6c 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index 6bb98e24b5..5ca29ed276 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -470,19 +470,19 @@ ZEND_INI_MH(OnUpdateDefaultHandler)
{
dba_handler *hptr;
- if (!strlen(new_value)) {
+ if (!new_value->len) {
DBA_G(default_hptr) = NULL;
- return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
- for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value); hptr++);
+ for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value->val); hptr++);
if (!hptr->name) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value->val);
return FAILURE;
}
DBA_G(default_hptr) = hptr;
- return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
PHP_INI_BEGIN()
diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c
index 075aedb0c1..17419dcf2e 100644
--- a/ext/dba/dba_cdb.c
+++ b/ext/dba/dba_cdb.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c
index 8ee5d95f22..66fd58b151 100644
--- a/ext/dba/dba_db1.c
+++ b/ext/dba/dba_db1.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c
index 60aa37f93a..6643eebcde 100644
--- a/ext/dba/dba_db2.c
+++ b/ext/dba/dba_db2.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index 95a1e51fe0..3f31222d9e 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c
index 94a6c95e81..a9752a7bf6 100644
--- a/ext/dba/dba_db4.c
+++ b/ext/dba/dba_db4.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c
index f65a79bcc7..b369f11c70 100644
--- a/ext/dba/dba_dbm.c
+++ b/ext/dba/dba_dbm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c
index ee8eefa652..9be6e9be18 100644
--- a/ext/dba/dba_flatfile.c
+++ b/ext/dba/dba_flatfile.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c
index d2c4a2f367..bea2f4cf58 100644
--- a/ext/dba/dba_gdbm.c
+++ b/ext/dba/dba_gdbm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c
index 6067e99154..aaae690344 100644
--- a/ext/dba/dba_inifile.c
+++ b/ext/dba/dba_inifile.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c
index 417446759c..f7b33efd3f 100644
--- a/ext/dba/dba_ndbm.c
+++ b/ext/dba/dba_ndbm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c
index a32b7e9e97..023e5e9b27 100644
--- a/ext/dba/dba_qdbm.c
+++ b/ext/dba/dba_qdbm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/dba_tcadb.c b/ext/dba/dba_tcadb.c
index 341e99fed6..99c10c2f07 100644
--- a/ext/dba/dba_tcadb.c
+++ b/ext/dba/dba_tcadb.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c
index d8c58372ba..c8caf8b8f2 100644
--- a/ext/dba/libcdb/cdb.c
+++ b/ext/dba/libcdb/cdb.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h
index c6ffd17949..4b4a7ff2ff 100644
--- a/ext/dba/libcdb/cdb.h
+++ b/ext/dba/libcdb/cdb.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c
index 2813336b40..b6236f085e 100644
--- a/ext/dba/libcdb/cdb_make.c
+++ b/ext/dba/libcdb/cdb_make.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h
index d43fceb6d8..d33fcb15da 100644
--- a/ext/dba/libcdb/cdb_make.h
+++ b/ext/dba/libcdb/cdb_make.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c
index d8152d5015..76e1bbeaf2 100644
--- a/ext/dba/libcdb/uint32.c
+++ b/ext/dba/libcdb/uint32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h
index b0e0b44002..5390291953 100644
--- a/ext/dba/libcdb/uint32.h
+++ b/ext/dba/libcdb/uint32.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c
index a1fce218ab..8eae2d2508 100644
--- a/ext/dba/libflatfile/flatfile.c
+++ b/ext/dba/libflatfile/flatfile.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h
index 7e9b1796cd..2cd8db3521 100644
--- a/ext/dba/libflatfile/flatfile.h
+++ b/ext/dba/libflatfile/flatfile.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 218037ebe3..6b64872649 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index e41dac0ca4..9de43b62f5 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h
index d4d4c62c4a..d19000cf0f 100644
--- a/ext/dba/php_dba.h
+++ b/ext/dba/php_dba.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dba/php_tcadb.h b/ext/dba/php_tcadb.h
index b718a172f8..209830a94c 100644
--- a/ext/dba/php_tcadb.h
+++ b/ext/dba/php_tcadb.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 61e1f9675e..7cef0230a4 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -78,7 +78,7 @@ PHP_METHOD(domattr, __construct)
RETURN_FALSE;
}
- nodep = xmlNewProp(NULL, (xmlChar *) name, value);
+ nodep = xmlNewProp(NULL, (xmlChar *) name, (xmlChar *) value);
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
@@ -147,7 +147,7 @@ int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC)
}
if ((content = xmlNodeGetContent((xmlNodePtr) attrp)) != NULL) {
- ZVAL_STRING(retval, content);
+ ZVAL_STRING(retval, (char *) content);
xmlFree(content);
} else {
ZVAL_EMPTY_STRING(retval);
@@ -173,7 +173,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
str = zval_get_string(newval);
- xmlNodeSetContentLen((xmlNodePtr) attrp, str->val, str->len + 1);
+ xmlNodeSetContentLen((xmlNodePtr) attrp, (xmlChar *) str->val, str->len + 1);
zend_string_release(str);
return SUCCESS;
diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c
index a126cec573..82af257c0a 100644
--- a/ext/dom/cdatasection.c
+++ b/ext/dom/cdatasection.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index 45306dde68..aee54bb3d2 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -87,7 +87,7 @@ int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC)
}
if ((content = xmlNodeGetContent(nodep)) != NULL) {
- ZVAL_STRING(retval, content);
+ ZVAL_STRING(retval, (char *) content);
xmlFree(content);
} else {
ZVAL_EMPTY_STRING(retval);
@@ -108,7 +108,7 @@ int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC)
str = zval_get_string(newval);
- xmlNodeSetContentLen(nodep, str->val, str->len + 1);
+ xmlNodeSetContentLen(nodep, (xmlChar *) str->val, str->len + 1);
zend_string_release(str);
return SUCCESS;
@@ -187,7 +187,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
xmlFree(cur);
if (substring) {
- RETVAL_STRING(substring);
+ RETVAL_STRING((char *) substring);
xmlFree(substring);
} else {
RETVAL_EMPTY_STRING();
@@ -223,7 +223,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
}
nodep->properties = NULL;
#else
- xmlTextConcat(nodep, arg, arg_len);
+ xmlTextConcat(nodep, (xmlChar *) arg, arg_len);
#endif
RETURN_TRUE;
}
@@ -268,7 +268,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
xmlFree(cur);
xmlNodeSetContent(node, first);
- xmlNodeAddContent(node, arg);
+ xmlNodeAddContent(node, (xmlChar *) arg);
xmlNodeAddContent(node, second);
xmlFree(first);
@@ -381,7 +381,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
second = xmlUTF8Strsub(cur, offset + count, length - offset);
}
- substring = xmlStrcat(substring, arg);
+ substring = xmlStrcat(substring, (xmlChar *) arg);
substring = xmlStrcat(substring, second);
xmlNodeSetContent(node, substring);
diff --git a/ext/dom/comment.c b/ext/dom/comment.c
index 050c3abf70..9015586fd9 100644
--- a/ext/dom/comment.c
+++ b/ext/dom/comment.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 9fa1dce9cb..133572af3f 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -712,7 +712,7 @@ PHP_FUNCTION(dom_document_create_element)
RETURN_FALSE;
}
- node = xmlNewDocNode(docp, NULL, name, value);
+ node = xmlNewDocNode(docp, NULL, (xmlChar *) name, (xmlChar *) value);
if (!node) {
RETURN_FALSE;
}
@@ -931,7 +931,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
RETURN_FALSE;
}
- node = xmlNewReference(docp, name);
+ node = xmlNewReference(docp, (xmlChar *) name);
if (!node) {
RETURN_FALSE;
}
@@ -1048,9 +1048,9 @@ PHP_FUNCTION(dom_document_create_element_ns)
if (errorcode == 0) {
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
- nodep = xmlNewDocNode (docp, NULL, localname, value);
+ nodep = xmlNewDocNode(docp, NULL, (xmlChar *) localname, (xmlChar *) value);
if (nodep != NULL && uri != NULL) {
- nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri);
+ nsptr = xmlSearchNsByHref(nodep->doc, nodep, (xmlChar *) uri);
if (nsptr == NULL) {
nsptr = dom_get_ns(nodep, uri, &errorcode, prefix);
}
@@ -1113,9 +1113,9 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
if (errorcode == 0) {
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
- nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL);
+ nodep = (xmlNodePtr) xmlNewDocProp(docp, (xmlChar *) localname, NULL);
if (nodep != NULL && uri_len > 0) {
- nsptr = xmlSearchNsByHref (nodep->doc, root, uri);
+ nsptr = xmlSearchNsByHref(nodep->doc, root, (xmlChar *) uri);
if (nsptr == NULL) {
nsptr = dom_get_ns(root, uri, &errorcode, prefix);
}
@@ -1268,7 +1268,7 @@ PHP_METHOD(domdocument, __construct)
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
- docp = xmlNewDoc(version);
+ docp = xmlNewDoc((xmlChar *) version);
if (!docp) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
@@ -1276,7 +1276,7 @@ PHP_METHOD(domdocument, __construct)
}
if (encoding_len > 0) {
- docp->encoding = (const xmlChar*)xmlStrdup(encoding);
+ docp->encoding = (const xmlChar *) xmlStrdup((xmlChar *) encoding);
}
intern = Z_DOMOBJ_P(id);
@@ -1306,8 +1306,8 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
int isFileUri = 0;
uri = xmlCreateURI();
- escsource = xmlURIEscapeStr(source, ":");
- xmlParseURIReference(uri, escsource);
+ escsource = xmlURIEscapeStr((xmlChar *) source, (xmlChar *) ":");
+ xmlParseURIReference(uri, (char *) escsource);
xmlFree(escsource);
if (uri->scheme != NULL) {
@@ -1454,7 +1454,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
}
/* If loading from memory, set the base reference uri for the document */
if (ret && ret->URL == NULL && ctxt->directory != NULL) {
- ret->URL = xmlStrdup(ctxt->directory);
+ ret->URL = xmlStrdup((xmlChar *) ctxt->directory);
}
} else {
ret = NULL;
@@ -1642,7 +1642,7 @@ PHP_FUNCTION(dom_document_savexml)
xmlBufferFree(buf);
RETURN_FALSE;
}
- RETVAL_STRING(mem);
+ RETVAL_STRING((char *) mem);
xmlBufferFree(buf);
} else {
if (options & LIBXML_SAVE_NOEMPTYTAG) {
@@ -1657,7 +1657,7 @@ PHP_FUNCTION(dom_document_savexml)
if (!size) {
RETURN_FALSE;
}
- RETVAL_STRINGL(mem, size);
+ RETVAL_STRINGL((char *) mem, size);
xmlFree(mem);
}
}
@@ -1995,7 +1995,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
if (mode == DOM_LOAD_FILE) {
ctxt = htmlCreateFileParserCtxt(source, NULL);
} else {
- source_len = xmlStrlen(source);
+ source_len = xmlStrlen((xmlChar *) source);
ctxt = htmlCreateMemoryParserCtxt(source, source_len);
}
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index a93b30620c..d3055214f6 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -138,7 +138,7 @@ PHP_METHOD(domdocumentfragment, appendXML) {
}
if (data) {
- err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, data, &lst);
+ err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, (xmlChar *) data, &lst);
if (err != 0) {
RETURN_FALSE;
}
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index 1193ed44d5..08b33242b1 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -204,7 +204,7 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval TSRMLS_D
if (ret_buf.s) {
smart_str_0(&ret_buf);
- ZVAL_STR(retval, ret_buf.s);
+ ZVAL_NEW_STR(retval, ret_buf.s);
return SUCCESS;
}
}
diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h
index 0e1002536e..8e6a64ac85 100644
--- a/ext/dom/dom_ce.h
+++ b/ext/dom/dom_ce.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h
index b05c4aee42..67cf0d199d 100644
--- a/ext/dom/dom_fe.h
+++ b/ext/dom/dom_fe.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index 22d0ab0ee3..ee892f3703 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -218,7 +218,8 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
} else {
goto err;
}
- curnode = dom_get_elements_by_tag_name_ns_raw(basenode, objmap->ns, objmap->local, &previndex, iter->index);
+ curnode = dom_get_elements_by_tag_name_ns_raw(
+ basenode, (char *) objmap->ns, (char *) objmap->local, &previndex, iter->index);
}
}
} else {
@@ -294,7 +295,8 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
} else {
nodep = nodep->children;
}
- curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &curindex, 0);
+ curnode = dom_get_elements_by_tag_name_ns_raw(
+ nodep, (char *) objmap->ns, (char *) objmap->local, &curindex, 0);
}
}
} else {
diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h
index 60551bdca1..7e607f0a2e 100644
--- a/ext/dom/dom_properties.h
+++ b/ext/dom/dom_properties.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c
index 272fda8f8f..4c189606dc 100644
--- a/ext/dom/domconfiguration.c
+++ b/ext/dom/domconfiguration.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c
index cd35b326b7..2214c3f786 100644
--- a/ext/dom/domerror.c
+++ b/ext/dom/domerror.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c
index 78b75fe615..af73819ee1 100644
--- a/ext/dom/domerrorhandler.c
+++ b/ext/dom/domerrorhandler.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c
index b41b83c6cd..4696e87f21 100644
--- a/ext/dom/domexception.c
+++ b/ext/dom/domexception.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index 8614c8b1d9..ea2b784b3c 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -107,14 +107,16 @@ PHP_METHOD(domimplementation, createDocumentType)
RETURN_FALSE;
}
- if (publicid_len > 0)
- pch1 = publicid;
- if (systemid_len > 0)
- pch2 = systemid;
+ if (publicid_len > 0) {
+ pch1 = (xmlChar *) publicid;
+ }
+ if (systemid_len > 0) {
+ pch2 = (xmlChar *) systemid;
+ }
uri = xmlParseURI(name);
if (uri != NULL && uri->opaque != NULL) {
- localname = xmlStrdup(uri->opaque);
+ localname = xmlStrdup((xmlChar *) uri->opaque);
if (xmlStrchr(localname, (xmlChar) ':') != NULL) {
php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
xmlFreeURI(uri);
@@ -122,7 +124,7 @@ PHP_METHOD(domimplementation, createDocumentType)
RETURN_FALSE;
}
} else {
- localname = xmlStrdup(name);
+ localname = xmlStrdup((xmlChar *) name);
}
/* TODO: Test that localname has no invalid chars
@@ -182,7 +184,9 @@ PHP_METHOD(domimplementation, createDocument)
if (name_len > 0) {
errorcode = dom_check_qname(name, &localname, &prefix, 1, name_len);
- if (errorcode == 0 && uri_len > 0 && ((nsptr = xmlNewNs(NULL, uri, prefix)) == NULL)) {
+ if (errorcode == 0 && uri_len > 0
+ && ((nsptr = xmlNewNs(NULL, (xmlChar *) uri, (xmlChar *) prefix)) == NULL)
+ ) {
errorcode = NAMESPACE_ERR;
}
}
@@ -217,7 +221,7 @@ PHP_METHOD(domimplementation, createDocument)
}
if (localname != NULL) {
- nodep = xmlNewDocNode (docp, nsptr, localname, NULL);
+ nodep = xmlNewDocNode(docp, nsptr, (xmlChar *) localname, NULL);
if (!nodep) {
if (doctype != NULL) {
docp->intSubset = NULL;
diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c
index 07479f52eb..b4d20172f0 100644
--- a/ext/dom/domimplementationlist.c
+++ b/ext/dom/domimplementationlist.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c
index 2e8a8d81b2..f3becc6454 100644
--- a/ext/dom/domimplementationsource.c
+++ b/ext/dom/domimplementationsource.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c
index 4e01b3a443..8fdd326fcc 100644
--- a/ext/dom/domlocator.c
+++ b/ext/dom/domlocator.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c
index a12d8633ac..6e8bc05bac 100644
--- a/ext/dom/domstringlist.c
+++ b/ext/dom/domstringlist.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/element.c b/ext/dom/element.c
index b2b8b10fad..0aff19561a 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -201,7 +201,7 @@ PHP_METHOD(domelement, __construct)
}
} else {
/* If you don't pass a namespace uri, then you can't set a prefix */
- localname = xmlSplitQName2((xmlChar *)name, (xmlChar **) &prefix);
+ localname = (char *) xmlSplitQName2((xmlChar *) name, (xmlChar **) &prefix);
if (prefix != NULL) {
xmlFree(localname);
xmlFree(prefix);
diff --git a/ext/dom/entity.c b/ext/dom/entity.c
index 264683e28b..e0625fdd72 100644
--- a/ext/dom/entity.c
+++ b/ext/dom/entity.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -107,7 +107,7 @@ int dom_entity_notation_name_read(dom_object *obj, zval *retval TSRMLS_DC)
if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
ZVAL_NULL(retval);
} else {
- content = xmlNodeGetContent((xmlNodePtr) nodep);
+ content = (char *) xmlNodeGetContent((xmlNodePtr) nodep);
ZVAL_STRING(retval, content);
xmlFree(content);
}
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index c9e7500719..1c3e60e4f1 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -70,7 +70,7 @@ PHP_METHOD(domentityreference, __construct)
RETURN_FALSE;
}
- node = xmlNewReference(NULL, name);
+ node = xmlNewReference(NULL, (xmlChar *) name);
if (!node) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index 39eab7ccdb..ab314851be 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -149,9 +149,9 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
objmap->nodetype == XML_ENTITY_NODE) {
if (objmap->ht) {
if (objmap->nodetype == XML_ENTITY_NODE) {
- itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named);
+ itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, (xmlChar *) named);
} else {
- notep = (xmlNotation *)xmlHashLookup(objmap->ht, named);
+ notep = (xmlNotation *)xmlHashLookup(objmap->ht, (xmlChar *) named);
if (notep) {
itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID);
}
@@ -160,7 +160,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
} else {
nodep = dom_object_get_node(objmap->baseobj);
if (nodep) {
- itemnode = (xmlNodePtr)xmlHasProp(nodep, named);
+ itemnode = (xmlNodePtr)xmlHasProp(nodep, (xmlChar *) named);
}
}
}
@@ -282,9 +282,9 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
objmap->nodetype == XML_ENTITY_NODE) {
if (objmap->ht) {
if (objmap->nodetype == XML_ENTITY_NODE) {
- itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named);
+ itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, (xmlChar *) named);
} else {
- notep = (xmlNotation *)xmlHashLookup(objmap->ht, named);
+ notep = (xmlNotation *)xmlHashLookup(objmap->ht, (xmlChar *) named);
if (notep) {
itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID);
}
@@ -293,7 +293,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
} else {
nodep = dom_object_get_node(objmap->baseobj);
if (nodep) {
- itemnode = (xmlNodePtr)xmlHasNsProp(nodep, named, uri);
+ itemnode = (xmlNodePtr)xmlHasNsProp(nodep, (xmlChar *) named, (xmlChar *) uri);
}
}
}
diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c
index 02b63af9ff..3f0b8e1640 100644
--- a/ext/dom/namelist.c
+++ b/ext/dom/namelist.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 6821348e07..b2079ffda2 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -216,9 +216,9 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
ns = nodep->ns;
if (ns != NULL && ns->prefix) {
qname = xmlStrdup(ns->prefix);
- qname = xmlStrcat(qname, ":");
+ qname = xmlStrcat(qname, (xmlChar *) ":");
qname = xmlStrcat(qname, nodep->name);
- str = qname;
+ str = (char *) qname;
} else {
str = (char *) nodep->name;
}
@@ -226,10 +226,10 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
case XML_NAMESPACE_DECL:
ns = nodep->ns;
if (ns != NULL && ns->prefix) {
- qname = xmlStrdup("xmlns");
- qname = xmlStrcat(qname, ":");
+ qname = xmlStrdup((xmlChar *) "xmlns");
+ qname = xmlStrcat(qname, (xmlChar *) ":");
qname = xmlStrcat(qname, nodep->name);
- str = qname;
+ str = (char *) qname;
} else {
str = (char *) nodep->name;
}
@@ -301,10 +301,10 @@ int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC)
case XML_COMMENT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_PI_NODE:
- str = xmlNodeGetContent(nodep);
+ str = (char *) xmlNodeGetContent(nodep);
break;
case XML_NAMESPACE_DECL:
- str = xmlNodeGetContent(nodep->children);
+ str = (char *) xmlNodeGetContent(nodep->children);
break;
default:
str = NULL;
@@ -344,7 +344,7 @@ int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
case XML_PI_NODE:
{
zend_string *str = zval_get_string(newval);
- xmlNodeSetContentLen(nodep, str->val, str->len + 1);
+ xmlNodeSetContentLen(nodep, (xmlChar *) str->val, str->len + 1);
zend_string_release(str);
break;
}
@@ -725,10 +725,10 @@ int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) {
strURI = (char *) nodep->ns->href;
if (strURI == NULL ||
- (!strcmp (prefix, "xml") && strcmp(strURI, XML_XML_NAMESPACE)) ||
- (nodep->type == XML_ATTRIBUTE_NODE && !strcmp (prefix, "xmlns") &&
- strcmp (strURI, DOM_XMLNS_NAMESPACE)) ||
- (nodep->type == XML_ATTRIBUTE_NODE && !strcmp (nodep->name, "xmlns"))) {
+ (!strcmp(prefix, "xml") && strcmp(strURI, (char *) XML_XML_NAMESPACE)) ||
+ (nodep->type == XML_ATTRIBUTE_NODE && !strcmp(prefix, "xmlns") &&
+ strcmp(strURI, (char *) DOM_XMLNS_NAMESPACE)) ||
+ (nodep->type == XML_ATTRIBUTE_NODE && !strcmp((char *) nodep->name, "xmlns"))) {
ns = NULL;
} else {
curns = nsnode->nsDef;
@@ -831,7 +831,7 @@ int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC)
return FAILURE;
}
- str = xmlNodeGetContent(nodep);
+ str = (char *) xmlNodeGetContent(nodep);
if (str != NULL) {
ZVAL_STRING(retval, str);
@@ -845,6 +845,21 @@ int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC)
int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
{
+ xmlNode *nodep = dom_object_get_node(obj);
+ zend_string *str;
+ xmlChar *enc_str;
+
+ if (nodep == NULL) {
+ php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ return FAILURE;
+ }
+
+ str = zval_get_string(newval);
+ enc_str = xmlEncodeEntitiesReentrant(nodep->doc, (xmlChar *) str->val);
+ xmlNodeSetContent(nodep, enc_str);
+ xmlFree(enc_str);
+ zend_string_release(str);
+
return SUCCESS;
}
@@ -1530,8 +1545,9 @@ PHP_FUNCTION(dom_node_lookup_prefix)
lookupp = nodep->parent;
}
- if (lookupp != NULL && (nsptr = xmlSearchNsByHref(lookupp->doc, lookupp, uri))) {
- if (nsptr->prefix != NULL) {
+ if (lookupp != NULL) {
+ nsptr = xmlSearchNsByHref(lookupp->doc, lookupp, (xmlChar *) uri);
+ if (nsptr && nsptr->prefix != NULL) {
RETURN_STRING((char *) nsptr->prefix);
}
}
@@ -1565,7 +1581,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
if (nodep && uri_len > 0) {
nsptr = xmlSearchNs(nodep->doc, nodep, NULL);
- if (nsptr && xmlStrEqual(nsptr->href, uri)) {
+ if (nsptr && xmlStrEqual(nsptr->href, (xmlChar *) uri)) {
RETURN_TRUE;
}
}
@@ -1584,8 +1600,8 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
xmlNodePtr nodep;
dom_object *intern;
xmlNsPtr nsptr;
- size_t prefix_len = 0;
- char *prefix=NULL;
+ size_t prefix_len;
+ char *prefix;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
return;
@@ -1599,7 +1615,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
}
}
- nsptr = xmlSearchNs(nodep->doc, nodep, prefix);
+ nsptr = xmlSearchNs(nodep->doc, nodep, (xmlChar *) prefix);
if (nsptr && nsptr->href != NULL) {
RETURN_STRING((char *) nsptr->href);
}
@@ -1692,7 +1708,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
if (nodep->type != XML_DOCUMENT_NODE) {
ctxp = xmlXPathNewContext(docp);
ctxp->node = nodep;
- xpathobjp = xmlXPathEvalExpression("(.//. | .//@* | .//namespace::*)", ctxp);
+ xpathobjp = xmlXPathEvalExpression((xmlChar *) "(.//. | .//@* | .//namespace::*)", ctxp);
ctxp->node = NULL;
if (xpathobjp && xpathobjp->type == XPATH_NODESET) {
nodeset = xpathobjp->nodesetval;
@@ -1730,13 +1746,13 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(tmp), prefix, tmpns) {
if (Z_TYPE_P(tmpns) == IS_STRING) {
if (prefix) {
- xmlXPathRegisterNs(ctxp, prefix->val, Z_STRVAL_P(tmpns));
+ xmlXPathRegisterNs(ctxp, (xmlChar *) prefix->val, (xmlChar *) Z_STRVAL_P(tmpns));
}
}
} ZEND_HASH_FOREACH_END();
}
- xpathobjp = xmlXPathEvalExpression(xquery, ctxp);
+ xpathobjp = xmlXPathEvalExpression((xmlChar *) xquery, ctxp);
ctxp->node = NULL;
if (xpathobjp && xpathobjp->type == XPATH_NODESET) {
nodeset = xpathobjp->nodesetval;
@@ -1759,7 +1775,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
sizeof(xmlChar *), 0);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
if (Z_TYPE_P(tmpns) == IS_STRING) {
- inclusive_ns_prefixes[nscount++] = Z_STRVAL_P(tmpns);
+ inclusive_ns_prefixes[nscount++] = (xmlChar *) Z_STRVAL_P(tmpns);
}
} ZEND_HASH_FOREACH_END();
inclusive_ns_prefixes[nscount] = NULL;
@@ -1849,7 +1865,7 @@ PHP_METHOD(domnode, getNodePath)
DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern);
- value = xmlGetNodePath(nodep);
+ value = (char *) xmlGetNodePath(nodep);
if (value == NULL) {
RETURN_NULL();
} else {
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index 965f4c7878..68292d1983 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -84,7 +84,8 @@ int dom_nodelist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
} else {
nodep = nodep->children;
}
- curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, -1);
+ curnode = dom_get_elements_by_tag_name_ns_raw(
+ nodep, (char *) objmap->ns, (char *) objmap->local, &count, -1);
}
}
}
@@ -152,7 +153,8 @@ PHP_FUNCTION(dom_nodelist_item)
} else {
nodep = nodep->children;
}
- itemnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, index);
+ itemnode = dom_get_elements_by_tag_name_ns_raw(
+ nodep, (char *) objmap->ns, (char *) objmap->local, &count, index);
}
}
}
diff --git a/ext/dom/notation.c b/ext/dom/notation.c
index dc63f1516d..b26608adcf 100644
--- a/ext/dom/notation.c
+++ b/ext/dom/notation.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 7f1c19bd0e..8a00ad5a08 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index 628a19e978..9162031a90 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index 78929214ec..a42cc9508b 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -127,7 +127,7 @@ int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
}
if ((content = xmlNodeGetContent(nodep)) != NULL) {
- ZVAL_STRING(retval, content);
+ ZVAL_STRING(retval, (char *) content);
xmlFree(content);
} else {
ZVAL_EMPTY_STRING(retval);
@@ -148,7 +148,7 @@ int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC
str = zval_get_string(newval);
- xmlNodeSetContentLen(nodep, str->val, str->len + 1);
+ xmlNodeSetContentLen(nodep, (xmlChar *) str->val, str->len + 1);
zend_string_release(str);
return SUCCESS;
diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c
index 3d65a84bad..75680089a4 100644
--- a/ext/dom/string_extend.c
+++ b/ext/dom/string_extend.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/tests/node_textcontent.phpt b/ext/dom/tests/node_textcontent.phpt
new file mode 100644
index 0000000000..a731a264aa
--- /dev/null
+++ b/ext/dom/tests/node_textcontent.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Testing reading and writing to DOMNode::textContent
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$html = <<<HTML
+<div id="test"><span>hi there</span></div>
+HTML;
+
+$text = '<p>hello world &trade;</p>';
+
+$dom = new DOMDocument('1.0', 'UTF-8');
+$dom->loadHTML($html);
+
+$node = $dom->getElementById('test');
+var_dump($node->textContent);
+$node->textContent = $text;
+var_dump($node->textContent == $text);
+
+var_dump($dom->saveHTML($node));
+
+?>
+--EXPECT--
+string(8) "hi there"
+bool(true)
+string(63) "<div id="test">&lt;p&gt;hello world &amp;trade;&lt;/p&gt;</div>"
+
diff --git a/ext/dom/text.c b/ext/dom/text.c
index 2cbb1c7da3..1cefa665aa 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -126,7 +126,7 @@ int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC)
}
if (wholetext != NULL) {
- ZVAL_STRING(retval, wholetext);
+ ZVAL_STRING(retval, (char *) wholetext);
xmlFree(wholetext);
} else {
ZVAL_EMPTY_STRING(retval);
diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c
index 5a437dc332..5267ee6f77 100644
--- a/ext/dom/typeinfo.c
+++ b/ext/dom/typeinfo.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c
index 6bddff6e73..e0b8756aa8 100644
--- a/ext/dom/userdatahandler.c
+++ b/ext/dom/userdatahandler.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h
index 49226c459c..9d5ffe8fb6 100644
--- a/ext/dom/xml_common.h
+++ b/ext/dom/xml_common.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -68,7 +68,8 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = Z_LIBXML_NODE_P(__id); \
if (__intern->node == NULL || !(__ptr = (__prtype)__intern->node->node)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", \
+ __intern->std.ce->name->val);\
RETURN_NULL();\
} \
}
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 7a7f7a81e1..336365e342 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -186,7 +186,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
}
return;
}
- ZVAL_STRING(&fci.function_name, obj->stringval);
+ ZVAL_STRING(&fci.function_name, (char *) obj->stringval);
xmlXPathFreeObject(obj);
fci.symbol_table = NULL;
@@ -222,7 +222,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
valuePush(ctxt, xmlXPathNewString((xmlChar *)""));
} else {
zend_string *str = zval_get_string(&retval);
- valuePush(ctxt, xmlXPathNewString(str->val));
+ valuePush(ctxt, xmlXPathNewString((xmlChar *) str->val));
zend_string_release(str);
}
zval_ptr_dtor(&retval);
@@ -412,7 +412,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
ctxp->namespaces = ns;
ctxp->nsNr = nsnbr;
- xpathobjp = xmlXPathEvalExpression(expr, ctxp);
+ xpathobjp = xmlXPathEvalExpression((xmlChar *) expr, ctxp);
ctxp->node = NULL;
if (ns != NULL) {
@@ -453,12 +453,12 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
nsparent = node->_private;
curns = xmlNewNs(NULL, node->name, NULL);
if (node->children) {
- curns->prefix = xmlStrdup((char *) node->children);
+ curns->prefix = xmlStrdup((xmlChar *) node->children);
}
if (node->children) {
- node = xmlNewDocNode(docp, NULL, (char *) node->children, node->name);
+ node = xmlNewDocNode(docp, NULL, (xmlChar *) node->children, node->name);
} else {
- node = xmlNewDocNode(docp, NULL, "xmlns", node->name);
+ node = xmlNewDocNode(docp, NULL, (xmlChar *) "xmlns", node->name);
}
node->type = XML_NAMESPACE_DECL;
node->parent = nsparent;
@@ -483,7 +483,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
break;
case XPATH_STRING:
- RETVAL_STRING(xpathobjp->stringval);
+ RETVAL_STRING((char *) xpathobjp->stringval);
break;
default:
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index ba91f9b44c..ca33700982 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index c1d92ba4e7..c626fef5c7 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h
index d34d19855f..f1c2676772 100644
--- a/ext/ereg/php_ereg.h
+++ b/ext/ereg/php_ereg.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/ereg/php_regex.h b/ext/ereg/php_regex.h
index bb83b89fc9..3fd5a663a1 100644
--- a/ext/ereg/php_regex.h
+++ b/ext/ereg/php_regex.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 9b6d86c415..42f8a24102 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -166,17 +166,17 @@ ZEND_DECLARE_MODULE_GLOBALS(exif)
ZEND_INI_MH(OnUpdateEncode)
{
- if (new_value && new_value_length) {
+ if (new_value && new_value->len) {
const zend_encoding **return_list;
size_t return_size;
- if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length,
+ if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
&return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
ZEND_INI_MH(OnUpdateDecode)
@@ -184,14 +184,14 @@ ZEND_INI_MH(OnUpdateDecode)
if (new_value) {
const zend_encoding **return_list;
size_t return_size;
- if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length,
+ if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
&return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
PHP_INI_BEGIN()
diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h
index e0326752e6..8c2c207fa9 100644
--- a/ext/exif/php_exif.h
+++ b/ext/exif/php_exif.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 17edd2d40c..f365b38573 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c
index 5fcc3a3c84..e626929c9e 100644
--- a/ext/fileinfo/libmagic/softmagic.c
+++ b/ext/fileinfo/libmagic/softmagic.c
@@ -1913,7 +1913,7 @@ convert_libmagic_pattern(zval *pattern, char *val, int len, int options)
t->val[j]='\0';
t->len = j;
- ZVAL_STR(pattern, t);
+ ZVAL_NEW_STR(pattern, t);
}
private int
diff --git a/ext/fileinfo/php_fileinfo.h b/ext/fileinfo/php_fileinfo.h
index 354ec7b284..d9c6c18c27 100644
--- a/ext/fileinfo/php_fileinfo.h
+++ b/ext/fileinfo/php_fileinfo.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c
index 49410dbfe6..5a0ea0777d 100644
--- a/ext/filter/callback_filter.c
+++ b/ext/filter/callback_filter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index e53e84f855..7ef65bc196 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -160,7 +160,7 @@ static PHP_INI_MH(UpdateDefaultFilter) /* {{{ */
int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
for (i = 0; i < size; ++i) {
- if ((strcasecmp(new_value, filter_list[i].name) == 0)) {
+ if ((strcasecmp(new_value->val, filter_list[i].name) == 0)) {
IF_G(default_filter) = filter_list[i].id;
return SUCCESS;
}
@@ -178,7 +178,7 @@ static PHP_INI_MH(OnUpdateFlags)
if (!new_value) {
IF_G(default_filter_flags) = FILTER_FLAG_NO_ENCODE_QUOTES;
} else {
- IF_G(default_filter_flags) = atoi(new_value);
+ IF_G(default_filter_flags) = atoi(new_value->val);
}
return SUCCESS;
}
diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h
index 4eec7b9119..8c41d8811e 100644
--- a/ext/filter/filter_private.h
+++ b/ext/filter/filter_private.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index cbefae9d70..c37df628d2 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h
index e62ef8c677..126a0c6c8b 100644
--- a/ext/filter/php_filter.h
+++ b/ext/filter/php_filter.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c
index ca3059cd26..8ddd55b95a 100644
--- a/ext/filter/sanitizing_filters.c
+++ b/ext/filter/sanitizing_filters.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -52,7 +52,7 @@ static void php_filter_encode_html(zval *value, const unsigned char *chars)
smart_str_0(&str);
zval_ptr_dtor(value);
- ZVAL_STR(value, str.s);
+ ZVAL_NEW_STR(value, str.s);
}
static const unsigned char hexchars[] = "0123456789ABCDEF";
@@ -105,7 +105,7 @@ static void php_filter_encode_url(zval *value, const unsigned char* chars, const
*p = '\0';
str->len = p - (unsigned char *)str->val;
zval_ptr_dtor(value);
- ZVAL_STR(value, str);
+ ZVAL_NEW_STR(value, str);
}
static void php_filter_strip(zval *value, zend_long flags)
@@ -135,7 +135,7 @@ static void php_filter_strip(zval *value, zend_long flags)
buf->val[c] = '\0';
buf->len = c;
zval_ptr_dtor(value);
- ZVAL_STR(value, buf);
+ ZVAL_NEW_STR(value, buf);
}
/* }}} */
@@ -174,7 +174,7 @@ static void filter_map_apply(zval *value, filter_map *map)
buf->val[c] = '\0';
buf->len = c;
zval_ptr_dtor(value);
- ZVAL_STR(value, buf);
+ ZVAL_NEW_STR(value, buf);
}
/* }}} */
@@ -184,7 +184,7 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
size_t new_len;
unsigned char enc[256] = {0};
- if (IS_INTERNED(Z_STR_P(value))) {
+ if (!Z_REFCOUNTED_P(value)) {
ZVAL_STRINGL(value, Z_STRVAL_P(value), Z_STRLEN_P(value));
}
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 27051677c9..a5341080b8 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index 57b3f663d7..f2051fe195 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 4586033298..32d8fb86e2 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -414,7 +414,7 @@ PHP_FUNCTION(ftp_login)
zval *z_ftp;
ftpbuf_t *ftp;
char *user, *pass;
- int user_len, pass_len;
+ size_t user_len, pass_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) {
return;
diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h
index fffe6bf2f5..bd8de97483 100644
--- a/ext/ftp/php_ftp.h
+++ b/ext/ftp/php_ftp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 97e625742f..ade37aa575 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 5c378ffb0f..0b79cb6f0d 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c
index d6fdd7d086..5a7d016ee8 100644
--- a/ext/gd/libgd/xbm.c
+++ b/ext/gd/libgd/xbm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h
index 1f32a8f9b1..7510b2425d 100644
--- a/ext/gd/php_gd.h
+++ b/ext/gd/php_gd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/gd/tests/bug48801_1.phpt b/ext/gd/tests/bug48801_1.phpt
index 11af80cd4b..0ab6d7cdd9 100644
--- a/ext/gd/tests/bug48801_1.phpt
+++ b/ext/gd/tests/bug48801_1.phpt
@@ -20,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
?>
--EXPECTF--
(-1, 15)
-(156, 15)
-(156, -48)
+(15%d, 15)
+(15%d, -48)
(-1, -48)
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index 3f1909e753..938997a4a6 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h
index f990d32af5..ab4f5fc764 100644
--- a/ext/gettext/php_gettext.h
+++ b/ext/gettext/php_gettext.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index fc7f4fbe56..5a51c50ea6 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -43,6 +43,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_init, 0, 0, 1)
ZEND_ARG_INFO(0, base)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_import, 0, 0, 1)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, word_size)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_export, 0, 0, 1)
+ ZEND_ARG_INFO(0, gmpnumber)
+ ZEND_ARG_INFO(0, word_size)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_intval, 0, 0, 1)
ZEND_ARG_INFO(0, gmpnumber)
ZEND_END_ARG_INFO()
@@ -117,6 +129,8 @@ static ZEND_GINIT_FUNCTION(gmp);
*/
const zend_function_entry gmp_functions[] = {
ZEND_FE(gmp_init, arginfo_gmp_init)
+ ZEND_FE(gmp_import, arginfo_gmp_import)
+ ZEND_FE(gmp_export, arginfo_gmp_export)
ZEND_FE(gmp_intval, arginfo_gmp_intval)
ZEND_FE(gmp_strval, arginfo_gmp_strval)
ZEND_FE(gmp_add, arginfo_gmp_binary)
@@ -204,6 +218,12 @@ typedef struct _gmp_temp {
#define GMP_ROUND_PLUSINF 1
#define GMP_ROUND_MINUSINF 2
+#define GMP_MSW_FIRST (1 << 0)
+#define GMP_LSW_FIRST (1 << 1)
+#define GMP_LITTLE_ENDIAN (1 << 2)
+#define GMP_BIG_ENDIAN (1 << 3)
+#define GMP_NATIVE_ENDIAN (1 << 4)
+
#define GMP_42_OR_NEWER \
((__GNU_MP_VERSION >= 5) || (__GNU_MP_VERSION >= 4 && __GNU_MP_VERSION_MINOR >= 2))
@@ -299,10 +319,10 @@ if (IS_GMP(zval)) { \
gmp_create(return_value, &gmpnumber TSRMLS_CC)
static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base);
-static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC);
+static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC);
static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC);
-/*
+/*
* The gmp_*_op functions provide an implementation for several common types
* of GMP functions. The gmp_zval_(unary|binary)_*_op functions have to be manually
* passed zvals to work on, whereas the gmp_(unary|binary)_*_op macros already
@@ -311,14 +331,14 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC);
typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr);
typedef int (*gmp_unary_opl_t)(mpz_srcptr);
-typedef void (*gmp_unary_ui_op_t)(mpz_ptr, zend_ulong);
+typedef void (*gmp_unary_ui_op_t)(mpz_ptr, gmp_ulong);
typedef void (*gmp_binary_op_t)(mpz_ptr, mpz_srcptr, mpz_srcptr);
typedef int (*gmp_binary_opl_t)(mpz_srcptr, mpz_srcptr);
-typedef void (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, zend_ulong);
+typedef void (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, gmp_ulong);
typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
-typedef void (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, zend_ulong);
+typedef void (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, gmp_ulong);
static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC);
static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero TSRMLS_DC);
@@ -463,7 +483,7 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
FETCH_GMP_ZVAL(gmpnum_op, op1, temp);
INIT_GMP_RETVAL(gmpnum_result);
- op(gmpnum_result, gmpnum_op, (zend_ulong) shift);
+ op(gmpnum_result, gmpnum_op, (gmp_ulong) shift);
FREE_GMP_TEMP(temp);
}
}
@@ -549,7 +569,7 @@ static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int gmp_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
+static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
{
mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(object);
smart_str buf = {0};
@@ -576,7 +596,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len
}
/* }}} */
-static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
+static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
{
mpz_ptr gmpnum;
const unsigned char *p, *max;
@@ -659,6 +679,12 @@ ZEND_MINIT_FUNCTION(gmp)
#endif
REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GMP_MSW_FIRST", GMP_MSW_FIRST, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GMP_LSW_FIRST", GMP_LSW_FIRST, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GMP_LITTLE_ENDIAN", GMP_LITTLE_ENDIAN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GMP_BIG_ENDIAN", GMP_BIG_ENDIAN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("GMP_NATIVE_ENDIAN", GMP_NATIVE_ENDIAN, CONST_CS | CONST_PERSISTENT);
+
mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree);
return SUCCESS;
@@ -696,7 +722,7 @@ ZEND_MODULE_INFO_D(gmp)
/* {{{ convert_to_gmp
* Convert zval to be gmp number */
-static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC)
+static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC)
{
switch (Z_TYPE_P(val)) {
case IS_LONG:
@@ -707,22 +733,20 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC)
}
case IS_STRING: {
char *numstr = Z_STRVAL_P(val);
- int skip_lead = 0;
+ zend_bool skip_lead = 0;
int ret;
- if (Z_STRLEN_P(val) > 2) {
- if (numstr[0] == '0') {
- if (numstr[1] == 'x' || numstr[1] == 'X') {
- base = 16;
- skip_lead = 1;
- } else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) {
- base = 2;
- skip_lead = 1;
- }
+ if (Z_STRLEN_P(val) > 2 && numstr[0] == '0') {
+ if ((base == 0 || base == 16) && (numstr[1] == 'x' || numstr[1] == 'X')) {
+ base = 16;
+ skip_lead = 1;
+ } else if ((base == 0 || base == 2) && (numstr[1] == 'b' || numstr[1] == 'B')) {
+ base = 2;
+ skip_lead = 1;
}
}
- ret = mpz_set_str(gmpnumber, (skip_lead ? &numstr[2] : numstr), base);
+ ret = mpz_set_str(gmpnumber, (skip_lead ? &numstr[2] : numstr), (int) base);
if (-1 == ret) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Unable to convert variable to GMP - string is not an integer");
@@ -741,7 +765,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC)
static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base) /* {{{ */
{
- int num_len;
+ size_t num_len;
zend_string *str;
num_len = mpz_sizeinbase(gmpnum, abs(base));
@@ -766,7 +790,7 @@ static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base) /* {{{ */
str->val[str->len] = '\0';
}
- ZVAL_STR(result, str);
+ ZVAL_NEW_STR(result, str);
}
/* }}} */
@@ -794,7 +818,7 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {
FREE_GMP_TEMP(temp_a);
FREE_GMP_TEMP(temp_b);
-
+
RETURN_LONG(res);
}
/* }}} */
@@ -802,14 +826,14 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {
/* {{{ gmp_zval_binary_ui_op
Execute GMP binary operation.
*/
-static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC)
+static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC)
{
mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result;
int use_ui = 0;
gmp_temp_t temp_a, temp_b;
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
-
+
if (gmp_ui_op && Z_TYPE_P(b_arg) == IS_LONG && Z_LVAL_P(b_arg) >= 0) {
use_ui = 1;
temp_b.is_used = 0;
@@ -836,7 +860,7 @@ static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *
INIT_GMP_RETVAL(gmpnum_result);
if (use_ui) {
- gmp_ui_op(gmpnum_result, gmpnum_a, (zend_ulong) Z_LVAL_P(b_arg));
+ gmp_ui_op(gmpnum_result, gmpnum_a, (gmp_ulong) Z_LVAL_P(b_arg));
} else {
gmp_op(gmpnum_result, gmpnum_a, gmpnum_b);
}
@@ -890,7 +914,7 @@ static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval
add_next_index_zval(return_value, &result2);
if (use_ui) {
- gmp_ui_op(gmpnum_result1, gmpnum_result2, gmpnum_a, (zend_ulong) Z_LVAL_P(b_arg));
+ gmp_ui_op(gmpnum_result1, gmpnum_result2, gmpnum_a, (gmp_ulong) Z_LVAL_P(b_arg));
} else {
gmp_op(gmpnum_result1, gmpnum_result2, gmpnum_a, gmpnum_b);
}
@@ -909,7 +933,7 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
return;
}
-
+
gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op, check_b_zero TSRMLS_CC);
}
/* }}} */
@@ -918,11 +942,11 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
/* {{{ gmp_zval_unary_op
*/
-static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC)
+static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC)
{
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
-
+
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
INIT_GMP_RETVAL(gmpnum_result);
@@ -967,7 +991,7 @@ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gm
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
return;
}
-
+
gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC);
}
/* }}} */
@@ -983,7 +1007,7 @@ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
return;
}
-
+
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
RETVAL_LONG(gmp_op(gmpnum_a));
FREE_GMP_TEMP(temp_a);
@@ -1037,6 +1061,118 @@ ZEND_FUNCTION(gmp_init)
}
/* }}} */
+int gmp_import_export_validate(zend_long size, zend_long options, int *order, int *endian TSRMLS_DC)
+{
+ if (size < 1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "Word size must be positive, %pd given", size);
+ return FAILURE;
+ }
+
+ switch (options & (GMP_LSW_FIRST | GMP_MSW_FIRST)) {
+ case GMP_LSW_FIRST:
+ *order = -1;
+ break;
+ case GMP_MSW_FIRST:
+ case 0: /* default */
+ *order = 1;
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "Invalid options: Conflicting word orders");
+ return FAILURE;
+ }
+
+ switch (options & (GMP_LITTLE_ENDIAN | GMP_BIG_ENDIAN | GMP_NATIVE_ENDIAN)) {
+ case GMP_LITTLE_ENDIAN:
+ *endian = -1;
+ break;
+ case GMP_BIG_ENDIAN:
+ *endian = 1;
+ break;
+ case GMP_NATIVE_ENDIAN:
+ case 0: /* default */
+ *endian = 0;
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "Invalid options: Conflicting word endianness");
+ return FAILURE;
+ }
+
+ return SUCCESS;
+}
+
+/* {{{ proto GMP gmp_import(string data [, int word_size = 1, int options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN])
+ Imports a GMP number from a binary string */
+ZEND_FUNCTION(gmp_import)
+{
+ char *data;
+ size_t data_len;
+ zend_long size = 1;
+ zend_long options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN;
+ int order, endian;
+ mpz_ptr gmpnumber;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &data, &data_len, &size, &options) == FAILURE) {
+ return;
+ }
+
+ if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if ((data_len % size) != 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "Input length must be a multiple of word size");
+ RETURN_FALSE;
+ }
+
+ INIT_GMP_RETVAL(gmpnumber);
+
+ mpz_import(gmpnumber, data_len / size, order, size, endian, 0, data);
+}
+/* }}} */
+
+/* {{{ proto string gmp_export(GMP gmpnumber [, int word_size = 1, int options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN])
+ Exports a GMP number to a binary string */
+ZEND_FUNCTION(gmp_export)
+{
+ zval *gmpnumber_arg;
+ zend_long size = 1;
+ zend_long options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN;
+ int order, endian;
+ mpz_ptr gmpnumber;
+ gmp_temp_t temp_a;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &gmpnumber_arg, &size, &options) == FAILURE) {
+ return;
+ }
+
+ if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ FETCH_GMP_ZVAL(gmpnumber, gmpnumber_arg, temp_a);
+
+ if (mpz_sgn(gmpnumber) == 0) {
+ RETURN_EMPTY_STRING();
+ } else {
+ size_t bits_per_word = size * 8;
+ size_t count = (mpz_sizeinbase(gmpnumber, 2) + bits_per_word - 1) / bits_per_word;
+ size_t out_len = count * size;
+
+ zend_string *out_string = zend_string_alloc(out_len, 0);
+ mpz_export(out_string->val, NULL, order, size, endian, 0, gmpnumber);
+ out_string->val[out_len] = '\0';
+
+ RETURN_STR(out_string);
+ }
+
+ FREE_GMP_TEMP(temp_a);
+}
+/* }}} */
+
/* {{{ proto int gmp_intval(mixed gmpnumber)
Gets signed long value of GMP number */
ZEND_FUNCTION(gmp_intval)
@@ -1046,7 +1182,7 @@ ZEND_FUNCTION(gmp_intval)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &gmpnumber_arg) == FAILURE){
return;
}
-
+
if (IS_GMP(gmpnumber_arg)) {
RETVAL_LONG(mpz_get_si(GET_GMP_FROM_ZVAL(gmpnumber_arg)));
} else {
@@ -1193,7 +1329,7 @@ ZEND_FUNCTION(gmp_div_q)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
-
+
}
/* }}} */
@@ -1273,7 +1409,7 @@ ZEND_FUNCTION(gmp_pow)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative exponent not supported");
RETURN_FALSE;
}
-
+
INIT_GMP_RETVAL(gmpnum_result);
if (Z_TYPE_P(base_arg) == IS_LONG && Z_LVAL_P(base_arg) >= 0) {
mpz_ui_pow_ui(gmpnum_result, Z_LVAL_P(base_arg), exp);
@@ -1315,10 +1451,9 @@ ZEND_FUNCTION(gmp_powm)
FETCH_GMP_ZVAL_DEP_DEP(gmpnum_mod, mod_arg, temp_mod, temp_exp, temp_base);
if (!mpz_cmp_ui(gmpnum_mod, 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modulus may not be zero");
FREE_GMP_TEMP(temp_base);
- if (use_ui) {
- FREE_GMP_TEMP(temp_exp);
- }
+ FREE_GMP_TEMP(temp_exp);
FREE_GMP_TEMP(temp_mod);
RETURN_FALSE;
}
@@ -1347,14 +1482,14 @@ ZEND_FUNCTION(gmp_sqrt)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
return;
}
-
+
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (mpz_sgn(gmpnum_a) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
- }
+ }
INIT_GMP_RETVAL(gmpnum_result);
mpz_sqrt(gmpnum_result, gmpnum_a);
@@ -1422,7 +1557,7 @@ ZEND_FUNCTION(gmp_root)
}
INIT_GMP_RETVAL(gmpnum_result);
- mpz_root(gmpnum_result, gmpnum_a, (unsigned long) nth);
+ mpz_root(gmpnum_result, gmpnum_a, (gmp_ulong) nth);
FREE_GMP_TEMP(temp_a);
}
/* }}} */
@@ -1462,14 +1597,14 @@ ZEND_FUNCTION(gmp_rootrem)
add_next_index_zval(return_value, &result2);
#if GMP_42_OR_NEWER
- mpz_rootrem(gmpnum_result1, gmpnum_result2, gmpnum_a, (unsigned long) nth);
+ mpz_rootrem(gmpnum_result1, gmpnum_result2, gmpnum_a, (gmp_ulong) nth);
#else
- mpz_root(gmpnum_result1, gmpnum_a, (unsigned long) nth);
- mpz_pow_ui(gmpnum_result2, gmpnum_result1, (unsigned long) nth);
+ mpz_root(gmpnum_result1, gmpnum_a, (gmp_ulong) nth);
+ mpz_pow_ui(gmpnum_result2, gmpnum_result1, (gmp_ulong) nth);
mpz_sub(gmpnum_result2, gmpnum_a, gmpnum_result2);
mpz_abs(gmpnum_result2, gmpnum_result2);
#endif
-
+
FREE_GMP_TEMP(temp_a);
}
/* }}} */
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h
index 05bd56fa91..59485dd5b7 100644
--- a/ext/gmp/php_gmp.h
+++ b/ext/gmp/php_gmp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -31,6 +31,8 @@ ZEND_MODULE_DEACTIVATE_D(gmp);
ZEND_MODULE_INFO_D(gmp);
ZEND_FUNCTION(gmp_init);
+ZEND_FUNCTION(gmp_import);
+ZEND_FUNCTION(gmp_export);
ZEND_FUNCTION(gmp_intval);
ZEND_FUNCTION(gmp_strval);
ZEND_FUNCTION(gmp_add);
@@ -73,6 +75,15 @@ ZEND_FUNCTION(gmp_popcount);
ZEND_FUNCTION(gmp_hamdist);
ZEND_FUNCTION(gmp_nextprime);
+/* GMP and MPIR use different datatypes on different platforms */
+#ifdef PHP_WIN32
+typedef zend_long gmp_long;
+typedef zend_ulong gmp_ulong;
+#else
+typedef long gmp_long;
+typedef unsigned long gmp_ulong;
+#endif
+
ZEND_BEGIN_MODULE_GLOBALS(gmp)
zend_bool rand_initialized;
gmp_randstate_t rand_state;
diff --git a/ext/gmp/tests/001.phpt b/ext/gmp/tests/001.phpt
deleted file mode 100644
index 2f9292f606..0000000000
--- a/ext/gmp/tests/001.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-Check for gmp presence
---SKIPIF--
-<?php if (!extension_loaded("gmp")) print "skip"; ?>
---FILE--
-<?php
-echo "gmp extension is available";
-/*
- you can add regression tests for your extension here
-
- the output of your test code has to be equal to the
- text in the --EXPECT-- section below for the tests
- to pass, differences between the output and the
- expected text are interpreted as failure
-
- see php7/tests/README for further information on
- writing regression tests
-*/
-?>
---EXPECT--
-gmp extension is available
diff --git a/ext/gmp/tests/bug50175.phpt b/ext/gmp/tests/bug50175.phpt
new file mode 100644
index 0000000000..0998e029c3
--- /dev/null
+++ b/ext/gmp/tests/bug50175.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #50175: gmp_init() results 0 on given base and number starting with 0x or 0b
+--FILE--
+<?php
+
+var_dump(gmp_init('0bcd', 16));
+var_dump(gmp_init('0xyz', 36));
+
+?>
+--EXPECTF--
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(4) "3021"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(5) "44027"
+}
diff --git a/ext/gmp/tests/013.phpt b/ext/gmp/tests/gmp_abs.phpt
index bb35891f2a..bb35891f2a 100644
--- a/ext/gmp/tests/013.phpt
+++ b/ext/gmp/tests/gmp_abs.phpt
diff --git a/ext/gmp/tests/029.phpt b/ext/gmp/tests/gmp_and.phpt
index 9bc401031b..9bc401031b 100644
--- a/ext/gmp/tests/029.phpt
+++ b/ext/gmp/tests/gmp_and.phpt
diff --git a/ext/gmp/tests/034.phpt b/ext/gmp/tests/gmp_clrbit.phpt
index 079d5d669f..079d5d669f 100644
--- a/ext/gmp/tests/034.phpt
+++ b/ext/gmp/tests/gmp_clrbit.phpt
diff --git a/ext/gmp/tests/026.phpt b/ext/gmp/tests/gmp_cmp.phpt
index 83e7910d1e..83e7910d1e 100644
--- a/ext/gmp/tests/026.phpt
+++ b/ext/gmp/tests/gmp_cmp.phpt
diff --git a/ext/gmp/tests/031.phpt b/ext/gmp/tests/gmp_com.phpt
index 1e0c1b4694..1e0c1b4694 100644
--- a/ext/gmp/tests/031.phpt
+++ b/ext/gmp/tests/gmp_com.phpt
diff --git a/ext/gmp/tests/009.phpt b/ext/gmp/tests/gmp_div_q.phpt
index 3b75a48e18..3b75a48e18 100644
--- a/ext/gmp/tests/009.phpt
+++ b/ext/gmp/tests/gmp_div_q.phpt
diff --git a/ext/gmp/tests/007.phpt b/ext/gmp/tests/gmp_div_qr.phpt
index e391c121f8..90099249db 100644
--- a/ext/gmp/tests/007.phpt
+++ b/ext/gmp/tests/gmp_div_qr.phpt
@@ -10,11 +10,13 @@ var_dump(gmp_div_qr(""));
var_dump(gmp_div_qr(0,1));
var_dump(gmp_div_qr(1,0));
+var_dump(gmp_div_qr(gmp_init(1), gmp_init(0)));
var_dump(gmp_div_qr(12653,23482734));
var_dump(gmp_div_qr(12653,23482734, 10));
var_dump(gmp_div_qr(1123123,123));
var_dump(gmp_div_qr(1123123,123, 1));
var_dump(gmp_div_qr(1123123,123, 2));
+var_dump(gmp_div_qr(gmp_init(1123123), gmp_init(123)));
var_dump(gmp_div_qr(1123123,123, GMP_ROUND_ZERO));
var_dump(gmp_div_qr(1123123,123, GMP_ROUND_PLUSINF));
var_dump(gmp_div_qr(1123123,123, GMP_ROUND_MINUSINF));
@@ -47,6 +49,9 @@ array(2) {
Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
bool(false)
+
+Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
+bool(false)
array(2) {
[0]=>
object(GMP)#%d (1) {
@@ -114,6 +119,18 @@ array(2) {
[0]=>
object(GMP)#%d (1) {
["num"]=>
+ string(4) "9131"
+ }
+ [1]=>
+ object(GMP)#%d (1) {
+ ["num"]=>
+ string(2) "10"
+ }
+}
+array(2) {
+ [0]=>
+ object(GMP)#%d (1) {
+ ["num"]=>
string(4) "9132"
}
[1]=>
diff --git a/ext/gmp/tests/008.phpt b/ext/gmp/tests/gmp_div_r.phpt
index c1874c86f9..c1874c86f9 100644
--- a/ext/gmp/tests/008.phpt
+++ b/ext/gmp/tests/gmp_div_r.phpt
diff --git a/ext/gmp/tests/011.phpt b/ext/gmp/tests/gmp_divexact.phpt
index a42c1b6b4e..a42c1b6b4e 100644
--- a/ext/gmp/tests/011.phpt
+++ b/ext/gmp/tests/gmp_divexact.phpt
diff --git a/ext/gmp/tests/gmp_export.phpt b/ext/gmp/tests/gmp_export.phpt
new file mode 100644
index 0000000000..fbc8901cfc
--- /dev/null
+++ b/ext/gmp/tests/gmp_export.phpt
@@ -0,0 +1,80 @@
+--TEST--
+gmp_export() basic tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) echo "skip"; ?>
+--FILE--
+<?php
+
+// Tests taken from GMPs own test suite.
+
+// format is [output, size, options, expected]
+$export = [
+ ['0',1,GMP_BIG_ENDIAN,''],
+ ['0',2,GMP_BIG_ENDIAN,''],
+ ['0',3,GMP_BIG_ENDIAN,''],
+ ['12345678',1,GMP_BIG_ENDIAN,'12345678'],
+ ['12345678',4,GMP_BIG_ENDIAN,'12345678'],
+ ['12345678',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'12345678'],
+ ['12345678',1,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
+ ['12345678',4,GMP_LITTLE_ENDIAN,'78563412'],
+ ['12345678',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
+ ['123456789ABC',2,GMP_BIG_ENDIAN,'123456789abc'],
+ ['123456789ABC',2,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9abc56781234'],
+ ['123456789ABC',2,GMP_LITTLE_ENDIAN,'34127856bc9a'],
+ ['123456789ABC',2,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'bc9a78563412'],
+ ['112233445566778899AABBCC',4,GMP_BIG_ENDIAN,'112233445566778899aabbcc'],
+ ['112233445566778899AABBCC',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'99aabbcc5566778811223344'],
+ ['112233445566778899AABBCC',4,GMP_LITTLE_ENDIAN,'4433221188776655ccbbaa99'],
+ ['112233445566778899AABBCC',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'ccbbaa998877665544332211'],
+ ['100120023003400450056006700780089009A00AB00BC00C',8,GMP_BIG_ENDIAN,'100120023003400450056006700780089009a00ab00bc00c'],
+ ['100120023003400450056006700780089009A00AB00BC00C',8,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9009a00ab00bc00c50056006700780081001200230034004'],
+ ['100120023003400450056006700780089009A00AB00BC00C',8,GMP_LITTLE_ENDIAN,'044003300220011008800770066005500cc00bb00aa00990'],
+ ['100120023003400450056006700780089009A00AB00BC00C',8,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'0cc00bb00aa0099008800770066005500440033002200110']
+];
+
+$passed = true;
+foreach ($export as $k => $test) {
+ $gmp = gmp_init($test[0], 16);
+ $str = gmp_export($gmp, $test[1], $test[2]);
+ if (is_string($str)) {
+ $result = bin2hex($str);
+ if ($result !== $test[3]) {
+ echo "$k: '$result' !== '{$test[3]}'\n";
+ $passed = false;
+ }
+ } else {
+ $type = gettype($str);
+ echo "$k: $type !== '{$test[3]}'\n";
+ }
+}
+
+var_dump($passed);
+
+// Invalid arguments (zpp failure)
+var_dump(gmp_export());
+
+// Invalid word sizes
+var_dump(gmp_export(123, -1));
+var_dump(gmp_export(123, 0));
+
+// Invalid options
+var_dump(gmp_export(123, 1, GMP_MSW_FIRST | GMP_LSW_FIRST));
+var_dump(gmp_export(123, 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN));
+
+--EXPECTF--
+bool(true)
+
+Warning: gmp_export() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gmp_export(): Word size must be positive, -1 given in %s on line %d
+bool(false)
+
+Warning: gmp_export(): Word size must be positive, 0 given in %s on line %d
+bool(false)
+
+Warning: gmp_export(): Invalid options: Conflicting word orders in %s on line %d
+bool(false)
+
+Warning: gmp_export(): Invalid options: Conflicting word endianness in %s on line %d
+bool(false)
diff --git a/ext/gmp/tests/014.phpt b/ext/gmp/tests/gmp_fact.phpt
index 6afccaf936..6afccaf936 100644
--- a/ext/gmp/tests/014.phpt
+++ b/ext/gmp/tests/gmp_fact.phpt
diff --git a/ext/gmp/tests/021.phpt b/ext/gmp/tests/gmp_gcd.phpt
index 275f0bca35..275f0bca35 100644
--- a/ext/gmp/tests/021.phpt
+++ b/ext/gmp/tests/gmp_gcd.phpt
diff --git a/ext/gmp/tests/022.phpt b/ext/gmp/tests/gmp_gcdext.phpt
index 469aa3013d..469aa3013d 100644
--- a/ext/gmp/tests/022.phpt
+++ b/ext/gmp/tests/gmp_gcdext.phpt
diff --git a/ext/gmp/tests/036.phpt b/ext/gmp/tests/gmp_hamdist.phpt
index c21e03ccb2..c21e03ccb2 100644
--- a/ext/gmp/tests/036.phpt
+++ b/ext/gmp/tests/gmp_hamdist.phpt
diff --git a/ext/gmp/tests/gmp_import.phpt b/ext/gmp/tests/gmp_import.phpt
new file mode 100644
index 0000000000..b7ae6600ed
--- /dev/null
+++ b/ext/gmp/tests/gmp_import.phpt
@@ -0,0 +1,91 @@
+--TEST--
+gmp_import() basic tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) echo "skip"; ?>
+--FILE--
+<?php
+
+// Tests taken from GMPs own test suite.
+
+// format is [expected, size, options, input]
+$import = [
+ ['0',1,GMP_BIG_ENDIAN,''],
+ ['12345678',1,GMP_BIG_ENDIAN,'12345678'],
+ ['12345678',4,GMP_BIG_ENDIAN,'12345678'],
+ ['12345678',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'12345678'],
+ ['12345678',1,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
+ ['12345678',4,GMP_LITTLE_ENDIAN,'78563412'],
+ ['12345678',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
+ ['123456789abc',2,GMP_BIG_ENDIAN,'123456789abc'],
+ ['123456789abc',2,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9abc56781234'],
+ ['123456789abc',2,GMP_LITTLE_ENDIAN,'34127856bc9a'],
+ ['123456789abc',2,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'bc9a78563412'],
+ ['112233445566778899aabbcc',4,GMP_BIG_ENDIAN,'112233445566778899aabbcc'],
+ ['112233445566778899aabbcc',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'99aabbcc5566778811223344'],
+ ['112233445566778899aabbcc',4,GMP_LITTLE_ENDIAN,'4433221188776655ccbbaa99'],
+ ['112233445566778899aabbcc',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'ccbbaa998877665544332211'],
+ ['100120023003400450056006700780089009a00ab00bc00c',8,GMP_BIG_ENDIAN,'100120023003400450056006700780089009a00ab00bc00c'],
+ ['100120023003400450056006700780089009a00ab00bc00c',8,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9009a00ab00bc00c50056006700780081001200230034004'],
+ ['100120023003400450056006700780089009a00ab00bc00c',8,GMP_LITTLE_ENDIAN,'044003300220011008800770066005500cc00bb00aa00990'],
+ ['100120023003400450056006700780089009a00ab00bc00c',8,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'0cc00bb00aa0099008800770066005500440033002200110']
+];
+
+$passed = true;
+foreach ($import as $k => $test) {
+ $gmp = gmp_import(hex2bin($test[3]), $test[1], $test[2]);
+ if ($gmp instanceof GMP) {
+ $result = gmp_strval($gmp, 16);
+ if ($result !== $test[0]) {
+ echo "$k: '$result' !== '{$test[0]}'\n";
+ $passed = false;
+ }
+ } else {
+ $type = gettype($gmp);
+ echo "$k: $type !== '{$test[0]}'\n";
+ }
+}
+
+var_dump($passed);
+
+// Invalid arguments (zpp failure)
+var_dump(gmp_import());
+
+// Invalid word sizes
+var_dump(gmp_import('a', -1));
+var_dump(gmp_import('a', 0));
+
+// Invalid data lengths
+var_dump(gmp_import('a', 2));
+var_dump(gmp_import('aa', 3));
+var_dump(gmp_import(str_repeat('a', 100), 64));
+
+// Invalid options
+var_dump(gmp_import('a', 1, GMP_MSW_FIRST | GMP_LSW_FIRST));
+var_dump(gmp_import('a', 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN));
+
+--EXPECTF--
+bool(true)
+
+Warning: gmp_import() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gmp_import(): Word size must be positive, -1 given in %s on line %d
+bool(false)
+
+Warning: gmp_import(): Word size must be positive, 0 given in %s on line %d
+bool(false)
+
+Warning: gmp_import(): Input length must be a multiple of word size in %s on line %d
+bool(false)
+
+Warning: gmp_import(): Input length must be a multiple of word size in %s on line %d
+bool(false)
+
+Warning: gmp_import(): Input length must be a multiple of word size in %s on line %d
+bool(false)
+
+Warning: gmp_import(): Invalid options: Conflicting word orders in %s on line %d
+bool(false)
+
+Warning: gmp_import(): Invalid options: Conflicting word endianness in %s on line %d
+bool(false)
diff --git a/ext/gmp/tests/040.phpt b/ext/gmp/tests/gmp_init.phpt
index 29640ba704..29640ba704 100644
--- a/ext/gmp/tests/040.phpt
+++ b/ext/gmp/tests/gmp_init.phpt
diff --git a/ext/gmp/tests/004.phpt b/ext/gmp/tests/gmp_intval.phpt
index 088dd08fd8..088dd08fd8 100644
--- a/ext/gmp/tests/004.phpt
+++ b/ext/gmp/tests/gmp_intval.phpt
diff --git a/ext/gmp/tests/023.phpt b/ext/gmp/tests/gmp_invert.phpt
index 81a90fe16a..81a90fe16a 100644
--- a/ext/gmp/tests/023.phpt
+++ b/ext/gmp/tests/gmp_invert.phpt
diff --git a/ext/gmp/tests/024.phpt b/ext/gmp/tests/gmp_jacobi.phpt
index 04ddba4f08..04ddba4f08 100644
--- a/ext/gmp/tests/024.phpt
+++ b/ext/gmp/tests/gmp_jacobi.phpt
diff --git a/ext/gmp/tests/025.phpt b/ext/gmp/tests/gmp_legendre.phpt
index 6dde34e1e7..6dde34e1e7 100644
--- a/ext/gmp/tests/025.phpt
+++ b/ext/gmp/tests/gmp_legendre.phpt
diff --git a/ext/gmp/tests/010.phpt b/ext/gmp/tests/gmp_mod.phpt
index 12e7cad2b3..12e7cad2b3 100644
--- a/ext/gmp/tests/010.phpt
+++ b/ext/gmp/tests/gmp_mod.phpt
diff --git a/ext/gmp/tests/012.phpt b/ext/gmp/tests/gmp_neg.phpt
index 8ca3471cb8..8ca3471cb8 100644
--- a/ext/gmp/tests/012.phpt
+++ b/ext/gmp/tests/gmp_neg.phpt
diff --git a/ext/gmp/tests/030.phpt b/ext/gmp/tests/gmp_or.phpt
index 035f070bd7..035f070bd7 100644
--- a/ext/gmp/tests/030.phpt
+++ b/ext/gmp/tests/gmp_or.phpt
diff --git a/ext/gmp/tests/019.phpt b/ext/gmp/tests/gmp_perfect_square.phpt
index aa596ba9cd..aa596ba9cd 100644
--- a/ext/gmp/tests/019.phpt
+++ b/ext/gmp/tests/gmp_perfect_square.phpt
diff --git a/ext/gmp/tests/gmp_php_int_max.phpt b/ext/gmp/tests/gmp_php_int_max.phpt
new file mode 100644
index 0000000000..1f680a1490
--- /dev/null
+++ b/ext/gmp/tests/gmp_php_int_max.phpt
@@ -0,0 +1,29 @@
+--TEST--
+PHP_INT_MAX tests
+--SKIPIF--
+<?php
+if (!extension_loaded("gmp")) print "skip";
+if (PHP_INT_SIZE != 8) print "skip";
+?>
+--FILE--
+<?php
+
+var_dump(gmp_mul(PHP_INT_MAX, PHP_INT_MAX));
+var_dump(gmp_add(PHP_INT_MAX, PHP_INT_MAX));
+var_dump(gmp_mul(PHP_INT_MAX, PHP_INT_MIN));
+?>
+DONE
+--EXPECTF--
+object(GMP)#%d (%d) {
+ ["num"]=>
+ string(38) "85070591730234615847396907784232501249"
+}
+object(GMP)#%d (%d) {
+ ["num"]=>
+ string(20) "18446744073709551614"
+}
+object(GMP)#%d (%d) {
+ ["num"]=>
+ string(39) "-85070591730234615856620279821087277056"
+}
+DONE
diff --git a/ext/gmp/tests/035.phpt b/ext/gmp/tests/gmp_popcount.phpt
index 4b45a04481..4b45a04481 100644
--- a/ext/gmp/tests/035.phpt
+++ b/ext/gmp/tests/gmp_popcount.phpt
diff --git a/ext/gmp/tests/015.phpt b/ext/gmp/tests/gmp_pow.phpt
index e17ecc7bad..e17ecc7bad 100644
--- a/ext/gmp/tests/015.phpt
+++ b/ext/gmp/tests/gmp_pow.phpt
diff --git a/ext/gmp/tests/016.phpt b/ext/gmp/tests/gmp_pown.phpt
index 8a0b34458f..f5857b6995 100644
--- a/ext/gmp/tests/016.phpt
+++ b/ext/gmp/tests/gmp_pown.phpt
@@ -19,6 +19,9 @@ var_dump(gmp_strval(gmp_powm($n,$e,1000)));
$m = gmp_init(900);
var_dump(gmp_strval(gmp_powm($n,$e,$m)));
+var_dump(gmp_powm(5, 11, 0));
+var_dump(gmp_powm(5, "11", gmp_init(0)));
+
var_dump(gmp_powm(array(),$e,$m));
var_dump(gmp_powm($n,array(),$m));
var_dump(gmp_powm($n,$e,array()));
@@ -46,6 +49,12 @@ string(3) "331"
string(3) "171"
string(3) "371"
+Warning: gmp_powm(): Modulus may not be zero in %s on line %d
+bool(false)
+
+Warning: gmp_powm(): Modulus may not be zero in %s on line %d
+bool(false)
+
Warning: gmp_powm(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
diff --git a/ext/gmp/tests/020.phpt b/ext/gmp/tests/gmp_prob_prime.phpt
index f8f3e6921c..f8f3e6921c 100644
--- a/ext/gmp/tests/020.phpt
+++ b/ext/gmp/tests/gmp_prob_prime.phpt
diff --git a/ext/gmp/tests/028.phpt b/ext/gmp/tests/gmp_random.phpt
index 3a876aa60c..3a876aa60c 100644
--- a/ext/gmp/tests/028.phpt
+++ b/ext/gmp/tests/gmp_random.phpt
diff --git a/ext/gmp/tests/041.phpt b/ext/gmp/tests/gmp_remroot.phpt
index 6e6d959288..4a3539d87c 100644
--- a/ext/gmp/tests/041.phpt
+++ b/ext/gmp/tests/gmp_remroot.phpt
@@ -1,21 +1,11 @@
--TEST--
-gmp_root() and gmp_rootrem() basic tests
+gmp_rootrem() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
-var_dump(gmp_root(1000, 3));
-var_dump(gmp_root(100, 3));
-var_dump(gmp_root(-100, 3));
-
-var_dump(gmp_root(1000, 4));
-var_dump(gmp_root(100, 4));
-var_dump(gmp_root(-100, 4));
-
-var_dump(gmp_root(0, 3));
-var_dump(gmp_root(100, 0));
-var_dump(gmp_root(100, -3));
+var_dump(gmp_rootrem());
var_dump(gmp_rootrem(1000, 3));
var_dump(gmp_rootrem(100, 3));
@@ -31,39 +21,8 @@ var_dump(gmp_rootrem(100, -3));
?>
--EXPECTF--
-object(GMP)#%d (1) {
- ["num"]=>
- string(2) "10"
-}
-object(GMP)#%d (1) {
- ["num"]=>
- string(1) "4"
-}
-object(GMP)#%d (1) {
- ["num"]=>
- string(2) "-4"
-}
-object(GMP)#%d (1) {
- ["num"]=>
- string(1) "5"
-}
-object(GMP)#%d (1) {
- ["num"]=>
- string(1) "3"
-}
-
-Warning: gmp_root(): Can't take even root of negative number in %s on line %d
-bool(false)
-object(GMP)#%d (1) {
- ["num"]=>
- string(1) "0"
-}
-
-Warning: gmp_root(): The root must be positive in %s on line %d
-bool(false)
-
-Warning: gmp_root(): The root must be positive in %s on line %d
-bool(false)
+Warning: gmp_rootrem() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
array(2) {
[0]=>
object(GMP)#%d (1) {
diff --git a/ext/gmp/tests/gmp_root.phpt b/ext/gmp/tests/gmp_root.phpt
new file mode 100644
index 0000000000..70faf27051
--- /dev/null
+++ b/ext/gmp/tests/gmp_root.phpt
@@ -0,0 +1,58 @@
+--TEST--
+gmp_root() basic tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_root());
+
+var_dump(gmp_root(1000, 3));
+var_dump(gmp_root(100, 3));
+var_dump(gmp_root(-100, 3));
+
+var_dump(gmp_root(1000, 4));
+var_dump(gmp_root(100, 4));
+var_dump(gmp_root(-100, 4));
+
+var_dump(gmp_root(0, 3));
+var_dump(gmp_root(100, 0));
+var_dump(gmp_root(100, -3));
+
+?>
+--EXPECTF--
+Warning: gmp_root() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(2) "10"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(1) "4"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(2) "-4"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(1) "5"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(1) "3"
+}
+
+Warning: gmp_root(): Can't take even root of negative number in %s on line %d
+bool(false)
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(1) "0"
+}
+
+Warning: gmp_root(): The root must be positive in %s on line %d
+bool(false)
+
+Warning: gmp_root(): The root must be positive in %s on line %d
+bool(false)
diff --git a/ext/gmp/tests/037.phpt b/ext/gmp/tests/gmp_scan0.phpt
index 2a87a968a2..2a87a968a2 100644
--- a/ext/gmp/tests/037.phpt
+++ b/ext/gmp/tests/gmp_scan0.phpt
diff --git a/ext/gmp/tests/038.phpt b/ext/gmp/tests/gmp_scan1.phpt
index 7ebce9be7d..7ebce9be7d 100644
--- a/ext/gmp/tests/038.phpt
+++ b/ext/gmp/tests/gmp_scan1.phpt
diff --git a/ext/gmp/tests/033.phpt b/ext/gmp/tests/gmp_setbit.phpt
index 99848959d5..99848959d5 100644
--- a/ext/gmp/tests/033.phpt
+++ b/ext/gmp/tests/gmp_setbit.phpt
diff --git a/ext/gmp/tests/027.phpt b/ext/gmp/tests/gmp_sign.phpt
index 1efdc28c6f..1efdc28c6f 100644
--- a/ext/gmp/tests/027.phpt
+++ b/ext/gmp/tests/gmp_sign.phpt
diff --git a/ext/gmp/tests/017.phpt b/ext/gmp/tests/gmp_sqrt.phpt
index d90f538213..d90f538213 100644
--- a/ext/gmp/tests/017.phpt
+++ b/ext/gmp/tests/gmp_sqrt.phpt
diff --git a/ext/gmp/tests/018.phpt b/ext/gmp/tests/gmp_sqrtrem.phpt
index 2fca463daa..2fca463daa 100644
--- a/ext/gmp/tests/018.phpt
+++ b/ext/gmp/tests/gmp_sqrtrem.phpt
diff --git a/ext/gmp/tests/005.phpt b/ext/gmp/tests/gmp_strval.phpt
index 79fd73ecf8..79fd73ecf8 100644
--- a/ext/gmp/tests/005.phpt
+++ b/ext/gmp/tests/gmp_strval.phpt
diff --git a/ext/gmp/tests/006.phpt b/ext/gmp/tests/gmp_sub.phpt
index e1d9df67db..e1d9df67db 100644
--- a/ext/gmp/tests/006.phpt
+++ b/ext/gmp/tests/gmp_sub.phpt
diff --git a/ext/gmp/tests/039.phpt b/ext/gmp/tests/gmp_testbit.phpt
index 399c511370..ab40abed7f 100644
--- a/ext/gmp/tests/039.phpt
+++ b/ext/gmp/tests/gmp_testbit.phpt
@@ -5,6 +5,8 @@ gmp_testbit() basic tests
--FILE--
<?php
+var_dump(gmp_testbit());
+
$n = gmp_init(0);
var_dump(gmp_testbit($n, -10));
var_dump(gmp_testbit($n, 0));
@@ -38,6 +40,9 @@ var_dump(gmp_strval($n));
echo "Done\n";
?>
--EXPECTF--
+Warning: gmp_testbit() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
Warning: gmp_testbit(): Index must be greater than or equal to zero in %s on line %d
bool(false)
bool(false)
diff --git a/ext/gmp/tests/032.phpt b/ext/gmp/tests/gmp_xor.phpt
index 2b0d29a620..2b0d29a620 100644
--- a/ext/gmp/tests/032.phpt
+++ b/ext/gmp/tests/gmp_xor.phpt
diff --git a/ext/gmp/tests/overloading.phpt b/ext/gmp/tests/overloading.phpt
index 0d8f5cfedb..3520f58bdc 100644
--- a/ext/gmp/tests/overloading.phpt
+++ b/ext/gmp/tests/overloading.phpt
@@ -16,6 +16,10 @@ var_dump($a - $b);
var_dump($a - 17);
var_dump(42 - $b);
+var_dump($a * $b);
+var_dump($a * 17);
+var_dump(42 * $b);
+
var_dump($a / $b);
var_dump($a / 17);
var_dump(42 / $b);
@@ -26,7 +30,9 @@ var_dump($a % 17);
var_dump(42 % $b);
var_dump($a % 0);
-// sl, sr
+var_dump($a ** $b);
+var_dump($a ** 17);
+var_dump(42 ** $b);
var_dump($a | $b);
var_dump($a | 17);
@@ -47,6 +53,9 @@ var_dump(42 << $b);
var_dump($a >> 2);
var_dump(-$a >> 2);
+var_dump($a << -1);
+var_dump($a >> -1);
+
var_dump(~$a);
var_dump(-$a);
var_dump(+$a);
@@ -83,9 +92,14 @@ var_dump(--$a);
var_dump($a--);
var_dump($a);
-$x = gmp_init(3);
-$y = gmp_init(2);
-var_dump($x ** $y);
+// Test operator that was not overloaded
+
+var_dump($a . $b);
+var_dump($a . '17');
+var_dump('42' . $b);
+
+$a .= '17';
+var_dump($a);
?>
--EXPECTF--
@@ -115,6 +129,18 @@ object(GMP)#%d (1) {
}
object(GMP)#%d (1) {
["num"]=>
+ string(3) "714"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(3) "714"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(3) "714"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
string(1) "2"
}
object(GMP)#%d (1) {
@@ -145,6 +171,18 @@ Warning: main(): Zero operand not allowed in %s on line %d
bool(false)
object(GMP)#%d (1) {
["num"]=>
+ string(28) "3937657486715347520027492352"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(28) "3937657486715347520027492352"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
+ string(28) "3937657486715347520027492352"
+}
+object(GMP)#%d (1) {
+ ["num"]=>
string(2) "59"
}
object(GMP)#%d (1) {
@@ -199,6 +237,12 @@ object(GMP)#%d (1) {
["num"]=>
string(3) "-11"
}
+
+Warning: main(): Shift cannot be negative in %s on line %d
+bool(false)
+
+Warning: main(): Shift cannot be negative in %s on line %d
+bool(false)
object(GMP)#%d (1) {
["num"]=>
string(3) "-43"
@@ -260,7 +304,7 @@ object(GMP)#%d (1) {
["num"]=>
string(2) "42"
}
-object(GMP)#%d (1) {
- ["num"]=>
- string(1) "9"
-}
+string(4) "4217"
+string(4) "4217"
+string(4) "4217"
+string(4) "4217"
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 5a4529d0f5..406f074da3 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -287,7 +287,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
php_hash_hmac_round((unsigned char *) digest->val, ops, context, K, (unsigned char *) digest->val, ops->digest_size);
/* Zero the key */
- memset(K, 0, ops->block_size);
+ ZEND_SECURE_ZERO(K, ops->block_size);
efree(K);
efree(context);
@@ -515,7 +515,7 @@ PHP_FUNCTION(hash_final)
hash->ops->hash_final((unsigned char *) digest->val, hash->context);
/* Zero the key */
- memset(hash->key, 0, hash->ops->block_size);
+ ZEND_SECURE_ZERO(hash->key, hash->ops->block_size);
efree(hash->key);
hash->key = NULL;
}
@@ -698,9 +698,9 @@ PHP_FUNCTION(hash_pbkdf2)
memcpy(result + ((i - 1) * ops->digest_size), temp, ops->digest_size);
}
/* Zero potentially sensitive variables */
- memset(K1, 0, ops->block_size);
- memset(K2, 0, ops->block_size);
- memset(computed_salt, 0, salt_len + 4);
+ ZEND_SECURE_ZERO(K1, ops->block_size);
+ ZEND_SECURE_ZERO(K2, ops->block_size);
+ ZEND_SECURE_ZERO(computed_salt, salt_len + 4);
efree(K1);
efree(K2);
efree(computed_salt);
@@ -975,7 +975,7 @@ PHP_FUNCTION(mhash_keygen_s2k)
}
RETVAL_STRINGL(key, bytes);
- memset(key, 0, bytes);
+ ZEND_SECURE_ZERO(key, bytes);
efree(digest);
efree(context);
efree(key);
diff --git a/ext/hash/hash_adler32.c b/ext/hash/hash_adler32.c
index af5ff82de0..22ab2f29ac 100644
--- a/ext/hash/hash_adler32.c
+++ b/ext/hash/hash_adler32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/hash_crc32.c b/ext/hash/hash_crc32.c
index 7e748df559..7e9a78e4a6 100644
--- a/ext/hash/hash_crc32.c
+++ b/ext/hash/hash_crc32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/hash_fnv.c b/ext/hash/hash_fnv.c
index 1c92478259..8433678ba9 100644
--- a/ext/hash/hash_fnv.c
+++ b/ext/hash/hash_fnv.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c
index bda9579830..9fb8f2a5fb 100644
--- a/ext/hash/hash_gost.c
+++ b/ext/hash/hash_gost.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -281,7 +281,7 @@ PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *context, const unsigned char *inp
}
memcpy(context->buffer, input + i, r);
- memset(&context->buffer[r], 0, 32 - r);
+ ZEND_SECURE_ZERO(&context->buffer[r], 32 - r);
context->length = r;
}
}
@@ -306,7 +306,7 @@ PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context)
digest[j + 3] = (unsigned char) ((context->state[i] >> 24) & 0xff);
}
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
const php_hash_ops php_hash_gost_ops = {
diff --git a/ext/hash/hash_haval.c b/ext/hash/hash_haval.c
index 32437cecdf..bc62954e6f 100644
--- a/ext/hash/hash_haval.c
+++ b/ext/hash/hash_haval.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -169,7 +169,7 @@ static void PHP_3HAVALTransform(php_hash_uint32 state[8], const unsigned char bl
}
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
@@ -206,7 +206,7 @@ static void PHP_4HAVALTransform(php_hash_uint32 state[8], const unsigned char bl
}
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
@@ -245,7 +245,7 @@ static void PHP_5HAVALTransform(php_hash_uint32 state[8], const unsigned char bl
}
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
@@ -368,7 +368,7 @@ PHP_HASH_API void PHP_HAVAL128Final(unsigned char *digest, PHP_HAVAL_CTX * conte
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -422,7 +422,7 @@ PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * conte
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -462,7 +462,7 @@ PHP_HASH_API void PHP_HAVAL192Final(unsigned char *digest, PHP_HAVAL_CTX * conte
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -503,7 +503,7 @@ PHP_HASH_API void PHP_HAVAL224Final(unsigned char *digest, PHP_HAVAL_CTX * conte
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -537,7 +537,7 @@ PHP_HASH_API void PHP_HAVAL256Final(unsigned char *digest, PHP_HAVAL_CTX * conte
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
diff --git a/ext/hash/hash_joaat.c b/ext/hash/hash_joaat.c
index cfeab863de..84f65b7609 100644
--- a/ext/hash/hash_joaat.c
+++ b/ext/hash/hash_joaat.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c
index 92f97ee506..98891f3b77 100644
--- a/ext/hash/hash_md.c
+++ b/ext/hash/hash_md.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -344,7 +344,7 @@ PHP_HASH_API void PHP_MD5Final(unsigned char digest[16], PHP_MD5_CTX * context)
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -437,7 +437,7 @@ const unsigned char block[64];
state[3] += d;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
@@ -602,7 +602,7 @@ PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX * context)
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
diff --git a/ext/hash/hash_ripemd.c b/ext/hash/hash_ripemd.c
index 16fbd12b18..740cb78220 100644
--- a/ext/hash/hash_ripemd.c
+++ b/ext/hash/hash_ripemd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -244,7 +244,7 @@ static void RIPEMD128Transform(php_hash_uint32 state[4], const unsigned char blo
state[0] = tmp;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
@@ -342,7 +342,7 @@ static void RIPEMD256Transform(php_hash_uint32 state[8], const unsigned char blo
state[7] += dd;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
@@ -441,7 +441,7 @@ static void RIPEMD160Transform(php_hash_uint32 state[5], const unsigned char blo
state[0] = tmp;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
@@ -549,7 +549,7 @@ static void RIPEMD320Transform(php_hash_uint32 state[10], const unsigned char bl
state[9] += ee;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
@@ -650,7 +650,7 @@ PHP_HASH_API void PHP_RIPEMD128Final(unsigned char digest[16], PHP_RIPEMD128_CTX
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -687,7 +687,7 @@ PHP_HASH_API void PHP_RIPEMD256Final(unsigned char digest[32], PHP_RIPEMD256_CTX
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -724,7 +724,7 @@ PHP_HASH_API void PHP_RIPEMD160Final(unsigned char digest[20], PHP_RIPEMD160_CTX
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -761,7 +761,7 @@ PHP_HASH_API void PHP_RIPEMD320Final(unsigned char digest[40], PHP_RIPEMD320_CTX
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c
index d60a7a9780..003f05a774 100644
--- a/ext/hash/hash_sha.c
+++ b/ext/hash/hash_sha.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -321,7 +321,7 @@ static void SHA1Transform(php_hash_uint32 state[5], const unsigned char block[64
state[4] += e;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
@@ -400,7 +400,7 @@ PHP_HASH_API void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -511,7 +511,7 @@ static void SHA256Transform(php_hash_uint32 state[8], const unsigned char block[
state[7] += h;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
@@ -607,7 +607,7 @@ PHP_HASH_API void PHP_SHA224Final(unsigned char digest[28], PHP_SHA224_CTX * con
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -684,7 +684,7 @@ PHP_HASH_API void PHP_SHA256Final(unsigned char digest[32], PHP_SHA256_CTX * con
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -821,7 +821,7 @@ static void SHA512Transform(php_hash_uint64 state[8], const unsigned char block[
state[7] += h;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
@@ -906,7 +906,7 @@ PHP_HASH_API void PHP_SHA384Final(unsigned char digest[48], PHP_SHA384_CTX * con
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
@@ -1020,7 +1020,7 @@ PHP_HASH_API void PHP_SHA512Final(unsigned char digest[64], PHP_SHA512_CTX * con
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
diff --git a/ext/hash/hash_snefru.c b/ext/hash/hash_snefru.c
index 2cf37998ad..c35fee3c29 100644
--- a/ext/hash/hash_snefru.c
+++ b/ext/hash/hash_snefru.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -166,7 +166,7 @@ PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *context, const unsigned char
}
memcpy(context->buffer, input + i, r);
- memset(&context->buffer[r], 0, 32 - r);
+ ZEND_SECURE_ZERO(&context->buffer[r], 32 - r);
context->length = r;
}
}
@@ -190,7 +190,7 @@ PHP_HASH_API void PHP_SNEFRUFinal(unsigned char digest[32], PHP_SNEFRU_CTX *cont
digest[j + 3] = (unsigned char) (context->state[i] & 0xff);
}
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
const php_hash_ops php_hash_snefru_ops = {
diff --git a/ext/hash/hash_tiger.c b/ext/hash/hash_tiger.c
index 78f932a745..78f42b3ec7 100644
--- a/ext/hash/hash_tiger.c
+++ b/ext/hash/hash_tiger.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -207,7 +207,7 @@ PHP_HASH_API void PHP_TIGERUpdate(PHP_TIGER_CTX *context, const unsigned char *i
i = 64 - context->length;
memcpy(&context->buffer[context->length], input, i);
tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state);
- memset(context->buffer, 0, 64);
+ ZEND_SECURE_ZERO(context->buffer, 64);
context->passed += 512;
}
@@ -216,7 +216,7 @@ PHP_HASH_API void PHP_TIGERUpdate(PHP_TIGER_CTX *context, const unsigned char *i
tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state);
context->passed += 512;
}
- memset(&context->buffer[r], 0, 64-r);
+ ZEND_SECURE_ZERO(&context->buffer[r], 64-r);
memcpy(context->buffer, &input[i], r);
context->length = r;
}
@@ -226,21 +226,21 @@ PHP_HASH_API void PHP_TIGER128Final(unsigned char digest[16], PHP_TIGER_CTX *con
{
TigerFinalize(context);
TigerDigest(digest, 16, context);
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX *context)
{
TigerFinalize(context);
TigerDigest(digest, 20, context);
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *context)
{
TigerFinalize(context);
TigerDigest(digest, 24, context);
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
#define PHP_HASH_TIGER_OPS(p, b) \
diff --git a/ext/hash/hash_whirlpool.c b/ext/hash/hash_whirlpool.c
index ca41e523d0..b20dc82c17 100644
--- a/ext/hash/hash_whirlpool.c
+++ b/ext/hash/hash_whirlpool.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -263,8 +263,8 @@ static void WhirlpoolTransform(PHP_WHIRLPOOL_CTX *context)
context->state[5] ^= state[5] ^ block[5];
context->state[6] ^= state[6] ^ block[6];
context->state[7] ^= state[7] ^ block[7];
-
- memset(state, 0, sizeof(state));
+
+ ZEND_SECURE_ZERO(state, sizeof(state));
}
PHP_HASH_API void PHP_WHIRLPOOLInit(PHP_WHIRLPOOL_CTX *context)
@@ -430,7 +430,7 @@ PHP_HASH_API void PHP_WHIRLPOOLFinal(unsigned char digest[64], PHP_WHIRLPOOL_CTX
digest += 8;
}
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
const php_hash_ops php_hash_whirlpool_ops = {
diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h
index d6905cfbd5..0fd0490f61 100644
--- a/ext/hash/php_hash.h
+++ b/ext/hash/php_hash.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_adler32.h b/ext/hash/php_hash_adler32.h
index ca78b38a13..73ef1067a1 100644
--- a/ext/hash/php_hash_adler32.h
+++ b/ext/hash/php_hash_adler32.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_crc32.h b/ext/hash/php_hash_crc32.h
index cc61243c30..fbd39e93df 100644
--- a/ext/hash/php_hash_crc32.h
+++ b/ext/hash/php_hash_crc32.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_crc32_tables.h b/ext/hash/php_hash_crc32_tables.h
index 30f5602287..889e4f667f 100644
--- a/ext/hash/php_hash_crc32_tables.h
+++ b/ext/hash/php_hash_crc32_tables.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_fnv.h b/ext/hash/php_hash_fnv.h
index 10023fc618..40005f2ead 100644
--- a/ext/hash/php_hash_fnv.h
+++ b/ext/hash/php_hash_fnv.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_gost.h b/ext/hash/php_hash_gost.h
index cd3f9cfe90..f1fda06c72 100644
--- a/ext/hash/php_hash_gost.h
+++ b/ext/hash/php_hash_gost.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_haval.h b/ext/hash/php_hash_haval.h
index 4a37815daf..1fafe5742e 100644
--- a/ext/hash/php_hash_haval.h
+++ b/ext/hash/php_hash_haval.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_joaat.h b/ext/hash/php_hash_joaat.h
index 494e7eb09a..d722efcae6 100644
--- a/ext/hash/php_hash_joaat.h
+++ b/ext/hash/php_hash_joaat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_md.h b/ext/hash/php_hash_md.h
index 473abee66c..cfb696a323 100644
--- a/ext/hash/php_hash_md.h
+++ b/ext/hash/php_hash_md.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_ripemd.h b/ext/hash/php_hash_ripemd.h
index b564b3a17c..8eae0107b3 100644
--- a/ext/hash/php_hash_ripemd.h
+++ b/ext/hash/php_hash_ripemd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_sha.h b/ext/hash/php_hash_sha.h
index bd24fb0974..6517619f17 100644
--- a/ext/hash/php_hash_sha.h
+++ b/ext/hash/php_hash_sha.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_snefru.h b/ext/hash/php_hash_snefru.h
index 214edb1982..d36e34df47 100644
--- a/ext/hash/php_hash_snefru.h
+++ b/ext/hash/php_hash_snefru.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_snefru_tables.h b/ext/hash/php_hash_snefru_tables.h
index ef92453031..89fae8bd69 100644
--- a/ext/hash/php_hash_snefru_tables.h
+++ b/ext/hash/php_hash_snefru_tables.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_tiger.h b/ext/hash/php_hash_tiger.h
index fd602d6819..f8d6a738d7 100644
--- a/ext/hash/php_hash_tiger.h
+++ b/ext/hash/php_hash_tiger.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_tiger_tables.h b/ext/hash/php_hash_tiger_tables.h
index f3e726f80c..3cf9846803 100644
--- a/ext/hash/php_hash_tiger_tables.h
+++ b/ext/hash/php_hash_tiger_tables.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_whirlpool.h b/ext/hash/php_hash_whirlpool.h
index d28b1d927c..15882c6a07 100644
--- a/ext/hash/php_hash_whirlpool.h
+++ b/ext/hash/php_hash_whirlpool.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/hash/php_hash_whirlpool_tables.h b/ext/hash/php_hash_whirlpool_tables.h
index 4951636003..4599f82444 100644
--- a/ext/hash/php_hash_whirlpool_tables.h
+++ b/ext/hash/php_hash_whirlpool_tables.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index ee4bdb8166..7ca97f9418 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -223,39 +223,39 @@ static char _generic_superset_name[] = ICONV_UCS4_ENCODING;
static PHP_INI_MH(OnUpdateInputEncoding)
{
- if (new_value_length >= ICONV_CSNMAXLEN) {
+ if (new_value->len >= ICONV_CSNMAXLEN) {
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.input_encoding is deprecated");
}
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
static PHP_INI_MH(OnUpdateOutputEncoding)
{
- if(new_value_length >= ICONV_CSNMAXLEN) {
+ if(new_value->len >= ICONV_CSNMAXLEN) {
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.output_encoding is deprecated");
}
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
static PHP_INI_MH(OnUpdateInternalEncoding)
{
- if(new_value_length >= ICONV_CSNMAXLEN) {
+ if(new_value->len >= ICONV_CSNMAXLEN) {
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.internal_encoding is deprecated");
}
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
@@ -415,7 +415,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
}
if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
- zend_long len;
+ size_t len;
char *p = strstr(get_output_encoding(TSRMLS_C), "//");
if (p) {
@@ -462,10 +462,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
if (in_p != NULL) {
while (in_left > 0) {
out_left = buf_growth - out_left;
- {
- size_t newlen;
- smart_str_alloc((d), out_left, 0);
- }
+ smart_str_alloc(d, out_left, 0);
out_p = (d)->s->val + (d)->s->len;
@@ -499,10 +496,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
} else {
for (;;) {
out_left = buf_growth - out_left;
- {
- size_t newlen;
- smart_str_alloc((d), out_left, 0);
- }
+ smart_str_alloc(d, out_left, 0);
out_p = (d)->s->val + (d)->s->len;
@@ -805,7 +799,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
size_t out_left;
size_t cnt;
- zend_long total_len;
+ size_t total_len;
err = _php_iconv_strlen(&total_len, str, nbytes, enc);
if (err != PHP_ICONV_ERR_SUCCESS) {
@@ -824,16 +818,16 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
}
}
- if(len > total_len) {
+ if((size_t)len > total_len) {
len = total_len;
}
- if (offset >= total_len) {
+ if ((size_t)offset >= total_len) {
return PHP_ICONV_ERR_SUCCESS;
}
- if ((offset + len) > total_len ) {
+ if ((size_t)(offset + len) > total_len ) {
/* trying to compute the length */
len = total_len - offset;
}
@@ -2076,7 +2070,7 @@ PHP_FUNCTION(iconv_substr)
err = _php_iconv_substr(&retval, str->val, str->len, offset, length, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
- if (err == PHP_ICONV_ERR_SUCCESS && str->val != NULL && retval.s != NULL) {
+ if (err == PHP_ICONV_ERR_SUCCESS && str->val[0] != '\0' && retval.s != NULL) {
RETURN_STR(retval.s);
}
smart_str_free(&retval);
@@ -2407,7 +2401,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
}
}
enc_str_len_tmp -= next_pos - enc_str_tmp;
- enc_str_tmp = next_pos;
+ enc_str_tmp = (char *)next_pos;
smart_str_free(&decoded_header);
}
@@ -2456,14 +2450,15 @@ PHP_NAMED_FUNCTION(php_if_iconv)
Sets internal encoding and output encoding for ob_iconv_handler() */
PHP_FUNCTION(iconv_set_encoding)
{
- char *type, *charset;
- size_t type_len, charset_len = 0, retval;
+ char *type;
+ zend_string *charset;
+ size_t type_len, retval;
zend_string *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &type, &type_len, &charset, &charset_len) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &type, &type_len, &charset) == FAILURE)
return;
- if (charset_len >= ICONV_CSNMAXLEN) {
+ if (charset->len >= ICONV_CSNMAXLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2478,7 +2473,7 @@ PHP_FUNCTION(iconv_set_encoding)
RETURN_FALSE;
}
- retval = zend_alter_ini_entry(name, charset, charset_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ retval = zend_alter_ini_entry(name, charset, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(name);
if (retval == SUCCESS) {
@@ -2760,7 +2755,7 @@ static int php_iconv_stream_filter_append_bucket(
prev_ocnt = ocnt;
}
- if (out_buf_size - ocnt > 0) {
+ if (out_buf_size > ocnt) {
if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
goto out_failure;
}
diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h
index 76e6758588..1a8330ae24 100644
--- a/ext/iconv/php_iconv.h
+++ b/ext/iconv/php_iconv.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 3969a036fc..d937681507 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h
index a823326cca..6f18181b53 100644
--- a/ext/imap/php_imap.h
+++ b/ext/imap/php_imap.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c
index b188e54e4f..6ac44ffeb0 100644
--- a/ext/interbase/ibase_blobs.c
+++ b/ext/interbase/ibase_blobs.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c
index 63a838679d..5a64b31c75 100644
--- a/ext/interbase/ibase_events.c
+++ b/ext/interbase/ibase_events.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 10d77449dc..2cd2ada65f 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c
index bdbec7d5b0..c068c8d56b 100644
--- a/ext/interbase/ibase_service.c
+++ b/ext/interbase/ibase_service.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index a21e6469fa..59c4a0fa42 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h
index a51f44c034..8e80505c17 100644
--- a/ext/interbase/php_ibase_includes.h
+++ b/ext/interbase/php_ibase_includes.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c
index 87d25ac531..4b47fbcfb6 100644
--- a/ext/interbase/php_ibase_udf.c
+++ b/ext/interbase/php_ibase_udf.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/interbase/php_interbase.h b/ext/interbase/php_interbase.h
index 0518b586f9..c8afc8df8f 100644
--- a/ext/interbase/php_interbase.h
+++ b/ext/interbase/php_interbase.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp
index ea3a305dd9..715a866111 100644
--- a/ext/intl/breakiterator/breakiterator_class.cpp
+++ b/ext/intl/breakiterator/breakiterator_class.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/breakiterator_class.h b/ext/intl/breakiterator/breakiterator_class.h
index 0cf213f260..6333003981 100644
--- a/ext/intl/breakiterator/breakiterator_class.h
+++ b/ext/intl/breakiterator/breakiterator_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp
index d8f18f99f3..19de7bce34 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.cpp
+++ b/ext/intl/breakiterator/breakiterator_iterators.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/breakiterator_iterators.h b/ext/intl/breakiterator/breakiterator_iterators.h
index a955f3a8e7..764f4f4426 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.h
+++ b/ext/intl/breakiterator/breakiterator_iterators.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp
index cb5f669d05..1153340e14 100644
--- a/ext/intl/breakiterator/breakiterator_methods.cpp
+++ b/ext/intl/breakiterator/breakiterator_methods.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/breakiterator_methods.h b/ext/intl/breakiterator/breakiterator_methods.h
index bc9ce80105..cffe767c55 100644
--- a/ext/intl/breakiterator/breakiterator_methods.h
+++ b/ext/intl/breakiterator/breakiterator_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp
index bffd1ee5cf..723cfd5022 100644
--- a/ext/intl/breakiterator/codepointiterator_internal.cpp
+++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/codepointiterator_internal.h b/ext/intl/breakiterator/codepointiterator_internal.h
index 933347b859..0c9b8cc9a5 100644
--- a/ext/intl/breakiterator/codepointiterator_internal.h
+++ b/ext/intl/breakiterator/codepointiterator_internal.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp
index a833cf1853..d7fe359712 100644
--- a/ext/intl/breakiterator/codepointiterator_methods.cpp
+++ b/ext/intl/breakiterator/codepointiterator_methods.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/codepointiterator_methods.h b/ext/intl/breakiterator/codepointiterator_methods.h
index ad3b710fc8..92f255d704 100644
--- a/ext/intl/breakiterator/codepointiterator_methods.h
+++ b/ext/intl/breakiterator/codepointiterator_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
index 74bebb2db2..d3b36291b2 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h
index 861ca4253f..3a9209c479 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index 58375f8196..7273b1d277 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h
index 2e7fbd2172..47f991f118 100644
--- a/ext/intl/calendar/calendar_class.h
+++ b/ext/intl/calendar/calendar_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 168c791d36..eaa1930e42 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/calendar/calendar_methods.h b/ext/intl/calendar/calendar_methods.h
index dfd0bbeeaf..838917cac3 100644
--- a/ext/intl/calendar/calendar_methods.h
+++ b/ext/intl/calendar/calendar_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp
index 790a0519cd..b0c8a964f6 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/calendar/gregoriancalendar_methods.h b/ext/intl/calendar/gregoriancalendar_methods.h
index f911752cc7..659566427c 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.h
+++ b/ext/intl/calendar/gregoriancalendar_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator.c b/ext/intl/collator/collator.c
index eff9568de1..07dc6385c8 100644
--- a/ext/intl/collator/collator.c
+++ b/ext/intl/collator/collator.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator.h b/ext/intl/collator/collator.h
index 96e7aa097b..ea0071b179 100644
--- a/ext/intl/collator/collator.h
+++ b/ext/intl/collator/collator.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c
index 72446f51a7..8d879de8f7 100644
--- a/ext/intl/collator/collator_attr.c
+++ b/ext/intl/collator/collator_attr.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_attr.h b/ext/intl/collator/collator_attr.h
index 85636cc486..b86365ff5e 100644
--- a/ext/intl/collator/collator_attr.h
+++ b/ext/intl/collator/collator_attr.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c
index 25a3ac8909..fd3f08e359 100644
--- a/ext/intl/collator/collator_class.c
+++ b/ext/intl/collator/collator_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h
index 8410e96646..f9d2cedf88 100644
--- a/ext/intl/collator/collator_class.h
+++ b/ext/intl/collator/collator_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c
index 444b1fc4fd..d27ff32ebd 100644
--- a/ext/intl/collator/collator_compare.c
+++ b/ext/intl/collator/collator_compare.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_compare.h b/ext/intl/collator/collator_compare.h
index 4e38b79309..cca9ca29b1 100644
--- a/ext/intl/collator/collator_compare.h
+++ b/ext/intl/collator/collator_compare.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c
index 5a572067f6..bc279b25f7 100644
--- a/ext/intl/collator/collator_convert.c
+++ b/ext/intl/collator/collator_convert.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h
index 7e169d559e..bf116bdfd8 100644
--- a/ext/intl/collator/collator_convert.h
+++ b/ext/intl/collator/collator_convert.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c
index a1b2aa743a..3c59f218e6 100644
--- a/ext/intl/collator/collator_create.c
+++ b/ext/intl/collator/collator_create.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_create.h b/ext/intl/collator/collator_create.h
index b740e82d68..b5e9489e3d 100644
--- a/ext/intl/collator/collator_create.h
+++ b/ext/intl/collator/collator_create.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c
index 91bc25d077..fb8886ef64 100644
--- a/ext/intl/collator/collator_error.c
+++ b/ext/intl/collator/collator_error.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_error.h b/ext/intl/collator/collator_error.h
index b2f44ea2a3..3c8c10a043 100644
--- a/ext/intl/collator/collator_error.h
+++ b/ext/intl/collator/collator_error.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c
index db9e41f887..a93cd962f3 100644
--- a/ext/intl/collator/collator_is_numeric.c
+++ b/ext/intl/collator/collator_is_numeric.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_is_numeric.h b/ext/intl/collator/collator_is_numeric.h
index d7aa12ce46..5ede4fa922 100644
--- a/ext/intl/collator/collator_is_numeric.h
+++ b/ext/intl/collator/collator_is_numeric.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.c
index dd37cc75db..76f154bb7c 100644
--- a/ext/intl/collator/collator_locale.c
+++ b/ext/intl/collator/collator_locale.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_locale.h b/ext/intl/collator/collator_locale.h
index bda90cd3b9..b2f837b49a 100644
--- a/ext/intl/collator/collator_locale.h
+++ b/ext/intl/collator/collator_locale.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index 59ad31b1dc..4fd7c4597e 100644
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/collator/collator_sort.h b/ext/intl/collator/collator_sort.h
index a990cdf089..b5cb017a8c 100644
--- a/ext/intl/collator/collator_sort.h
+++ b/ext/intl/collator/collator_sort.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp
index 783611e02f..23dc342080 100644
--- a/ext/intl/common/common_date.cpp
+++ b/ext/intl/common/common_date.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h
index d2396cbf5a..e8ab66f40d 100644
--- a/ext/intl/common/common_date.h
+++ b/ext/intl/common/common_date.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp
index ff28bdb456..952b39edca 100644
--- a/ext/intl/common/common_enum.cpp
+++ b/ext/intl/common/common_enum.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/common/common_enum.h b/ext/intl/common/common_enum.h
index 2b6d1790d9..af46a47751 100644
--- a/ext/intl/common/common_enum.h
+++ b/ext/intl/common/common_enum.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c
index f7b739555e..524bb94327 100644
--- a/ext/intl/common/common_error.c
+++ b/ext/intl/common/common_error.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/common/common_error.h b/ext/intl/common/common_error.h
index 8716222124..46a26793ee 100644
--- a/ext/intl/common/common_error.h
+++ b/ext/intl/common/common_error.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index 887c404271..b27652aa9a 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/converter/converter.h b/ext/intl/converter/converter.h
index bd316fcf98..520c7c6c86 100644
--- a/ext/intl/converter/converter.h
+++ b/ext/intl/converter/converter.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c
index eedc60040e..ffa606a9cd 100644
--- a/ext/intl/dateformat/dateformat.c
+++ b/ext/intl/dateformat/dateformat.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat.h b/ext/intl/dateformat/dateformat.h
index f11918b79f..6139b67951 100644
--- a/ext/intl/dateformat/dateformat.h
+++ b/ext/intl/dateformat/dateformat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c
index 0450ef1c37..314ae730c7 100644
--- a/ext/intl/dateformat/dateformat_attr.c
+++ b/ext/intl/dateformat/dateformat_attr.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_attr.h b/ext/intl/dateformat/dateformat_attr.h
index 6fe82a6e00..e7013a9e2a 100644
--- a/ext/intl/dateformat/dateformat_attr.h
+++ b/ext/intl/dateformat/dateformat_attr.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp
index 5f63d33143..71b136c6c1 100644
--- a/ext/intl/dateformat/dateformat_attrcpp.cpp
+++ b/ext/intl/dateformat/dateformat_attrcpp.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_attrcpp.h b/ext/intl/dateformat/dateformat_attrcpp.h
index 408232f940..54536f21fa 100644
--- a/ext/intl/dateformat/dateformat_attrcpp.h
+++ b/ext/intl/dateformat/dateformat_attrcpp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c
index 4c46a7d694..0d93338ecd 100644
--- a/ext/intl/dateformat/dateformat_class.c
+++ b/ext/intl/dateformat/dateformat_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h
index a3eb4b9839..ebd057022e 100644
--- a/ext/intl/dateformat/dateformat_class.h
+++ b/ext/intl/dateformat/dateformat_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
index 97997554a5..4a272aa45f 100644
--- a/ext/intl/dateformat/dateformat_create.cpp
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_create.h b/ext/intl/dateformat/dateformat_create.h
index 47e67c2f45..c6e2d0feb8 100644
--- a/ext/intl/dateformat/dateformat_create.h
+++ b/ext/intl/dateformat/dateformat_create.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_data.c b/ext/intl/dateformat/dateformat_data.c
index 33451e1c51..509e91b617 100644
--- a/ext/intl/dateformat/dateformat_data.c
+++ b/ext/intl/dateformat/dateformat_data.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h
index cde9e363c9..a49da7dc89 100644
--- a/ext/intl/dateformat/dateformat_data.h
+++ b/ext/intl/dateformat/dateformat_data.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c
index dd9b64d4ee..d11eb2df24 100644
--- a/ext/intl/dateformat/dateformat_format.c
+++ b/ext/intl/dateformat/dateformat_format.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_format.h b/ext/intl/dateformat/dateformat_format.h
index 49f34c6892..02b773f991 100644
--- a/ext/intl/dateformat/dateformat_format.h
+++ b/ext/intl/dateformat/dateformat_format.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp
index 2b431383ff..b552ed7529 100644
--- a/ext/intl/dateformat/dateformat_format_object.cpp
+++ b/ext/intl/dateformat/dateformat_format_object.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_format_object.h b/ext/intl/dateformat/dateformat_format_object.h
index d80ea87e0f..f92296cd59 100644
--- a/ext/intl/dateformat/dateformat_format_object.h
+++ b/ext/intl/dateformat/dateformat_format_object.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp
index 92296be97a..b3f134a4f1 100644
--- a/ext/intl/dateformat/dateformat_helpers.cpp
+++ b/ext/intl/dateformat/dateformat_helpers.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h
index ca88da008a..c6121d75bb 100644
--- a/ext/intl/dateformat/dateformat_helpers.h
+++ b/ext/intl/dateformat/dateformat_helpers.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index 183ccb261c..15279da3a1 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/dateformat/dateformat_parse.h b/ext/intl/dateformat/dateformat_parse.h
index c74a3d5f15..694dbf8d90 100644
--- a/ext/intl/dateformat/dateformat_parse.h
+++ b/ext/intl/dateformat/dateformat_parse.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter.c b/ext/intl/formatter/formatter.c
index 12cbb6c75b..bb4d3d2ac5 100644
--- a/ext/intl/formatter/formatter.c
+++ b/ext/intl/formatter/formatter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter.h b/ext/intl/formatter/formatter.h
index 1f9ebead8e..47ec473aae 100644
--- a/ext/intl/formatter/formatter.h
+++ b/ext/intl/formatter/formatter.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c
index 7278007c35..639342f4af 100644
--- a/ext/intl/formatter/formatter_attr.c
+++ b/ext/intl/formatter/formatter_attr.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_attr.h b/ext/intl/formatter/formatter_attr.h
index c4bc94ce5f..e8690ac8a4 100644
--- a/ext/intl/formatter/formatter_attr.h
+++ b/ext/intl/formatter/formatter_attr.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c
index 601aeae5e6..8fcc155e85 100644
--- a/ext/intl/formatter/formatter_class.c
+++ b/ext/intl/formatter/formatter_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h
index 12061ba5df..1db688712c 100644
--- a/ext/intl/formatter/formatter_class.h
+++ b/ext/intl/formatter/formatter_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_data.c b/ext/intl/formatter/formatter_data.c
index 88f122f7c9..2f785ba68f 100644
--- a/ext/intl/formatter/formatter_data.c
+++ b/ext/intl/formatter/formatter_data.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h
index adc4818afc..0e3bc4fea4 100644
--- a/ext/intl/formatter/formatter_data.h
+++ b/ext/intl/formatter/formatter_data.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c
index 1382b88d74..937cb05812 100644
--- a/ext/intl/formatter/formatter_format.c
+++ b/ext/intl/formatter/formatter_format.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_format.h b/ext/intl/formatter/formatter_format.h
index 35fafd1ede..af7b0ffe26 100644
--- a/ext/intl/formatter/formatter_format.h
+++ b/ext/intl/formatter/formatter_format.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c
index f7ac1b789f..939a8f782b 100644
--- a/ext/intl/formatter/formatter_main.c
+++ b/ext/intl/formatter/formatter_main.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_main.h b/ext/intl/formatter/formatter_main.h
index 7669e684ae..66cf5c1b6b 100644
--- a/ext/intl/formatter/formatter_main.h
+++ b/ext/intl/formatter/formatter_main.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index a84eecb2a9..0959d11830 100644
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/formatter/formatter_parse.h b/ext/intl/formatter/formatter_parse.h
index cb96c72b5d..7a3098fcb2 100644
--- a/ext/intl/formatter/formatter_parse.h
+++ b/ext/intl/formatter/formatter_parse.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h
index 756ce9173e..5256a272a1 100644
--- a/ext/intl/grapheme/grapheme.h
+++ b/ext/intl/grapheme/grapheme.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c
index c752b02372..5e94eefc8a 100644
--- a/ext/intl/grapheme/grapheme_util.c
+++ b/ext/intl/grapheme/grapheme_util.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h
index 235d043818..a66796d80d 100644
--- a/ext/intl/grapheme/grapheme_util.h
+++ b/ext/intl/grapheme/grapheme_util.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c
index 99e484c17e..1d07dbba80 100644
--- a/ext/intl/idn/idn.c
+++ b/ext/intl/idn/idn.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2009 The PHP Group |
+----------------------------------------------------------------------+
@@ -184,7 +184,7 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
add_assoc_zval_ex(idna_info, "result", sizeof("result")-1, return_value);
} else {
zval zv;
- ZVAL_STR(&zv, buffer);
+ ZVAL_NEW_STR(&zv, buffer);
buffer_used = 1;
add_assoc_zval_ex(idna_info, "result", sizeof("result")-1, &zv);
}
diff --git a/ext/intl/idn/idn.h b/ext/intl/idn/idn.h
index 1fa4f8f2e5..1d49fe9f0a 100644
--- a/ext/intl/idn/idn.h
+++ b/ext/intl/idn/idn.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2009 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/intl/intl_common.h b/ext/intl/intl_common.h
index 9424571d02..a49794648d 100644
--- a/ext/intl/intl_common.h
+++ b/ext/intl/intl_common.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_convert.c b/ext/intl/intl_convert.c
index 92cdc4cef4..7f756b9e7f 100644
--- a/ext/intl/intl_convert.c
+++ b/ext/intl/intl_convert.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_convert.h b/ext/intl/intl_convert.h
index 3fc03f4bb7..952d765c52 100644
--- a/ext/intl/intl_convert.h
+++ b/ext/intl/intl_convert.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_convertcpp.cpp b/ext/intl/intl_convertcpp.cpp
index f699a3c61c..f52348bc25 100644
--- a/ext/intl/intl_convertcpp.cpp
+++ b/ext/intl/intl_convertcpp.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_convertcpp.h b/ext/intl/intl_convertcpp.h
index 89d4209dd3..fc2242a6b8 100644
--- a/ext/intl/intl_convertcpp.h
+++ b/ext/intl/intl_convertcpp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_cppshims.h b/ext/intl/intl_cppshims.h
index e58ec3bd45..e2db488d93 100644
--- a/ext/intl/intl_cppshims.h
+++ b/ext/intl/intl_cppshims.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h
index 1b764a2ab1..a7afb36be9 100644
--- a/ext/intl/intl_data.h
+++ b/ext/intl/intl_data.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c
index 5c082ce190..9474834417 100644
--- a/ext/intl/intl_error.c
+++ b/ext/intl/intl_error.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h
index 06f33a4bd3..6a809e8e39 100644
--- a/ext/intl/intl_error.h
+++ b/ext/intl/intl_error.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/locale/locale.c b/ext/intl/locale/locale.c
index 921e6e589f..21c875ca5d 100644
--- a/ext/intl/locale/locale.c
+++ b/ext/intl/locale/locale.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/locale/locale.h b/ext/intl/locale/locale.h
index f3859c7a2a..9118bee653 100644
--- a/ext/intl/locale/locale.h
+++ b/ext/intl/locale/locale.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/locale/locale_class.c b/ext/intl/locale/locale_class.c
index 432cfb28fc..eec4699b6d 100644
--- a/ext/intl/locale/locale_class.c
+++ b/ext/intl/locale/locale_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/locale/locale_class.h b/ext/intl/locale/locale_class.h
index cbddccbe17..afae06c77c 100644
--- a/ext/intl/locale/locale_class.h
+++ b/ext/intl/locale/locale_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index 843f669342..2679983646 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -223,12 +223,11 @@ PHP_NAMED_FUNCTION(zif_locale_get_default)
Set default locale */
PHP_NAMED_FUNCTION(zif_locale_set_default)
{
- char* locale_name = NULL;
- size_t len = 0;
+ zend_string* locale_name;
zend_string *ini_name;
+ char *default_locale = NULL;
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &locale_name ,&len ) == FAILURE)
+ if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S", &locale_name) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"locale_set_default: unable to parse input params", 0 TSRMLS_CC );
@@ -236,14 +235,17 @@ PHP_NAMED_FUNCTION(zif_locale_set_default)
RETURN_FALSE;
}
- if(len == 0) {
- locale_name = (char *)uloc_getDefault() ;
- len = strlen(locale_name);
+ if (locale_name->len == 0) {
+ default_locale = (char *)uloc_getDefault();
+ locale_name = zend_string_init(default_locale, strlen(default_locale), 0);
}
ini_name = zend_string_init(LOCALE_INI_NAME, sizeof(LOCALE_INI_NAME) - 1, 0);
- zend_alter_ini_entry(ini_name, locale_name, len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, locale_name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
+ if (default_locale != NULL) {
+ zend_string_release(locale_name);
+ }
RETURN_TRUE;
}
diff --git a/ext/intl/locale/locale_methods.h b/ext/intl/locale/locale_methods.h
index e88fac64b7..bc11975c18 100644
--- a/ext/intl/locale/locale_methods.h
+++ b/ext/intl/locale/locale_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index b42d87967e..2ca8ed9186 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat.h b/ext/intl/msgformat/msgformat.h
index 205c7066fd..a0b2c89644 100644
--- a/ext/intl/msgformat/msgformat.h
+++ b/ext/intl/msgformat/msgformat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index 9359b796c3..79c04266e0 100644
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_attr.h b/ext/intl/msgformat/msgformat_attr.h
index 898c4451e1..891f44c073 100644
--- a/ext/intl/msgformat/msgformat_attr.h
+++ b/ext/intl/msgformat/msgformat_attr.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index 71504bce2c..65f32bf683 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h
index 66b6ce18a5..8c2c29a7dd 100644
--- a/ext/intl/msgformat/msgformat_class.h
+++ b/ext/intl/msgformat/msgformat_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index 5d49054473..f94920d3e8 100644
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h
index 3b7bdda78e..f3a594d25a 100644
--- a/ext/intl/msgformat/msgformat_data.h
+++ b/ext/intl/msgformat/msgformat_data.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index cb81137316..36cd61c685 100644
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_format.h b/ext/intl/msgformat/msgformat_format.h
index b74deab8ff..12b0e4a283 100644
--- a/ext/intl/msgformat/msgformat_format.h
+++ b/ext/intl/msgformat/msgformat_format.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index c0c204cc69..46ebe25a17 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index f88fd4f06b..41d179f8d0 100644
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c
index 516f493ec9..add2f901eb 100644
--- a/ext/intl/msgformat/msgformat_parse.c
+++ b/ext/intl/msgformat/msgformat_parse.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/msgformat/msgformat_parse.h b/ext/intl/msgformat/msgformat_parse.h
index a937235839..4a86403a48 100644
--- a/ext/intl/msgformat/msgformat_parse.h
+++ b/ext/intl/msgformat/msgformat_parse.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/normalizer/normalizer.c b/ext/intl/normalizer/normalizer.c
index f06a3e685c..18c3cedcaf 100644
--- a/ext/intl/normalizer/normalizer.c
+++ b/ext/intl/normalizer/normalizer.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/normalizer/normalizer.h b/ext/intl/normalizer/normalizer.h
index eca9abe05a..c057a51883 100644
--- a/ext/intl/normalizer/normalizer.h
+++ b/ext/intl/normalizer/normalizer.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.c
index 154d877e3f..ccd8be3b29 100644
--- a/ext/intl/normalizer/normalizer_class.c
+++ b/ext/intl/normalizer/normalizer_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h
index 4d3f7d2341..3ce37fae88 100644
--- a/ext/intl/normalizer/normalizer_class.h
+++ b/ext/intl/normalizer/normalizer_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/normalizer/normalizer_normalize.h b/ext/intl/normalizer/normalizer_normalize.h
index 41c31f7949..c282c56795 100644
--- a/ext/intl/normalizer/normalizer_normalize.h
+++ b/ext/intl/normalizer/normalizer_normalize.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 9ca225ab88..2c5e74809d 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h
index 86a75cb335..3625c4fdcc 100644
--- a/ext/intl/php_intl.h
+++ b/ext/intl/php_intl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c
index 1232a42868..9b6b734ed6 100644
--- a/ext/intl/resourcebundle/resourcebundle.c
+++ b/ext/intl/resourcebundle/resourcebundle.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/resourcebundle/resourcebundle.h b/ext/intl/resourcebundle/resourcebundle.h
index 607ece98ba..e5aa9f092b 100644
--- a/ext/intl/resourcebundle/resourcebundle.h
+++ b/ext/intl/resourcebundle/resourcebundle.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index a8252de638..0fbf7931d4 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h
index 7cb015a8df..403b6beb17 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.h
+++ b/ext/intl/resourcebundle/resourcebundle_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c
index bdedfd15bc..cf38c6b676 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.c
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.h b/ext/intl/resourcebundle/resourcebundle_iterator.h
index 32818f847f..b28fa91638 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.h
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker.c b/ext/intl/spoofchecker/spoofchecker.c
index 42a014a90e..0a22875dcf 100644
--- a/ext/intl/spoofchecker/spoofchecker.c
+++ b/ext/intl/spoofchecker/spoofchecker.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker.h b/ext/intl/spoofchecker/spoofchecker.h
index f976d639ac..1cbdd7ea65 100644
--- a/ext/intl/spoofchecker/spoofchecker.h
+++ b/ext/intl/spoofchecker/spoofchecker.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c
index 7ae1a2feb6..5fb6ffb90c 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.c
+++ b/ext/intl/spoofchecker/spoofchecker_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h
index 9683b03b08..847b0a97b5 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.h
+++ b/ext/intl/spoofchecker/spoofchecker_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker_create.c b/ext/intl/spoofchecker/spoofchecker_create.c
index cf0173f997..962e31cb08 100644
--- a/ext/intl/spoofchecker/spoofchecker_create.c
+++ b/ext/intl/spoofchecker/spoofchecker_create.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker_create.h b/ext/intl/spoofchecker/spoofchecker_create.h
index 313faab8a3..405c1bda12 100644
--- a/ext/intl/spoofchecker/spoofchecker_create.h
+++ b/ext/intl/spoofchecker/spoofchecker_create.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c
index e5d11a899e..959a0c568f 100644
--- a/ext/intl/spoofchecker/spoofchecker_main.c
+++ b/ext/intl/spoofchecker/spoofchecker_main.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/spoofchecker/spoofchecker_main.h b/ext/intl/spoofchecker/spoofchecker_main.h
index fb920d7841..44c99ec856 100644
--- a/ext/intl/spoofchecker/spoofchecker_main.h
+++ b/ext/intl/spoofchecker/spoofchecker_main.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index 623a643c49..d2aaa12344 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h
index 71de20c09e..94b781b332 100644
--- a/ext/intl/timezone/timezone_class.h
+++ b/ext/intl/timezone/timezone_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index 530e6c5bed..033b216cdf 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/timezone/timezone_methods.h b/ext/intl/timezone/timezone_methods.h
index 28c39f4fd7..29d72913fd 100644
--- a/ext/intl/timezone/timezone_methods.h
+++ b/ext/intl/timezone/timezone_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/transliterator/transliterator.c b/ext/intl/transliterator/transliterator.c
index 5f698e2b90..fda183b85a 100644
--- a/ext/intl/transliterator/transliterator.c
+++ b/ext/intl/transliterator/transliterator.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/transliterator/transliterator.h b/ext/intl/transliterator/transliterator.h
index cfd5d38dbd..3e38095b89 100644
--- a/ext/intl/transliterator/transliterator.h
+++ b/ext/intl/transliterator/transliterator.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c
index ff299a8f38..647ece8ba0 100644
--- a/ext/intl/transliterator/transliterator_class.c
+++ b/ext/intl/transliterator/transliterator_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/transliterator/transliterator_class.h b/ext/intl/transliterator/transliterator_class.h
index a99c2ced16..f70e86995f 100644
--- a/ext/intl/transliterator/transliterator_class.h
+++ b/ext/intl/transliterator/transliterator_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c
index 978c830da7..e79aeb1621 100644
--- a/ext/intl/transliterator/transliterator_methods.c
+++ b/ext/intl/transliterator/transliterator_methods.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/transliterator/transliterator_methods.h b/ext/intl/transliterator/transliterator_methods.h
index b806de84fb..ff0b93a29a 100644
--- a/ext/intl/transliterator/transliterator_methods.h
+++ b/ext/intl/transliterator/transliterator_methods.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/json/json.c b/ext/json/json.c
index 24324bbe99..485d14d11b 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -384,7 +384,7 @@ static void json_escape_string(smart_str *buf, char *s, size_t len, int options
{
int status;
unsigned int us, next_us = 0;
- size_t pos, checkpoint, newlen;
+ size_t pos, checkpoint;
if (len == 0) {
smart_str_appendl(buf, "\"\"", 2);
@@ -789,7 +789,7 @@ static PHP_FUNCTION(json_encode)
ZVAL_FALSE(return_value);
} else {
smart_str_0(&buf); /* copy? */
- ZVAL_STR(return_value, buf.s);
+ ZVAL_NEW_STR(return_value, buf.s);
}
}
/* }}} */
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 08a4a7ff94..05dcc43e06 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/json/utf8_decode.h b/ext/json/utf8_decode.h
index cc0fc79f6c..0908edd2d4 100644
--- a/ext/json/utf8_decode.h
+++ b/ext/json/utf8_decode.h
@@ -5,8 +5,8 @@
typedef struct json_utf8_decode
{
- int the_index;
char *the_input;
+ int the_index;
int the_length;
int the_char;
int the_byte;
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 151b059026..f00799e946 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/ldap/php_ldap.h b/ext/ldap/php_ldap.h
index 944c3dd531..0ccdbfe665 100644
--- a/ext/ldap/php_ldap.h
+++ b/ext/ldap/php_ldap.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 8fd661c81d..d9e92541e9 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1030,20 +1030,20 @@ static PHP_FUNCTION(libxml_get_errors)
zval z_error;
object_init_ex(&z_error, libxmlerror_class_entry);
- add_property_long(&z_error, "level", error->level);
- add_property_long(&z_error, "code", error->code);
- add_property_long(&z_error, "column", error->int2);
+ add_property_long_ex(&z_error, "level", sizeof("level") - 1, error->level TSRMLS_CC);
+ add_property_long_ex(&z_error, "code", sizeof("code") - 1, error->code TSRMLS_CC);
+ add_property_long_ex(&z_error, "column", sizeof("column") - 1, error->int2 TSRMLS_CC);
if (error->message) {
- add_property_string(&z_error, "message", error->message);
+ add_property_string_ex(&z_error, "message", sizeof("message") - 1, error->message TSRMLS_CC);
} else {
- add_property_stringl(&z_error, "message", "", 0);
+ add_property_stringl_ex(&z_error, "message", sizeof("message") - 1, "", 0 TSRMLS_CC);
}
if (error->file) {
- add_property_string(&z_error, "file", error->file);
+ add_property_string_ex(&z_error, "file", sizeof("file") - 1, error->file TSRMLS_CC);
} else {
- add_property_stringl(&z_error, "file", "", 0);
+ add_property_stringl_ex(&z_error, "file", sizeof("file") - 1, "", 0 TSRMLS_CC);
}
- add_property_long(&z_error, "line", error->line);
+ add_property_long_ex(&z_error, "line", sizeof("line") - 1, error->line TSRMLS_CC);
add_next_index_zval(return_value, &z_error);
error = zend_llist_get_next(LIBXML(error_list));
diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h
index b79ca17556..b06462db28 100644
--- a/ext/libxml/php_libxml.h
+++ b/ext/libxml/php_libxml.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index 92e7327787..a50768f6d0 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h
index ab6fcc86e0..091d8e2d9b 100644
--- a/ext/mbstring/mb_gpc.h
+++ b/ext/mbstring/mb_gpc.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2001 The PHP Group |
+----------------------------------------------------------------------+
@@ -30,14 +30,14 @@
#if HAVE_MBSTRING
/* {{{ typedefs */
typedef struct _php_mb_encoding_handler_info_t {
- int data_type;
const char *separator;
- unsigned int report_errors: 1;
- enum mbfl_no_language to_language;
const mbfl_encoding *to_encoding;
- enum mbfl_no_language from_language;
const mbfl_encoding **from_encodings;
size_t num_from_encodings;
+ int data_type;
+ unsigned int report_errors : 1;
+ enum mbfl_no_language to_language;
+ enum mbfl_no_language from_language;
} php_mb_encoding_handler_info_t;
/* }}}*/
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 8718e9f8f2..691391ab92 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1209,7 +1209,7 @@ static PHP_INI_MH(OnUpdate_mbstring_language)
{
enum mbfl_no_language no_language;
- no_language = mbfl_name2no_language(new_value);
+ no_language = mbfl_name2no_language(new_value->val);
if (no_language == mbfl_no_language_invalid) {
MBSTRG(language) = mbfl_no_language_neutral;
return FAILURE;
@@ -1235,7 +1235,7 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
return SUCCESS;
}
- if (FAILURE == php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1 TSRMLS_CC)) {
return FAILURE;
}
@@ -1268,7 +1268,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
return SUCCESS;
}
- if (FAILURE == php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1 TSRMLS_CC)) {
return FAILURE;
}
@@ -1291,7 +1291,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
{
const mbfl_encoding *encoding;
- if (new_value == NULL || new_value_length == 0) {
+ if (new_value == NULL || new_value->len == 0) {
encoding = mbfl_name2encoding(get_output_encoding(TSRMLS_C));
if (!encoding) {
MBSTRG(http_output_encoding) = &mbfl_encoding_pass;
@@ -1299,7 +1299,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
return SUCCESS;
}
} else {
- encoding = mbfl_name2encoding(new_value);
+ encoding = mbfl_name2encoding(new_value->val);
if (!encoding) {
MBSTRG(http_output_encoding) = &mbfl_encoding_pass;
MBSTRG(current_http_output_encoding) = &mbfl_encoding_pass;
@@ -1350,13 +1350,13 @@ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.internal_encoding is deprecated");
}
- if (OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
+ if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
return FAILURE;
}
if (stage & (PHP_INI_STAGE_STARTUP | PHP_INI_STAGE_SHUTDOWN | PHP_INI_STAGE_RUNTIME)) {
- if (new_value_length) {
- return _php_mb_ini_mbstring_internal_encoding_set(new_value, new_value_length TSRMLS_CC);
+ if (new_value && new_value->len) {
+ return _php_mb_ini_mbstring_internal_encoding_set(new_value->val, new_value->len TSRMLS_CC);
} else {
return _php_mb_ini_mbstring_internal_encoding_set(get_internal_encoding(TSRMLS_C), strlen(get_internal_encoding(TSRMLS_C))+1 TSRMLS_CC);
}
@@ -1379,20 +1379,20 @@ static PHP_INI_MH(OnUpdate_mbstring_substitute_character)
char *endptr = NULL;
if (new_value != NULL) {
- if (strcasecmp("none", new_value) == 0) {
+ if (strcasecmp("none", new_value->val) == 0) {
MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE;
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE;
- } else if (strcasecmp("long", new_value) == 0) {
+ } else if (strcasecmp("long", new_value->val) == 0) {
MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG;
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG;
- } else if (strcasecmp("entity", new_value) == 0) {
+ } else if (strcasecmp("entity", new_value->val) == 0) {
MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY;
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY;
} else {
MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
- if (new_value_length >0) {
- c = strtol(new_value, &endptr, 0);
+ if (new_value->len >0) {
+ c = strtol(new_value->val, &endptr, 0);
if (*endptr == '\0') {
MBSTRG(filter_illegal_substchar) = c;
MBSTRG(current_filter_illegal_substchar) = c;
@@ -1417,7 +1417,7 @@ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation)
return FAILURE;
}
- OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
if (MBSTRG(encoding_translation)) {
sapi_unregister_post_entry(php_post_entries TSRMLS_CC);
@@ -1439,9 +1439,8 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output_conv_mimetypes)
if (!new_value) {
new_value = entry->orig_value;
- new_value_length = entry->orig_value_length;
}
- php_trim(new_value, new_value_length, NULL, 0, &tmp, 3 TSRMLS_CC);
+ php_trim(new_value->val, new_value->len, NULL, 0, &tmp, 3 TSRMLS_CC);
if (Z_STRLEN(tmp) > 0) {
if (!(re = _php_mb_compile_regex(Z_STRVAL(tmp) TSRMLS_CC))) {
@@ -1732,18 +1731,17 @@ PHP_MINFO_FUNCTION(mbstring)
Sets the current language or Returns the current language as a string */
PHP_FUNCTION(mb_language)
{
- char *name = NULL;
- size_t name_len = 0;
+ zend_string *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
return;
}
if (name == NULL) {
RETVAL_STRING((char *)mbfl_no_language2name(MBSTRG(language)));
} else {
zend_string *ini_name = zend_string_init("mbstring.language", sizeof("mbstring.language") - 1, 0);
- if (FAILURE == zend_alter_ini_entry(ini_name, name, name_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown language \"%s\"", name);
+ if (FAILURE == zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown language \"%s\"", name->val);
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -2965,7 +2963,7 @@ PHP_FUNCTION(mb_strimwidth)
string.val = (unsigned char *)str;
string.len = str_len;
- if (from < 0 || from > str_len) {
+ if (from < 0 || (size_t)from > str_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start position is out of range");
RETURN_FALSE;
}
@@ -4197,7 +4195,7 @@ PHP_FUNCTION(mb_send_mail)
}
/* Subject: */
- if (subject != NULL && subject_len >= 0) {
+ if (subject != NULL) {
orig_str.no_language = MBSTRG(language);
orig_str.val = (unsigned char *)subject;
orig_str.len = subject_len;
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 8e6310f75f..0136f8ef7d 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 9628ee2526..246f2223d1 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -717,7 +717,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* don't bother doing an extended regex with just a number */
}
- if (!Z_STRVAL_P(arg_pattern) || Z_STRLEN_P(arg_pattern) == 0) {
+ if (Z_STRLEN_P(arg_pattern) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern");
RETVAL_FALSE;
goto out;
@@ -1081,7 +1081,7 @@ PHP_FUNCTION(mb_split)
err = 0;
regs = onig_region_new();
/* churn through str, generating array entries as we go */
- while (count != 0 && (pos - (OnigUChar *)string) < string_len) {
+ while (count != 0 && (pos - (OnigUChar *)string) < (ptrdiff_t)string_len) {
int beg, end;
err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0);
if (err < 0) {
@@ -1403,7 +1403,7 @@ PHP_FUNCTION(mb_ereg_search_setpos)
return;
}
- if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && position >= Z_STRLEN(MBREX(search_str)))) {
+ if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range");
MBREX(search_pos) = 0;
RETURN_FALSE;
diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h
index 3d2e2b8e46..0088b0a716 100644
--- a/ext/mbstring/php_mbregex.h
+++ b/ext/mbstring/php_mbregex.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index a1db6819e9..ee5b75e67a 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h
index 5932b8d2da..e376895cbd 100644
--- a/ext/mbstring/php_unicode.h
+++ b/ext/mbstring/php_unicode.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mbstring/tests/zend_multibyte-02.phpt b/ext/mbstring/tests/zend_multibyte-02.phpt
index 8a1a572804..7db444841e 100644
--- a/ext/mbstring/tests/zend_multibyte-02.phpt
+++ b/ext/mbstring/tests/zend_multibyte-02.phpt
@@ -1,6 +1,7 @@
--TEST--
zend multibyte (2)
--INI--
+error_reporting=E_ALL & ~E_DEPRECATED
zend.multibyte=On
zend.script_encoding=UTF-8
mbstring.internal_encoding=CP932
@@ -9,4 +10,4 @@ mbstring.internal_encoding=CP932
var_dump(bin2hex("テスト"));
?>
--EXPECTF--
-php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed.
+string(12) "836583588367"
diff --git a/ext/mbstring/tests/zend_multibyte-06.phpt b/ext/mbstring/tests/zend_multibyte-06.phpt
index 1b8adb5186..7eeac1d353 100644
--- a/ext/mbstring/tests/zend_multibyte-06.phpt
+++ b/ext/mbstring/tests/zend_multibyte-06.phpt
@@ -10,4 +10,4 @@ declare(encoding="UTF-8");
var_dump(bin2hex("テスト"));
?>
--EXPECTF--
-php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed.
+string(12) "836583588367"
diff --git a/ext/mbstring/tests/zend_multibyte-07.phpt b/ext/mbstring/tests/zend_multibyte-07.phpt
index 50d4cd95ed..685c6f1f04 100644
--- a/ext/mbstring/tests/zend_multibyte-07.phpt
+++ b/ext/mbstring/tests/zend_multibyte-07.phpt
@@ -1,8 +1,5 @@
--TEST--
zend multibyte (7)
---SKIPIF--
---XFAIL--
-https://bugs.php.net/bug.php?id=66582
--INI--
error_reporting=E_ALL & ~E_DEPRECATED
zend.multibyte=On
diff --git a/ext/mbstring/tests/zend_multibyte-09.phpt b/ext/mbstring/tests/zend_multibyte-09.phpt
index 7b0015c6c1..f9b8bf734f 100644
--- a/ext/mbstring/tests/zend_multibyte-09.phpt
+++ b/ext/mbstring/tests/zend_multibyte-09.phpt
@@ -1,8 +1,5 @@
--TEST--
zend multibyte (9)
---SKIPIF--
---XFAIL--
-https://bugs.php.net/bug.php?id=66582
--INI--
error_reporting=E_ALL & ~E_DEPRECATED
zend.multibyte=On
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index bfd9003e55..e572b7e4ba 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c
index 698664b236..26f3dceba7 100644
--- a/ext/mcrypt/mcrypt_filter.c
+++ b/ext/mcrypt/mcrypt_filter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mcrypt/php_mcrypt.h b/ext/mcrypt/php_mcrypt.h
index 9dfa1d8185..994e1cbfa5 100644
--- a/ext/mcrypt/php_mcrypt.h
+++ b/ext/mcrypt/php_mcrypt.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mcrypt/php_mcrypt_filter.h b/ext/mcrypt/php_mcrypt_filter.h
index bfb0d7288f..cacac5ca46 100644
--- a/ext/mcrypt/php_mcrypt_filter.h
+++ b/ext/mcrypt/php_mcrypt_filter.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 8746895cdd..1ba77ca8c4 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h
index 5b2456e9bd..b0313a160a 100644
--- a/ext/mssql/php_mssql.h
+++ b/ext/mssql/php_mssql.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysql/mysql_mysqlnd.h b/ext/mysql/mysql_mysqlnd.h
index 0c4c221b15..29ac9838f2 100644
--- a/ext/mysql/mysql_mysqlnd.h
+++ b/ext/mysql/mysql_mysqlnd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2009 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 424f923d78..fc1dac5da7 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -485,7 +485,7 @@ static void _close_mysql_plink(zend_resource *rsrc TSRMLS_DC)
static PHP_INI_MH(OnMySQLPort)
{
if (new_value != NULL) { /* default port */
- MySG(default_port) = atoi(new_value);
+ MySG(default_port) = atoi(new_value->val);
} else {
MySG(default_port) = -1;
}
diff --git a/ext/mysql/php_mysql.h b/ext/mysql/php_mysql.h
index 0368140580..279aec001d 100644
--- a/ext/mysql/php_mysql.h
+++ b/ext/mysql/php_mysql.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysql/php_mysql_structs.h b/ext/mysql/php_mysql_structs.h
index c39e5b25af..8eb9aa1d29 100644
--- a/ext/mysql/php_mysql_structs.h
+++ b/ext/mysql/php_mysql_structs.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index c5124ebc2f..878c8fb946 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index d8596c9620..eea6348034 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c
index cb8a477be4..95096f4a61 100644
--- a/ext/mysqli/mysqli_driver.c
+++ b/ext/mysqli/mysqli_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c
index 898287d3fb..4c1c4a37a5 100644
--- a/ext/mysqli/mysqli_embedded.c
+++ b/ext/mysqli/mysqli_embedded.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c
index 30ed75ddb7..ec86b9d740 100644
--- a/ext/mysqli/mysqli_exception.c
+++ b/ext/mysqli/mysqli_exception.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c
index e099fe7194..2b6c99b9c7 100644
--- a/ext/mysqli/mysqli_fe.c
+++ b/ext/mysqli/mysqli_fe.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_fe.h b/ext/mysqli/mysqli_fe.h
index 9a9f851248..f5ca0963b5 100644
--- a/ext/mysqli/mysqli_fe.h
+++ b/ext/mysqli/mysqli_fe.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_libmysql.h b/ext/mysqli/mysqli_libmysql.h
index 5e7f730aec..a22899185a 100644
--- a/ext/mysqli/mysqli_libmysql.h
+++ b/ext/mysqli/mysqli_libmysql.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_mysqlnd.h b/ext/mysqli/mysqli_mysqlnd.h
index b6d23d9ef1..a1656e59eb 100644
--- a/ext/mysqli/mysqli_mysqlnd.h
+++ b/ext/mysqli/mysqli_mysqlnd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2009 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 9c9a109ba2..e137e822d8 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h
index b240cfab09..cff28400ed 100644
--- a/ext/mysqli/mysqli_priv.h
+++ b/ext/mysqli/mysqli_priv.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index c1fa0a17d6..1354e0db93 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -84,7 +84,7 @@ static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC) \
if (l < ZEND_LONG_MAX) {\
ZVAL_LONG(retval, (zend_long) l);\
} else { \
- ZVAL_STR(retval, strpprintf(0, __ret_type_sprint_mod, l)); \
+ ZVAL_NEW_STR(retval, strpprintf(0, __ret_type_sprint_mod, l)); \
} \
}\
return retval;\
@@ -170,7 +170,7 @@ static zval *link_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
if (rc < ZEND_LONG_MAX) {
ZVAL_LONG(retval, (zend_long) rc);
} else {
- ZVAL_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc));
+ ZVAL_NEW_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc));
}
}
return retval;
@@ -357,7 +357,7 @@ static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
if (rc < ZEND_LONG_MAX) {
ZVAL_LONG(retval, (zend_long) rc);
} else {
- ZVAL_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc));
+ ZVAL_NEW_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc));
}
}
return retval;
diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c
index 7703465e21..ceec68efb4 100644
--- a/ext/mysqli/mysqli_report.c
+++ b/ext/mysqli/mysqli_report.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c
index 615ba94bbf..5caa926b47 100644
--- a/ext/mysqli/mysqli_result_iterator.c
+++ b/ext/mysqli/mysqli_result_iterator.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
index f32a826295..084bc58581 100644
--- a/ext/mysqli/mysqli_warning.c
+++ b/ext/mysqli/mysqli_warning.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h
index e036cf42b7..566bdd7004 100644
--- a/ext/mysqli/php_mysqli.h
+++ b/ext/mysqli/php_mysqli.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index 9570952ec0..d815df3eee 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index f6a3fffac8..513df95a80 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -2496,7 +2496,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons
DBG_INF_FMT("Adding [%s][%s]", key, value);
{
zval attrz;
- ZVAL_STR(&attrz, zend_string_init(value, strlen(value), 1));
+ ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), 1));
zend_hash_str_update(conn->options->connect_attr, key, strlen(key), &attrz);
}
break;
@@ -2798,18 +2798,18 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1);
}
if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) {
- unsigned long server_version = conn->m->get_server_version(conn TSRMLS_CC);
+ zend_ulong server_version = conn->m->get_server_version(conn TSRMLS_CC);
if (server_version < 50605L) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
smart_str_free(&tmp_str);
break;
} else if (mode & TRANS_START_READ_WRITE) {
- if (tmp_str.s->len) {
+ if (tmp_str.s && tmp_str.s->len) {
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
}
smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1);
} else if (mode & TRANS_START_READ_ONLY) {
- if (tmp_str.s->len) {
+ if (tmp_str.s && tmp_str.s->len) {
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
}
smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1);
diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
index c70934be4d..1a23781eb0 100644
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -264,8 +264,6 @@ PHPAPI void _mysqlnd_get_client_stats(zval *return_value TSRMLS_DC ZEND_FILE_L
#define MYSQLND_METHOD_PRIVATE(class, method) php_##class##_##method##_priv
ZEND_BEGIN_MODULE_GLOBALS(mysqlnd)
- zend_bool collect_statistics;
- zend_bool collect_memory_statistics;
char * debug; /* The actual string */
char * trace_alloc_settings; /* The actual string */
MYSQLND_DEBUG * dbg; /* The DBG object for standard tracing */
@@ -283,6 +281,8 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqlnd)
zend_long debug_realloc_fail_threshold;
char * sha256_server_public_key;
zend_bool fetch_data_copy;
+ zend_bool collect_statistics;
+ zend_bool collect_memory_statistics;
ZEND_END_MODULE_GLOBALS(mysqlnd)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd)
diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c
index 9cc46dba4a..f37738dd12 100644
--- a/ext/mysqlnd/mysqlnd_alloc.c
+++ b/ext/mysqlnd/mysqlnd_alloc.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_alloc.h b/ext/mysqlnd/mysqlnd_alloc.h
index eef5988829..b8a14fd1ab 100644
--- a/ext/mysqlnd/mysqlnd_alloc.h
+++ b/ext/mysqlnd/mysqlnd_alloc.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c
index 985357e3bc..255098c4f3 100644
--- a/ext/mysqlnd/mysqlnd_auth.c
+++ b/ext/mysqlnd/mysqlnd_auth.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c
index 100e807bae..705f52ea82 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.c
+++ b/ext/mysqlnd/mysqlnd_block_alloc.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.h b/ext/mysqlnd/mysqlnd_block_alloc.h
index f9627744d5..c0232d4286 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.h
+++ b/ext/mysqlnd/mysqlnd_block_alloc.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c
index bf67498eea..97a49e1054 100644
--- a/ext/mysqlnd/mysqlnd_charset.c
+++ b/ext/mysqlnd/mysqlnd_charset.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h
index 87f30d8ba5..ef77b2fb74 100644
--- a/ext/mysqlnd/mysqlnd_charset.h
+++ b/ext/mysqlnd/mysqlnd_charset.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c
index 92121cf247..f1fde4efbb 100644
--- a/ext/mysqlnd/mysqlnd_debug.c
+++ b/ext/mysqlnd/mysqlnd_debug.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h
index fe91082175..bb4ff3e895 100644
--- a/ext/mysqlnd/mysqlnd_debug.h
+++ b/ext/mysqlnd/mysqlnd_debug.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c
index 98826b9ce3..e67d023edb 100644
--- a/ext/mysqlnd/mysqlnd_driver.c
+++ b/ext/mysqlnd/mysqlnd_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h
index 0d6a25a419..90068783d9 100644
--- a/ext/mysqlnd/mysqlnd_enum_n_def.h
+++ b/ext/mysqlnd/mysqlnd_enum_n_def.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c
index 13f1e294dc..43f1318caa 100644
--- a/ext/mysqlnd/mysqlnd_ext_plugin.c
+++ b/ext/mysqlnd/mysqlnd_ext_plugin.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.h b/ext/mysqlnd/mysqlnd_ext_plugin.h
index d4a9d6cfc0..c66043da83 100644
--- a/ext/mysqlnd/mysqlnd_ext_plugin.h
+++ b/ext/mysqlnd/mysqlnd_ext_plugin.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_libmysql_compat.h b/ext/mysqlnd/mysqlnd_libmysql_compat.h
index b8ff959d18..db3883cd1e 100644
--- a/ext/mysqlnd/mysqlnd_libmysql_compat.h
+++ b/ext/mysqlnd/mysqlnd_libmysql_compat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c
index ab7a1ae9eb..a29a5a186d 100644
--- a/ext/mysqlnd/mysqlnd_loaddata.c
+++ b/ext/mysqlnd/mysqlnd_loaddata.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index 6333875e18..da92acfbff 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_net.h b/ext/mysqlnd/mysqlnd_net.h
index 76a474bc5f..699dd7f7d5 100644
--- a/ext/mysqlnd/mysqlnd_net.h
+++ b/ext/mysqlnd/mysqlnd_net.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c
index 7f5fb9b03f..3bb3c05147 100644
--- a/ext/mysqlnd/mysqlnd_plugin.c
+++ b/ext/mysqlnd/mysqlnd_plugin.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h
index 79e67da464..f05e352baa 100644
--- a/ext/mysqlnd/mysqlnd_priv.h
+++ b/ext/mysqlnd/mysqlnd_priv.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index e2745d8729..1b2602e6b6 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -115,7 +115,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(NULL);
}
- memset(set->data, 0, (size_t)(result->stored_data->row_count * result->meta->field_count * sizeof(zval)));;
+ memset(set->data, 0, (size_t)(result->stored_data->row_count * result->meta->field_count * sizeof(zval)));
}
/* Position at the first row */
set->data_cursor = set->data;
@@ -905,7 +905,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
#endif
if (!Z_ISNULL_P(data)) {
if ((Z_TYPE_P(data) == IS_STRING) &&
- (meta->fields[i].max_length < (unsigned long) Z_STRLEN_P(data))) {
+ (meta->fields[i].max_length < (zend_ulong) Z_STRLEN_P(data))) {
meta->fields[i].max_length = Z_STRLEN_P(data);
}
ZVAL_COPY_VALUE(result, data);
@@ -1093,7 +1093,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
if (!Z_ISNULL_P(data)) {
if ((Z_TYPE_P(data) == IS_STRING) &&
- (meta->fields[i].max_length < (unsigned long) Z_STRLEN_P(data))) {
+ (meta->fields[i].max_length < (zend_ulong) Z_STRLEN_P(data))) {
meta->fields[i].max_length = Z_STRLEN_P(data);
}
ZVAL_COPY_VALUE(result, data);
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c
index 7cb462960b..e98d1c3a52 100644
--- a/ext/mysqlnd/mysqlnd_ps_codec.c
+++ b/ext/mysqlnd/mysqlnd_ps_codec.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -200,17 +200,27 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
/* The following cast is guaranteed to do the right thing */
dval = (double) d32val;
}
+#elif defined(PHP_WIN32)
+ {
+ /* float datatype on Winows is already 4 byte but has a precision of 7 digits */
+ char num_buf[2048];
+ (void)_gcvt_s(num_buf, 2048, fval, field->decimals >= 31 ? 7 : field->decimals);
+ dval = zend_strtod(num_buf, NULL);
+ }
#else
{
char num_buf[2048]; /* Over allocated */
char *s;
+#ifndef FLT_DIG
+# define FLT_DIG 6
+#endif
/* Convert to string. Ignoring localization, etc.
* Following MySQL's rules. If precision is undefined (NOT_FIXED_DEC i.e. 31)
* or larger than 31, the value is limited to 6 (FLT_DIG).
*/
s = php_gcvt(fval,
- field->decimals >= 31 ? 6 : field->decimals,
+ field->decimals >= 31 ? FLT_DIG : field->decimals,
'.',
'e',
num_buf);
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index ea275be192..610642d8de 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_result.h b/ext/mysqlnd/mysqlnd_result.h
index f7e22a1d87..700efed83e 100644
--- a/ext/mysqlnd/mysqlnd_result.h
+++ b/ext/mysqlnd/mysqlnd_result.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_result_meta.c b/ext/mysqlnd/mysqlnd_result_meta.c
index e29c077602..447de33ac9 100644
--- a/ext/mysqlnd/mysqlnd_result_meta.c
+++ b/ext/mysqlnd/mysqlnd_result_meta.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -64,7 +64,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
}
field_packet->persistent_alloc = meta->persistent;
for (;i < meta->field_count; i++) {
- zend_long idx;
+ zend_ulong idx;
if (meta->fields[i].root) {
/* We re-read metadata for PS */
diff --git a/ext/mysqlnd/mysqlnd_result_meta.h b/ext/mysqlnd/mysqlnd_result_meta.h
index 97720adba1..91388b65a5 100644
--- a/ext/mysqlnd/mysqlnd_result_meta.h
+++ b/ext/mysqlnd/mysqlnd_result_meta.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_reverse_api.c b/ext/mysqlnd/mysqlnd_reverse_api.c
index 49684876a4..553a507818 100644
--- a/ext/mysqlnd/mysqlnd_reverse_api.c
+++ b/ext/mysqlnd/mysqlnd_reverse_api.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_reverse_api.h b/ext/mysqlnd/mysqlnd_reverse_api.h
index 79c0feb60a..58a1ddd087 100644
--- a/ext/mysqlnd/mysqlnd_reverse_api.h
+++ b/ext/mysqlnd/mysqlnd_reverse_api.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c
index a664f9b578..e25befbc15 100644
--- a/ext/mysqlnd/mysqlnd_statistics.c
+++ b/ext/mysqlnd/mysqlnd_statistics.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_statistics.h b/ext/mysqlnd/mysqlnd_statistics.h
index 0493d89396..bfc316ec59 100644
--- a/ext/mysqlnd/mysqlnd_statistics.h
+++ b/ext/mysqlnd/mysqlnd_statistics.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index a50600f4bc..406c5a69b1 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -56,9 +56,9 @@ struct st_mysqlnd_memory_pool_chunk
size_t app;
MYSQLND_MEMORY_POOL *pool;
zend_uchar *ptr;
- unsigned int size;
enum_func_status (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC);
+ unsigned int size;
zend_bool from_pool;
};
@@ -869,11 +869,10 @@ struct st_mysqlnd_net_data
struct st_mysqlnd_net
{
- struct st_mysqlnd_net_data * data;
+ /* cmd buffer */
+ MYSQLND_CMD_BUFFER cmd_buffer;
- /* sequence for simple checking of correct packets */
- zend_uchar packet_no;
- zend_uchar compressed_envelope_packet_no;
+ struct st_mysqlnd_net_data * data;
#ifdef MYSQLND_COMPRESSION_ENABLED
MYSQLND_READ_BUFFER * uncompressed_data;
@@ -881,10 +880,11 @@ struct st_mysqlnd_net
void * unused_pad1;
#endif
- /* cmd buffer */
- MYSQLND_CMD_BUFFER cmd_buffer;
-
zend_bool persistent;
+
+ /* sequence for simple checking of correct packets */
+ zend_uchar packet_no;
+ zend_uchar compressed_envelope_packet_no;
};
@@ -994,14 +994,17 @@ struct st_mysqlnd_result_metadata
{
MYSQLND_FIELD *fields;
struct mysqlnd_field_hash_key *zend_hash_keys;
- unsigned int current_field;
- unsigned int field_count;
+
+ struct st_mysqlnd_res_meta_methods * m;
+
+ size_t bit_fields_total_len; /* trailing \0 not counted */
/* We need this to make fast allocs in rowp_read */
unsigned int bit_fields_count;
- size_t bit_fields_total_len; /* trailing \0 not counted */
- zend_bool persistent;
- struct st_mysqlnd_res_meta_methods * m;
+ unsigned int current_field;
+ unsigned int field_count;
+
+ zend_bool persistent;
};
@@ -1055,6 +1058,8 @@ struct st_mysqlnd_buffered_result_c
struct st_mysqlnd_unbuffered_result
{
+ struct st_mysqlnd_result_unbuffered_methods m;
+ uint64_t row_count;
/* For unbuffered (both normal and PS) */
zval *last_row_data;
@@ -1070,14 +1075,13 @@ struct st_mysqlnd_unbuffered_result
struct st_mysqlnd_packet_row * row_packet;
- uint64_t row_count;
+ unsigned int field_count;
+
zend_bool eof_reached;
- unsigned int field_count;
zend_bool ps;
zend_bool persistent;
- struct st_mysqlnd_result_unbuffered_methods m;
};
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index a6e2517b2b..1d86df7859 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -524,7 +524,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
int1store(p, packet->auth_data_len);
++p;
/*!!!!! is the buffer big enough ??? */
- if ((sizeof(buffer) - (p - buffer)) < packet->auth_data_len) {
+ if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) {
DBG_ERR("the stack buffer was not enough!!");
DBG_RETURN(0);
}
@@ -596,7 +596,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
} ZEND_HASH_FOREACH_END();
}
#endif
- if ((sizeof(buffer) - (p - buffer)) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len))) {
+ if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - buffer))) {
p = php_mysqlnd_net_store_length(p, ca_payload_len);
#ifdef OLD_CODE
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h
index b40808d595..5238715987 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.h
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -90,20 +90,20 @@ typedef struct st_mysqlnd_packet_greet {
/* Client authenticates */
typedef struct st_mysqlnd_packet_auth {
MYSQLND_PACKET_HEADER header;
- uint32_t client_flags;
- uint32_t max_packet_size;
- uint8_t charset_no;
const char *user;
const zend_uchar *auth_data;
size_t auth_data_len;
const char *db;
const char *auth_plugin_name;
+ uint32_t client_flags;
+ uint32_t max_packet_size;
+ uint8_t charset_no;
/* Here the packet ends. This is user supplied data */
- size_t db_len;
zend_bool send_auth_data;
zend_bool is_change_user_packet;
zend_bool silent;
HashTable *connect_attr;
+ size_t db_len;
} MYSQLND_PACKET_AUTH;
/* Auth response packet */
diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c
index 15d572793b..c38975f146 100644
--- a/ext/mysqlnd/php_mysqlnd.c
+++ b/ext/mysqlnd/php_mysqlnd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -208,7 +208,7 @@ static PHP_INI_MH(OnUpdateNetCmdBufferSize)
{
zend_long long_value;
- ZEND_ATOL(long_value, new_value);
+ ZEND_ATOL(long_value, new_value->val);
if (long_value < MYSQLND_NET_CMD_BUFFER_MIN_SIZE) {
return FAILURE;
}
diff --git a/ext/mysqlnd/php_mysqlnd.h b/ext/mysqlnd/php_mysqlnd.h
index dc39028900..d81e0a0799 100644
--- a/ext/mysqlnd/php_mysqlnd.h
+++ b/ext/mysqlnd/php_mysqlnd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 3c63692533..c941c8eaf2 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1383,9 +1383,9 @@ PHP_MINFO_FUNCTION(oci)
php_info_print_table_start();
php_info_print_table_header(2, "Statistics", "");
- snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent));
+ snprintf(buf, sizeof(buf), "%pd", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
- snprintf(buf, sizeof(buf), "%ld", OCI_G(num_links));
+ snprintf(buf, sizeof(buf), "%pd", OCI_G(num_links));
php_info_print_table_row(2, "Active Connections", buf);
php_info_print_table_end();
}
@@ -1758,9 +1758,9 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
php_oci_connection *connection;
char *username, *password;
char *dbname = NULL, *charset = NULL;
- int username_len = 0, password_len = 0;
- int dbname_len = 0, charset_len = 0;
- long session_mode = OCI_DEFAULT;
+ size_t username_len = 0, password_len = 0;
+ size_t dbname_len = 0, charset_len = 0;
+ zend_long session_mode = OCI_DEFAULT;
/* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) {
@@ -1789,7 +1789,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
if (!connection) {
RETURN_FALSE;
}
- RETURN_RESOURCE(connection->id);
+ RETURN_RES(connection->id);
}
/* }}} */
@@ -1799,7 +1799,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
* The real connect function. Allocates all the resources needed, establishes the connection and
* returns the result handle (or NULL)
*/
-php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC)
+php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC)
{
zval *zvp;
zend_resource *le;
@@ -1815,7 +1815,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
ub2 charsetid_nls_lang = 0;
if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%ld)", session_mode);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%pd)", session_mode);
return NULL;
}
if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
@@ -1889,7 +1889,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0);
if (password_len) {
- ulong password_hash;
+ zend_ulong password_hash;
password_hash = zend_inline_hash_func(password, password_len);
smart_str_append_unsigned_ex(&hashed_details, password_hash, 0);
}
@@ -1949,9 +1949,8 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
int type, link;
void *ptr;
- link = OCI8_PTR_TO_INT(le->ptr);
- ptr = zend_list_find(link, &type); /* PHPNG TODO */
- if (ptr && (type == le_connection)) {
+ ptr = le->ptr; /* PHPNG TODO */
+ if (ptr && (le->type == le_connection)) {
connection = (php_oci_connection *)ptr;
}
}
@@ -1972,7 +1971,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
*/
if (connection && connection->is_persistent && connection->is_stub) {
if (php_oci_create_session(connection, NULL, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) {
- smart_str_free_ex(&hashed_details, 0);
+ smart_str_free(&hashed_details);
zend_hash_del(&EG(persistent_list), connection->hash_key);
return NULL;
@@ -2007,10 +2006,10 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* okay, the connection is open and the server is still alive */
connection->used_this_request = 1;
- tmp = (php_oci_connection *)zend_list_find(connection->id, &rsrc_type);
+ tmp = (php_oci_connection *)connection->id->ptr;
if (tmp != NULL && rsrc_type == le_pconnection && tmp->hash_key->len == hashed_details.s->len &&
- memcmp(tmp->hash_key->val, hashed_details.s->val, tmp->hash_key->len) == 0 && zend_list_addref(connection->id) == SUCCESS) {
+ memcmp(tmp->hash_key->val, hashed_details.s->val, tmp->hash_key->len) == 0 && ++GC_REFCOUNT(connection->id) == SUCCESS) {
/* do nothing */
} else {
PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection);
@@ -2020,18 +2019,18 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* decremented in the persistent helper
*/
if (OCI_G(old_oci_close_semantics)) {
- zend_list_addref(connection->id);
+ ++GC_REFCOUNT(connection->id);
}
}
- smart_str_free_ex(&hashed_details, 0);
+ smart_str_free(&hashed_details);
return connection;
}
}
/* server died */
} else {
/* we do not ping non-persistent connections */
- smart_str_free_ex(&hashed_details, 0);
- zend_list_addref(connection->id);
+ smart_str_free(&hashed_details);
+ ++GC_REFCOUNT(connection->id);
return connection;
}
} /* is_open is true? */
@@ -2048,7 +2047,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* We have to do a hash_del but need to preserve the resource if there is a positive
* refcount. Set the data pointer in the list entry to NULL
*/
- if (connection == zend_list_find(connection->id, &rsrc_type) && rsrc_type == le_pconnection) {
+ if (connection == connection->id->ptr && rsrc_type == le_pconnection) {
le->ptr = NULL;
}
@@ -2083,7 +2082,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* all persistent connactions are in use, fallback to non-persistent connection creation */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%ld)", OCI_G(num_persistent));
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent));
alloc_non_persistent = 1;
}
}
@@ -2131,7 +2130,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
if ((session_pool = php_oci_get_spool(username, username_len, password, password_len, dbname, dbname_len, charsetid ? charsetid:charsetid_nls_lang TSRMLS_CC))==NULL)
{
php_oci_connection_close(connection TSRMLS_CC);
- smart_str_free_ex(&hashed_details, 0);
+ smart_str_free(&hashed_details);
return NULL;
}
}
@@ -2142,7 +2141,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* Mark password as unchanged by PHP during the duration of the database session */
connection->passwd_changed = 0;
- smart_str_free_ex(&hashed_details, 0);
+ smart_str_free(&hashed_details);
if (charsetid) {
connection->charset = charsetid;
@@ -2181,14 +2180,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* refcount is decremented in the persistent helper
*/
if (OCI_G(old_oci_close_semantics)) {
- zend_list_addref(connection->id);
+ ++GC_REFCOUNT(connection->id);
}
zend_hash_update_mem(&EG(persistent_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource));
OCI_G(num_persistent)++;
OCI_G(num_links)++;
} else if (!exclusive) {
PHP_OCI_REGISTER_RESOURCE(connection, le_connection);
- new_le.ptr = OCI8_INT_TO_PTR(connection->id);
+ new_le.ptr = connection->id;
new_le.type = le_index_ptr;
zend_hash_update_mem(&EG(regular_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource));
OCI_G(num_links)++;
@@ -2564,15 +2563,15 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
}
if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */
- ZVAL_RESOURCE(value, column->stmtid);
- zend_list_addref(column->stmtid);
+ zend_register_resource(value, column->stmtid, 0 TSRMLS_CC); /* XXX type correct? */
+ ++GC_REFCOUNT(column->stmtid);
} else if (column->is_descr) {
if (column->data_type != SQLT_RDD) {
int rsrc_type;
/* reset descriptor's length */
- descriptor = (php_oci_descriptor *) zend_list_find(column->descid, &rsrc_type);
+ descriptor = (php_oci_descriptor *) column->descid->ptr;
if (!descriptor || rsrc_type != le_descriptor) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find LOB descriptor #%d", column->descid);
@@ -2608,7 +2607,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
/* return the locator */
object_init_ex(value, oci_lob_class_entry_ptr);
add_property_resource(value, "descriptor", column->descid);
- zend_list_addref(column->descid);
+ ++GC_REFCOUNT(column->descid);
}
} else {
switch (column->retcode) {
@@ -2648,7 +2647,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
php_oci_out_column *column;
ub4 nrows = 1;
int i;
- long fetch_mode = 0;
+ zend_long fetch_mode = 0;
if (expected_args > 2) {
/* only for ocifetchinto BC */
@@ -2762,19 +2761,18 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
}
if (!(column->indicator == -1)) {
- zval *element;
+ zval element;
- MAKE_STD_ZVAL(element);
- php_oci_column_to_zval(column, element, fetch_mode TSRMLS_CC);
+ php_oci_column_to_zval(column, &element, fetch_mode TSRMLS_CC);
if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) {
- add_index_zval(return_value, i, element);
+ add_index_zval(return_value, i, &element);
}
if (fetch_mode & PHP_OCI_ASSOC) {
if (fetch_mode & PHP_OCI_NUM) {
- Z_ADDREF_P(element);
+ Z_ADDREF(element);
}
- add_assoc_zval(return_value, column->name, element);
+ add_assoc_zval(return_value, column->name, &element);
}
} else {
@@ -2789,7 +2787,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (expected_args > 2) {
/* Only for ocifetchinto BC. In all other cases we return array, not long */
- REPLACE_ZVAL_VALUE(&array, return_value, 1); /* copy return_value to given reference */
+ ZVAL_COPY_VALUE(array, return_value); /* copy return_value to given reference */
zval_dtor(return_value);
RETURN_LONG(statement->ncolumns);
}
@@ -2976,6 +2974,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
zend_resource spool_le = {0};
zend_resource *spool_out_le = NULL;
zend_bool iserror = 0;
+ zval *spool_out_zv = NULL;
/* {{{ Create the spool hash key */
smart_str_appendl_ex(&spool_hashed_details, "oci8spool***", sizeof("oci8spool***") - 1, 0);
@@ -2987,7 +2986,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
}
smart_str_appendl_ex(&spool_hashed_details, "**", sizeof("**") - 1, 0);
if (password_len) {
- ulong password_hash;
+ zend_ulong password_hash;
password_hash = zend_inline_hash_func(password, password_len);
smart_str_append_unsigned_ex(&spool_hashed_details, password_hash, 0);
}
@@ -3007,7 +3006,12 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
php_strtolower(spool_hashed_details.s->val, spool_hashed_details.s->len);
/* }}} */
- if ((spool_out_le = zend_hash_find(&EG(persistent_list), spool_hashed_details.s)) == NULL) {
+ spool_out_zv = zend_hash_find(&EG(persistent_list), spool_hashed_details.s);
+ if (spool_out_zv != NULL) {
+ spool_out_le = Z_RES_P(spool_out_zv);
+ }
+
+ if (spool_out_le == NULL) {
session_pool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, spool_hashed_details.s, charsetid TSRMLS_CC);
@@ -3027,7 +3031,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
}
exit_get_spool:
- smart_str_free_ex(&spool_hashed_details, 0);
+ smart_str_free(&spool_hashed_details);
if (iserror && session_pool) {
php_oci_spool_close(session_pool TSRMLS_CC);
session_pool = NULL;
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c
index d525ef4a9b..341a983ef5 100644
--- a/ext/oci8/oci8_collection.c
+++ b/ext/oci8/oci8_collection.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -56,7 +56,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch
collection->connection = connection;
collection->collection = NULL;
- zend_list_addref(collection->connection->id);
+ ++GC_REFCOUNT(collection->connection->id);
/* get type handle by name */
PHP_OCI_CALL_RETURN(errstatus, OCITypeByName,
@@ -260,7 +260,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC)
/* {{{ php_oci_collection_max()
Return max number of elements in the collection */
-int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC)
+int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC)
{
php_oci_connection *connection = collection->connection;
@@ -273,7 +273,7 @@ int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC)
/* {{{ php_oci_collection_trim()
Trim collection to the given number of elements */
-int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC)
+int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
@@ -473,7 +473,7 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int
/* {{{ php_oci_collection_element_get()
Get the element with the given index */
-int php_oci_collection_element_get(php_oci_collection *collection, long index, zval **result_element TSRMLS_DC)
+int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC)
{
php_oci_connection *connection = collection->connection;
dvoid *element;
@@ -483,8 +483,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
ub4 buff_len = 1024;
sword errstatus;
- MAKE_STD_ZVAL(*result_element);
- ZVAL_NULL(*result_element);
+ ZVAL_NULL(result_element);
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
@@ -503,13 +502,11 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- FREE_ZVAL(*result_element);
return 1;
}
if (exists == 0) {
/* element doesn't exist */
- FREE_ZVAL(*result_element);
return 1;
}
@@ -525,12 +522,11 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- FREE_ZVAL(*result_element);
return 1;
}
- ZVAL_STRINGL(*result_element, (char *)buff, buff_len, 1);
- Z_STRVAL_P(*result_element)[buff_len] = '\0';
+ ZVAL_STRINGL(result_element, (char *)buff, buff_len);
+ Z_STRVAL_P(result_element)[buff_len] = '\0';
return 0;
break;
@@ -543,7 +539,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string));
if (str) {
- ZVAL_STRING(*result_element, (char *)str, 1);
+ ZVAL_STRING(result_element, (char *)str);
}
return 0;
}
@@ -568,18 +564,16 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- FREE_ZVAL(*result_element);
return 1;
}
- ZVAL_DOUBLE(*result_element, double_number);
+ ZVAL_DOUBLE(result_element, double_number);
return 0;
}
break;
default:
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
- FREE_ZVAL(*result_element);
return 1;
break;
}
@@ -590,7 +584,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
/* {{{ php_oci_collection_element_set_null()
Set the element with the given index to NULL */
-int php_oci_collection_element_set_null(php_oci_collection *collection, long index TSRMLS_DC)
+int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC)
{
OCIInd null_index = OCI_IND_NULL;
php_oci_connection *connection = collection->connection;
@@ -611,7 +605,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, long ind
/* {{{ php_oci_collection_element_set_date()
Change element's value to the given DATE */
-int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC)
+int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIDate oci_date;
@@ -652,7 +646,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind
/* {{{ php_oci_collection_element_set_number()
Change element's value to the given NUMBER */
-int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC)
+int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC)
{
OCIInd new_index = OCI_IND_NOTNULL;
double element_double;
@@ -694,7 +688,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i
/* {{{ php_oci_collection_element_set_string()
Change element's value to the given string */
-int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC)
+int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIString *ocistr = (OCIString *)0;
@@ -733,7 +727,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i
/* {{{ php_oci_collection_element_set()
Collection element setter */
-int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC)
+int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC)
{
if (value_len == 0) {
return php_oci_collection_element_set_null(collection, index TSRMLS_CC);
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index 198493b946..6c73ad0a32 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -51,8 +51,8 @@ PHP_FUNCTION(oci_define_by_name)
{
zval *stmt, *var;
char *name;
- int name_len;
- long type = 0;
+ size_t name_len;
+ zend_long type = 0;
php_oci_statement *statement;
php_oci_define *define, *tmp_define;
@@ -74,7 +74,8 @@ PHP_FUNCTION(oci_define_by_name)
define = ecalloc(1,sizeof(php_oci_define));
- if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) {
+ //if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) {
+ if ((tmp_define = zend_hash_add_new_ptr(statement->defines, zend_string_init(name, name_len, 0), define)) != NULL) {
efree(define);
define = tmp_define;
} else {
@@ -85,8 +86,8 @@ PHP_FUNCTION(oci_define_by_name)
define->name = (text*) estrndup(name, name_len);
define->name_len = name_len;
define->type = type;
- define->zval = var;
- zval_add_ref(&var);
+ memmove(&define->zval, var, sizeof(zval));
+ Z_ADDREF_P(var);
RETURN_TRUE;
}
@@ -98,8 +99,8 @@ PHP_FUNCTION(oci_define_by_name)
PHP_FUNCTION(oci_bind_by_name)
{
ub2 bind_type = SQLT_CHR; /* unterminated string */
- int name_len;
- long maxlen = -1, type = 0;
+ size_t name_len;
+ zend_long maxlen = -1, type = 0;
char *name;
zval *z_statement;
zval *bind_var = NULL;
@@ -126,10 +127,10 @@ PHP_FUNCTION(oci_bind_by_name)
Bind a PHP array to an Oracle PL/SQL type by name */
PHP_FUNCTION(oci_bind_array_by_name)
{
- int name_len;
- long max_item_len = -1;
- long max_array_len = 0;
- long type = SQLT_AFC;
+ size_t name_len;
+ zend_long max_item_len = -1;
+ zend_long max_array_len = 0;
+ zend_long type = SQLT_AFC;
char *name;
zval *z_statement;
zval *bind_var = NULL;
@@ -161,7 +162,7 @@ PHP_FUNCTION(oci_bind_array_by_name)
Deletes large object description */
PHP_FUNCTION(oci_free_descriptor)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
@@ -170,12 +171,12 @@ PHP_FUNCTION(oci_free_descriptor)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
zend_list_delete(descriptor->id);
RETURN_TRUE;
@@ -186,11 +187,11 @@ PHP_FUNCTION(oci_free_descriptor)
Saves a large object */
PHP_FUNCTION(oci_lob_save)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *data;
- int data_len;
- long offset = 0;
+ size_t data_len;
+ zend_long offset = 0;
ub4 bytes_written;
if (getThis()) {
@@ -204,12 +205,12 @@ PHP_FUNCTION(oci_lob_save)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (offset < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0");
@@ -227,10 +228,10 @@ PHP_FUNCTION(oci_lob_save)
Loads file into a LOB */
PHP_FUNCTION(oci_lob_import)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *filename;
- int filename_len;
+ size_t filename_len;
if (getThis()) {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
@@ -259,12 +260,12 @@ PHP_FUNCTION(oci_lob_import)
}
#endif
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_import(descriptor, filename TSRMLS_CC)) {
RETURN_FALSE;
@@ -277,7 +278,7 @@ PHP_FUNCTION(oci_lob_import)
Loads a large object */
PHP_FUNCTION(oci_lob_load)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *buffer = NULL;
ub4 buffer_len;
@@ -288,18 +289,18 @@ PHP_FUNCTION(oci_lob_load)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) {
RETURN_FALSE;
}
if (buffer_len > 0) {
- RETURN_STRINGL(buffer, buffer_len, 0);
+ RETURN_STRINGL(buffer, buffer_len);
}
else {
RETURN_EMPTY_STRING();
@@ -311,9 +312,9 @@ PHP_FUNCTION(oci_lob_load)
Reads particular part of a large object */
PHP_FUNCTION(oci_lob_read)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
- long length;
+ zend_long length;
char *buffer;
ub4 buffer_len;
@@ -328,12 +329,12 @@ PHP_FUNCTION(oci_lob_read)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (length <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
@@ -344,7 +345,7 @@ PHP_FUNCTION(oci_lob_read)
RETURN_FALSE;
}
if (buffer_len > 0) {
- RETURN_STRINGL(buffer, buffer_len, 0);
+ RETURN_STRINGL(buffer, buffer_len);
}
else {
RETURN_EMPTY_STRING();
@@ -356,7 +357,7 @@ PHP_FUNCTION(oci_lob_read)
Checks if EOF is reached */
PHP_FUNCTION(oci_lob_eof)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
ub4 lob_length;
@@ -366,12 +367,12 @@ PHP_FUNCTION(oci_lob_eof)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (!php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC) && lob_length >= 0) {
if (lob_length == descriptor->lob_current_position) {
@@ -386,7 +387,7 @@ PHP_FUNCTION(oci_lob_eof)
Tells LOB pointer position */
PHP_FUNCTION(oci_lob_tell)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
@@ -395,12 +396,12 @@ PHP_FUNCTION(oci_lob_tell)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
RETURN_LONG(descriptor->lob_current_position);
}
@@ -410,7 +411,7 @@ PHP_FUNCTION(oci_lob_tell)
Rewind pointer of a LOB */
PHP_FUNCTION(oci_lob_rewind)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
@@ -419,12 +420,12 @@ PHP_FUNCTION(oci_lob_rewind)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
descriptor->lob_current_position = 0;
@@ -436,9 +437,9 @@ PHP_FUNCTION(oci_lob_rewind)
Moves the pointer of a LOB */
PHP_FUNCTION(oci_lob_seek)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
- long offset, whence = PHP_OCI_SEEK_SET;
+ zend_long offset, whence = PHP_OCI_SEEK_SET;
ub4 lob_length;
if (getThis()) {
@@ -452,12 +453,12 @@ PHP_FUNCTION(oci_lob_seek)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
RETURN_FALSE;
@@ -488,7 +489,7 @@ PHP_FUNCTION(oci_lob_seek)
Returns size of a large object */
PHP_FUNCTION(oci_lob_size)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
ub4 lob_length;
@@ -498,12 +499,12 @@ PHP_FUNCTION(oci_lob_size)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
RETURN_FALSE;
@@ -516,10 +517,10 @@ PHP_FUNCTION(oci_lob_size)
Writes data to current position of a LOB */
PHP_FUNCTION(oci_lob_write)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
- int data_len;
- long write_len = 0;
+ size_t data_len;
+ zend_long write_len = 0;
ub4 bytes_written;
char *data;
@@ -542,12 +543,12 @@ PHP_FUNCTION(oci_lob_write)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (data_len <= 0) {
RETURN_LONG(0);
@@ -564,7 +565,7 @@ PHP_FUNCTION(oci_lob_write)
Appends data from a LOB to another LOB */
PHP_FUNCTION(oci_lob_append)
{
- zval **tmp_dest, **tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from;
+ zval *tmp_dest, *tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from;
php_oci_descriptor *descriptor_dest, *descriptor_from;
if (getThis()) {
@@ -578,18 +579,18 @@ PHP_FUNCTION(oci_lob_append)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) {
+ if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) {
+ if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest);
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
if (php_oci_lob_append(descriptor_dest, descriptor_from TSRMLS_CC)) {
RETURN_FALSE;
@@ -603,9 +604,9 @@ PHP_FUNCTION(oci_lob_append)
Truncates a LOB */
PHP_FUNCTION(oci_lob_truncate)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
- long trim_length = 0;
+ zend_long trim_length = 0;
ub4 ub_trim_length;
if (getThis()) {
@@ -619,7 +620,7 @@ PHP_FUNCTION(oci_lob_truncate)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -630,7 +631,7 @@ PHP_FUNCTION(oci_lob_truncate)
}
ub_trim_length = (ub4) trim_length;
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_truncate(descriptor, ub_trim_length TSRMLS_CC)) {
RETURN_FALSE;
@@ -643,10 +644,10 @@ PHP_FUNCTION(oci_lob_truncate)
Erases a specified portion of the internal LOB, starting at a specified offset */
PHP_FUNCTION(oci_lob_erase)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
ub4 bytes_erased;
- long offset = -1, length = -1;
+ zend_long offset = -1, length = -1;
if (getThis()) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &offset, &length) == FAILURE) {
@@ -679,12 +680,12 @@ PHP_FUNCTION(oci_lob_erase)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased TSRMLS_CC)) {
RETURN_FALSE;
@@ -697,9 +698,9 @@ PHP_FUNCTION(oci_lob_erase)
Flushes the LOB buffer */
PHP_FUNCTION(oci_lob_flush)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
- long flush_flag = 0;
+ zend_long flush_flag = 0;
if (getThis()) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flush_flag) == FAILURE) {
@@ -712,12 +713,12 @@ PHP_FUNCTION(oci_lob_flush)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) {
/* buffering wasn't enabled, there is nothing to flush */
@@ -735,7 +736,7 @@ PHP_FUNCTION(oci_lob_flush)
Enables/disables buffering for a LOB */
PHP_FUNCTION(ocisetbufferinglob)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
zend_bool flag;
@@ -750,12 +751,12 @@ PHP_FUNCTION(ocisetbufferinglob)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_set_buffering(descriptor, flag TSRMLS_CC)) {
RETURN_FALSE;
@@ -768,7 +769,7 @@ PHP_FUNCTION(ocisetbufferinglob)
Returns current state of buffering for a LOB */
PHP_FUNCTION(ocigetbufferinglob)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
@@ -777,12 +778,12 @@ PHP_FUNCTION(ocigetbufferinglob)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) {
RETURN_TRUE;
@@ -795,26 +796,26 @@ PHP_FUNCTION(ocigetbufferinglob)
Copies data from a LOB to another LOB */
PHP_FUNCTION(oci_lob_copy)
{
- zval **tmp_dest, **tmp_from, *z_descriptor_dest, *z_descriptor_from;
+ zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from;
php_oci_descriptor *descriptor_dest, *descriptor_from;
- long length = 0;
+ zend_long length = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) {
return;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) {
+ if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) {
+ if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest);
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
if (ZEND_NUM_ARGS() == 3 && length < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
@@ -837,7 +838,7 @@ PHP_FUNCTION(oci_lob_copy)
Tests to see if two LOB/FILE locators are equal */
PHP_FUNCTION(oci_lob_is_equal)
{
- zval **tmp_first, **tmp_second, *z_descriptor_first, *z_descriptor_second;
+ zval *tmp_first, *tmp_second, *z_descriptor_first, *z_descriptor_second;
php_oci_descriptor *descriptor_first, *descriptor_second;
boolean is_equal;
@@ -845,18 +846,18 @@ PHP_FUNCTION(oci_lob_is_equal)
return;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"), (void **)&tmp_first) == FAILURE) {
+ if ((tmp_first = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"), (void **)&tmp_second) == FAILURE) {
+ if ((tmp_second = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_first, descriptor_first);
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_second, descriptor_second);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_first, descriptor_first);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_second, descriptor_second);
if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal TSRMLS_CC)) {
RETURN_FALSE;
@@ -873,12 +874,12 @@ PHP_FUNCTION(oci_lob_is_equal)
Writes a large object into a file */
PHP_FUNCTION(oci_lob_export)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *filename;
char *buffer;
- int filename_len;
- long start = -1, length = -1, block_length;
+ size_t filename_len;
+ zend_long start = -1, length = -1, block_length;
php_stream *stream;
ub4 lob_length;
@@ -927,12 +928,12 @@ PHP_FUNCTION(oci_lob_export)
}
#endif
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
RETURN_FALSE;
@@ -1006,11 +1007,11 @@ PHP_FUNCTION(oci_lob_export)
Writes temporary blob */
PHP_FUNCTION(oci_lob_write_temporary)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *data;
- int data_len;
- long type = OCI_TEMP_CLOB;
+ size_t data_len;
+ zend_long type = OCI_TEMP_CLOB;
if (getThis()) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) {
@@ -1023,12 +1024,12 @@ PHP_FUNCTION(oci_lob_write_temporary)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) {
RETURN_FALSE;
@@ -1041,7 +1042,7 @@ PHP_FUNCTION(oci_lob_write_temporary)
Closes lob descriptor */
PHP_FUNCTION(oci_lob_close)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
@@ -1050,12 +1051,12 @@ PHP_FUNCTION(oci_lob_close)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_close(descriptor TSRMLS_CC)) {
RETURN_FALSE;
@@ -1071,7 +1072,7 @@ PHP_FUNCTION(oci_new_descriptor)
zval *z_connection;
php_oci_connection *connection;
php_oci_descriptor *descriptor;
- long type = OCI_DTYPE_LOB;
+ zend_long type = OCI_DTYPE_LOB;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_connection, &type) == FAILURE) {
return;
@@ -1146,7 +1147,7 @@ PHP_FUNCTION(oci_field_name)
php_oci_out_column *column;
if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) {
- RETURN_STRINGL(column->name, column->name_len, 1);
+ RETURN_STRINGL(column->name, column->name_len);
}
RETURN_FALSE;
}
@@ -1210,64 +1211,64 @@ PHP_FUNCTION(oci_field_type)
switch (column->data_type) {
#ifdef SQLT_TIMESTAMP
case SQLT_TIMESTAMP:
- RETVAL_STRING("TIMESTAMP",1);
+ RETVAL_STRING("TIMESTAMP");
break;
#endif
#ifdef SQLT_TIMESTAMP_TZ
case SQLT_TIMESTAMP_TZ:
- RETVAL_STRING("TIMESTAMP WITH TIMEZONE",1);
+ RETVAL_STRING("TIMESTAMP WITH TIMEZONE");
break;
#endif
#ifdef SQLT_TIMESTAMP_LTZ
case SQLT_TIMESTAMP_LTZ:
- RETVAL_STRING("TIMESTAMP WITH LOCAL TIMEZONE",1);
+ RETVAL_STRING("TIMESTAMP WITH LOCAL TIMEZONE");
break;
#endif
#ifdef SQLT_INTERVAL_YM
case SQLT_INTERVAL_YM:
- RETVAL_STRING("INTERVAL YEAR TO MONTH",1);
+ RETVAL_STRING("INTERVAL YEAR TO MONTH");
break;
#endif
#ifdef SQLT_INTERVAL_DS
case SQLT_INTERVAL_DS:
- RETVAL_STRING("INTERVAL DAY TO SECOND",1);
+ RETVAL_STRING("INTERVAL DAY TO SECOND");
break;
#endif
case SQLT_DAT:
- RETVAL_STRING("DATE",1);
+ RETVAL_STRING("DATE");
break;
case SQLT_NUM:
- RETVAL_STRING("NUMBER",1);
+ RETVAL_STRING("NUMBER");
break;
case SQLT_LNG:
- RETVAL_STRING("LONG",1);
+ RETVAL_STRING("LONG");
break;
case SQLT_BIN:
- RETVAL_STRING("RAW",1);
+ RETVAL_STRING("RAW");
break;
case SQLT_LBI:
- RETVAL_STRING("LONG RAW",1);
+ RETVAL_STRING("LONG RAW");
break;
case SQLT_CHR:
- RETVAL_STRING("VARCHAR2",1);
+ RETVAL_STRING("VARCHAR2");
break;
case SQLT_RSET:
- RETVAL_STRING("REFCURSOR",1);
+ RETVAL_STRING("REFCURSOR");
break;
case SQLT_AFC:
- RETVAL_STRING("CHAR",1);
+ RETVAL_STRING("CHAR");
break;
case SQLT_BLOB:
- RETVAL_STRING("BLOB",1);
+ RETVAL_STRING("BLOB");
break;
case SQLT_CLOB:
- RETVAL_STRING("CLOB",1);
+ RETVAL_STRING("CLOB");
break;
case SQLT_BFILE:
- RETVAL_STRING("BFILE",1);
+ RETVAL_STRING("BFILE");
break;
case SQLT_RDD:
- RETVAL_STRING("ROWID",1);
+ RETVAL_STRING("ROWID");
break;
default:
RETVAL_LONG(column->data_type);
@@ -1318,7 +1319,7 @@ PHP_FUNCTION(oci_execute)
{
zval *z_statement;
php_oci_statement *statement;
- long mode = OCI_COMMIT_ON_SUCCESS;
+ zend_long mode = OCI_COMMIT_ON_SUCCESS;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &mode) == FAILURE) {
return;
@@ -1386,13 +1387,14 @@ PHP_FUNCTION(ocifetchinto)
Fetch all rows of result data into an array */
PHP_FUNCTION(oci_fetch_all)
{
- zval *z_statement, *array, *element, *tmp;
+ zval *z_statement, *array;
+ zval element, tmp;
php_oci_statement *statement;
php_oci_out_column **columns;
- zval ***outarrs;
+ zval **outarrs;
ub4 nrows = 1;
int i;
- long rows = 0, flags = 0, skip = 0, maxrows = -1;
+ zend_long rows = 0, flags = 0, skip = 0, maxrows = -1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|lll", &z_statement, &array, &skip, &maxrows, &flags) == FAILURE) {
return;
@@ -1417,23 +1419,21 @@ PHP_FUNCTION(oci_fetch_all)
}
while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
- zval *row;
+ zval row;
- MAKE_STD_ZVAL(row);
- array_init(row);
+ array_init(&row);
for (i = 0; i < statement->ncolumns; i++) {
- MAKE_STD_ZVAL(element);
- php_oci_column_to_zval(columns[ i ], element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
+ php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
if (flags & PHP_OCI_NUM) {
- zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL(row), &element);
} else { /* default to ASSOC */
- zend_symtable_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL);
+ zend_symtable_update(Z_ARRVAL(row), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &element);
}
}
- zend_hash_next_index_insert(Z_ARRVAL_P(array), &row, sizeof(zval*), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array), &row);
rows++;
if (maxrows != -1 && rows == maxrows) {
@@ -1451,25 +1451,22 @@ PHP_FUNCTION(oci_fetch_all)
for (i = 0; i < statement->ncolumns; i++) {
columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
- MAKE_STD_ZVAL(tmp);
- array_init(tmp);
- zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
+ array_init(&tmp);
+ outarrs[ i ] = zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp);
}
} else { /* default to ASSOC */
for (i = 0; i < statement->ncolumns; i++) {
columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
- MAKE_STD_ZVAL(tmp);
- array_init(tmp);
- zend_symtable_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
+ array_init(&tmp);
+ outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &tmp);
}
}
while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
for (i = 0; i < statement->ncolumns; i++) {
- MAKE_STD_ZVAL(element);
- php_oci_column_to_zval(columns[ i ], element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
- zend_hash_index_update((*(outarrs[ i ]))->value.ht, rows, (void *)&element, sizeof(zval*), NULL);
+ php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
+ zend_hash_index_update(&(outarrs[ i ])->value.arr->ht, rows, &element);
}
rows++;
@@ -1616,7 +1613,7 @@ PHP_FUNCTION(oci_error)
}
if (ZEND_NUM_ARGS() > 0) {
- statement = (php_oci_statement *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement);
if (statement) {
errh = statement->err;
errcode = statement->errcode;
@@ -1627,14 +1624,14 @@ PHP_FUNCTION(oci_error)
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
@@ -1696,7 +1693,7 @@ PHP_FUNCTION(oci_parse)
php_oci_connection *connection;
php_oci_statement *statement;
char *query;
- int query_len;
+ size_t query_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &query, &query_len) == FAILURE) {
return;
@@ -1707,7 +1704,7 @@ PHP_FUNCTION(oci_parse)
statement = php_oci_statement_create(connection, query, query_len TSRMLS_CC);
if (statement) {
- RETURN_RESOURCE(statement->id);
+ RETURN_RES(statement->id);
}
RETURN_FALSE;
}
@@ -1719,7 +1716,7 @@ PHP_FUNCTION(oci_set_prefetch)
{
zval *z_statement;
php_oci_statement *statement;
- long size;
+ zend_long size;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_statement, &size) == FAILURE) {
return;
@@ -1746,7 +1743,7 @@ PHP_FUNCTION(oci_set_client_identifier)
zval *z_connection;
php_oci_connection *connection;
char *client_id;
- int client_id_len;
+ size_t client_id_len;
sword errstatus;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_id, &client_id_len) == FAILURE) {
@@ -1796,7 +1793,7 @@ PHP_FUNCTION(oci_set_edition)
{
#if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2)))
char *edition;
- int edition_len;
+ size_t edition_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &edition, &edition_len) == FAILURE) {
return;
@@ -1830,7 +1827,7 @@ PHP_FUNCTION(oci_set_module_name)
zval *z_connection;
php_oci_connection *connection;
char *module;
- int module_len;
+ size_t module_len;
sword errstatus;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &module, &module_len) == FAILURE) {
@@ -1862,7 +1859,7 @@ PHP_FUNCTION(oci_set_action)
zval *z_connection;
php_oci_connection *connection;
char *action;
- int action_len;
+ size_t action_len;
sword errstatus;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &action, &action_len) == FAILURE) {
@@ -1894,7 +1891,7 @@ PHP_FUNCTION(oci_set_client_info)
zval *z_connection;
php_oci_connection *connection;
char *client_info;
- int client_info_len;
+ size_t client_info_len;
sword errstatus;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_info, &client_info_len) == FAILURE) {
@@ -1927,7 +1924,7 @@ PHP_FUNCTION(oci_set_db_operation)
zval *z_connection;
php_oci_connection *connection;
char *dbop_name;
- int dbop_name_len;
+ size_t dbop_name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &dbop_name, &dbop_name_len) == FAILURE) {
return;
@@ -1956,7 +1953,7 @@ PHP_FUNCTION(oci_password_change)
{
zval *z_connection;
char *user, *pass_old, *pass_new, *dbname;
- int user_len, pass_old_len, pass_new_len, dbname_len;
+ size_t user_len, pass_old_len, pass_new_len, dbname_len;
php_oci_connection *connection;
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
@@ -2006,7 +2003,7 @@ PHP_FUNCTION(oci_password_change)
if (!connection) {
RETURN_FALSE;
}
- RETURN_RESOURCE(connection->id);
+ RETURN_RES(connection->id);
}
WRONG_PARAM_COUNT;
}
@@ -2029,7 +2026,7 @@ PHP_FUNCTION(oci_new_cursor)
statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC);
if (statement) {
- RETURN_RESOURCE(statement->id);
+ RETURN_RES(statement->id);
}
RETURN_FALSE;
}
@@ -2058,7 +2055,7 @@ PHP_FUNCTION(oci_client_version)
char *version = NULL;
php_oci_client_get_version(&version TSRMLS_CC);
- RETURN_STRING(version, 0);
+ RETURN_STRING(version);
}
/* }}} */
@@ -2080,7 +2077,7 @@ PHP_FUNCTION(oci_server_version)
RETURN_FALSE;
}
- RETURN_STRING(version, 0);
+ RETURN_STRING(version);
}
/* }}} */
@@ -2104,37 +2101,37 @@ PHP_FUNCTION(oci_statement_type)
switch (type) {
case OCI_STMT_SELECT:
- RETVAL_STRING("SELECT",1);
+ RETVAL_STRING("SELECT");
break;
case OCI_STMT_UPDATE:
- RETVAL_STRING("UPDATE",1);
+ RETVAL_STRING("UPDATE");
break;
case OCI_STMT_DELETE:
- RETVAL_STRING("DELETE",1);
+ RETVAL_STRING("DELETE");
break;
case OCI_STMT_INSERT:
- RETVAL_STRING("INSERT",1);
+ RETVAL_STRING("INSERT");
break;
case OCI_STMT_CREATE:
- RETVAL_STRING("CREATE",1);
+ RETVAL_STRING("CREATE");
break;
case OCI_STMT_DROP:
- RETVAL_STRING("DROP",1);
+ RETVAL_STRING("DROP");
break;
case OCI_STMT_ALTER:
- RETVAL_STRING("ALTER",1);
+ RETVAL_STRING("ALTER");
break;
case OCI_STMT_BEGIN:
- RETVAL_STRING("BEGIN",1);
+ RETVAL_STRING("BEGIN");
break;
case OCI_STMT_DECLARE:
- RETVAL_STRING("DECLARE",1);
+ RETVAL_STRING("DECLARE");
break;
case OCI_STMT_CALL:
- RETVAL_STRING("CALL",1);
+ RETVAL_STRING("CALL");
break;
default:
- RETVAL_STRING("UNKNOWN",1);
+ RETVAL_STRING("UNKNOWN");
}
}
/* }}} */
@@ -2164,7 +2161,7 @@ PHP_FUNCTION(oci_num_rows)
Deletes collection object*/
PHP_FUNCTION(oci_free_collection)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
if (!getThis()) {
@@ -2173,12 +2170,12 @@ PHP_FUNCTION(oci_free_collection)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
zend_list_delete(collection->id);
RETURN_TRUE;
@@ -2189,10 +2186,10 @@ PHP_FUNCTION(oci_free_collection)
Append an object to the collection */
PHP_FUNCTION(oci_collection_append)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
char *value;
- int value_len;
+ size_t value_len;
if (getThis()) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) {
@@ -2205,12 +2202,12 @@ PHP_FUNCTION(oci_collection_append)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_append(collection, value, value_len TSRMLS_CC)) {
RETURN_FALSE;
@@ -2223,10 +2220,10 @@ PHP_FUNCTION(oci_collection_append)
Retrieve the value at collection index ndx */
PHP_FUNCTION(oci_collection_element_get)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
- long element_index;
- zval *value;
+ zend_long element_index;
+ zval value;
if (getThis()) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &element_index) == FAILURE) {
@@ -2239,20 +2236,18 @@ PHP_FUNCTION(oci_collection_element_get)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_element_get(collection, element_index, &value TSRMLS_CC)) {
RETURN_FALSE;
}
- *return_value = *value;
- zval_copy_ctor(return_value);
- zval_ptr_dtor(&value);
+ RETURN_ZVAL(&value, 1, 1);
}
/* }}} */
@@ -2260,7 +2255,7 @@ PHP_FUNCTION(oci_collection_element_get)
Assign a collection from another existing collection */
PHP_FUNCTION(oci_collection_assign)
{
- zval **tmp_dest, **tmp_from, *z_collection_dest = getThis(), *z_collection_from;
+ zval *tmp_dest, *tmp_from, *z_collection_dest = getThis(), *z_collection_from;
php_oci_collection *collection_dest, *collection_from;
if (getThis()) {
@@ -2274,18 +2269,18 @@ PHP_FUNCTION(oci_collection_assign)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection_dest), "collection", sizeof("collection"), (void **)&tmp_dest) == FAILURE) {
+ if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_collection_dest), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The first argument should be valid collection object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection_from), "collection", sizeof("collection"), (void **)&tmp_from) == FAILURE) {
+ if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_collection_from), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The second argument should be valid collection object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp_dest, collection_dest);
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp_from, collection_from);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp_dest, collection_dest);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp_from, collection_from);
if (php_oci_collection_assign(collection_dest, collection_from TSRMLS_CC)) {
RETURN_FALSE;
@@ -2298,10 +2293,10 @@ PHP_FUNCTION(oci_collection_assign)
Assign element val to collection at index ndx */
PHP_FUNCTION(oci_collection_element_assign)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
- int value_len;
- long element_index;
+ size_t value_len;
+ zend_long element_index;
char *value;
if (getThis()) {
@@ -2315,12 +2310,12 @@ PHP_FUNCTION(oci_collection_element_assign)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_element_set(collection, element_index, value, value_len TSRMLS_CC)) {
RETURN_FALSE;
@@ -2333,7 +2328,7 @@ PHP_FUNCTION(oci_collection_element_assign)
Return the size of a collection */
PHP_FUNCTION(oci_collection_size)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
sb4 size = 0;
@@ -2343,12 +2338,12 @@ PHP_FUNCTION(oci_collection_size)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_size(collection, &size TSRMLS_CC)) {
RETURN_FALSE;
@@ -2361,9 +2356,9 @@ PHP_FUNCTION(oci_collection_size)
Return the max value of a collection. For a varray this is the maximum length of the array */
PHP_FUNCTION(oci_collection_max)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
- long max;
+ zend_long max;
if (!getThis()) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
@@ -2371,12 +2366,12 @@ PHP_FUNCTION(oci_collection_max)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_max(collection, &max TSRMLS_CC)) {
RETURN_FALSE;
@@ -2389,9 +2384,9 @@ PHP_FUNCTION(oci_collection_max)
Trim num elements from the end of a collection */
PHP_FUNCTION(oci_collection_trim)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
- long trim_size;
+ zend_long trim_size;
if (getThis()) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &trim_size) == FAILURE) {
@@ -2404,12 +2399,12 @@ PHP_FUNCTION(oci_collection_trim)
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_trim(collection, trim_size TSRMLS_CC)) {
RETURN_FALSE;
@@ -2426,7 +2421,7 @@ PHP_FUNCTION(oci_new_collection)
php_oci_connection *connection;
php_oci_collection *collection;
char *tdo, *schema = NULL;
- int tdo_len, schema_len = 0;
+ size_t tdo_len, schema_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) {
return;
@@ -2463,7 +2458,7 @@ PHP_FUNCTION(oci_get_implicit_resultset)
if (imp_statement) {
if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT TSRMLS_CC))
RETURN_FALSE;
- RETURN_RESOURCE(imp_statement->id);
+ RETURN_RES(imp_statement->id);
}
RETURN_FALSE;
}
diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c
index 4982d0f88f..12986a8d3a 100644
--- a/ext/oci8/oci8_lob.c
+++ b/ext/oci8/oci8_lob.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -51,7 +51,7 @@
/* {{{ php_oci_lob_create()
Create LOB descriptor and allocate all the resources needed */
-php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long type TSRMLS_DC)
+php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_long type TSRMLS_DC)
{
php_oci_descriptor *descriptor;
sword errstatus;
@@ -63,7 +63,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ
/* these three are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %ld", type);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %pd", type);
return NULL;
break;
}
@@ -71,7 +71,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ
descriptor = ecalloc(1, sizeof(php_oci_descriptor));
descriptor->type = type;
descriptor->connection = connection;
- zend_list_addref(descriptor->connection->id);
+ ++GC_REFCOUNT(descriptor->connection->id);
PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0));
@@ -109,7 +109,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ
return NULL;
}
- zend_hash_index_update(connection->descriptors,descriptor->index,&descriptor,sizeof(php_oci_descriptor *),NULL);
+ zend_hash_index_update_ptr(connection->descriptors, descriptor->index, &descriptor);
}
return descriptor;
@@ -210,7 +210,7 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece
/* {{{ php_oci_lob_calculate_buffer()
Work out the size for LOB buffering */
-static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, long read_length TSRMLS_DC)
+static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length TSRMLS_DC)
{
php_oci_connection *connection = descriptor->connection;
ub4 chunk_size;
@@ -241,7 +241,7 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, l
/* {{{ php_oci_lob_read()
Read specified portion of the LOB into the buffer */
-int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long initial_offset, char **data, ub4 *data_len TSRMLS_DC)
+int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zend_long initial_offset, char **data, ub4 *data_len TSRMLS_DC)
{
php_oci_connection *connection = descriptor->connection;
ub4 length = 0;
@@ -513,7 +513,7 @@ int php_oci_lob_get_buffering (php_oci_descriptor *descriptor)
/* {{{ php_oci_lob_copy()
Copy one LOB (or its part) to another one */
-int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, long length TSRMLS_DC)
+int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC)
{
php_oci_connection *connection = descriptor_dest->connection;
ub4 length_dest, length_from, copy_len;
@@ -619,7 +619,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
/* {{{ php_oci_lob_flush()
Flush buffers for the LOB (only if they have been used) */
-int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC)
+int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC)
{
OCILobLocator *lob = descriptor->descriptor;
php_oci_connection *connection = descriptor->connection;
@@ -635,7 +635,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC)
/* only these two are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %ld", flush_flag);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %pd", flush_flag);
return 1;
break;
}
@@ -806,7 +806,7 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
/* {{{ php_oci_lob_truncate()
Truncate LOB to the given length */
-int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC)
+int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
@@ -848,7 +848,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TS
/* {{{ php_oci_lob_erase()
Erase (or fill with whitespaces, depending on LOB type) the LOB (or its part) */
-int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC)
+int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
@@ -906,7 +906,7 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript
/* {{{ php_oci_lob_write_tmp()
Create temporary LOB and write data to it */
-int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data, int data_len TSRMLS_DC)
+int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
@@ -919,7 +919,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data
/* only these two are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %ld", type);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %pd", type);
return 1;
break;
}
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index f9d2a3a0ff..7dc0d5ee66 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -106,7 +106,7 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
statement->impres_child_stmt = NULL;
statement->impres_count = 0;
statement->impres_flag = PHP_OCI_IMPRES_UNKNOWN; /* may or may not have Implicit Result Set children */
- zend_list_addref(statement->connection->id);
+ ++GC_REFCOUNT(statement->connection->id);
if (OCI_G(default_prefetch) >= 0) {
php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch) TSRMLS_CC);
@@ -166,8 +166,8 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T
statement2->has_descr = 0;
statement2->stmttype = 0;
- zend_list_addref(statement->id);
- zend_list_addref(statement2->connection->id);
+ Z_ADDREF_P(statement->id);
+ Z_ADDREF_P(statement2->connection->id);
php_oci_statement_set_prefetch(statement2, statement->prefetch_count TSRMLS_CC);
@@ -359,8 +359,8 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
continue;
}
- zval_dtor(column->define->zval);
- php_oci_column_to_zval(column, column->define->zval, 0 TSRMLS_CC);
+ zval_dtor(&column->define->zval);
+ php_oci_column_to_zval(column, &column->define->zval, 0 TSRMLS_CC);
}
return 0;
@@ -377,7 +377,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* {{{ php_oci_statement_get_column()
Get column from the result set */
-php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, char *column_name, int column_name_len TSRMLS_DC)
+php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC)
{
php_oci_out_column *column = NULL;
int i;
@@ -396,7 +396,7 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, l
}
}
} else if (column_index != -1) {
- if (zend_hash_index_find(statement->columns, column_index, (void **)&column) == FAILURE) {
+ if ((column = zend_hash_index_find_ptr(statement->columns, column_index)) == NULL) {
return NULL;
}
return column;
@@ -427,7 +427,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
return OCI_ERROR;
}
nested_stmt->parent_stmtid = outcol->statement->id;
- zend_list_addref(outcol->statement->id);
+ ++GC_REFCOUNT(outcol->statement->id);
outcol->nested_statement = nested_stmt;
outcol->stmtid = nested_stmt->id;
@@ -590,7 +590,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
for (counter = 1; counter <= colcount; counter++) {
memset(&column,0,sizeof(php_oci_out_column));
- if (zend_hash_index_update(statement->columns, counter, &column, sizeof(php_oci_out_column), (void**) &outcol) == FAILURE) {
+ if ((outcol = zend_hash_index_update_ptr(statement->columns, counter, &column)) == NULL) {
efree(statement->columns);
/* out of memory */
return 1;
@@ -683,7 +683,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
/* find a user-set define */
if (statement->defines) {
- if (zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define) == SUCCESS) {
+ if ((outcol->define = zend_hash_str_find_ptr(statement->defines, outcol->name, outcol->name_len)) != NULL) {
if (outcol->define->type) {
outcol->data_type = outcol->define->type;
}
@@ -909,7 +909,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
*(int *)result = 0;
- if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
+ if (Z_TYPE(bind->zval) == IS_ARRAY) {
/* These checks are currently valid for oci_bind_by_name, not
* oci_bind_array_by_name. Also bind->type and
* bind->indicator are not used for oci_bind_array_by_name.
@@ -923,7 +923,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
case SQLT_CLOB:
case SQLT_BLOB:
case SQLT_RDD:
- if (Z_TYPE_P(bind->zval) != IS_OBJECT) {
+ if (Z_TYPE(bind->zval) != IS_OBJECT) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -939,14 +939,14 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
case SQLT_LBI:
case SQLT_BIN:
case SQLT_LNG:
- if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) {
+ if (Z_TYPE(bind->zval) == IS_RESOURCE || Z_TYPE(bind->zval) == IS_OBJECT) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
case SQLT_RSET:
- if (Z_TYPE_P(bind->zval) != IS_RESOURCE) {
+ if (Z_TYPE(bind->zval) != IS_RESOURCE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -969,27 +969,27 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
sword errstatus;
if (bind->indicator == -1) { /* NULL */
- zval *val = bind->zval;
+ zval *val = &bind->zval;
if (Z_TYPE_P(val) == IS_STRING) {
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
}
zval_dtor(val);
ZVAL_NULL(val);
- } else if (Z_TYPE_P(bind->zval) == IS_STRING
- && Z_STRLEN_P(bind->zval) > 0
- && Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') {
+ } else if (Z_TYPE(bind->zval) == IS_STRING
+ && Z_STRLEN(bind->zval) > 0
+ && Z_STRVAL(bind->zval)[ Z_STRLEN(bind->zval) ] != '\0') {
/* The post- PHP 5.3 feature for "interned" strings disallows
* their reallocation but (i) any IN binds either interned or
* not should already be null terminated and (ii) for OUT
* binds, php_oci_bind_out_callback() should have allocated a
* new string that we can modify here.
*/
- Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1);
- Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
- } else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
+ Z_STR(bind->zval) = zend_string_realloc(Z_STR(bind->zval), Z_STRLEN(bind->zval)+1, 0);
+ Z_STRVAL(bind->zval)[ Z_STRLEN(bind->zval) ] = '\0';
+ } else if (Z_TYPE(bind->zval) == IS_ARRAY) {
int i;
- zval **entry;
- HashTable *hash = HASH_OF(bind->zval);
+ zval *entry = NULL;
+ HashTable *hash = HASH_OF(&bind->zval);
zend_hash_internal_pointer_reset(hash);
@@ -998,23 +998,23 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
case SQLT_INT:
case SQLT_LNG:
for (i = 0; i < bind->array.current_length; i++) {
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- zval_dtor(*entry);
- ZVAL_LONG(*entry, ((ub4 *)(bind->array.elements))[i]);
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
+ zval_dtor(entry);
+ ZVAL_LONG(entry, ((ub4 *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
- add_next_index_long(bind->zval, ((ub4 *)(bind->array.elements))[i]);
+ add_next_index_long(&bind->zval, ((ub4 *)(bind->array.elements))[i]);
}
}
break;
case SQLT_FLT:
for (i = 0; i < bind->array.current_length; i++) {
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- zval_dtor(*entry);
- ZVAL_DOUBLE(*entry, ((double *)(bind->array.elements))[i]);
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
+ zval_dtor(entry);
+ ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
- add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]);
+ add_next_index_double(&bind->zval, ((double *)(bind->array.elements))[i]);
}
}
break;
@@ -1025,17 +1025,17 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
memset((void*)buff,0,sizeof(buff));
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
- zval_dtor(*entry);
+ zval_dtor(entry);
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- ZVAL_NULL(*entry);
+ ZVAL_NULL(entry);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
- ZVAL_STRINGL(*entry, (char *)buff, buff_len, 1);
+ ZVAL_STRINGL(entry, (char *)buff, buff_len);
}
zend_hash_move_forward(hash);
} else {
@@ -1043,10 +1043,10 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- add_next_index_null(bind->zval);
+ add_next_index_null(&bind->zval);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
- add_next_index_stringl(bind->zval, (char *)buff, buff_len);
+ add_next_index_stringl(&bind->zval, (char *)buff, buff_len);
}
}
}
@@ -1061,12 +1061,12 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
for (i = 0; i < bind->array.current_length; i++) {
/* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */
int curr_element_length = bind->array.element_lengths[i];
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- zval_dtor(*entry);
- ZVAL_STRINGL(*entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length, 1);
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
+ zval_dtor(entry);
+ ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
zend_hash_move_forward(hash);
} else {
- add_next_index_stringl(bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
+ add_next_index_stringl(&bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
}
}
break;
@@ -1079,7 +1079,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
/* {{{ php_oci_bind_by_name()
Bind zval to the given placeholder */
-int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long maxlength, ub2 type TSRMLS_DC)
+int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC)
{
php_oci_collection *bind_collection = NULL;
php_oci_descriptor *bind_descriptor = NULL;
@@ -1096,14 +1096,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
switch (type) {
case SQLT_NTY:
{
- zval **tmp;
+ zval *tmp;
- if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "collection", sizeof("collection"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
return 1;
}
- PHP_OCI_ZVAL_TO_COLLECTION_EX(*tmp, bind_collection);
+ PHP_OCI_ZVAL_TO_COLLECTION_EX(tmp, bind_collection);
value_sz = sizeof(void*);
mode = OCI_DEFAULT;
@@ -1118,14 +1118,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_BLOB:
case SQLT_RDD:
{
- zval **tmp;
+ zval *tmp;
- if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
return 1;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(*tmp, bind_descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, bind_descriptor);
value_sz = sizeof(void*);
@@ -1213,21 +1213,19 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
}
memset((void*)&bind,0,sizeof(php_oci_bind));
- if (zend_hash_find(statement->binds, name, name_len + 1, (void **)&old_bind) == SUCCESS) {
+ if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) {
bindp = old_bind;
- if (bindp->zval) {
- zval_ptr_dtor(&bindp->zval);
- }
+ zval_ptr_dtor(&bindp->zval);
} else {
- zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp);
+ bindp = zend_hash_update_ptr(statement->binds, zend_string_init(name, name_len + 1, 0), &bind);
}
bindp->descriptor = oci_desc;
bindp->statement = oci_stmt;
bindp->parent_statement = statement;
- bindp->zval = var;
+ ZVAL_COPY(&bindp->zval, var);
bindp->type = type;
- zval_add_ref(&var);
+ Z_ADDREF_P(var);
PHP_OCI_CALL_RETURN(errstatus,
OCIBindByName,
@@ -1316,7 +1314,7 @@ sb4 php_oci_bind_in_callback(
zval *val;
TSRMLS_FETCH();
- if (!(phpbind=(php_oci_bind *)ictxp) || !(val = phpbind->zval)) {
+ if (!(phpbind=(php_oci_bind *)ictxp) || !(val = &phpbind->zval)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value");
return OCI_ERROR;
}
@@ -1370,7 +1368,7 @@ sb4 php_oci_bind_out_callback(
sb4 retval = OCI_ERROR;
TSRMLS_FETCH();
- if (!(phpbind=(php_oci_bind *)octxp) || !(val = phpbind->zval)) {
+ if (!(phpbind=(php_oci_bind *)octxp) || !(val = &phpbind->zval)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value");
return retval;
}
@@ -1386,7 +1384,7 @@ sb4 php_oci_bind_out_callback(
}
retval = OCI_CONTINUE;
} else if (Z_TYPE_P(val) == IS_OBJECT) {
- zval **tmp;
+ zval *tmp;
php_oci_descriptor *desc;
if (!phpbind->descriptor) {
@@ -1397,11 +1395,11 @@ sb4 php_oci_bind_out_callback(
* out-bind as the contents would have been changed for in/out
* binds (Bug #46994).
*/
- if (zend_hash_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find object outbind descriptor property");
return OCI_ERROR;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(*tmp, desc);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, desc);
desc->lob_size = -1; /* force OCI8 to update cached size */
*alenpp = &phpbind->dummy_len;
@@ -1414,12 +1412,14 @@ sb4 php_oci_bind_out_callback(
convert_to_string(val);
zval_dtor(val);
- Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
- Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1);
-
+ //Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
+ //Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1);
+ // XXX is this right?
+ ZVAL_STRINGL(val, NULL, Z_STRLEN(phpbind->zval) + 1);
+
/* XXX we assume that zend-zval len has 4 bytes */
- *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
- *bufpp = Z_STRVAL_P(phpbind->zval);
+ *alenpp = (ub4*) &Z_STRLEN(phpbind->zval);
+ *bufpp = Z_STRVAL(phpbind->zval);
*piecep = OCI_ONE_PIECE;
*rcodepp = &phpbind->retcode;
*indpp = &phpbind->indicator;
@@ -1442,7 +1442,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
return NULL;
}
- statement = (php_oci_statement *) zend_fetch_resource(&z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement);
if (!statement) {
return NULL;
@@ -1466,7 +1466,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
convert_to_long(&tmp);
column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0 TSRMLS_CC);
if (!column) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL(tmp));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp));
zval_dtor(&tmp);
return NULL;
}
@@ -1524,7 +1524,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR
/* {{{ php_oci_bind_array_by_name()
Bind arrays to PL/SQL types */
-int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long max_table_length, long maxlength, long type TSRMLS_DC)
+int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC)
{
php_oci_bind *bind, *bindp;
sword errstatus;
@@ -1532,7 +1532,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
convert_to_array(var);
if (maxlength < -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%ld)", maxlength);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%pd)", maxlength);
return 1;
}
@@ -1563,7 +1563,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection TSRMLS_CC);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %ld", type);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %pd", type);
return 1;
break;
}
@@ -1578,18 +1578,18 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0);
}
- zend_hash_update(statement->binds, name, name_len + 1, bind, sizeof(php_oci_bind), (void **)&bindp);
+ bindp = zend_hash_update_ptr(statement->binds, zend_string_init(name, name_len + 1, 0), bind);
bindp->descriptor = NULL;
bindp->statement = NULL;
bindp->parent_statement = statement;
bindp->bind = NULL;
- bindp->zval = var;
+ ZVAL_COPY(&bindp->zval, var);
bindp->array.type = type;
bindp->indicator = 0; /* not used for array binds */
bindp->type = 0; /* not used for array binds */
- zval_add_ref(&var);
+ Z_ADDREF_P(var);
PHP_OCI_CALL_RETURN(errstatus,
OCIBindByName,
@@ -1626,21 +1626,21 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
/* {{{ php_oci_bind_array_helper_string()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, long maxlength TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC)
{
php_oci_bind *bind;
ub4 i;
HashTable *hash;
- zval **entry;
+ zval *entry;
hash = HASH_OF(var);
if (maxlength == -1) {
zend_hash_internal_pointer_reset(hash);
- while (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
+ while ((entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_string_ex(entry);
- if (Z_STRLEN_PP(entry) > maxlength) {
- maxlength = Z_STRLEN_PP(entry) + 1;
+ if (Z_STRLEN_P(entry) > maxlength) {
+ maxlength = Z_STRLEN_P(entry) + 1;
}
zend_hash_move_forward(hash);
}
@@ -1660,10 +1660,10 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length,
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < bind->array.current_length; i++) {
- if (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
+ if ((entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_string_ex(entry);
- bind->array.element_lengths[i] = Z_STRLEN_PP(entry);
- if (Z_STRLEN_PP(entry) == 0) {
+ bind->array.element_lengths[i] = Z_STRLEN_P(entry);
+ if (Z_STRLEN_P(entry) == 0) {
bind->array.indicators[i] = -1;
}
zend_hash_move_forward(hash);
@@ -1674,13 +1674,13 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length,
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
int element_length;
convert_to_string_ex(entry);
- element_length = (maxlength > Z_STRLEN_PP(entry)) ? Z_STRLEN_PP(entry) : maxlength;
+ element_length = (maxlength > Z_STRLEN_P(entry)) ? Z_STRLEN_P(entry) : maxlength;
- memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_PP(entry), element_length);
+ memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_P(entry), element_length);
((text *)bind->array.elements)[i*maxlength + element_length] = '\0';
zend_hash_move_forward(hash);
@@ -1696,12 +1696,12 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length,
/* {{{ php_oci_bind_array_helper_number()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC)
{
php_oci_bind *bind;
ub4 i;
HashTable *hash;
- zval **entry;
+ zval *entry;
hash = HASH_OF(var);
@@ -1719,9 +1719,9 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length
if (i < bind->array.current_length) {
bind->array.element_lengths[i] = sizeof(ub4);
}
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_long_ex(entry);
- ((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_PP(entry);
+ ((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_P(entry);
zend_hash_move_forward(hash);
} else {
((ub4 *)bind->array.elements)[i] = 0;
@@ -1735,12 +1735,12 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length
/* {{{ php_oci_bind_array_helper_double()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC)
{
php_oci_bind *bind;
ub4 i;
HashTable *hash;
- zval **entry;
+ zval *entry;
hash = HASH_OF(var);
@@ -1758,9 +1758,9 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length
if (i < bind->array.current_length) {
bind->array.element_lengths[i] = sizeof(double);
}
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_double_ex(entry);
- ((double *)bind->array.elements)[i] = (double) Z_DVAL_PP(entry);
+ ((double *)bind->array.elements)[i] = (double) Z_DVAL_P(entry);
zend_hash_move_forward(hash);
} else {
((double *)bind->array.elements)[i] = 0;
@@ -1774,12 +1774,12 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length
/* {{{ php_oci_bind_array_helper_date()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, php_oci_connection *connection TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC)
{
php_oci_bind *bind;
ub4 i;
HashTable *hash;
- zval **entry;
+ zval *entry;
sword errstatus;
hash = HASH_OF(var);
@@ -1799,10 +1799,10 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p
if (i < bind->array.current_length) {
bind->array.element_lengths[i] = sizeof(OCIDate);
}
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_string_ex(entry);
- PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date));
+ PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_P(entry), Z_STRLEN_P(entry), NULL, 0, NULL, 0, &oci_date));
if (errstatus != OCI_SUCCESS) {
/* failed to convert string to date */
diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h
index 066812edad..d673a3c083 100644
--- a/ext/oci8/php_oci8.h
+++ b/ext/oci8/php_oci8.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h
index 7cf3d170fa..852fe986f3 100644
--- a/ext/oci8/php_oci8_int.h
+++ b/ext/oci8/php_oci8_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -144,7 +144,7 @@ typedef struct {
sb4 errcode; /* last ORA- error number */
HashTable *descriptors; /* descriptors hash, used to flush all the LOBs using this connection on commit */
- ulong descriptor_count; /* used to index the descriptors hash table. Not an accurate count */
+ zend_ulong descriptor_count; /* used to index the descriptors hash table. Not an accurate count */
unsigned is_open:1; /* hels to determine if the connection is dead or not */
unsigned is_attached:1; /* hels to determine if we should detach from the server when closing/freeing the connection */
unsigned is_persistent:1; /* self-descriptive */
@@ -165,7 +165,7 @@ typedef struct {
/* {{{ php_oci_descriptor */
typedef struct {
zend_resource *id;
- ulong index; /* descriptors hash table index */
+ zend_ulong index; /* descriptors hash table index */
php_oci_connection *connection; /* parent connection handle */
dvoid *descriptor; /* OCI descriptor handle */
ub4 type; /* descriptor type (FILE/LOB) */
@@ -221,7 +221,7 @@ typedef struct {
OCIStmt *stmt; /* statement handle */
char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor received from Oracle */
char impres_flag; /* PHP_OCI_IMPRES_*_ */
- long last_query_len; /* last query length */
+ zend_long last_query_len; /* last query length */
HashTable *columns; /* hash containing all the result columns */
HashTable *binds; /* binds hash */
HashTable *defines; /* defines hash */
@@ -249,7 +249,7 @@ typedef struct {
ub4 current_length;
ub4 old_length;
ub4 max_length;
- long type;
+ zend_long type;
} array;
sb2 indicator; /* -1 means NULL */
ub2 retcode;
@@ -361,20 +361,20 @@ typedef struct {
} while (0)
#define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \
- ZEND_FETCH_RESOURCE2(connection, php_oci_connection *, &zval, -1, "oci8 connection", le_connection, le_pconnection)
+ ZEND_FETCH_RESOURCE2(connection, php_oci_connection *, zval, -1, "oci8 connection", le_connection, le_pconnection)
#define PHP_OCI_ZVAL_TO_STATEMENT(zval, statement) \
ZEND_FETCH_RESOURCE(statement, php_oci_statement *, zval, -1, "oci8 statement", le_statement)
#define PHP_OCI_ZVAL_TO_DESCRIPTOR(zval, descriptor) \
- ZEND_FETCH_RESOURCE(descriptor, php_oci_descriptor *, &zval, -1, "oci8 descriptor", le_descriptor)
+ ZEND_FETCH_RESOURCE(descriptor, php_oci_descriptor *, zval, -1, "oci8 descriptor", le_descriptor)
#define PHP_OCI_ZVAL_TO_COLLECTION(zval, collection) \
- ZEND_FETCH_RESOURCE(collection, php_oci_collection *, &zval, -1, "oci8 collection", le_collection)
+ ZEND_FETCH_RESOURCE(collection, php_oci_collection *, zval, -1, "oci8 collection", le_collection)
#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \
do { \
- var = (type) zend_fetch_resource(&zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
+ var = (type) zend_fetch_resource(zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
if (!var) { \
return 1; \
} \
@@ -407,7 +407,7 @@ sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC);
sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC);
int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC);
void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive);
-php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC);
+php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC);
int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC);
int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC);
int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC);
@@ -422,22 +422,22 @@ void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode
/* {{{ lob related prototypes */
-php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, long type TSRMLS_DC);
+php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, zend_long type TSRMLS_DC);
int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC);
-int php_oci_lob_read(php_oci_descriptor *descriptor, long read_length, long inital_offset, char **data, ub4 *data_len TSRMLS_DC);
+int php_oci_lob_read(php_oci_descriptor *descriptor, zend_long read_length, zend_long inital_offset, char **data, ub4 *data_len TSRMLS_DC);
int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC);
-int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC);
+int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC);
int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off TSRMLS_DC);
int php_oci_lob_get_buffering(php_oci_descriptor *descriptor);
-int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, long length TSRMLS_DC);
+int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC);
int php_oci_lob_close(php_oci_descriptor *descriptor TSRMLS_DC);
int php_oci_temp_lob_close(php_oci_descriptor *descriptor TSRMLS_DC);
-int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, long type, char *data, int data_len TSRMLS_DC);
+int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC);
void php_oci_lob_free(php_oci_descriptor *descriptor TSRMLS_DC);
int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename TSRMLS_DC);
int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC);
-int php_oci_lob_truncate(php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC);
-int php_oci_lob_erase(php_oci_descriptor *descriptor, long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC);
+int php_oci_lob_truncate(php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC);
+int php_oci_lob_erase(php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC);
int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC);
sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp);
/* }}} */
@@ -446,15 +446,15 @@ sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece,
php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC);
int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC);
-int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC);
-int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC);
+int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC);
+int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC);
int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC);
-int php_oci_collection_element_get(php_oci_collection *collection, long index, zval **result_element TSRMLS_DC);
-int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC);
-int php_oci_collection_element_set_null(php_oci_collection *collection, long index TSRMLS_DC);
-int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC);
-int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC);
-int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC);
+int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC);
+int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC);
+int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC);
+int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC);
+int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC);
+int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC);
int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC);
void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC);
int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC);
@@ -471,24 +471,24 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC);
int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC);
int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC);
-php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, char *column_name, int column_name_len TSRMLS_DC);
+php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC);
int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC);
int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC);
void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC);
int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC);
int php_oci_bind_post_exec(void *data TSRMLS_DC);
-int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long maxlength, ub2 type TSRMLS_DC);
+int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC);
sb4 php_oci_bind_in_callback(dvoid *ictxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp);
sb4 php_oci_bind_out_callback(dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp);
php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data);
int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC);
int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC);
int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC);
-int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long max_table_length, long maxlength, long type TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, long maxlength TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, php_oci_connection *connection TSRMLS_DC);
+int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC);
+php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC);
+php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC);
+php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC);
+php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC);
/* }}} */
@@ -496,14 +496,14 @@ ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ Module globals */
sb4 errcode; /* global last ORA- error number. Used when connect fails, for example */
OCIError *err; /* global error handle */
- long max_persistent; /* maximum number of persistent connections per process */
- long num_persistent; /* number of existing persistent connections */
- long num_links; /* non-persistent + persistent connections */
- long num_statements; /* number of statements open */
- long ping_interval; /* time interval between pings */
- long persistent_timeout; /* time period after which idle persistent connection is considered expired */
- long statement_cache_size; /* statement cache size. used with 9i+ clients only*/
- long default_prefetch; /* default prefetch setting */
+ zend_long max_persistent; /* maximum number of persistent connections per process */
+ zend_long num_persistent; /* number of existing persistent connections */
+ zend_long num_links; /* non-persistent + persistent connections */
+ zend_long num_statements; /* number of statements open */
+ zend_long ping_interval; /* time interval between pings */
+ zend_long persistent_timeout; /* time period after which idle persistent connection is considered expired */
+ zend_long statement_cache_size; /* statement cache size. used with 9i+ clients only*/
+ zend_long default_prefetch; /* default prefetch setting */
zend_bool privileged_connect; /* privileged connect flag (On/Off) */
zend_bool old_oci_close_semantics; /* old_oci_close_semantics flag (to determine the way oci_close() should behave) */
diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
index 09162ae61b..3857c6955c 100644
--- a/ext/odbc/birdstep.c
+++ b/ext/odbc/birdstep.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/odbc/php_birdstep.h b/ext/odbc/php_birdstep.h
index eb694577fb..eab1dcee7c 100644
--- a/ext/odbc/php_birdstep.h
+++ b/ext/odbc/php_birdstep.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 9b1149e13d..13bd9e1628 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -524,9 +524,9 @@ static PHP_INI_DISP(display_link_nums)
TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value;
+ value = ini_entry->orig_value->val;
} else if (ini_entry->value) {
- value = ini_entry->value;
+ value = ini_entry->value->val;
} else {
value = NULL;
}
@@ -549,9 +549,9 @@ static PHP_INI_DISP(display_defPW)
TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value;
+ value = ini_entry->orig_value->val;
} else if (ini_entry->value) {
- value = ini_entry->value;
+ value = ini_entry->value->val;
} else {
value = NULL;
}
@@ -580,9 +580,9 @@ static PHP_INI_DISP(display_binmode)
TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value;
+ value = ini_entry->orig_value->val;
} else if (ini_entry->value) {
- value = ini_entry->value;
+ value = ini_entry->value->val;
} else {
value = NULL;
}
@@ -611,9 +611,9 @@ static PHP_INI_DISP(display_lrl)
TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value;
+ value = ini_entry->orig_value->val;
} else if (ini_entry->value) {
- value = ini_entry->value;
+ value = ini_entry->value->val;
} else {
value = NULL;
}
@@ -637,9 +637,9 @@ static PHP_INI_DISP(display_cursortype)
TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value;
+ value = ini_entry->orig_value->val;
} else if (ini_entry->value) {
- value = ini_entry->value;
+ value = ini_entry->value->val;
} else {
value = NULL;
}
@@ -2615,13 +2615,13 @@ try_and_get_another_connection:
zend_resource *index_ptr, new_index_ptr;
if ((index_ptr = zend_hash_str_find_ptr(&EG(regular_list), hashed_details, hashed_len)) != NULL) {
- int conn_id;
+ zend_ulong conn_id;
zend_resource *p;
if (index_ptr->type != le_index_ptr) {
RETURN_FALSE;
}
- conn_id = (int)index_ptr->ptr;
+ conn_id = (zend_ulong)index_ptr->ptr;
p = zend_hash_index_find_ptr(&EG(regular_list), conn_id); /* check if the connection is still there */
if (p && p->ptr && (p->type == le_conn || p->type == le_pconn)) {
diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h
index bd78e88f52..9219fa87ad 100644
--- a/ext/odbc/php_odbc.h
+++ b/ext/odbc/php_odbc.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index f44b897b9b..6a7e5c3756 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 3289299ce1..1f873912b4 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -169,7 +169,6 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz
case ZEND_FE_RESET:
case ZEND_NEW:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
START_BLOCK_OP(ZEND_OP2(opline).opline_num);
START_BLOCK_OP(opno + 1);
break;
@@ -297,7 +296,6 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz
case ZEND_FE_RESET:
case ZEND_NEW:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
case ZEND_FE_FETCH:
cur_block->op2_to = &blocks[ZEND_OP2(opline).opline_num];
/* break missing intentionally */
@@ -614,7 +612,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
end = opline + block->len;
while ((op_array->T) && (opline < end)) {
/* strip X = QM_ASSIGN(const) */
- if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR &&
+ if ((ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) &&
VAR_SOURCE(opline->op1) &&
VAR_SOURCE(opline->op1)->opcode == ZEND_QM_ASSIGN &&
ZEND_OP1_TYPE(VAR_SOURCE(opline->op1)) == IS_CONST &&
@@ -633,7 +631,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
}
/* T = QM_ASSIGN(C), F(T) => NOP, F(C) */
- if (ZEND_OP2_TYPE(opline) == IS_TMP_VAR &&
+ if ((ZEND_OP2_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) &&
VAR_SOURCE(opline->op2) &&
VAR_SOURCE(opline->op2)->opcode == ZEND_QM_ASSIGN &&
ZEND_OP1_TYPE(VAR_SOURCE(opline->op2)) == IS_CONST) {
@@ -880,10 +878,10 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
opline->opcode == ZEND_JMPNZ_EX ||
opline->opcode == ZEND_JMPNZ ||
opline->opcode == ZEND_JMPZNZ) &&
- ZEND_OP1_TYPE(opline) == IS_TMP_VAR &&
+ (ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) &&
VAR_SOURCE(opline->op1) != NULL &&
(!used_ext[VAR_NUM(ZEND_OP1(opline).var)] ||
- (ZEND_RESULT_TYPE(opline) == IS_TMP_VAR &&
+ ((ZEND_RESULT_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) &&
ZEND_RESULT(opline).var == ZEND_OP1(opline).var)) &&
(VAR_SOURCE(opline->op1)->opcode == ZEND_BOOL ||
VAR_SOURCE(opline->op1)->opcode == ZEND_QM_ASSIGN)) {
@@ -913,7 +911,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
}
old_len = Z_STRLEN(ZEND_OP1_LITERAL(last_op));
l = old_len + Z_STRLEN(ZEND_OP1_LITERAL(opline));
- if (IS_INTERNED(Z_STR(ZEND_OP1_LITERAL(last_op)))) {
+ if (!Z_REFCOUNTED(ZEND_OP1_LITERAL(last_op))) {
zend_string *tmp = zend_string_alloc(l, 0);
memcpy(tmp->val, Z_STRVAL(ZEND_OP1_LITERAL(last_op)), old_len);
Z_STR(ZEND_OP1_LITERAL(last_op)) = tmp;
@@ -925,7 +923,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
Z_STRVAL(ZEND_OP1_LITERAL(last_op))[l] = '\0';
zval_dtor(&ZEND_OP1_LITERAL(opline));
Z_STR(ZEND_OP1_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP1_LITERAL(last_op)) TSRMLS_CC);
- if (IS_INTERNED(Z_STR(ZEND_OP1_LITERAL(opline)))) {
+ if (!Z_REFCOUNTED(ZEND_OP1_LITERAL(opline))) {
Z_TYPE_FLAGS(ZEND_OP1_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
ZVAL_NULL(&ZEND_OP1_LITERAL(last_op));
@@ -957,7 +955,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
COPY_NODE(opline->op1, src->op1);
old_len = Z_STRLEN(ZEND_OP2_LITERAL(src));
l = old_len + Z_STRLEN(ZEND_OP2_LITERAL(opline));
- if (IS_INTERNED(Z_STR(ZEND_OP2_LITERAL(src)))) {
+ if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(src))) {
zend_string *tmp = zend_string_alloc(l, 0);
memcpy(tmp->val, Z_STRVAL(ZEND_OP2_LITERAL(src)), old_len);
Z_STR(ZEND_OP2_LITERAL(last_op)) = tmp;
@@ -969,7 +967,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
Z_STRVAL(ZEND_OP2_LITERAL(src))[l] = '\0';
zend_string_release(Z_STR(ZEND_OP2_LITERAL(opline)));
Z_STR(ZEND_OP2_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)) TSRMLS_CC);
- if (IS_INTERNED(Z_STR(ZEND_OP2_LITERAL(opline)))) {
+ if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(opline))) {
Z_TYPE_FLAGS(ZEND_OP2_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
ZVAL_NULL(&ZEND_OP2_LITERAL(src));
@@ -1049,7 +1047,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
opline->opcode = ZEND_QM_ASSIGN;
zend_optimizer_update_op1_const(op_array, opline, &result TSRMLS_CC);
} else if ((opline->opcode == ZEND_RETURN || opline->opcode == ZEND_EXIT) &&
- ZEND_OP1_TYPE(opline) == IS_TMP_VAR &&
+ (ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) &&
VAR_SOURCE(opline->op1) &&
VAR_SOURCE(opline->op1)->opcode == ZEND_QM_ASSIGN) {
/* T = QM_ASSIGN(X), RETURN(T) to RETURN(X) */
@@ -1133,8 +1131,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
opline->opcode = ZEND_CONCAT;
MAKE_NOP(src);
} else if (opline->opcode == ZEND_QM_ASSIGN &&
- ZEND_OP1_TYPE(opline) == IS_TMP_VAR &&
- ZEND_RESULT_TYPE(opline) == IS_TMP_VAR &&
+ ZEND_OP1_TYPE(opline) == ZEND_RESULT_TYPE(opline) &&
ZEND_OP1(opline).var == ZEND_RESULT(opline).var) {
/* strip T = QM_ASSIGN(T) */
MAKE_NOP(opline);
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index 78f1d28445..091437e119 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -40,6 +40,7 @@
#define LITERAL_STATIC_PROPERTY 0x0700
#define LITERAL_METHOD 0x0800
#define LITERAL_PROPERTY 0x0900
+#define LITERAL_GLOBAL 0x0A00
#define LITERAL_EX_CLASS 0x4000
#define LITERAL_EX_OBJ 0x2000
@@ -278,6 +279,9 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
}
}
break;
+ case ZEND_BIND_GLOBAL:
+ LITERAL_INFO(opline->op2.constant, LITERAL_GLOBAL, 0, 1, 1);
+ break;
default:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1, 0, 1);
@@ -311,7 +315,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
/* Merge equal constants */
j = 0; cache_slots = 0;
- zend_hash_init(&hash, 16, NULL, NULL, 0);
+ zend_hash_init(&hash, op_array->last_literal, NULL, NULL, 0);
map = (int*)zend_arena_alloc(&ctx->arena, op_array->last_literal * sizeof(int));
memset(map, 0, op_array->last_literal * sizeof(int));
for (i = 0; i < op_array->last_literal; i++) {
diff --git a/ext/opcache/Optimizer/nop_removal.c b/ext/opcache/Optimizer/nop_removal.c
index bea42229f6..17cc838990 100644
--- a/ext/opcache/Optimizer/nop_removal.c
+++ b/ext/opcache/Optimizer/nop_removal.c
@@ -97,7 +97,6 @@ void zend_optimizer_nop_removal(zend_op_array *op_array)
case ZEND_FE_RESET:
case ZEND_NEW:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
ZEND_OP2(opline).opline_num -= shiftlist[ZEND_OP2(opline).opline_num];
break;
case ZEND_JMPZNZ:
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index def060c66c..3f3e72dc31 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -529,7 +529,6 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
case ZEND_NEW:
case ZEND_DO_FCALL:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
collect_constants = 0;
break;
case ZEND_FETCH_R:
diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c
index 511431bb2c..345e347a5b 100644
--- a/ext/opcache/Optimizer/pass3.c
+++ b/ext/opcache/Optimizer/pass3.c
@@ -182,7 +182,6 @@ void zend_optimizer_pass3(zend_op_array *op_array TSRMLS_DC)
break;
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) {
break;
}
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index 6d011afc60..f31ce38cfe 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -467,7 +467,6 @@ static void zend_accel_optimize(zend_op_array *op_array,
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
case ZEND_NEW:
case ZEND_FE_RESET:
case ZEND_FE_FETCH:
@@ -505,7 +504,6 @@ static void zend_accel_optimize(zend_op_array *op_array,
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
case ZEND_NEW:
case ZEND_FE_RESET:
case ZEND_FE_FETCH:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 053a17c993..e210a46210 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -192,13 +192,13 @@ void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason T
*/
static ZEND_INI_MH(accel_include_path_on_modify)
{
- int ret = orig_include_path_on_modify(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ int ret = orig_include_path_on_modify(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
ZCG(include_path_key) = NULL;
if (ret == SUCCESS) {
- ZCG(include_path) = new_value;
+ ZCG(include_path) = new_value->val;
if (ZCG(include_path) && *ZCG(include_path)) {
- ZCG(include_path_len) = new_value_length;
+ ZCG(include_path_len) = new_value->len;
if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled))) {
@@ -1913,6 +1913,7 @@ static void accel_activate(void)
* allocated block separately, but we like to call all the destructors and
* callbacks in exactly the same order.
*/
+static void accel_fast_zval_dtor(zval *zvalue);
static void accel_fast_hash_destroy(HashTable *ht)
{
@@ -1922,7 +1923,7 @@ static void accel_fast_hash_destroy(HashTable *ht)
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
- ht->pDestructor(&p->val);
+ accel_fast_zval_dtor(&p->val);
}
}
@@ -1936,7 +1937,6 @@ static void accel_fast_zval_dtor(zval *zvalue)
if (Z_ARR_P(zvalue) != &EG(symbol_table)) {
/* break possible cycles */
ZVAL_NULL(zvalue);
- Z_ARRVAL_P(zvalue)->pDestructor = accel_fast_zval_dtor;
accel_fast_hash_destroy(Z_ARRVAL_P(zvalue));
}
}
@@ -1978,61 +1978,29 @@ static int accel_clean_non_persistent_function(zval *zv TSRMLS_DC)
return ZEND_HASH_APPLY_STOP;
} else {
if (function->op_array.static_variables) {
- function->op_array.static_variables->pDestructor = accel_fast_zval_dtor;
accel_fast_hash_destroy(function->op_array.static_variables);
function->op_array.static_variables = NULL;
}
- return (--(*function->op_array.refcount) <= 0) ?
- ZEND_HASH_APPLY_REMOVE :
- ZEND_HASH_APPLY_KEEP;
- }
-}
-
-static int accel_cleanup_function_data(zval *zv TSRMLS_DC)
-{
- zend_function *function = Z_PTR_P(zv);
-
- if (function->type == ZEND_USER_FUNCTION) {
- if (function->op_array.static_variables) {
- function->op_array.static_variables->pDestructor = accel_fast_zval_dtor;
- accel_fast_hash_destroy(function->op_array.static_variables);
- function->op_array.static_variables = NULL;
- }
- }
- return 0;
-}
-
-static int accel_clean_non_persistent_class(zval *zv TSRMLS_DC)
-{
- zend_class_entry *ce = Z_PTR_P(zv);
-
- if (ce->type == ZEND_INTERNAL_CLASS) {
- return ZEND_HASH_APPLY_STOP;
- } else {
- if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) {
- zend_hash_apply(&ce->function_table, (apply_func_t) accel_cleanup_function_data TSRMLS_CC);
- }
- if (ce->static_members_table) {
- int i;
-
- for (i = 0; i < ce->default_static_members_count; i++) {
- accel_fast_zval_dtor(&ce->static_members_table[i]);
- ZVAL_UNDEF(&ce->static_members_table[i]);
- }
- ce->static_members_table = NULL;
- }
return ZEND_HASH_APPLY_REMOVE;
}
}
-static int accel_clean_non_persistent_constant(zval *zv TSRMLS_DC)
+static inline void zend_accel_fast_del_bucket(HashTable *ht, uint32_t idx, Bucket *p)
{
- zend_constant *c = Z_PTR_P(zv);
+ uint32_t nIndex = p->h & ht->nTableMask;
+ uint32_t i = ht->arHash[nIndex];
- if (c->flags & CONST_PERSISTENT) {
- return ZEND_HASH_APPLY_STOP;
- } else {
- return ZEND_HASH_APPLY_REMOVE;
+ ht->nNumUsed--;
+ ht->nNumOfElements--;
+ if (idx != i) {
+ Bucket *prev = ht->arData + i;
+ while (Z_NEXT(prev->val) != idx) {
+ i = Z_NEXT(prev->val);
+ prev = ht->arData + i;
+ }
+ Z_NEXT(prev->val) = Z_NEXT(p->val);
+ } else {
+ ht->arHash[p->h & ht->nTableMask] = Z_NEXT(p->val);
}
}
@@ -2054,18 +2022,60 @@ static void zend_accel_fast_shutdown(TSRMLS_D)
EG(symbol_table).ht.pDestructor = old_destructor;
}
zend_hash_init(&EG(symbol_table).ht, 8, NULL, NULL, 0);
- old_destructor = EG(function_table)->pDestructor;
- EG(function_table)->pDestructor = NULL;
- zend_hash_reverse_apply(EG(function_table), (apply_func_t) accel_clean_non_persistent_function TSRMLS_CC);
- EG(function_table)->pDestructor = old_destructor;
- old_destructor = EG(class_table)->pDestructor;
- EG(class_table)->pDestructor = NULL;
- zend_hash_reverse_apply(EG(class_table), (apply_func_t) accel_clean_non_persistent_class TSRMLS_CC);
- EG(class_table)->pDestructor = old_destructor;
- old_destructor = EG(zend_constants)->pDestructor;
- EG(zend_constants)->pDestructor = NULL;
- zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) accel_clean_non_persistent_constant TSRMLS_CC);
- EG(zend_constants)->pDestructor = old_destructor;
+
+ ZEND_HASH_REVERSE_FOREACH(EG(function_table), 0) {
+ zend_function *func = Z_PTR(_p->val);
+
+ if (func->type == ZEND_INTERNAL_FUNCTION) {
+ break;
+ } else {
+ if (func->op_array.static_variables) {
+ accel_fast_hash_destroy(func->op_array.static_variables);
+ }
+ zend_accel_fast_del_bucket(EG(function_table), _idx-1, _p);
+ }
+ } ZEND_HASH_FOREACH_END();
+
+ ZEND_HASH_REVERSE_FOREACH(EG(class_table), 0) {
+ zend_class_entry *ce = Z_PTR(_p->val);
+
+ if (ce->type == ZEND_INTERNAL_CLASS) {
+ break;
+ } else {
+ if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) {
+ zend_function *func;
+
+ ZEND_HASH_FOREACH_PTR(&ce->function_table, func) {
+ if (func->type == ZEND_USER_FUNCTION) {
+ if (func->op_array.static_variables) {
+ accel_fast_hash_destroy(func->op_array.static_variables);
+ func->op_array.static_variables = NULL;
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ }
+ if (ce->static_members_table) {
+ int i;
+
+ for (i = 0; i < ce->default_static_members_count; i++) {
+ accel_fast_zval_dtor(&ce->static_members_table[i]);
+ ZVAL_UNDEF(&ce->static_members_table[i]);
+ }
+ ce->static_members_table = NULL;
+ }
+ zend_accel_fast_del_bucket(EG(class_table), _idx-1, _p);
+ }
+ } ZEND_HASH_FOREACH_END();
+
+ ZEND_HASH_REVERSE_FOREACH(EG(zend_constants), 0) {
+ zend_constant *c = Z_PTR(_p->val);
+
+ if (c->flags & CONST_PERSISTENT) {
+ break;
+ } else {
+ zend_accel_fast_del_bucket(EG(zend_constants), _idx-1, _p);
+ }
+ } ZEND_HASH_FOREACH_END();
}
CG(unclean_shutdown) = 1;
}
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index a53ed122e6..001c3ee9ed 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -109,10 +109,10 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption)
#endif
/* keep the compiler happy */
- (void)entry; (void)new_value_length; (void)mh_arg2; (void)mh_arg3; (void)stage;
+ (void)entry; (void)mh_arg2; (void)mh_arg3; (void)stage;
p = (zend_long *) (base + (size_t)mh_arg1);
- memsize = atoi(new_value);
+ memsize = atoi(new_value->val);
/* sanity check we must use at least 8 MB */
if (memsize < 8) {
const char *new_new_value = "8";
@@ -128,8 +128,7 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption)
return FAILURE;
}
- ini_entry->value = strdup(new_new_value);
- ini_entry->value_length = strlen(new_new_value);
+ ini_entry->value = zend_string_init(new_new_value, 1, 1);
}
*p = memsize * (1024 * 1024);
return SUCCESS;
@@ -146,10 +145,10 @@ static ZEND_INI_MH(OnUpdateMaxAcceleratedFiles)
#endif
/* keep the compiler happy */
- (void)entry; (void)new_value_length; (void)mh_arg2; (void)mh_arg3; (void)stage;
+ (void)entry; (void)mh_arg2; (void)mh_arg3; (void)stage;
p = (zend_long *) (base + (size_t)mh_arg1);
- size = atoi(new_value);
+ size = atoi(new_value->val);
/* sanity check we must use a value between MIN_ACCEL_FILES and MAX_ACCEL_FILES */
if (size < MIN_ACCEL_FILES || size > MAX_ACCEL_FILES) {
@@ -173,8 +172,7 @@ static ZEND_INI_MH(OnUpdateMaxAcceleratedFiles)
sizeof("opcache.max_accelerated_files")-1)) == NULL) {
return FAILURE;
}
- ini_entry->value = strdup(new_new_value);
- ini_entry->value_length = strlen(new_new_value);
+ ini_entry->value = zend_string_init(new_new_value, strlen(new_new_value), 1);
}
*p = size;
return SUCCESS;
@@ -191,10 +189,10 @@ static ZEND_INI_MH(OnUpdateMaxWastedPercentage)
#endif
/* keep the compiler happy */
- (void)entry; (void)new_value_length; (void)mh_arg2; (void)mh_arg3; (void)stage;
+ (void)entry; (void)mh_arg2; (void)mh_arg3; (void)stage;
p = (double *) (base + (size_t)mh_arg1);
- percentage = atoi(new_value);
+ percentage = atoi(new_value->val);
if (percentage <= 0 || percentage > 50) {
const char *new_new_value = "5";
@@ -208,8 +206,7 @@ static ZEND_INI_MH(OnUpdateMaxWastedPercentage)
sizeof("opcache.max_wasted_percentage")-1)) == NULL) {
return FAILURE;
}
- ini_entry->value = strdup(new_new_value);
- ini_entry->value_length = strlen(new_new_value);
+ ini_entry->value = zend_string_init(new_new_value, strlen(new_new_value), 1);
}
*p = (double)percentage / 100.0;
return SUCCESS;
@@ -220,7 +217,7 @@ static ZEND_INI_MH(OnEnable)
if (stage == ZEND_INI_STAGE_STARTUP ||
stage == ZEND_INI_STAGE_SHUTDOWN ||
stage == ZEND_INI_STAGE_DEACTIVATE) {
- return OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
} else {
/* It may be only temporary disabled */
zend_bool *p;
@@ -231,10 +228,10 @@ static ZEND_INI_MH(OnEnable)
#endif
p = (zend_bool *) (base+(size_t) mh_arg1);
- if ((new_value_length == 2 && strcasecmp("on", new_value) == 0) ||
- (new_value_length == 3 && strcasecmp("yes", new_value) == 0) ||
- (new_value_length == 4 && strcasecmp("true", new_value) == 0) ||
- atoi(new_value) != 0) {
+ if ((new_value->len == 2 && strcasecmp("on", new_value->val) == 0) ||
+ (new_value->len == 3 && strcasecmp("yes", new_value->val) == 0) ||
+ (new_value->len == 4 && strcasecmp("true", new_value->val) == 0) ||
+ atoi(new_value->val) != 0) {
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " can't be temporary enabled (it may be only disabled till the end of request)");
return FAILURE;
} else {
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index e04b1ec7db..5dbb48237d 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -232,14 +232,14 @@ static inline zend_string *zend_clone_str(zend_string *str TSRMLS_DC)
if (IS_INTERNED(str)) {
ret = str;
- } else if (zend_string_refcount(str) <= 1 || (ret = accel_xlat_get(str)) == NULL) {
+ } else if (GC_REFCOUNT(str) <= 1 || (ret = accel_xlat_get(str)) == NULL) {
ret = zend_string_dup(str, 0);
GC_FLAGS(ret) = GC_FLAGS(str);
- if (zend_string_refcount(str) > 1) {
+ if (GC_REFCOUNT(str) > 1) {
accel_xlat_set(str, ret);
}
} else {
- zend_string_addref(ret);
+ GC_REFCOUNT(ret)++;
}
return ret;
}
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index b49f28f4e3..05fbd4fc75 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -198,6 +198,7 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
} else {
+ GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
/* make immutable array */
@@ -251,6 +252,7 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
} else {
+ GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
/* make immutable array */
@@ -371,7 +373,6 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
case ZEND_JMP_SET:
- case ZEND_JMP_SET_VAR:
case ZEND_NEW:
case ZEND_FE_RESET:
case ZEND_FE_FETCH:
diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c
index 76d1b043b0..d2de94f05c 100644
--- a/ext/opcache/zend_persist_calc.c
+++ b/ext/opcache/zend_persist_calc.c
@@ -120,7 +120,7 @@ static uint zend_persist_zval_calc(zval *z TSRMLS_DC)
case IS_CONSTANT:
flags = Z_GC_FLAGS_P(z) & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
ADD_INTERNED_STRING(Z_STR_P(z), 0);
- if (IS_INTERNED(Z_STR_P(z))) {
+ if (!Z_REFCOUNTED_P(z)) {
Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
Z_GC_FLAGS_P(z) |= flags;
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index f2219dcd1e..c4b155b478 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -4386,7 +4386,7 @@ PHP_FUNCTION(openssl_private_encrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf->val[cryptedlen] = '\0';
- ZVAL_STR(crypted, cryptedbuf);
+ ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -4451,7 +4451,7 @@ PHP_FUNCTION(openssl_private_decrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf->val[cryptedlen] = '\0';
- ZVAL_STR(crypted, cryptedbuf);
+ ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -4509,7 +4509,7 @@ PHP_FUNCTION(openssl_public_encrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf->val[cryptedlen] = '\0';
- ZVAL_STR(crypted, cryptedbuf);
+ ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -4576,7 +4576,7 @@ PHP_FUNCTION(openssl_public_decrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf->val[cryptedlen] = '\0';
- ZVAL_STR(crypted, cryptedbuf);
+ ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -4660,7 +4660,7 @@ PHP_FUNCTION(openssl_sign)
zval_dtor(signature);
sigbuf->val[siglen] = '\0';
sigbuf->len = siglen;
- ZVAL_STR(signature, sigbuf);
+ ZVAL_NEW_STR(signature, sigbuf);
RETVAL_TRUE;
} else {
efree(sigbuf);
@@ -4812,7 +4812,7 @@ PHP_FUNCTION(openssl_seal)
if (len1 + len2 > 0) {
zval_dtor(sealdata);
buf[len1 + len2] = '\0';
- ZVAL_STR(sealdata, zend_string_init((char*)buf, len1 + len2, 0));
+ ZVAL_NEW_STR(sealdata, zend_string_init((char*)buf, len1 + len2, 0));
efree(buf);
zval_dtor(ekeys);
@@ -4903,7 +4903,7 @@ PHP_FUNCTION(openssl_open)
} else {
zval_dtor(opendata);
buf[len1 + len2] = '\0';
- ZVAL_STR(opendata, zend_string_init((char*)buf, len1 + len2, 0));
+ ZVAL_NEW_STR(opendata, zend_string_init((char*)buf, len1 + len2, 0));
efree(buf);
RETVAL_TRUE;
}
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 968919eb64..08a9656b71 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 7954fb753a..28afe1d4dd 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1820,7 +1820,7 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
to hang forever. To avoid this scenario we poll with a timeout before performing
the actual read. If it times out we're finished.
*/
- if (sock->is_blocked) {
+ if (sock->is_blocked && SSL_pending(sslsock->ssl_handle) == 0) {
php_openssl_stream_wait_for_data(sock);
if (sock->timeout_event) {
stream->eof = 1;
@@ -2146,17 +2146,19 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS
case PHP_STREAM_AS_FD_FOR_SELECT:
if (ret) {
- if (sslsock->ssl_active) {
- /* OpenSSL has an internal buffer which select() cannot see. If we don't
- fetch it into the stream's buffer, no activity will be reported on the
- stream even though there is data waiting to be read - but we only fetch
- the number of bytes OpenSSL has ready to give us since we weren't asked
- for any data at this stage. This is only likely to cause issues with
- non-blocking streams, but it's harmless to always do it. */
- int bytes;
- while ((bytes = SSL_pending(sslsock->ssl_handle)) > 0) {
- php_stream_fill_read_buffer(stream, (size_t)bytes);
- }
+ /* OpenSSL has an internal buffer which select() cannot see. If we don't
+ * fetch it into the stream's buffer, no activity will be reported on the
+ * stream even though there is data waiting to be read - but we only fetch
+ * the lower of bytes OpenSSL has ready to give us or chunk_size since we
+ * weren't asked for any data at this stage. This is only likely to cause
+ * issues with non-blocking streams, but it's harmless to always do it. */
+ size_t pending;
+ if (stream->writepos == stream->readpos
+ && sslsock->ssl_active
+ && (pending = (size_t)SSL_pending(sslsock->ssl_handle)) > 0) {
+ php_stream_fill_read_buffer(stream, pending < stream->chunk_size
+ ? pending
+ : stream->chunk_size);
}
*(php_socket_t *)ret = sslsock->s.socket;
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 5595f31b58..11ad1018ec 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h
index 05c7f45566..d02d6867f4 100644
--- a/ext/pcntl/php_pcntl.h
+++ b/ext/pcntl/php_pcntl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c
index 9f308d793c..aa2139342c 100644
--- a/ext/pcntl/php_signal.c
+++ b/ext/pcntl/php_signal.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h
index 5c61b10396..fc69fac756 100644
--- a/ext/pcntl/php_signal.h
+++ b/ext/pcntl/php_signal.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 89c5f1155b..3b49bf9ef5 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -782,7 +782,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
}
/* Add MARK, if available */
if (mark) {
- add_assoc_string(&result_set, "MARK", (char *) mark);
+ add_assoc_string_ex(&result_set, "MARK", sizeof("MARK") - 1, (char *)mark);
}
/* And add it to the output array */
zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &result_set);
@@ -822,7 +822,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
}
/* Add MARK, if available */
if (mark) {
- add_assoc_string(subpats, "MARK", (char *) mark);
+ add_assoc_string_ex(subpats, "MARK", sizeof("MARK") - 1, (char *)mark);
}
}
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index fb90395f75..cd6621372f 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 936428ad7b..61c68ff46d 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -179,7 +179,7 @@ static PHP_GINIT_FUNCTION(pdo)
PDO_API int php_pdo_register_driver(pdo_driver_t *driver) /* {{{ */
{
if (driver->api_version != PDO_DRIVER_API) {
- zend_error(E_ERROR, "PDO: driver %s requires PDO API version %ld; this is PDO version %d",
+ zend_error(E_ERROR, "PDO: driver %s requires PDO API version %pd; this is PDO version %d",
driver->driver_name, driver->api_version, PDO_DRIVER_API);
return FAILURE;
}
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 814013d319..2abd5a03ef 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -466,10 +466,8 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry
} else if (!Z_ISUNDEF(retval)) {
zval_ptr_dtor(&retval);
}
-
- if (fci.params) {
- efree(fci.params);
- }
+
+ zend_fcall_info_args_clear(&fci, 1);
}
}
/* }}} */
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 0db82c6068..9dd7305723 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -1,7 +1,7 @@
/* Generated by re2c 0.13.5 */
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -406,10 +406,10 @@ yy45:
struct placeholder {
char *pos;
+ char *quoted; /* quoted value */
int len;
int bindno;
int qlen; /* quoted length of value */
- char *quoted; /* quoted value */
int freeq;
struct placeholder *next;
};
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
index 94ad04b983..79e167ba1d 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c
index e3585844c6..94829a01a2 100644
--- a/ext/pdo/pdo_sqlstate.c
+++ b/ext/pdo/pdo_sqlstate.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index afbe068e3f..5781de78e6 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -2128,7 +2128,7 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
php_stream_printf(out TSRMLS_CC, "Key: Position #%pd:\n", num);
}
- php_stream_printf(out TSRMLS_CC, "paramno=%ld\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
+ php_stream_printf(out TSRMLS_CC, "paramno=%pd\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
param->paramno, param->name? param->name->len : 0, param->name? param->name->len : 0,
param->name ? param->name->val : "",
param->is_param,
@@ -2267,7 +2267,7 @@ static zend_object *dbstmt_clone_obj(zval *zobject TSRMLS_DC)
}
zend_object_handlers pdo_dbstmt_object_handlers;
-static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);
+static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
void pdo_stmt_init(TSRMLS_D)
{
@@ -2700,7 +2700,7 @@ zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC)
return &row->std;
}
-static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC)
+static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC)
{
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDORow instances may not be serialized");
return FAILURE;
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
index 0dca85779a..ce5b3a229d 100644
--- a/ext/pdo/php_pdo.h
+++ b/ext/pdo/php_pdo.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index 279619ee0d..de9780e226 100644
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -528,10 +528,10 @@ static inline pdo_dbh_object_t *php_pdo_dbh_fetch_object(zend_object *obj) {
/* describes a column */
struct pdo_column_data {
char *name;
- int namelen;
zend_ulong maxlen;
- enum pdo_param_type param_type;
zend_ulong precision;
+ enum pdo_param_type param_type;
+ int namelen;
/* don't touch this unless your name is dbdo */
void *dbdo_data;
@@ -539,18 +539,21 @@ struct pdo_column_data {
/* describes a bound parameter */
struct pdo_bound_param_data {
+ zval parameter; /* the variable itself */
+
+ zval driver_params; /* optional parameter(s) for the driver */
+
zend_long paramno; /* if -1, then it has a name, and we don't know the index *yet* */
zend_string *name;
zend_long max_value_len; /* as a hint for pre-allocation */
-
- zval parameter; /* the variable itself */
- enum pdo_param_type param_type; /* desired or suggested type */
- zval driver_params; /* optional parameter(s) for the driver */
void *driver_data;
pdo_stmt_t *stmt; /* for convenience in dtor */
+
+ enum pdo_param_type param_type; /* desired or suggested variable type */
+
int is_param; /* parameter or column ? */
};
diff --git a/ext/pdo/php_pdo_error.h b/ext/pdo/php_pdo_error.h
index 60bb89a8f8..e89a2b8811 100644
--- a/ext/pdo/php_pdo_error.h
+++ b/ext/pdo/php_pdo_error.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index 27cca7c29f..23de705ec1 100644
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index ddf182b190..40d4114879 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index 6bd2a5976e..a29405b24e 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c
index 2801ece8f1..3afd885df5 100644
--- a/ext/pdo_dblib/pdo_dblib.c
+++ b/ext/pdo_dblib/pdo_dblib.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_dblib/php_pdo_dblib.h b/ext/pdo_dblib/php_pdo_dblib.h
index f7de387b96..5198976d25 100644
--- a/ext/pdo_dblib/php_pdo_dblib.h
+++ b/ext/pdo_dblib/php_pdo_dblib.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h
index df15b229e0..e247b5c19e 100644
--- a/ext/pdo_dblib/php_pdo_dblib_int.h
+++ b/ext/pdo_dblib/php_pdo_dblib_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index ab4612a119..298d2539e3 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index 622cbc39a3..d46a67d504 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c
index 4eea0b69de..4e2c816460 100644
--- a/ext/pdo_firebird/pdo_firebird.c
+++ b/ext/pdo_firebird/pdo_firebird.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_firebird/php_pdo_firebird.h b/ext/pdo_firebird/php_pdo_firebird.h
index f7e9f17f12..3f1fc9a76c 100644
--- a/ext/pdo_firebird/php_pdo_firebird.h
+++ b/ext/pdo_firebird/php_pdo_firebird.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h
index 1fc610ce78..18670fee18 100644
--- a/ext/pdo_firebird/php_pdo_firebird_int.h
+++ b/ext/pdo_firebird/php_pdo_firebird_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 0cf5b55bdd..7e4945a7b8 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 5eddc832a1..20d3ede0f6 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index 3a06741a05..d9c04470a4 100644
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h
index e4d37c88ab..b5f6afd9eb 100644
--- a/ext/pdo_mysql/php_pdo_mysql.h
+++ b/ext/pdo_mysql/php_pdo_mysql.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index 31ccb5d02a..f6cdb0a8f2 100644
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt
index 22d36183cb..fb7e9a9d0a 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt
@@ -30,4 +30,4 @@ MySQLPDOTest::skip();
}
?>
--EXPECTF--
-done! \ No newline at end of file
+done!
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index a8e7913fa7..9132999461 100644
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c
index 4e341c08be..7c86a23dcc 100644
--- a/ext/pdo_oci/oci_statement.c
+++ b/ext/pdo_oci/oci_statement.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_oci/pdo_oci.c b/ext/pdo_oci/pdo_oci.c
index 8eabb7e7c5..896f392664 100644
--- a/ext/pdo_oci/pdo_oci.c
+++ b/ext/pdo_oci/pdo_oci.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_oci/php_pdo_oci.h b/ext/pdo_oci/php_pdo_oci.h
index 3299dfe269..3448638fc1 100644
--- a/ext/pdo_oci/php_pdo_oci.h
+++ b/ext/pdo_oci/php_pdo_oci.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h
index 4979aadb13..36d45d0af7 100644
--- a/ext/pdo_oci/php_pdo_oci_int.h
+++ b/ext/pdo_oci/php_pdo_oci_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index e99463de58..c0034d43ea 100644
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 274ce9b0d6..7491ec685d 100644
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c
index 1fe17c1c30..914b8bc980 100644
--- a/ext/pdo_odbc/pdo_odbc.c
+++ b/ext/pdo_odbc/pdo_odbc.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_odbc/php_pdo_odbc.h b/ext/pdo_odbc/php_pdo_odbc.h
index cd01ae45e5..52e8e6f8e7 100644
--- a/ext/pdo_odbc/php_pdo_odbc.h
+++ b/ext/pdo_odbc/php_pdo_odbc.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h
index 90d9d5d505..0d6d488b65 100644
--- a/ext/pdo_odbc/php_pdo_odbc_int.h
+++ b/ext/pdo_odbc/php_pdo_odbc_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c
index 5fbad7d4a0..5ca4b07a23 100644
--- a/ext/pdo_pgsql/pdo_pgsql.c
+++ b/ext/pdo_pgsql/pdo_pgsql.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index dfc6f4025a..327d70218b 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 7a315c7f08..05b8f79b27 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_pgsql/php_pdo_pgsql.h b/ext/pdo_pgsql/php_pdo_pgsql.h
index 9c01d9886c..31d89096ad 100644
--- a/ext/pdo_pgsql/php_pdo_pgsql.h
+++ b/ext/pdo_pgsql/php_pdo_pgsql.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h
index d6f7ad48aa..722d63706e 100644
--- a/ext/pdo_pgsql/php_pdo_pgsql_int.h
+++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_pgsql/tests/getnotify.phpt b/ext/pdo_pgsql/tests/getnotify.phpt
index c093e0357a..c54a31604d 100644
--- a/ext/pdo_pgsql/tests/getnotify.phpt
+++ b/ext/pdo_pgsql/tests/getnotify.phpt
@@ -70,14 +70,16 @@ var_dump($db->pgsqlGetNotify());
// Test second parameter, should wait 2 seconds because no notify is queued
$t = microtime(1);
$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 1000);
-var_dump((microtime(1) - $t) >= 1);
+$diff = microtime(1) - $t;
+var_dump($diff >= 1 || 1 - abs($diff) < .01);
var_dump($notify);
// Test second parameter, should return immediately because a notify is queued
$db->exec("NOTIFY notifies_phpt");
$t = microtime(1);
$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 5000);
-var_dump((microtime(1) - $t) < 1);
+$diff = microtime(1) - $t;
+var_dump($diff < 1 || abs(1 - abs($diff)) < .01);
var_dump(count($notify));
?>
diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c
index 33cffee821..0014de4e3b 100644
--- a/ext/pdo_sqlite/pdo_sqlite.c
+++ b/ext/pdo_sqlite/pdo_sqlite.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h
index 607b3ddedb..9413e1bb70 100644
--- a/ext/pdo_sqlite/php_pdo_sqlite.h
+++ b/ext/pdo_sqlite/php_pdo_sqlite.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h
index 188856a3d1..133893bf8f 100644
--- a/ext/pdo_sqlite/php_pdo_sqlite_int.h
+++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index c76841bae2..413b50b9d4 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c
index 2cf271c0d3..378d8bb337 100644
--- a/ext/pdo_sqlite/sqlite_statement.c
+++ b/ext/pdo_sqlite/sqlite_statement.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index e3f64e0ed0..8ea4d3c06f 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -5484,26 +5484,26 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
char *name;
array_init(&elem);
/* pg_attribute.attnum */
- add_assoc_long(&elem, "num", atoi(PQgetvalue(pg_result,i,1)));
+ add_assoc_long_ex(&elem, "num", sizeof("num") - 1, atoi(PQgetvalue(pg_result, i, 1)));
/* pg_type.typname */
- add_assoc_string(&elem, "type", PQgetvalue(pg_result,i,2));
+ add_assoc_string_ex(&elem, "type", sizeof("type") - 1, PQgetvalue(pg_result, i, 2));
/* pg_attribute.attlen */
- add_assoc_long(&elem, "len", atoi(PQgetvalue(pg_result,i,3)));
+ add_assoc_long_ex(&elem, "len", sizeof("len") - 1, atoi(PQgetvalue(pg_result,i,3)));
/* pg_attribute.attnonull */
- add_assoc_bool(&elem, "not null", !strcmp(PQgetvalue(pg_result,i,4), "t"));
+ add_assoc_bool_ex(&elem, "not null", sizeof("not null") - 1, !strcmp(PQgetvalue(pg_result, i, 4), "t"));
/* pg_attribute.atthasdef */
- add_assoc_bool(&elem, "has default", !strcmp(PQgetvalue(pg_result,i,5), "t"));
+ add_assoc_bool_ex(&elem, "has default", sizeof("has default") - 1, !strcmp(PQgetvalue(pg_result,i,5), "t"));
/* pg_attribute.attndims */
- add_assoc_long(&elem, "array dims", atoi(PQgetvalue(pg_result,i,6)));
+ add_assoc_long_ex(&elem, "array dims", sizeof("array dims") - 1, atoi(PQgetvalue(pg_result, i, 6)));
/* pg_type.typtype */
- add_assoc_bool(&elem, "is enum", !strcmp(PQgetvalue(pg_result,i,7), "e"));
+ add_assoc_bool_ex(&elem, "is enum", sizeof("is enum") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "e"));
if (extended) {
/* pg_type.typtype */
- add_assoc_bool(&elem, "is base", !strcmp(PQgetvalue(pg_result,i,7), "b"));
- add_assoc_bool(&elem, "is composite", !strcmp(PQgetvalue(pg_result,i,7), "c"));
- add_assoc_bool(&elem, "is pesudo", !strcmp(PQgetvalue(pg_result,i,7), "p"));
+ add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b"));
+ add_assoc_bool_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c"));
+ add_assoc_bool_ex(&elem, "is pesudo", sizeof("is pesudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "p"));
/* pg_description.description */
- add_assoc_string(&elem, "description", PQgetvalue(pg_result,i,8));
+ add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8));
}
/* pg_attribute.attname */
name = PQgetvalue(pg_result,i,0);
@@ -5701,7 +5701,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
if (should_free) {
zval_ptr_dtor(src);
}
- ZVAL_STR(src, str.s);
+ ZVAL_NEW_STR(src, str.s);
return SUCCESS;
}
@@ -5971,7 +5971,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
/* better to use PGSQLescapeLiteral since PGescapeStringConn does not handle special \ */
str->len = PQescapeStringConn(pg_link, str->val, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL);
str = zend_string_realloc(str, str->len, 0);
- ZVAL_STR(&new_val, str);
+ ZVAL_NEW_STR(&new_val, str);
php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
}
break;
@@ -6268,7 +6268,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
smart_str_appendl(&s, Z_STRVAL(new_val), Z_STRLEN(new_val));
smart_str_0(&s);
zval_ptr_dtor(&new_val);
- ZVAL_STR(&new_val, s.s);
+ ZVAL_NEW_STR(&new_val, s.s);
}
break;
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 9bfbf142f9..661c02f77f 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 2fd46b9621..8f17c771d1 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -50,28 +50,28 @@ ZEND_INI_MH(phar_ini_modify_handler) /* {{{ */
{
zend_bool old, ini;
- if (entry->name_length == sizeof("phar.readonly")-1) {
+ if (entry->name->len == sizeof("phar.readonly")-1) {
old = PHAR_G(readonly_orig);
} else {
old = PHAR_G(require_hash_orig);
}
- if (new_value_length == 2 && !strcasecmp("on", new_value)) {
+ if (new_value->len == 2 && !strcasecmp("on", new_value->val)) {
ini = (zend_bool) 1;
}
- else if (new_value_length == 3 && !strcasecmp("yes", new_value)) {
+ else if (new_value->len == 3 && !strcasecmp("yes", new_value->val)) {
ini = (zend_bool) 1;
}
- else if (new_value_length == 4 && !strcasecmp("true", new_value)) {
+ else if (new_value->len == 4 && !strcasecmp("true", new_value->val)) {
ini = (zend_bool) 1;
}
else {
- ini = (zend_bool) atoi(new_value);
+ ini = (zend_bool) atoi(new_value->val);
}
/* do not allow unsetting in runtime */
if (stage == ZEND_INI_STAGE_STARTUP) {
- if (entry->name_length == sizeof("phar.readonly")-1) {
+ if (entry->name->len == sizeof("phar.readonly")-1) {
PHAR_G(readonly_orig) = ini;
} else {
PHAR_G(require_hash_orig) = ini;
@@ -80,7 +80,7 @@ ZEND_INI_MH(phar_ini_modify_handler) /* {{{ */
return FAILURE;
}
- if (entry->name_length == sizeof("phar.readonly")-1) {
+ if (entry->name->len == sizeof("phar.readonly")-1) {
PHAR_G(readonly) = ini;
if (PHAR_GLOBALS->request_init && PHAR_GLOBALS->phar_fname_map.arHash) {
zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_fname_map), phar_set_writeable_bit, (void *)&ini TSRMLS_CC);
@@ -183,7 +183,7 @@ finish_error:
ZEND_INI_MH(phar_ini_cache_list) /* {{{ */
{
- PHAR_G(cache_list) = new_value;
+ PHAR_G(cache_list) = new_value->val;
if (stage == ZEND_INI_STAGE_STARTUP) {
phar_split_cache_list(TSRMLS_C);
@@ -1618,7 +1618,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
#ifndef MAX_WBITS
#define MAX_WBITS 15
#endif
- add_assoc_long(&filterparams, "window", MAX_WBITS + 32);
+ add_assoc_long_ex(&filterparams, "window", sizeof("window") - 1, MAX_WBITS + 32);
/* entire file is gzip-compressed, uncompress to temporary file */
if (!(temp = php_stream_fopen_tmpfile())) {
@@ -1630,7 +1630,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
if (!filter) {
err = 1;
- add_assoc_long(&filterparams, "window", MAX_WBITS);
+ add_assoc_long_ex(&filterparams, "window", sizeof("window") - 1, MAX_WBITS);
filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRMLS_CC);
zval_dtor(&filterparams);
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index ed3e60a0ea..f82b825631 100755
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -87,7 +87,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char
zend_string *str = strpprintf(4096, "phar://%s%s", fname, entry);
ZVAL_STR(&temp, Z_STR_P(stuff));
- ZVAL_STR(stuff, str);
+ ZVAL_NEW_STR(stuff, str);
zend_hash_str_update(_SERVER, "PHAR_PATH_TRANSLATED", sizeof("PHAR_PATH_TRANSLATED")-1, &temp);
}
@@ -134,7 +134,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char
zend_string *str = strpprintf(4096, "phar://%s%s", fname, entry);
ZVAL_STR(&temp, Z_STR_P(stuff));
- ZVAL_STR(stuff, str);
+ ZVAL_NEW_STR(stuff, str);
zend_hash_str_update(_SERVER, "PHAR_SCRIPT_FILENAME", sizeof("PHAR_SCRIPT_FILENAME")-1, &temp);
}
@@ -553,6 +553,7 @@ PHP_METHOD(Phar, webPhar)
int entry_len, code, not_cgi;
phar_archive_data *phar = NULL;
phar_entry_info *info = NULL;
+ size_t sapi_mod_name_len = strlen(sapi_module.name);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) {
return;
@@ -587,9 +588,9 @@ PHP_METHOD(Phar, webPhar)
++basename;
}
- if ((strlen(sapi_module.name) == sizeof("cgi-fcgi")-1 && !strncmp(sapi_module.name, "cgi-fcgi", sizeof("cgi-fcgi")-1))
- || (strlen(sapi_module.name) == sizeof("fpm-fcgi")-1 && !strncmp(sapi_module.name, "fpm-fcgi", sizeof("fpm-fcgi")-1))
- || (strlen(sapi_module.name) == sizeof("cgi")-1 && !strncmp(sapi_module.name, "cgi", sizeof("cgi")-1))) {
+ if ((sapi_mod_name_len == sizeof("cgi-fcgi") - 1 && !strncmp(sapi_module.name, "cgi-fcgi", sizeof("cgi-fcgi") - 1))
+ || (sapi_mod_name_len == sizeof("fpm-fcgi") - 1 && !strncmp(sapi_module.name, "fpm-fcgi", sizeof("fpm-fcgi") - 1))
+ || (sapi_mod_name_len == sizeof("cgi") - 1 && !strncmp(sapi_module.name, "cgi", sizeof("cgi") - 1))) {
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF) {
HashTable *_server = Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]);
@@ -1382,10 +1383,10 @@ struct _phar_t {
phar_archive_object *p;
zend_class_entry *c;
char *b;
- uint l;
zval *ret;
- int count;
php_stream *fp;
+ uint l;
+ int count;
};
static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
@@ -3550,7 +3551,7 @@ PHP_METHOD(Phar, offsetGet)
}
sfname = strpprintf(0, "phar://%s/%s", phar_obj->archive->fname, fname);
- ZVAL_STR(&zfname, sfname);
+ ZVAL_NEW_STR(&zfname, sfname);
spl_instantiate_arg_ex1(phar_obj->spl.info_class, return_value, &zfname TSRMLS_CC);
zval_ptr_dtor(&zfname);
}
diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index 985abd14a9..76862f7cdb 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -570,7 +570,7 @@ bail:
phar_destroy_phar_data(myphar TSRMLS_CC);
return FAILURE;
}
- } while (read != 0);
+ } while (!php_stream_eof(fp));
if (zend_hash_str_exists(&(myphar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
myphar->is_data = 0;
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index a314498813..4fe0bf05c8 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -241,7 +241,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
mydata->metadata_len = 0;
/* if not valid serialized data, it is a regular string */
- ZVAL_STR(&mydata->metadata, zend_string_init(metadata, PHAR_GET_16(locator.comment_len), mydata->is_persistent));
+ ZVAL_NEW_STR(&mydata->metadata, zend_string_init(metadata, PHAR_GET_16(locator.comment_len), mydata->is_persistent));
}
} else {
ZVAL_UNDEF(&mydata->metadata);
@@ -529,7 +529,7 @@ foundit:
entry.metadata_len = 0;
/* if not valid serialized data, it is a regular string */
- ZVAL_STR(&entry.metadata, zend_string_init(buf, PHAR_GET_16(zipentry.comment_len), entry.is_persistent));
+ ZVAL_NEW_STR(&entry.metadata, zend_string_init(buf, PHAR_GET_16(zipentry.comment_len), entry.is_persistent));
}
} else {
ZVAL_UNDEF(&entry.metadata);
diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h
index 8ace07c1c0..ebd449231d 100644
--- a/ext/posix/php_posix.h
+++ b/ext/posix/php_posix.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 091b42cfdd..ca7d34c645 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pspell/php_pspell.h b/ext/pspell/php_pspell.h
index 83103fae74..bd0956c2ba 100644
--- a/ext/pspell/php_pspell.h
+++ b/ext/pspell/php_pspell.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index bf01f28df6..72165ae78e 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h
index 5660bdb7f6..7a014164fc 100644
--- a/ext/readline/php_readline.h
+++ b/ext/readline/php_readline.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 5299f839dc..0e7b146174 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c
index b23703ea08..23841e4eea 100644
--- a/ext/readline/readline_cli.c
+++ b/ext/readline/readline_cli.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -79,7 +79,7 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_readline);
static char php_last_char = '\0';
static FILE *pager_pipe = NULL;
-static size_t readline_shell_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */
+static size_t readline_shell_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
{
if (CLIR_G(prompt_str)) {
smart_str_appendl(CLIR_G(prompt_str), str, str_length);
@@ -97,7 +97,7 @@ static size_t readline_shell_write(const char *str, uint str_length TSRMLS_DC) /
}
/* }}} */
-static int readline_shell_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */
+static size_t readline_shell_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
{
/* We just store the last char here and then pass back to the
caller (sapi_cli_single_write in sapi/cli) which will actually
@@ -409,7 +409,7 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC
static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData TSRMLS_DC) /* {{{ */
{
zend_string *name;
- ulong number;
+ zend_ulong number;
if (!(*state % 2)) {
zend_hash_internal_pointer_reset(ht);
@@ -633,7 +633,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
param++;
cmd = zend_string_init(&line[1], param - &line[1] - 1, 0);
- zend_alter_ini_entry_ex(cmd, param, strlen(param), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_chars_ex(cmd, param, strlen(param), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
zend_string_release(cmd);
add_history(line);
diff --git a/ext/readline/readline_cli.h b/ext/readline/readline_cli.h
index becd9d3342..0531c71e35 100644
--- a/ext/readline/readline_cli.h
+++ b/ext/readline/readline_cli.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/recode/php_recode.h b/ext/recode/php_recode.h
index 76ae292c56..265af7f148 100644
--- a/ext/recode/php_recode.h
+++ b/ext/recode/php_recode.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index 2e044301cb..a70a4fcb2c 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 8c4c487da3..c99f066834 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -209,10 +209,10 @@ typedef enum {
/* Struct for reflection objects */
typedef struct {
zval dummy; /* holder for the second property */
- void *ptr;
- reflection_type_t ref_type;
zval obj;
+ void *ptr;
zend_class_entry *ce;
+ reflection_type_t ref_type;
unsigned int ignore_visibility:1;
zend_object zo;
} reflection_object;
@@ -941,7 +941,7 @@ static void _property_string(string *str, zend_property_info *prop, char *prop_n
string_printf(str, "static ");
}
- zend_unmangle_property_name(prop->name->val, prop->name->len, &class_name, (const char**)&prop_name);
+ zend_unmangle_property_name(prop->name, &class_name, (const char**)&prop_name);
string_printf(str, "$%s", prop_name);
}
@@ -958,7 +958,7 @@ static int _extension_ini_string(zval *el TSRMLS_DC, int num_args, va_list args,
char *comma = "";
if (number == ini_entry->module_number) {
- string_printf(str, " %sEntry [ %s <", indent, ini_entry->name);
+ string_printf(str, " %sEntry [ %s <", indent, ini_entry->name->val);
if (ini_entry->modifiable == ZEND_INI_ALL) {
string_printf(str, "ALL");
} else {
@@ -976,9 +976,9 @@ static int _extension_ini_string(zval *el TSRMLS_DC, int num_args, va_list args,
}
string_printf(str, "> ]\n");
- string_printf(str, " %s Current = '%s'\n", indent, ini_entry->value ? ini_entry->value : "");
+ string_printf(str, " %s Current = '%s'\n", indent, ini_entry->value ? ini_entry->value->val : "");
if (ini_entry->modified) {
- string_printf(str, " %s Default = '%s'\n", indent, ini_entry->orig_value ? ini_entry->orig_value : "");
+ string_printf(str, " %s Default = '%s'\n", indent, ini_entry->orig_value ? ini_entry->orig_value->val : "");
}
string_printf(str, " %s}\n", indent);
}
@@ -1178,7 +1178,7 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSR
reflection_object *intern;
zval name;
- ZVAL_STR(&name, zend_string_copy(ce->name));
+ ZVAL_STR_COPY(&name, ce->name);
reflection_instantiate(reflection_class_ptr, object TSRMLS_CC);
intern = Z_REFLECTION_P(object);
intern->ptr = ce;
@@ -1251,7 +1251,7 @@ static void reflection_function_factory(zend_function *function, zval *closure_o
reflection_object *intern;
zval name;
- ZVAL_STR(&name, zend_string_copy(function->common.function_name));
+ ZVAL_STR_COPY(&name, function->common.function_name);
reflection_instantiate(reflection_function_ptr, object TSRMLS_CC);
intern = Z_REFLECTION_P(object);
@@ -1273,9 +1273,9 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
zval name;
zval classname;
- ZVAL_STR(&name, zend_string_copy((method->common.scope && method->common.scope->trait_aliases)?
- zend_resolve_method_name(ce, method) : method->common.function_name));
- ZVAL_STR(&classname, zend_string_copy(method->common.scope->name));
+ ZVAL_STR_COPY(&name, (method->common.scope && method->common.scope->trait_aliases)?
+ zend_resolve_method_name(ce, method) : method->common.function_name);
+ ZVAL_STR_COPY(&classname, method->common.scope->name);
reflection_instantiate(reflection_method_ptr, object TSRMLS_CC);
intern = Z_REFLECTION_P(object);
intern->ptr = method;
@@ -1298,15 +1298,16 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
zval classname;
property_reference *reference;
const char *class_name, *prop_name;
+ size_t prop_name_len;
- zend_unmangle_property_name(prop->name->val, prop->name->len, &class_name, &prop_name);
+ zend_unmangle_property_name_ex(prop->name, &class_name, &prop_name, &prop_name_len);
if (!(prop->flags & ZEND_ACC_PRIVATE)) {
/* we have to search the class hierarchy for this (implicit) public or protected property */
zend_class_entry *tmp_ce = ce, *store_ce = ce;
zend_property_info *tmp_info = NULL;
- while (tmp_ce && (tmp_info = zend_hash_str_find_ptr(&tmp_ce->properties_info, prop_name, strlen(prop_name))) == NULL) {
+ while (tmp_ce && (tmp_info = zend_hash_str_find_ptr(&tmp_ce->properties_info, prop_name, prop_name_len)) == NULL) {
ce = tmp_ce;
tmp_ce = tmp_ce->parent;
}
@@ -1318,8 +1319,8 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
}
}
- ZVAL_STRING(&name, prop_name);
- ZVAL_STR(&classname, zend_string_copy(prop->ce->name));
+ ZVAL_STRINGL(&name, prop_name, prop_name_len);
+ ZVAL_STR_COPY(&classname, prop->ce->name);
reflection_instantiate(reflection_property_ptr, object TSRMLS_CC);
intern = Z_REFLECTION_P(object);
@@ -1622,7 +1623,7 @@ ZEND_METHOD(reflection_function, __construct)
return;
}
- ZVAL_STR(&name, zend_string_copy(fptr->common.function_name));
+ ZVAL_STR_COPY(&name, fptr->common.function_name);
reflection_update_property(object, "name", &name);
intern->ptr = fptr;
intern->ref_type = REF_TYPE_FUNCTION;
@@ -2739,9 +2740,9 @@ ZEND_METHOD(reflection_method, __construct)
}
efree(lcname);
- ZVAL_STR(&name, zend_string_copy(mptr->common.scope->name));
+ ZVAL_STR_COPY(&name, mptr->common.scope->name);
reflection_update_property(object, "class", &name);
- ZVAL_STR(&name, zend_string_copy(mptr->common.function_name));
+ ZVAL_STR_COPY(&name, mptr->common.function_name);
reflection_update_property(object, "name", &name);
intern->ptr = mptr;
intern->ref_type = REF_TYPE_FUNCTION;
@@ -3304,7 +3305,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
}
if (Z_TYPE_P(argument) == IS_OBJECT) {
- ZVAL_STR(&classname, zend_string_copy(Z_OBJCE_P(argument)->name));
+ ZVAL_STR_COPY(&classname, Z_OBJCE_P(argument)->name);
reflection_update_property(object, "name", &classname);
intern->ptr = Z_OBJCE_P(argument);
if (is_object) {
@@ -3320,7 +3321,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
return;
}
- ZVAL_STR(&classname, zend_string_copy(ce->name));
+ ZVAL_STR_COPY(&classname, ce->name);
reflection_update_property(object, "name", &classname);
intern->ptr = ce;
@@ -3794,7 +3795,7 @@ ZEND_METHOD(reflection_class, hasProperty)
RETURN_TRUE;
} else {
if (Z_TYPE(intern->obj) != IS_UNDEF && Z_OBJ_HANDLER(intern->obj, has_property)) {
- ZVAL_STR(&property, zend_string_copy(name));
+ ZVAL_STR_COPY(&property, name);
if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL TSRMLS_CC)) {
zval_ptr_dtor(&property);
RETURN_TRUE;
@@ -3905,7 +3906,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend
{
zval property;
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
- zval *retval = va_arg(args, zval*), member;
+ zval *retval = va_arg(args, zval*);
/* under some circumstances, the properties hash table may contain numeric
* properties (e.g. when casting from array). This is a WONT FIX bug, at
@@ -3918,8 +3919,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend
return 0; /* non public cannot be dynamic */
}
- ZVAL_STR(&member, hash_key->key);
- if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) {
+ if (zend_get_property_info(ce, hash_key->key, 1 TSRMLS_CC) == &EG(std_property_info)) {
EG(std_property_info).flags = ZEND_ACC_IMPLICIT_PUBLIC;
reflection_property_factory(ce, &EG(std_property_info), &property TSRMLS_CC);
add_next_index_zval(retval, &property);
@@ -4733,7 +4733,6 @@ ZEND_METHOD(reflection_property, __construct)
{
zval propname, cname, *classname;
char *name_str;
- const char *class_name, *prop_name;
size_t name_len;
int dynam_prop = 0;
zval *object;
@@ -4797,11 +4796,13 @@ ZEND_METHOD(reflection_property, __construct)
}
if (dynam_prop == 0) {
- zend_unmangle_property_name(property_info->name->val, property_info->name->len, &class_name, &prop_name);
- ZVAL_STR(&cname, zend_string_copy(property_info->ce->name));
- ZVAL_STRING(&propname, prop_name);
+ const char *class_name, *prop_name;
+ size_t prop_name_len;
+ zend_unmangle_property_name_ex(property_info->name, &class_name, &prop_name, &prop_name_len);
+ ZVAL_STR_COPY(&cname, property_info->ce->name);
+ ZVAL_STRINGL(&propname, prop_name, prop_name_len);
} else {
- ZVAL_STR(&cname, zend_string_copy(ce->name));
+ ZVAL_STR_COPY(&cname, ce->name);
ZVAL_STRINGL(&propname, name_str, name_len);
}
reflection_update_property(object, "class", &cname);
@@ -4950,12 +4951,14 @@ ZEND_METHOD(reflection_property, getValue)
ZVAL_DUP(return_value, &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]);
} else {
const char *class_name, *prop_name;
+ size_t prop_name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
return;
}
- zend_unmangle_property_name(ref->prop.name->val, ref->prop.name->len, &class_name, &prop_name);
- member_p = zend_read_property(ref->ce, object, prop_name, strlen(prop_name), 1 TSRMLS_CC);
+
+ zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len);
+ member_p = zend_read_property(ref->ce, object, prop_name, prop_name_len, 1 TSRMLS_CC);
ZVAL_DUP(return_value, member_p);
}
}
@@ -5024,12 +5027,14 @@ ZEND_METHOD(reflection_property, setValue)
}
} else {
const char *class_name, *prop_name;
+ size_t prop_name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) {
return;
}
- zend_unmangle_property_name(ref->prop.name->val, ref->prop.name->len, &class_name, &prop_name);
- zend_update_property(ref->ce, object, prop_name, strlen(prop_name), value TSRMLS_CC);
+
+ zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len);
+ zend_update_property(ref->ce, object, prop_name, prop_name_len, value TSRMLS_CC);
}
}
/* }}} */
@@ -5043,18 +5048,17 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
zend_class_entry *tmp_ce, *ce;
zend_property_info *tmp_info;
const char *prop_name, *class_name;
- int prop_name_len;
+ size_t prop_name_len;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ref);
- if (zend_unmangle_property_name(ref->prop.name->val, ref->prop.name->len, &class_name, &prop_name) != SUCCESS) {
+ if (zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len) != SUCCESS) {
RETURN_FALSE;
}
- prop_name_len = strlen(prop_name);
ce = tmp_ce = ref->ce;
while (tmp_ce && (tmp_info = zend_hash_str_find_ptr(&tmp_ce->properties_info, prop_name, prop_name_len)) != NULL) {
if (tmp_info->flags & ZEND_ACC_PRIVATE || tmp_info->flags & ZEND_ACC_SHADOW) {
@@ -5278,9 +5282,12 @@ static int _addinientry(zval *el TSRMLS_DC, int num_args, va_list args, zend_has
if (number == ini_entry->module_number) {
if (ini_entry->value) {
- add_assoc_stringl(retval, ini_entry->name, ini_entry->value, ini_entry->value_length);
+ zval zv;
+
+ ZVAL_STR_COPY(&zv, ini_entry->value);
+ zend_symtable_update(Z_ARRVAL_P(retval), ini_entry->name, &zv);
} else {
- add_assoc_null(retval, ini_entry->name);
+ zend_symtable_update(Z_ARRVAL_P(retval), ini_entry->name, &EG(uninitialized_zval));
}
}
return ZEND_HASH_APPLY_KEEP;
diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h
index 2c03bd6e7e..1c436d7dcc 100644
--- a/ext/reflection/php_reflection.h
+++ b/ext/reflection/php_reflection.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index bc87ef9e1e..cb61c8a221 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -57,13 +57,13 @@
#endif
typedef struct {
- int fd;
char *lastkey;
char *basedir;
size_t basedir_len;
size_t dirdepth;
size_t st_size;
int filemode;
+ int fd;
} ps_files;
ps_module ps_mod_files = {
diff --git a/ext/session/mod_files.h b/ext/session/mod_files.h
index d1d26cd39b..a56dce1d36 100644
--- a/ext/session/mod_files.h
+++ b/ext/session/mod_files.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c
index 319f1d3c79..bf48436a7e 100644
--- a/ext/session/mod_mm.c
+++ b/ext/session/mod_mm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/session/mod_mm.h b/ext/session/mod_mm.h
index cafbfa0932..e0f2c1239f 100644
--- a/ext/session/mod_mm.h
+++ b/ext/session/mod_mm.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index 5d69712543..5d474deab5 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -44,7 +44,7 @@ ps_module ps_mod_user = {
#define SESS_ZVAL_STR(vl, a) \
{ \
- ZVAL_STR(a, zend_string_copy(vl)); \
+ ZVAL_STR_COPY(a, vl); \
}
static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRMLS_DC)
diff --git a/ext/session/mod_user.h b/ext/session/mod_user.h
index b1f3688a25..72a119cbab 100644
--- a/ext/session/mod_user.h
+++ b/ext/session/mod_user.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index 33fc71c569..7e2960cc32 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -144,6 +144,8 @@ PHP_METHOD(SessionHandler, create_sid)
{
zend_string *id;
+ PS_SANITY_CHECK;
+
if (zend_parse_parameters_none() == FAILURE) {
return;
}
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 790e116528..9fb6477056 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/session/session.c b/ext/session/session.c
index 9b31bddf3a..18c02822e3 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -581,7 +581,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
ps_module *tmp;
SESSION_CHECK_ACTIVE_STATE;
- tmp = _php_find_ps_module(new_value TSRMLS_CC);
+ tmp = _php_find_ps_module(new_value->val TSRMLS_CC);
if (PG(modules_activated) && !tmp) {
int err_type;
@@ -594,7 +594,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find save handler '%s'", new_value);
+ php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find save handler '%s'", new_value->val);
}
return FAILURE;
}
@@ -611,7 +611,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
const ps_serializer *tmp;
SESSION_CHECK_ACTIVE_STATE;
- tmp = _php_find_ps_serializer(new_value TSRMLS_CC);
+ tmp = _php_find_ps_serializer(new_value->val TSRMLS_CC);
if (PG(modules_activated) && !tmp) {
int err_type;
@@ -624,7 +624,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find serialization handler '%s'", new_value);
+ php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find serialization handler '%s'", new_value->val);
}
return FAILURE;
}
@@ -638,10 +638,10 @@ static PHP_INI_MH(OnUpdateTransSid) /* {{{ */
{
SESSION_CHECK_ACTIVE_STATE;
- if (!strncasecmp(new_value, "on", sizeof("on"))) {
+ if (!strncasecmp(new_value->val, "on", sizeof("on"))) {
PS(use_trans_sid) = (zend_bool) 1;
} else {
- PS(use_trans_sid) = (zend_bool) atoi(new_value);
+ PS(use_trans_sid) = (zend_bool) atoi(new_value->val);
}
return SUCCESS;
@@ -654,19 +654,19 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
char *p;
- if (memchr(new_value, '\0', new_value_length) != NULL) {
+ if (memchr(new_value->val, '\0', new_value->len) != NULL) {
return FAILURE;
}
/* we do not use zend_memrchr() since path can contain ; itself */
- if ((p = strchr(new_value, ';'))) {
+ if ((p = strchr(new_value->val, ';'))) {
char *p2;
p++;
if ((p2 = strchr(p, ';'))) {
p = p2 + 1;
}
} else {
- p = new_value;
+ p = new_value->val;
}
if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
@@ -674,7 +674,7 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
}
}
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
/* }}} */
@@ -682,7 +682,7 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
static PHP_INI_MH(OnUpdateName) /* {{{ */
{
/* Numeric session.name won't work at all */
- if ((!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) {
+ if ((!new_value->len || is_numeric_string(new_value->val, new_value->len, NULL, NULL, 0))) {
int err_type;
if (stage == ZEND_INI_STAGE_RUNTIME || stage == ZEND_INI_STAGE_ACTIVATE || stage == ZEND_INI_STAGE_STARTUP) {
@@ -693,12 +693,12 @@ static PHP_INI_MH(OnUpdateName) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "session.name cannot be a numeric or empty '%s'", new_value);
+ php_error_docref(NULL TSRMLS_CC, err_type, "session.name cannot be a numeric or empty '%s'", new_value->val);
}
return FAILURE;
}
- OnUpdateStringUnempty(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateStringUnempty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
/* }}} */
@@ -712,7 +712,7 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
PS(hash_ops) = NULL;
#endif
- val = ZEND_STRTOL(new_value, &endptr, 10);
+ val = ZEND_STRTOL(new_value->val, &endptr, 10);
if (endptr && (*endptr == '\0')) {
/* Numeric value */
PS(hash_func) = val ? 1 : 0;
@@ -720,15 +720,15 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
return SUCCESS;
}
- if (new_value_length == (sizeof("md5") - 1) &&
- strncasecmp(new_value, "md5", sizeof("md5") - 1) == 0) {
+ if (new_value->len == (sizeof("md5") - 1) &&
+ strncasecmp(new_value->val, "md5", sizeof("md5") - 1) == 0) {
PS(hash_func) = PS_HASH_FUNC_MD5;
return SUCCESS;
}
- if (new_value_length == (sizeof("sha1") - 1) &&
- strncasecmp(new_value, "sha1", sizeof("sha1") - 1) == 0) {
+ if (new_value->len == (sizeof("sha1") - 1) &&
+ strncasecmp(new_value->val, "sha1", sizeof("sha1") - 1) == 0) {
PS(hash_func) = PS_HASH_FUNC_SHA1;
return SUCCESS;
@@ -736,7 +736,7 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH) /* {{{ */
{
- php_hash_ops *ops = (php_hash_ops*)php_hash_fetch_ops(new_value, new_value_length);
+ php_hash_ops *ops = (php_hash_ops*)php_hash_fetch_ops(new_value->val, new_value->len);
if (ops) {
PS(hash_func) = PS_HASH_FUNC_OTHER;
@@ -747,7 +747,7 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
}
#endif /* HAVE_HASH_EXT }}} */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.configuration 'session.hash_function' must be existing hash function. %s does not exist.", new_value);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.configuration 'session.hash_function' must be existing hash function. %s does not exist.", new_value->val);
return FAILURE;
}
/* }}} */
@@ -755,12 +755,12 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
{
int tmp;
- tmp = zend_atoi(new_value, new_value_length);
+ tmp = zend_atoi(new_value->val, new_value->len);
if(tmp < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.upload_progress.freq must be greater than or equal to zero");
return FAILURE;
}
- if(new_value_length > 0 && new_value[new_value_length-1] == '%') {
+ if(new_value->len > 0 && new_value->val[new_value->len-1] == '%') {
if(tmp > 100) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.upload_progress.freq cannot be over 100%%");
return FAILURE;
@@ -1268,7 +1268,8 @@ static void php_session_remove_cookie(TSRMLS_D) {
zend_llist_element *current;
char *session_cookie;
zend_string *e_session_name;
- int session_cookie_len, len = sizeof("Set-Cookie")-1;
+ int session_cookie_len;
+ uint len = sizeof("Set-Cookie")-1;
e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)));
spprintf(&session_cookie, 0, "Set-Cookie: %s=", e_session_name->val);
@@ -1643,42 +1644,41 @@ PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t
static PHP_FUNCTION(session_set_cookie_params)
{
zval *lifetime;
- char *path = NULL, *domain = NULL;
- size_t path_len, domain_len;
+ zend_string *path = NULL, *domain = NULL;
int argc = ZEND_NUM_ARGS();
zend_bool secure = 0, httponly = 0;
zend_string *ini_name;
if (!PS(use_cookies) ||
- zend_parse_parameters(argc TSRMLS_CC, "z|ssbb", &lifetime, &path, &path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
+ zend_parse_parameters(argc TSRMLS_CC, "z|SSbb", &lifetime, &path, &domain, &secure, &httponly) == FAILURE) {
return;
}
convert_to_string_ex(lifetime);
ini_name = zend_string_init("session.cookie_lifetime", sizeof("session.cookie_lifetime") - 1, 0);
- zend_alter_ini_entry(ini_name, Z_STRVAL_P(lifetime), Z_STRLEN_P(lifetime), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, Z_STR_P(lifetime), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
if (path) {
ini_name = zend_string_init("session.cookie_path", sizeof("session.cookie_path") - 1, 0);
- zend_alter_ini_entry(ini_name, path, path_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, path, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
if (domain) {
ini_name = zend_string_init("session.cookie_domain", sizeof("session.cookie_domain") - 1, 0);
- zend_alter_ini_entry(ini_name, domain, domain_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, domain, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
if (argc > 3) {
ini_name = zend_string_init("session.cookie_secure", sizeof("session.cookie_secure") - 1, 0);
- zend_alter_ini_entry(ini_name, secure ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry_chars(ini_name, secure ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
if (argc > 4) {
ini_name = zend_string_init("session.cookie_httponly", sizeof("session.cookie_httponly") - 1, 0);
- zend_alter_ini_entry(ini_name, httponly ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry_chars(ini_name, httponly ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
}
@@ -1706,11 +1706,10 @@ static PHP_FUNCTION(session_get_cookie_params)
Return the current session name. If newname is given, the session name is replaced with newname */
static PHP_FUNCTION(session_name)
{
- char *name = NULL;
- size_t name_len;
+ zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
return;
}
@@ -1718,7 +1717,7 @@ static PHP_FUNCTION(session_name)
if (name) {
ini_name = zend_string_init("session.name", sizeof("session.name") - 1, 0);
- zend_alter_ini_entry(ini_name, name, name_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
}
@@ -1728,11 +1727,10 @@ static PHP_FUNCTION(session_name)
Return the current module name used for accessing session data. If newname is given, the module name is replaced with newname */
static PHP_FUNCTION(session_module_name)
{
- char *name = NULL;
- size_t name_len;
+ zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
return;
}
@@ -1744,8 +1742,8 @@ static PHP_FUNCTION(session_module_name)
}
if (name) {
- if (!_php_find_ps_module(name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find named PHP session module (%s)", name);
+ if (!_php_find_ps_module(name->val TSRMLS_CC)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find named PHP session module (%s)", name->val);
zval_dtor(return_value);
RETURN_FALSE;
@@ -1756,7 +1754,7 @@ static PHP_FUNCTION(session_module_name)
PS(mod_data) = NULL;
ini_name = zend_string_init("session.save_handler", sizeof("session.save_handler") - 1, 0);
- zend_alter_ini_entry(ini_name, name, name_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
}
@@ -1769,7 +1767,7 @@ static PHP_FUNCTION(session_set_save_handler)
zval *args = NULL;
int i, num_args, argc = ZEND_NUM_ARGS();
zend_string *name;
- zend_string *ini_name;
+ zend_string *ini_name, *ini_val;
if (PS(session_status) != php_session_none) {
RETURN_FALSE;
@@ -1843,7 +1841,9 @@ static PHP_FUNCTION(session_set_save_handler)
if (PS(mod) && PS(session_status) == php_session_none && PS(mod) != &ps_mod_user) {
ini_name = zend_string_init("session.save_handler", sizeof("session.save_handler") - 1, 0);
- zend_alter_ini_entry(ini_name, "user", sizeof("user") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ ini_val = zend_string_init("user", sizeof("user") - 1, 0);
+ zend_alter_ini_entry(ini_name, ini_val, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_string_release(ini_val);
zend_string_release(ini_name);
}
@@ -1873,7 +1873,9 @@ static PHP_FUNCTION(session_set_save_handler)
if (PS(mod) && PS(mod) != &ps_mod_user) {
ini_name = zend_string_init("session.save_handler", sizeof("session.save_handler") - 1, 0);
- zend_alter_ini_entry(ini_name, "user", sizeof("user")-1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ ini_val = zend_string_init("user", sizeof("user") - 1, 0);
+ zend_alter_ini_entry(ini_name, ini_val, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_string_release(ini_val);
zend_string_release(ini_name);
}
@@ -1892,24 +1894,23 @@ static PHP_FUNCTION(session_set_save_handler)
Return the current save path passed to module_name. If newname is given, the save path is replaced with newname */
static PHP_FUNCTION(session_save_path)
{
- char *name = NULL;
- size_t name_len;
+ zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
return;
}
RETVAL_STRING(PS(save_path));
if (name) {
- if (memchr(name, '\0', name_len) != NULL) {
+ if (memchr(name->val, '\0', name->len) != NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The save_path cannot contain NULL characters");
zval_dtor(return_value);
RETURN_FALSE;
}
ini_name = zend_string_init("session.save_path", sizeof("session.save_path") - 1, 0);
- zend_alter_ini_entry(ini_name, name, name_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
}
@@ -1990,11 +1991,10 @@ static PHP_FUNCTION(session_regenerate_id)
Return the current cache limiter. If new_cache_limited is given, the current cache_limiter is replaced with new_cache_limiter */
static PHP_FUNCTION(session_cache_limiter)
{
- char *limiter = NULL;
- size_t limiter_len;
+ zend_string *limiter = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &limiter, &limiter_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &limiter) == FAILURE) {
return;
}
@@ -2002,7 +2002,7 @@ static PHP_FUNCTION(session_cache_limiter)
if (limiter) {
ini_name = zend_string_init("session.cache_limiter", sizeof("session.cache_limiter") - 1, 0);
- zend_alter_ini_entry(ini_name, limiter, limiter_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, limiter, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
}
@@ -2024,7 +2024,7 @@ static PHP_FUNCTION(session_cache_expire)
if (expires) {
convert_to_string_ex(expires);
ini_name = zend_string_init("session.cache_expire", sizeof("session.cache_expire") - 1, 0);
- zend_alter_ini_entry(ini_name, Z_STRVAL_P(expires), Z_STRLEN_P(expires), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry(ini_name, Z_STR_P(expires), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
zend_string_release(ini_name);
}
}
diff --git a/ext/session/tests/bug67972.phpt b/ext/session/tests/bug67972.phpt
new file mode 100644
index 0000000000..63ed3a95b8
--- /dev/null
+++ b/ext/session/tests/bug67972.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #67972: SessionHandler Invalid memory read create_sid()
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+
+(new SessionHandler)->create_sid();
+--EXPECTF--
+Fatal error: SessionHandler::create_sid(): Cannot call default session handler in %s on line %d
diff --git a/ext/shmop/php_shmop.h b/ext/shmop/php_shmop.h
index b9eaba6f07..4ee6d4f61c 100644
--- a/ext/shmop/php_shmop.h
+++ b/ext/shmop/php_shmop.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h
index b908e4c722..780974c0c9 100644
--- a/ext/simplexml/php_simplexml.h
+++ b/ext/simplexml/php_simplexml.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h
index 6cdda1be4a..82e5aff9e4 100644
--- a/ext/simplexml/php_simplexml_exports.h
+++ b/ext/simplexml/php_simplexml_exports.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index db4944ff5a..366a6f0d3b 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c
index e237d2fb95..27d1e9b0f2 100644
--- a/ext/simplexml/sxe.c
+++ b/ext/simplexml/sxe.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/simplexml/sxe.h b/ext/simplexml/sxe.h
index 629e7b31d4..a08c8f7300 100644
--- a/ext/simplexml/sxe.h
+++ b/ext/simplexml/sxe.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h
index 6e170ffe71..610fff11c7 100644
--- a/ext/snmp/php_snmp.h
+++ b/ext/snmp/php_snmp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index f2eb434b9c..250b1f0ebe 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index e04a0dda2c..99375be050 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -813,7 +813,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
}
}
str->val[str->len] = '\0';
- ZVAL_STR(ret, str);
+ ZVAL_NEW_STR(ret, str);
} else {
ZVAL_EMPTY_STRING(ret);
}
@@ -1201,7 +1201,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
/* Hack for bug #32455 */
zend_property_info *property_info;
- property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC);
EG(scope) = old_scope;
if (property_info && zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) {
zval_ptr_dtor(&member);
@@ -1717,7 +1717,6 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
}
case XSD_CONTENT_ANY: {
zval *data;
- xmlNodePtr property;
encodePtr enc;
zval rv;
@@ -1731,10 +1730,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
zval *val;
ZEND_HASH_FOREACH_VAL(ht, val) {
- property = master_to_xml(enc, val, style, node TSRMLS_CC);
+ master_to_xml(enc, val, style, node TSRMLS_CC);
} ZEND_HASH_FOREACH_END();
} else {
- property = master_to_xml(enc, data, style, node TSRMLS_CC);
+ master_to_xml(enc, data, style, node TSRMLS_CC);
}
return 1;
} else if (model->min_occurs == 0) {
@@ -1985,7 +1984,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
if (Z_TYPE_P(data) == IS_OBJECT) {
const char *class_name;
- zend_unmangle_property_name(str_key->val, str_key->len, &class_name, &prop_name);
+ zend_unmangle_property_name(str_key, &class_name, &prop_name);
} else {
prop_name = str_key->val;
}
@@ -2485,14 +2484,12 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS
int* dims = NULL;
int* pos = NULL;
xmlAttrPtr attr;
- sdlPtr sdl;
sdlAttributePtr arrayType;
sdlExtraAttributePtr ext;
sdlTypePtr elementType;
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- sdl = SOAP_GLOBAL(sdl);
if (data &&
(attr = get_attribute(data->properties,"arrayType")) &&
diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h
index adcccd3612..4424116524 100644
--- a/ext/soap/php_encoding.h
+++ b/ext/soap/php_encoding.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 09958ac51f..ebadf6debb 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -26,7 +26,7 @@
static char *get_http_header_value(char *headers, char *type);
static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size TSRMLS_DC);
-static int get_http_headers(php_stream *socketd,char **response, int *out_size TSRMLS_DC);
+static zend_string *get_http_headers(php_stream *socketd TSRMLS_DC);
#define smart_str_append_const(str, const) \
smart_str_appendl(str,const,sizeof(const)-1)
@@ -236,8 +236,6 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
/* SSL & proxy */
if (stream && *use_proxy && use_ssl) {
smart_str soap_headers = {0};
- char *http_headers;
- int http_header_size;
smart_str_append_const(&soap_headers, "CONNECT ");
smart_str_appends(&soap_headers, phpurl->host);
@@ -260,13 +258,13 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
smart_str_free(&soap_headers);
if (stream) {
- if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC) || http_headers == NULL) {
+ zend_string *http_headers = get_http_headers(stream TSRMLS_CC);
+ if (http_headers) {
+ zend_string_free(http_headers);
+ } else {
php_stream_close(stream);
stream = NULL;
}
- if (http_headers) {
- efree(http_headers);
- }
}
/* enable SSL transport layer */
if (stream) {
@@ -341,8 +339,9 @@ int make_http_soap_request(zval *this_ptr,
zval *trace, *tmp;
int use_proxy = 0;
int use_ssl;
- char *http_headers, *http_body, *content_type, *http_version, *cookie_itt;
- int http_header_size, http_body_size, http_close;
+ char *http_body, *content_type, *http_version, *cookie_itt;
+ int http_body_size, http_close;
+ zend_string *http_headers;
char *connection;
int http_1_1;
int http_status;
@@ -874,8 +873,8 @@ try_again:
}
do {
- if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC)) {
- if (http_headers) {efree(http_headers);}
+ http_headers = get_http_headers(stream TSRMLS_CC);
+ if (!http_headers) {
if (request != buf) {efree(request);}
php_stream_close(stream);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
@@ -887,13 +886,13 @@ try_again:
if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL &&
Z_LVAL_P(trace) > 0) {
- add_property_stringl(this_ptr, "__last_response_headers", http_headers, http_header_size);
+ add_property_str(this_ptr, "__last_response_headers", zend_string_copy(http_headers));
}
/* Check to see what HTTP status was sent */
http_1_1 = 0;
http_status = 0;
- http_version = get_http_header_value(http_headers,"HTTP/");
+ http_version = get_http_header_value(http_headers->val, "HTTP/");
if (http_version) {
char *tmp;
@@ -918,7 +917,7 @@ try_again:
/* Try and get headers again */
if (http_status == 100) {
- efree(http_headers);
+ zend_string_release(http_headers);
}
}
} while (http_status == 100);
@@ -929,9 +928,9 @@ try_again:
we shouldn't be changing urls so path dont
matter too much
*/
- cookie_itt = strstr(http_headers,"Set-Cookie: ");
+ cookie_itt = strstr(http_headers->val, "Set-Cookie: ");
while (cookie_itt) {
- char *end_pos, *cookie;
+ char *cookie;
char *eqpos, *sempos;
zval *cookies;
@@ -941,7 +940,6 @@ try_again:
cookies = zend_hash_str_update(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies")-1, &tmp_cookies);
}
- end_pos = strstr(cookie_itt,"\r\n");
cookie = get_http_header_value(cookie_itt,"Set-Cookie: ");
eqpos = strstr(cookie, "=");
@@ -1007,7 +1005,7 @@ try_again:
if (http_1_1) {
http_close = FALSE;
if (use_proxy && !use_ssl) {
- connection = get_http_header_value(http_headers,"Proxy-Connection: ");
+ connection = get_http_header_value(http_headers->val, "Proxy-Connection: ");
if (connection) {
if (strncasecmp(connection, "close", sizeof("close")-1) == 0) {
http_close = TRUE;
@@ -1016,7 +1014,7 @@ try_again:
}
}
if (http_close == FALSE) {
- connection = get_http_header_value(http_headers,"Connection: ");
+ connection = get_http_header_value(http_headers->val, "Connection: ");
if (connection) {
if (strncasecmp(connection, "close", sizeof("close")-1) == 0) {
http_close = TRUE;
@@ -1027,7 +1025,7 @@ try_again:
} else {
http_close = TRUE;
if (use_proxy && !use_ssl) {
- connection = get_http_header_value(http_headers,"Proxy-Connection: ");
+ connection = get_http_header_value(http_headers->val, "Proxy-Connection: ");
if (connection) {
if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
http_close = FALSE;
@@ -1036,7 +1034,7 @@ try_again:
}
}
if (http_close == TRUE) {
- connection = get_http_header_value(http_headers,"Connection: ");
+ connection = get_http_header_value(http_headers->val, "Connection: ");
if (connection) {
if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
http_close = FALSE;
@@ -1046,10 +1044,10 @@ try_again:
}
}
- if (!get_http_body(stream, http_close, http_headers, &http_body, &http_body_size TSRMLS_CC)) {
+ if (!get_http_body(stream, http_close, http_headers->val, &http_body, &http_body_size TSRMLS_CC)) {
if (request != buf) {efree(request);}
php_stream_close(stream);
- efree(http_headers);
+ zend_string_release(http_headers);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL TSRMLS_CC);
@@ -1073,11 +1071,11 @@ try_again:
if (http_status >= 300 && http_status < 400) {
char *loc;
- if ((loc = get_http_header_value(http_headers,"Location: ")) != NULL) {
+ if ((loc = get_http_header_value(http_headers->val, "Location: ")) != NULL) {
php_url *new_url = php_url_parse(loc);
if (new_url != NULL) {
- efree(http_headers);
+ zend_string_release(http_headers);
efree(http_body);
efree(loc);
if (new_url->scheme == NULL && new_url->path != NULL) {
@@ -1119,7 +1117,7 @@ try_again:
} else if (http_status == 401) {
/* Digest authentication */
zval *digest, *login, *password;
- char *auth = get_http_header_value(http_headers, "WWW-Authenticate: ");
+ char *auth = get_http_header_value(http_headers->val, "WWW-Authenticate: ");
if (auth &&
strstr(auth, "Digest") == auth &&
@@ -1185,7 +1183,7 @@ try_again:
phpurl = new_url;
efree(auth);
- efree(http_headers);
+ zend_string_release(http_headers);
efree(http_body);
goto try_again;
@@ -1196,7 +1194,7 @@ try_again:
smart_str_free(&soap_headers_z);
/* Check and see if the server even sent a xml document */
- content_type = get_http_header_value(http_headers,"Content-Type: ");
+ content_type = get_http_header_value(http_headers->val, "Content-Type: ");
if (content_type) {
char *pos = NULL;
int cmplen;
@@ -1216,7 +1214,7 @@ try_again:
ZVAL_STRINGL(err, http_body, http_body_size, 1);
add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err TSRMLS_CC);
efree(content_type);
- efree(http_headers);
+ zend_string_release(http_headers);
efree(http_body);
return FALSE;
}
@@ -1226,7 +1224,7 @@ try_again:
}
/* Decompress response */
- content_encoding = get_http_header_value(http_headers,"Content-Encoding: ");
+ content_encoding = get_http_header_value(http_headers->val, "Content-Encoding: ");
if (content_encoding) {
zval func;
zval retval;
@@ -1243,7 +1241,7 @@ try_again:
ZVAL_STRINGL(&params[0], http_body, http_body_size);
} else {
efree(content_encoding);
- efree(http_headers);
+ zend_string_release(http_headers);
efree(http_body);
if (http_msg) {
efree(http_msg);
@@ -1261,7 +1259,7 @@ try_again:
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&func);
efree(content_encoding);
- efree(http_headers);
+ zend_string_release(http_headers);
efree(http_body);
add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL TSRMLS_CC);
if (http_msg) {
@@ -1278,7 +1276,7 @@ try_again:
efree(http_body);
}
- efree(http_headers);
+ zend_string_release(http_headers);
if (http_status >= 400) {
int error = 0;
@@ -1486,31 +1484,25 @@ static int get_http_body(php_stream *stream, int close, char *headers, char **r
return TRUE;
}
-static int get_http_headers(php_stream *stream, char **response, int *out_size TSRMLS_DC)
+static zend_string *get_http_headers(php_stream *stream TSRMLS_DC)
{
- int done = FALSE;
smart_str tmp_response = {0};
char headerbuf[8192];
- while (!done) {
- if (!php_stream_gets(stream, headerbuf, sizeof(headerbuf))) {
- break;
- }
-
+ while (php_stream_gets(stream, headerbuf, sizeof(headerbuf))) {
if ((headerbuf[0] == '\r' && headerbuf[1] == '\n') ||
(headerbuf[0] == '\n')) {
/* empty line marks end of headers */
- done = TRUE;
- break;
+ smart_str_0(&tmp_response);
+ return tmp_response.s;
}
/* add header to collection */
smart_str_appends(&tmp_response, headerbuf);
}
- smart_str_0(&tmp_response);
- (*response) = tmp_response.s->val;
- (*out_size) = tmp_response.s->len;
- return done;
+
+ smart_str_free(&tmp_response);
+ return NULL;
}
/*
* Local variables:
diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h
index 3fcc053741..b752641b1b 100644
--- a/ext/soap/php_http.h
+++ b/ext/soap/php_http.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 12fc31786f..52fa71d4e0 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h
index dacf5055a2..632470f255 100644
--- a/ext/soap/php_packet_soap.h
+++ b/ext/soap/php_packet_soap.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index 2c4c6c9189..b5aa5f21c2 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h
index d68db88edc..55595f2ad8 100644
--- a/ext/soap/php_schema.h
+++ b/ext/soap/php_schema.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 456fe59584..798c06fdd2 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -292,7 +292,7 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
zval new_header;
rest += 2;
- ZVAL_STR(&new_header, zend_string_alloc(Z_STRLEN_P(header) - (rest - s), 0));
+ ZVAL_NEW_STR(&new_header, zend_string_alloc(Z_STRLEN_P(header) - (rest - s), 0));
memcpy(Z_STRVAL(new_header), Z_STRVAL_P(header), s - Z_STRVAL_P(header));
memcpy(Z_STRVAL(new_header) + (s - Z_STRVAL_P(header)), rest, Z_STRLEN_P(header) - (rest - Z_STRVAL_P(header)) + 1);
ZVAL_COPY(&ctx->old_header, header);
@@ -975,7 +975,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
input = get_node_ex(portTypeOperation->children, "input", WSDL_NAMESPACE);
if (input != NULL) {
- xmlAttrPtr message, name;
+ xmlAttrPtr message;
message = get_attribute(input->properties, "message");
if (message == NULL) {
@@ -983,8 +983,8 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
}
function->requestParameters = wsdl_message(&ctx, message->children->content);
- name = get_attribute(input->properties, "name");
/* FIXME
+ xmlAttrPtr name = get_attribute(input->properties, "name");
if (name != NULL) {
function->requestName = estrdup(name->children->content);
} else {
@@ -1004,7 +1004,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
output = get_node_ex(portTypeOperation->children, "output", WSDL_NAMESPACE);
if (output != NULL) {
- xmlAttrPtr message, name;
+ xmlAttrPtr message;
message = get_attribute(output->properties, "message");
if (message == NULL) {
@@ -1012,8 +1012,8 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
}
function->responseParameters = wsdl_message(&ctx, message->children->content);
- name = get_attribute(output->properties, "name");
/* FIXME
+ xmlAttrPtr name = get_attribute(output->properties, "name");
if (name != NULL) {
function->responseName = estrdup(name->children->content);
} else if (input == NULL) {
@@ -3250,8 +3250,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
smart_str_appends(&proxy,Z_STRVAL(str_port));
smart_str_0(&proxy);
zval_dtor(&str_port);
- ZVAL_STR(&str_proxy, zend_string_copy(proxy.s));
- smart_str_free(&proxy);
+ ZVAL_NEW_STR(&str_proxy, proxy.s);
if (!context) {
context = php_stream_context_alloc(TSRMLS_C);
@@ -3289,9 +3288,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
}
smart_str_0(&headers);
- ZVAL_STR(&str_headers, zend_string_copy(headers.s));
+ ZVAL_NEW_STR(&str_headers, headers.s);
php_stream_context_set_option(context, "http", "header", &str_headers);
- smart_str_free(&headers);
zval_ptr_dtor(&str_headers);
}
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index a29e2e9a1a..cf6e26b179 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index efa0ac0baf..1cba5e7f07 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index f7c8fd51e5..5ad5548c40 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h
index 1eddcf9503..42d9dc9c6b 100644
--- a/ext/soap/php_xml.h
+++ b/ext/soap/php_xml.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index a78b9ddeaf..2b7566525d 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -479,7 +479,7 @@ ZEND_INI_MH(OnUpdateCacheMode)
p = (char*) (base+(size_t) mh_arg1);
- *p = (char)atoi(new_value);
+ *p = (char)atoi(new_value->val);
return SUCCESS;
}
@@ -490,19 +490,19 @@ static PHP_INI_MH(OnUpdateCacheDir)
if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
char *p;
- if (memchr(new_value, '\0', new_value_length) != NULL) {
+ if (memchr(new_value->val, '\0', new_value->len) != NULL) {
return FAILURE;
}
/* we do not use zend_memrchr() since path can contain ; itself */
- if ((p = strchr(new_value, ';'))) {
+ if ((p = strchr(new_value->val, ';'))) {
char *p2;
p++;
if ((p2 = strchr(p, ';'))) {
p = p2 + 1;
}
} else {
- p = new_value;
+ p = new_value->val;
}
if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
@@ -510,7 +510,7 @@ static PHP_INI_MH(OnUpdateCacheDir)
}
}
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
@@ -1429,7 +1429,7 @@ PHP_METHOD(SoapServer, addFunction)
return;
}
- ZVAL_STR(&function_copy, zend_string_copy(f->common.function_name));
+ ZVAL_STR_COPY(&function_copy, f->common.function_name);
zend_hash_update(service->soap_functions.ft, key, &function_copy);
zend_string_release(key);
@@ -1452,7 +1452,7 @@ PHP_METHOD(SoapServer, addFunction)
zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
}
- ZVAL_STR(&function_copy, zend_string_copy(f->common.function_name));
+ ZVAL_STR_COPY(&function_copy, f->common.function_name);
zend_hash_update(service->soap_functions.ft, key, &function_copy);
zend_string_release(key);
} else if (Z_TYPE_P(function_name) == IS_LONG) {
@@ -1713,7 +1713,7 @@ PHP_METHOD(SoapServer, handle)
if (zend_hash_str_exists(&Z_OBJCE(tmp_soap)->function_table, php_strtolower(class_name, class_name_len), class_name_len)) {
zval c_ret, constructor;
- ZVAL_STR(&constructor, zend_string_copy(service->soap_class.ce->name));
+ ZVAL_STR_COPY(&constructor, service->soap_class.ce->name);
if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
}
diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c
index ec66c9d0e0..f31208cf4d 100644
--- a/ext/sockets/conversions.c
+++ b/ext/sockets/conversions.c
@@ -175,7 +175,7 @@ static void do_from_to_zval_err(struct err_s *err,
err->should_free = 1;
efree(user_msg);
- smart_str_free_ex(&path, 0);
+ smart_str_free(&path);
}
ZEND_ATTRIBUTE_FORMAT(printf, 2 ,3)
static void do_from_zval_err(ser_context *ctx, const char *fmt, ...)
@@ -310,7 +310,7 @@ static zend_long from_zval_integer_common(const zval *arr_value, ser_context *ct
ZVAL_NULL(&lzval);
if (Z_TYPE_P(arr_value) != IS_LONG) {
- ZVAL_COPY(&lzval, arr_value);
+ ZVAL_COPY(&lzval, (zval *)arr_value);
arr_value = &lzval;
}
@@ -540,26 +540,20 @@ static void from_zval_write_sin_addr(const zval *zaddr_str, char *inaddr, ser_co
{
int res;
struct sockaddr_in saddr = {0};
- zval lzval;
+ zend_string *addr_str;
TSRMLS_FETCH();
- ZVAL_NULL(&lzval);
- if (Z_TYPE_P(zaddr_str) != IS_STRING) {
- ZVAL_COPY(&lzval, zaddr_str);
- convert_to_string(&lzval);
- zaddr_str = &lzval;
- }
-
- res = php_set_inet_addr(&saddr, Z_STRVAL_P(zaddr_str), ctx->sock TSRMLS_CC);
+ addr_str = zval_get_string((zval *) zaddr_str);
+ res = php_set_inet_addr(&saddr, addr_str->val, ctx->sock TSRMLS_CC);
if (res) {
memcpy(inaddr, &saddr.sin_addr, sizeof saddr.sin_addr);
} else {
/* error already emitted, but let's emit another more relevant */
do_from_zval_err(ctx, "could not resolve address '%s' to get an AF_INET "
- "address", Z_STRVAL_P(zaddr_str));
+ "address", addr_str->val);
}
- zval_dtor(&lzval);
+ zend_string_release(addr_str);
}
static void to_zval_read_sin_addr(const char *data, zval *zv, res_context *ctx)
{
@@ -568,7 +562,7 @@ static void to_zval_read_sin_addr(const char *data, zval *zv, res_context *ctx)
zend_string *str = zend_string_alloc(size - 1, 0);
memset(str->val, '\0', size);
- ZVAL_STR(zv, str);
+ ZVAL_NEW_STR(zv, str);
if (inet_ntop(AF_INET, addr, Z_STRVAL_P(zv), size) == NULL) {
do_to_zval_err(ctx, "could not convert IPv4 address to string "
@@ -597,18 +591,11 @@ static void from_zval_write_sin6_addr(const zval *zaddr_str, char *addr6, ser_co
{
int res;
struct sockaddr_in6 saddr6 = {0};
- zval lzval;
+ zend_string *addr_str;
TSRMLS_FETCH();
- ZVAL_NULL(&lzval);
- if (Z_TYPE_P(zaddr_str) != IS_STRING) {
- ZVAL_COPY(&lzval, zaddr_str);
- convert_to_string(&lzval);
- zaddr_str = &lzval;
- }
-
- res = php_set_inet6_addr(&saddr6,
- Z_STRVAL_P(zaddr_str), ctx->sock TSRMLS_CC);
+ addr_str = zval_get_string((zval *) zaddr_str);
+ res = php_set_inet6_addr(&saddr6, addr_str->val, ctx->sock TSRMLS_CC);
if (res) {
memcpy(addr6, &saddr6.sin6_addr, sizeof saddr6.sin6_addr);
} else {
@@ -617,7 +604,7 @@ static void from_zval_write_sin6_addr(const zval *zaddr_str, char *addr6, ser_co
"address", Z_STRVAL_P(zaddr_str));
}
- zval_dtor(&lzval);
+ zend_string_release(addr_str);
}
static void to_zval_read_sin6_addr(const char *data, zval *zv, res_context *ctx)
{
@@ -627,7 +614,7 @@ static void to_zval_read_sin6_addr(const char *data, zval *zv, res_context *ctx)
memset(str->val, '\0', size);
- ZVAL_STR(zv, str);
+ ZVAL_NEW_STR(zv, str);
if (inet_ntop(AF_INET6, addr, Z_STRVAL_P(zv), size) == NULL) {
do_to_zval_err(ctx, "could not convert IPv6 address to string "
@@ -656,33 +643,29 @@ static void to_zval_read_sockaddr_in6(const char *data, zval *zv, res_context *c
#endif /* HAVE_IPV6 */
static void from_zval_write_sun_path(const zval *path, char *sockaddr_un_c, ser_context *ctx)
{
- zval lzval;
+ zend_string *path_str;
struct sockaddr_un *saddr = (struct sockaddr_un*)sockaddr_un_c;
+ TSRMLS_FETCH();
- ZVAL_NULL(&lzval);
- if (Z_TYPE_P(path) != IS_STRING) {
- ZVAL_COPY(&lzval, path);
- convert_to_string(&lzval);
- path = &lzval;
- }
+ path_str = zval_get_string((zval *) path);
/* code in this file relies on the path being nul terminated, even though
* this is not required, at least on linux for abstract paths. It also
* assumes that the path is not empty */
- if (Z_STRLEN_P(path) == 0) {
+ if (path_str->len == 0) {
do_from_zval_err(ctx, "%s", "the path is cannot be empty");
return;
}
- if (Z_STRLEN_P(path) >= sizeof(saddr->sun_path)) {
+ if (path_str->len >= sizeof(saddr->sun_path)) {
do_from_zval_err(ctx, "the path is too long, the maximum permitted "
"length is %ld", sizeof(saddr->sun_path) - 1);
return;
}
- memcpy(&saddr->sun_path, Z_STRVAL_P(path), Z_STRLEN_P(path));
- saddr->sun_path[Z_STRLEN_P(path)] = '\0';
+ memcpy(&saddr->sun_path, path_str->val, path_str->len);
+ saddr->sun_path[path_str->len] = '\0';
- zval_dtor(&lzval);
+ zend_string_release(path_str);
}
static void to_zval_read_sun_path(const char *data, zval *zv, res_context *ctx) {
struct sockaddr_un *saddr = (struct sockaddr_un*)data;
@@ -1229,7 +1212,7 @@ static void to_zval_read_iov(const char *msghdr_c, zval *zv, res_context *ctx)
memcpy(buf->val, msghdr->msg_iov[i].iov_base, buf->len);
buf->val[buf->len] = '\0';
- ZVAL_STR(&elem, buf);
+ ZVAL_NEW_STR(&elem, buf);
add_next_index_zval(zv, &elem);
bytes_left -= len;
}
@@ -1252,10 +1235,7 @@ void to_zval_read_msghdr(const char *msghdr_c, zval *zv, res_context *ctx)
/* CONVERSIONS for if_index */
static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context *ctx)
{
- unsigned ret = 0;
- zval lzval;
-
- ZVAL_NULL(&lzval);
+ unsigned ret = 0;
if (Z_TYPE_P(zv) == IS_LONG) {
if (Z_LVAL_P(zv) < 0 || Z_LVAL_P(zv) > UINT_MAX) { /* allow 0 (unspecified interface) */
@@ -1265,34 +1245,30 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context
ret = (unsigned)Z_LVAL_P(zv);
}
} else {
- if (Z_TYPE_P(zv) != IS_STRING) {
- ZVAL_COPY_VALUE(&lzval, zv);
- zval_copy_ctor(&lzval);
- convert_to_string(&lzval);
- zv = &lzval;
- }
+ zend_string *str;
+ TSRMLS_FETCH();
+
+ str = zval_get_string((zval *) zv);
#if HAVE_IF_NAMETOINDEX
- ret = if_nametoindex(Z_STRVAL_P(zv));
+ ret = if_nametoindex(str->val);
if (ret == 0) {
- do_from_zval_err(ctx, "no interface with name \"%s\" could be "
- "found", Z_STRVAL_P(zv));
+ do_from_zval_err(ctx, "no interface with name \"%s\" could be found", str->val);
}
#elif defined(SIOCGIFINDEX)
{
struct ifreq ifr;
- if (strlcpy(ifr.ifr_name, Z_STRVAL_P(zv), sizeof(ifr.ifr_name))
+ if (strlcpy(ifr.ifr_name, str->val, sizeof(ifr.ifr_name))
>= sizeof(ifr.ifr_name)) {
- do_from_zval_err(ctx, "the interface name \"%s\" is too large ",
- Z_STRVAL_P(zv));
+ do_from_zval_err(ctx, "the interface name \"%s\" is too large ", str->val);
} else if (ioctl(ctx->sock->bsd_socket, SIOCGIFINDEX, &ifr) < 0) {
if (errno == ENODEV) {
do_from_zval_err(ctx, "no interface with name \"%s\" could be "
- "found", Z_STRVAL_P(zv));
+ "found", str->val);
} else {
do_from_zval_err(ctx, "error fetching interface index for "
"interface with name \"%s\" (errno %d)",
- Z_STRVAL_P(zv), errno);
+ str->val, errno);
}
} else {
ret = (unsigned)ifr.ifr_ifindex;
@@ -1303,13 +1279,13 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context
"this platform does not support looking up an interface by "
"name, an integer interface index must be supplied instead");
#endif
+
+ zend_string_release(str);
}
if (!ctx->err.has_error) {
memcpy(uinteger, &ret, sizeof(ret));
}
-
- zval_dtor(&lzval);
}
/* CONVERSIONS for struct in6_pktinfo */
diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c
index d0bddf674a..3c076b4e7c 100644
--- a/ext/sockets/multicast.c
+++ b/ext/sockets/multicast.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h
index 29eb54efd8..de76dfcec7 100644
--- a/ext/sockets/multicast.h
+++ b/ext/sockets/multicast.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index 86729650e4..b1ee5798c9 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c
index 91867d99e3..dcaa60ac7a 100644
--- a/ext/sockets/sendrecvmsg.c
+++ b/ext/sockets/sendrecvmsg.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 0da81e74f5..0dab51bed6 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1586,7 +1586,7 @@ PHP_FUNCTION(socket_recv)
/* Rebuild buffer zval */
zval_dtor(buf);
- ZVAL_STR(buf, recv_buf);
+ ZVAL_NEW_STR(buf, recv_buf);
}
if (retval == -1) {
@@ -1673,7 +1673,7 @@ PHP_FUNCTION(socket_recvfrom)
zval_dtor(arg2);
zval_dtor(arg5);
- ZVAL_STR(arg2, recv_buf);
+ ZVAL_NEW_STR(arg2, recv_buf);
ZVAL_STRING(arg5, s_un.sun_path);
break;
@@ -1703,7 +1703,7 @@ PHP_FUNCTION(socket_recvfrom)
address = inet_ntoa(sin.sin_addr);
- ZVAL_STR(arg2, recv_buf);
+ ZVAL_NEW_STR(arg2, recv_buf);
ZVAL_STRING(arg5, address ? address : "0.0.0.0");
ZVAL_LONG(arg6, ntohs(sin.sin_port));
break;
@@ -1735,7 +1735,7 @@ PHP_FUNCTION(socket_recvfrom)
memset(addr6, 0, INET6_ADDRSTRLEN);
inet_ntop(AF_INET6, &sin6.sin6_addr, addr6, INET6_ADDRSTRLEN);
- ZVAL_STR(arg2, recv_buf);
+ ZVAL_NEW_STR(arg2, recv_buf);
ZVAL_STRING(arg5, addr6[0] ? addr6 : "::");
ZVAL_LONG(arg6, ntohs(sin6.sin6_port));
break;
diff --git a/ext/sockets/unix_socket_constants.h b/ext/sockets/unix_socket_constants.h
index 485b2534d2..7d183b83ae 100644
--- a/ext/sockets/unix_socket_constants.h
+++ b/ext/sockets/unix_socket_constants.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sockets/win32_socket_constants.h b/ext/sockets/win32_socket_constants.h
index 848e14fb51..2d707e9074 100644
--- a/ext/sockets/win32_socket_constants.h
+++ b/ext/sockets/win32_socket_constants.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sockets/windows_common.h b/ext/sockets/windows_common.h
index 9cc01ae129..5536d88a4a 100644
--- a/ext/sockets/windows_common.h
+++ b/ext/sockets/windows_common.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index ad3bb85313..d38da10e65 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h
index c2b1837e8d..534a03885e 100644
--- a/ext/spl/php_spl.h
+++ b/ext/spl/php_spl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -60,10 +60,10 @@ PHP_MINFO_FUNCTION(spl);
ZEND_BEGIN_MODULE_GLOBALS(spl)
zend_string *autoload_extensions;
HashTable *autoload_functions;
- int autoload_running;
intptr_t hash_mask_handle;
intptr_t hash_mask_handlers;
int hash_mask_init;
+ int autoload_running;
ZEND_END_MODULE_GLOBALS(spl)
#ifdef ZTS
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 84c3714da2..11293eb5e5 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h
index 23ca80bc8f..c27e55bbec 100644
--- a/ext/spl/spl_array.h
+++ b/ext/spl/spl_array.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 0694e8f335..1d9c00db0a 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -2883,7 +2883,12 @@ SPL_METHOD(SplFileObject, fwrite)
}
if (ZEND_NUM_ARGS() > 1) {
- str_len = MAX(0, MIN(length, str_len));
+ if (length >= 0) {
+ str_len = MAX(0, MIN((size_t)length, str_len));
+ } else {
+ /* Negative length given, nothing to write */
+ str_len = 0;
+ }
}
if (!str_len) {
RETURN_LONG(0);
@@ -2911,7 +2916,7 @@ SPL_METHOD(SplFileObject, fread)
RETURN_FALSE;
}
- ZVAL_STR(return_value, zend_string_alloc(length, 0));
+ ZVAL_NEW_STR(return_value, zend_string_alloc(length, 0));
Z_STRLEN_P(return_value) = php_stream_read(intern->u.file.stream, Z_STRVAL_P(return_value), length);
/* needed because recv/read/gzread doesnt put a null at the end*/
diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h
index 4993f67b1f..f1db1f69b9 100644
--- a/ext/spl/spl_directory.h
+++ b/ext/spl/spl_directory.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index e02b9b2e83..a02cfb685d 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -101,8 +101,8 @@ struct _spl_dllist_object {
/* define an overloaded iterator structure */
struct _spl_dllist_it {
zend_user_iterator intern;
- int traverse_position;
spl_ptr_llist_element *traverse_pointer;
+ int traverse_position;
int flags;
};
diff --git a/ext/spl/spl_dllist.h b/ext/spl/spl_dllist.h
index c6f82ce57a..b8bd98ef6d 100644
--- a/ext/spl/spl_dllist.h
+++ b/ext/spl/spl_dllist.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c
index 99a18c69f0..1e51484394 100644
--- a/ext/spl/spl_engine.c
+++ b/ext/spl/spl_engine.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h
index fc82b4fe53..a621355ba4 100644
--- a/ext/spl/spl_engine.h
+++ b/ext/spl/spl_engine.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c
index 221b25df47..3c6b724b5c 100644
--- a/ext/spl/spl_exceptions.c
+++ b/ext/spl/spl_exceptions.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_exceptions.h b/ext/spl/spl_exceptions.h
index 5e4e0f702c..e061c86118 100644
--- a/ext/spl/spl_exceptions.h
+++ b/ext/spl/spl_exceptions.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index a025a376ab..ee5ef6b990 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_fixedarray.h b/ext/spl/spl_fixedarray.h
index 9011e8c1d5..a61f7ef486 100644
--- a/ext/spl/spl_fixedarray.h
+++ b/ext/spl/spl_fixedarray.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c
index 13440355ce..f409927271 100644
--- a/ext/spl/spl_functions.c
+++ b/ext/spl/spl_functions.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -84,8 +84,7 @@ void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_fla
if ((tmp = zend_hash_find(Z_ARRVAL_P(list), pce->name)) == NULL) {
zval t;
- zend_string_addref(pce->name);
- ZVAL_STR(&t, pce->name);
+ ZVAL_STR_COPY(&t, pce->name);
zend_hash_add(Z_ARRVAL_P(list), pce->name, &t);
}
}
diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h
index 88ae478a02..3381975e6c 100644
--- a/ext/spl/spl_functions.h
+++ b/ext/spl/spl_functions.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index 97d95d2acf..d29150c1d6 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_heap.h b/ext/spl/spl_heap.h
index a3ac4a8f5c..7d0a8a319d 100644
--- a/ext/spl/spl_heap.h
+++ b/ext/spl/spl_heap.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index dcc2a8a573..75f229dfc1 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -2264,7 +2264,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren)
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception)) {
- ZVAL_STR(&regex, zend_string_copy(intern->u.regex.regex));
+ ZVAL_STR_COPY(&regex, intern->u.regex.regex);
spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, &regex TSRMLS_CC);
zval_ptr_dtor(&regex);
}
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index 7435ce7f27..f0740275dc 100644
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -154,12 +154,12 @@ typedef struct _spl_dual_it_object {
} append;
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
struct {
- int use_flags;
- zend_long flags;
- regex_mode mode;
- zend_long preg_flags;
+ zend_long flags;
+ zend_long preg_flags;
pcre_cache_entry *pce;
zend_string *regex;
+ regex_mode mode;
+ int use_flags;
} regex;
#endif
_spl_cbfilter_it_intern *cbfilter;
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index bcb316a744..289e9212e8 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/spl/spl_observer.h b/ext/spl/spl_observer.h
index 51573d732f..640f79cde3 100644
--- a/ext/spl/spl_observer.h
+++ b/ext/spl/spl_observer.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sqlite3/php_sqlite3.h b/ext/sqlite3/php_sqlite3.h
index 2c19b9d9c4..5c7dfcfa5a 100644
--- a/ext/sqlite3/php_sqlite3.h
+++ b/ext/sqlite3/php_sqlite3.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h
index 5a291a9a50..3036809856 100644
--- a/ext/sqlite3/php_sqlite3_structs.h
+++ b/ext/sqlite3/php_sqlite3_structs.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 4981fad416..af3dec0681 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 09aaddfbf5..de5639fbab 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -706,12 +706,12 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /*
if (f->key == NULL) {
ZVAL_LONG(&args[0], f->h);
} else {
- ZVAL_STR(&args[0], zend_string_copy(f->key));
+ ZVAL_STR_COPY(&args[0], f->key);
}
if (s->key == NULL) {
ZVAL_LONG(&args[1], s->h);
} else {
- ZVAL_STR(&args[1], zend_string_copy(s->key));
+ ZVAL_STR_COPY(&args[1], s->key);
}
BG(user_compare_fci).param_count = 2;
@@ -1427,7 +1427,7 @@ PHP_FUNCTION(extract)
if (var_exists && var_name->len == sizeof("this")-1 && !strcmp(var_name->val, "this") && EG(scope) && EG(scope)->name->len != 0) {
break;
}
- ZVAL_STR(&final_name, zend_string_copy(var_name));
+ ZVAL_STR_COPY(&final_name, var_name);
break;
case EXTR_PREFIX_IF_EXISTS:
@@ -1438,7 +1438,7 @@ PHP_FUNCTION(extract)
case EXTR_PREFIX_SAME:
if (!var_exists && var_name->len != 0) {
- ZVAL_STR(&final_name, zend_string_copy(var_name));
+ ZVAL_STR_COPY(&final_name, var_name);
}
/* break omitted intentionally */
@@ -1453,14 +1453,14 @@ PHP_FUNCTION(extract)
if (!php_valid_var_name(var_name->val, var_name->len)) {
php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC);
} else {
- ZVAL_STR(&final_name, zend_string_copy(var_name));
+ ZVAL_STR_COPY(&final_name, var_name);
}
}
break;
default:
if (!var_exists) {
- ZVAL_STR(&final_name, zend_string_copy(var_name));
+ ZVAL_STR_COPY(&final_name, var_name);
}
break;
}
@@ -1528,7 +1528,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
PHP_FUNCTION(compact)
{
zval *args = NULL; /* function arguments array */
- int num_args, i;
+ uint32_t num_args, i;
zend_array *symbol_table;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
@@ -1826,7 +1826,7 @@ static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */
for (j = 0; j < n_elems; j++) {
p = hash->arData + j;
- if (p->key && !IS_INTERNED(p->key)) {
+ if (p->key) {
zend_string_release(p->key);
}
p->h = j;
@@ -2085,7 +2085,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
zend_hash_rehash(Z_ARRVAL_P(stack));
}
}
- } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) {
+ } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= (zend_ulong)(Z_ARRVAL_P(stack)->nNextFreeElement - 1)) {
Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1;
}
@@ -2605,7 +2605,7 @@ PHP_FUNCTION(array_keys)
if (add_key) {
if (str_idx) {
- ZVAL_STR(&new_val, zend_string_copy(str_idx));
+ ZVAL_STR_COPY(&new_val, str_idx);
} else {
ZVAL_LONG(&new_val, num_idx);
}
@@ -2889,14 +2889,14 @@ PHP_FUNCTION(array_flip)
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
if (Z_TYPE_P(entry) == IS_LONG) {
if (str_idx) {
- ZVAL_STR(&data, zend_string_copy(str_idx));
+ ZVAL_STR_COPY(&data, str_idx);
} else {
ZVAL_LONG(&data, num_idx);
}
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_P(entry), &data);
} else if (Z_TYPE_P(entry) == IS_STRING) {
if (str_idx) {
- ZVAL_STR(&data, zend_string_copy(str_idx));
+ ZVAL_STR_COPY(&data, str_idx);
} else {
ZVAL_LONG(&data, num_idx);
}
@@ -3174,7 +3174,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
int arr_argc, i, c = 0;
uint idx;
Bucket **lists, *list, **ptrs, *p;
- int req_args;
+ uint32_t req_args;
char *param_spec;
zend_fcall_info fci1, fci2;
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
@@ -3598,7 +3598,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
int arr_argc, i, c;
uint idx;
Bucket **lists, *list, **ptrs, *p;
- int req_args;
+ uint32_t req_args;
char *param_spec;
zend_fcall_info fci1, fci2;
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
@@ -4366,9 +4366,9 @@ PHP_FUNCTION(array_filter)
}
} else {
if (use_type == ARRAY_FILTER_USE_BOTH) {
- ZVAL_STR(&args[1], zend_string_copy(string_key));
+ ZVAL_STR_COPY(&args[1], string_key);
} else if (use_type == ARRAY_FILTER_USE_KEY) {
- ZVAL_STR(&args[0], zend_string_copy(string_key));
+ ZVAL_STR_COPY(&args[0], string_key);
}
}
}
@@ -4423,7 +4423,8 @@ PHP_FUNCTION(array_map)
zval result;
zend_fcall_info fci = empty_fcall_info;
zend_fcall_info_cache fci_cache = empty_fcall_info_cache;
- int i, k, maxlen = 0;
+ int i;
+ uint32_t k, maxlen = 0;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index 80ea740100..65472170e2 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -58,17 +58,17 @@ static PHP_INI_MH(OnChangeCallback) /* {{{ */
zval_ptr_dtor(&ASSERTG(callback));
ZVAL_UNDEF(&ASSERTG(callback));
}
- if (new_value && (Z_TYPE(ASSERTG(callback)) != IS_UNDEF || new_value_length)) {
- ZVAL_STRINGL(&ASSERTG(callback), new_value, new_value_length);
+ if (new_value && (Z_TYPE(ASSERTG(callback)) != IS_UNDEF || new_value->len)) {
+ ZVAL_STR_COPY(&ASSERTG(callback), new_value);
}
} else {
if (ASSERTG(cb)) {
pefree(ASSERTG(cb), 1);
}
- if (new_value && new_value_length) {
- ASSERTG(cb) = pemalloc(new_value_length + 1, 1);
- memcpy(ASSERTG(cb), new_value, new_value_length);
- ASSERTG(cb)[new_value_length] = '\0';
+ if (new_value && new_value->len) {
+ ASSERTG(cb) = pemalloc(new_value->len + 1, 1);
+ memcpy(ASSERTG(cb), new_value->val, new_value->len);
+ ASSERTG(cb)[new_value->len] = '\0';
} else {
ASSERTG(cb) = NULL;
}
@@ -272,7 +272,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.active", sizeof("assert.active")-1, 0);
- zend_alter_ini_entry_ex(key, value_str->val, value_str->len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -284,7 +284,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.bail", sizeof("assert.bail")-1, 0);
- zend_alter_ini_entry_ex(key, value_str->val, value_str->len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -296,7 +296,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.quiet_eval", sizeof("assert.quiet_eval")-1, 0);
- zend_alter_ini_entry_ex(key, value_str->val, value_str->len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -308,7 +308,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.warning", sizeof("assert.warning")-1, 0);
- zend_alter_ini_entry_ex(key, value_str->val, value_str->len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
zend_string_release(key);
zend_string_release(value_str);
}
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index 0a4093f185..fd1c910234 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -59,10 +59,6 @@ PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) /
unsigned char *p;
zend_string *result;
- if (length < 0) {
- return NULL;
- }
-
result = zend_string_alloc(((length + 2) / 3) * 4 * sizeof(char), 0);
p = (unsigned char *)result->val;
diff --git a/ext/standard/base64.h b/ext/standard/base64.h
index 43324e4911..a31a799c3a 100644
--- a/ext/standard/base64.h
+++ b/ext/standard/base64.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 31012d2c2a..36611b812b 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -3556,6 +3556,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
REGISTER_LONG_CONSTANT("INI_SCANNER_NORMAL", ZEND_INI_SCANNER_NORMAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("INI_SCANNER_RAW", ZEND_INI_SCANNER_RAW, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INI_SCANNER_TYPED", ZEND_INI_SCANNER_TYPED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_CS | CONST_PERSISTENT);
@@ -4177,8 +4178,9 @@ static int parse_opts(char * opts, opt_struct ** result)
{
opt_struct * paras = NULL;
unsigned int i, count = 0;
+ unsigned int opts_len = (unsigned int)strlen(opts);
- for (i = 0; i < strlen(opts); i++) {
+ for (i = 0; i < opts_len; i++) {
if ((opts[i] >= 48 && opts[i] <= 57) ||
(opts[i] >= 65 && opts[i] <= 90) ||
(opts[i] >= 97 && opts[i] <= 122)
@@ -4860,9 +4862,11 @@ static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */
zend_string *function_name;
if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) {
- php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name->val);
if (function_name) {
+ php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name->val);
zend_string_release(function_name);
+ } else {
+ php_error(E_WARNING, "(Registered shutdown functions) Unable to call - function does not exist");
}
return 0;
}
@@ -5008,7 +5012,11 @@ PHP_FUNCTION(register_shutdown_function)
/* Prevent entering of anything but valid callback (syntax check only!) */
if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val);
+ if (callback_name) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback passed");
+ }
efree(shutdown_function_entry.arguments);
RETVAL_FALSE;
} else {
@@ -5233,27 +5241,30 @@ static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, ze
array_init(&option);
if (ini_entry->orig_value) {
- add_assoc_stringl(&option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length);
+ add_assoc_str(&option, "global_value", zend_string_copy(ini_entry->orig_value));
} else if (ini_entry->value) {
- add_assoc_stringl(&option, "global_value", ini_entry->value, ini_entry->value_length);
+ add_assoc_str(&option, "global_value", zend_string_copy(ini_entry->value));
} else {
add_assoc_null(&option, "global_value");
}
if (ini_entry->value) {
- add_assoc_stringl(&option, "local_value", ini_entry->value, ini_entry->value_length);
+ add_assoc_str(&option, "local_value", zend_string_copy(ini_entry->value));
} else {
add_assoc_null(&option, "local_value");
}
add_assoc_long(&option, "access", ini_entry->modifiable);
- add_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, &option);
+ zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &option);
} else {
if (ini_entry->value) {
- add_assoc_stringl(ini_array, ini_entry->name, ini_entry->value, ini_entry->value_length);
+ zval zv;
+
+ ZVAL_STR_COPY(&zv, ini_entry->value);
+ zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &zv);
} else {
- add_assoc_null(ini_array, ini_entry->name);
+ zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &EG(uninitialized_zval));
}
}
}
@@ -5304,11 +5315,10 @@ static int php_ini_check_path(char *option_name, int option_len, char *new_optio
PHP_FUNCTION(ini_set)
{
zend_string *varname;
- char *new_value;
- size_t new_value_len;
+ zend_string *new_value;
char *old_value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ss", &varname, &new_value, &new_value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &varname, &new_value) == FAILURE) {
return;
}
@@ -5330,14 +5340,14 @@ PHP_FUNCTION(ini_set)
_CHECK_PATH(varname->val, varname->len, "mail.log") ||
_CHECK_PATH(varname->val, varname->len, "java.library.path") ||
_CHECK_PATH(varname->val, varname->len, "vpopmail.directory")) {
- if (php_check_open_basedir(new_value TSRMLS_CC)) {
+ if (php_check_open_basedir(new_value->val TSRMLS_CC)) {
zval_dtor(return_value);
RETURN_FALSE;
}
}
}
- if (zend_alter_ini_entry_ex(varname, new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -5362,12 +5372,11 @@ PHP_FUNCTION(ini_restore)
Sets the include_path configuration option */
PHP_FUNCTION(set_include_path)
{
- char *new_value;
- size_t new_value_len;
+ zend_string *new_value;
char *old_value;
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &new_value, &new_value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &new_value) == FAILURE) {
return;
}
@@ -5380,7 +5389,7 @@ PHP_FUNCTION(set_include_path)
}
key = zend_string_init("include_path", sizeof("include_path") - 1, 0);
- if (zend_alter_ini_entry_ex(key, new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
zend_string_release(key);
zval_dtor(return_value);
RETURN_FALSE;
@@ -5470,11 +5479,10 @@ PHP_FUNCTION(connection_status)
Set whether we want to ignore a user abort event or not */
PHP_FUNCTION(ignore_user_abort)
{
- char *arg = NULL;
- size_t arg_len = 0;
+ zend_string *arg = NULL;
int old_setting;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &arg) == FAILURE) {
return;
}
@@ -5482,7 +5490,7 @@ PHP_FUNCTION(ignore_user_abort)
if (arg) {
zend_string *key = zend_string_init("ignore_user_abort", sizeof("ignore_user_abort"), 0);
- zend_alter_ini_entry_ex(key, arg, arg_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
zend_string_release(key);
}
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 64a6c5363c..1b0325caa8 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index cc8a01f4f4..9c54aa4897 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -296,7 +296,7 @@ PHP_INI_MH(OnChangeBrowscap)
if (bdata->filename[0] != '\0') {
browscap_bdata_dtor(bdata, 0 TSRMLS_CC);
}
- if (VCWD_REALPATH(new_value, bdata->filename) == NULL) {
+ if (VCWD_REALPATH(new_value->val, bdata->filename) == NULL) {
return FAILURE;
}
return SUCCESS;
diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c
index b3a0593f41..a515b492b8 100644
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/crc32.h b/ext/standard/crc32.h
index be9a99e6e2..222967dd25 100644
--- a/ext/standard/crc32.h
+++ b/ext/standard/crc32.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 6df81ca029..1aeff9e679 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/credits.h b/ext/standard/credits.h
index a1f57360a5..0a501526f8 100644
--- a/ext/standard/credits.h
+++ b/ext/standard/credits.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 1a9acf5bd6..9599e2f056 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -207,11 +207,11 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch
crypt_res = php_crypt_blowfish_rn(password, salt, output, sizeof(output));
if (!crypt_res) {
- memset(output, 0, PHP_MAX_SALT_LEN + 1);
+ ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1);
return NULL;
} else {
result = zend_string_init(output, strlen(output), 0);
- memset(output, 0, PHP_MAX_SALT_LEN + 1);
+ ZEND_SECURE_ZERO(output, PHP_MAX_SALT_LEN + 1);
return result;
}
} else {
diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c
index e53f488805..ee68cec027 100644
--- a/ext/standard/crypt_sha256.c
+++ b/ext/standard/crypt_sha256.c
@@ -520,7 +520,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b
if (rounds_custom) {
#ifdef PHP_WIN32
- int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha256_rounds_prefix, rounds);
+ int n = _snprintf(cp, MAX(0, buflen), "%s%I64u$", sha256_rounds_prefix, rounds);
#else
int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha256_rounds_prefix, rounds);
#endif
@@ -571,18 +571,17 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b
inside the SHA256 implementation as well. */
sha256_init_ctx(&ctx);
sha256_finish_ctx(&ctx, alt_result);
- memset(temp_result, '\0', sizeof(temp_result));
- memset(p_bytes, '\0', key_len);
- memset(s_bytes, '\0', salt_len);
- memset(&ctx, '\0', sizeof(ctx));
- memset(&alt_ctx, '\0', sizeof(alt_ctx));
+ ZEND_SECURE_ZERO(temp_result, sizeof(temp_result));
+ ZEND_SECURE_ZERO(p_bytes, key_len);
+ ZEND_SECURE_ZERO(s_bytes, salt_len);
+ ZEND_SECURE_ZERO(&ctx, sizeof(ctx));
+ ZEND_SECURE_ZERO(&alt_ctx, sizeof(alt_ctx));
if (copied_key != NULL) {
- memset(copied_key, '\0', key_len);
-
+ ZEND_SECURE_ZERO(copied_key, key_len);
}
if (copied_salt != NULL) {
- memset(copied_salt, '\0', salt_len);
+ ZEND_SECURE_ZERO(copied_salt, salt_len);
}
return buffer;
diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c
index a673bfac1c..9e5def38c5 100644
--- a/ext/standard/crypt_sha512.c
+++ b/ext/standard/crypt_sha512.c
@@ -555,7 +555,7 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
if (rounds_custom) {
#ifdef PHP_WIN32
- int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha512_rounds_prefix, rounds);
+ int n = _snprintf(cp, MAX(0, buflen), "%s%I64u$", sha512_rounds_prefix, rounds);
#else
int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha512_rounds_prefix, rounds);
#endif
@@ -619,16 +619,16 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
inside the SHA512 implementation as well. */
sha512_init_ctx(&ctx);
sha512_finish_ctx(&ctx, alt_result);
- memset(temp_result, '\0', sizeof(temp_result));
- memset(p_bytes, '\0', key_len);
- memset(s_bytes, '\0', salt_len);
- memset(&ctx, '\0', sizeof(ctx));
- memset(&alt_ctx, '\0', sizeof(alt_ctx));
+ ZEND_SECURE_ZERO(temp_result, sizeof(temp_result));
+ ZEND_SECURE_ZERO(p_bytes, key_len);
+ ZEND_SECURE_ZERO(s_bytes, salt_len);
+ ZEND_SECURE_ZERO(&ctx, sizeof(ctx));
+ ZEND_SECURE_ZERO(&alt_ctx, sizeof(alt_ctx));
if (copied_key != NULL) {
- memset(copied_key, '\0', key_len);
+ ZEND_SECURE_ZERO(copied_key, key_len);
}
if (copied_salt != NULL) {
- memset(copied_salt, '\0', salt_len);
+ ZEND_SECURE_ZERO(copied_salt, salt_len);
}
return buffer;
diff --git a/ext/standard/css.c b/ext/standard/css.c
index 9ce6138015..f4469bea30 100644
--- a/ext/standard/css.c
+++ b/ext/standard/css.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/css.h b/ext/standard/css.h
index b3c79f2429..408abc1787 100644
--- a/ext/standard/css.h
+++ b/ext/standard/css.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c
index e36b8c8d69..ea5cc19387 100644
--- a/ext/standard/cyr_convert.c
+++ b/ext/standard/cyr_convert.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/cyr_convert.h b/ext/standard/cyr_convert.h
index 6b16be2960..41cce1aaa3 100644
--- a/ext/standard/cyr_convert.h
+++ b/ext/standard/cyr_convert.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index 7b6a912244..39f8669038 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h
index bb6673497c..0edaff1b00 100644
--- a/ext/standard/datetime.h
+++ b/ext/standard/datetime.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 40632a0cf5..7b4ab1cd3e 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 7a2a1648d4..6ea69e5b81 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/dl.h b/ext/standard/dl.h
index eee70472b5..50ed19afc0 100644
--- a/ext/standard/dl.h
+++ b/ext/standard/dl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index b43bd9160a..a000ad9638 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index aab31891da..865ad30b3e 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2008-2009 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 94c5a26937..28f01b338f 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/exec.h b/ext/standard/exec.h
index 8ffe471408..79b0574e28 100644
--- a/ext/standard/exec.h
+++ b/ext/standard/exec.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 21f9a752e3..66b0f0f5ff 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1210,7 +1210,7 @@ PHPAPI PHP_FUNCTION(fwrite)
num_bytes = arg2len;
} else {
if (arg3 > 0) {
- num_bytes = MAX(0, MIN((size_t)arg3, arg2len));
+ num_bytes = MIN((size_t)arg3, arg2len);
} else {
num_bytes = 0;
}
@@ -1809,12 +1809,12 @@ static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t le
unsigned char last_chars[2] = { 0, 0 };
while (len > 0) {
- inc_len = (*ptr == '\0' ? 1: php_mblen(ptr, len));
+ inc_len = (*ptr == '\0' ? 1 : php_mblen(ptr, len));
switch (inc_len) {
case -2:
case -1:
inc_len = 1;
- php_ignore_value(php_mblen(NULL, 0));
+ php_mb_reset();
break;
case 0:
goto quit_loop;
@@ -2070,7 +2070,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
zend_bool first_field = 1;
/* initialize internal state */
- php_ignore_value(php_mblen(NULL, 0));
+ php_mb_reset();
/* Now into new section that parses buf for delimiter/enclosure fields */
@@ -2096,7 +2096,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
tptr = temp;
- inc_len = (bptr < limit ? (*bptr == '\0' ? 1: php_mblen(bptr, limit - bptr)): 0);
+ inc_len = (bptr < limit ? (*bptr == '\0' ? 1 : php_mblen(bptr, limit - bptr)): 0);
if (inc_len == 1) {
char *tmp = bptr;
while ((*tmp != delimiter) && isspace((int)*(unsigned char *)tmp)) {
@@ -2185,7 +2185,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
case -2:
case -1:
- php_ignore_value(php_mblen(NULL, 0));
+ php_mb_reset();
/* break is omitted intentionally */
case 1:
/* we need to determine if the enclosure is
@@ -2240,7 +2240,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
}
break;
}
- inc_len = (bptr < limit ? (*bptr == '\0' ? 1: php_mblen(bptr, limit - bptr)): 0);
+ inc_len = (bptr < limit ? (*bptr == '\0' ? 1 : php_mblen(bptr, limit - bptr)): 0);
}
quit_loop_2:
@@ -2253,7 +2253,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
case -2:
case -1:
inc_len = 1;
- php_ignore_value(php_mblen(NULL, 0));
+ php_mb_reset();
/* break is omitted intentionally */
case 1:
if (*bptr == delimiter) {
@@ -2264,7 +2264,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
break;
}
bptr += inc_len;
- inc_len = (bptr < limit ? (*bptr == '\0' ? 1: php_mblen(bptr, limit - bptr)): 0);
+ inc_len = (bptr < limit ? (*bptr == '\0' ? 1 : php_mblen(bptr, limit - bptr)): 0);
}
quit_loop_3:
@@ -2284,7 +2284,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
case -2:
case -1:
inc_len = 1;
- php_ignore_value(php_mblen(NULL, 0));
+ php_mb_reset();
/* break is omitted intentionally */
case 1:
if (*bptr == delimiter) {
@@ -2295,7 +2295,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
break;
}
bptr += inc_len;
- inc_len = (bptr < limit ? (*bptr == '\0' ? 1: php_mblen(bptr, limit - bptr)): 0);
+ inc_len = (bptr < limit ? (*bptr == '\0' ? 1 : php_mblen(bptr, limit - bptr)): 0);
}
quit_loop_4:
memcpy(tptr, hunk_begin, bptr - hunk_begin);
diff --git a/ext/standard/file.h b/ext/standard/file.h
index 4551d5ec44..fdace75d3b 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 992f99d24e..6a06a55d94 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1235,18 +1235,18 @@ PHP_FUNCTION(realpath_cache_get)
/* bucket->key is unsigned long */
if (ZEND_LONG_MAX >= bucket->key) {
- add_assoc_long(&entry, "key", bucket->key);
+ add_assoc_long_ex(&entry, "key", sizeof("key") - 1, bucket->key);
} else {
- add_assoc_double(&entry, "key", (double)bucket->key);
+ add_assoc_double_ex(&entry, "key", sizeof("key") - 1, (double)bucket->key);
}
- add_assoc_bool(&entry, "is_dir", bucket->is_dir);
- add_assoc_stringl(&entry, "realpath", bucket->realpath, bucket->realpath_len);
- add_assoc_long(&entry, "expires", bucket->expires);
+ add_assoc_bool_ex(&entry, "is_dir", sizeof("is_dir") - 1, bucket->is_dir);
+ add_assoc_stringl_ex(&entry, "realpath", sizeof("realpath") - 1, bucket->realpath, bucket->realpath_len);
+ add_assoc_long_ex(&entry, "expires", sizeof("expires") - 1, bucket->expires);
#ifdef PHP_WIN32
- add_assoc_bool(&entry, "is_rvalid", bucket->is_rvalid);
- add_assoc_bool(&entry, "is_wvalid", bucket->is_wvalid);
- add_assoc_bool(&entry, "is_readable", bucket->is_readable);
- add_assoc_bool(&entry, "is_writable", bucket->is_writable);
+ add_assoc_bool_ex(&entry, "is_rvalid", sizeof("is_rvalid") - 1, bucket->is_rvalid);
+ add_assoc_bool_ex(&entry, "is_wvalid", sizeof("is_wvalid") - 1, bucket->is_wvalid);
+ add_assoc_bool_ex(&entry, "is_readable", sizeof("is_readable") - 1, bucket->is_readable);
+ add_assoc_bool_ex(&entry, "is_writable", sizeof("is_writable") - 1, bucket->is_writable);
#endif
zend_hash_str_update(Z_ARRVAL_P(return_value), bucket->path, bucket->path_len, &entry);
bucket = bucket->next;
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 9ab9f652fe..e76ddfb619 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -322,14 +322,14 @@ struct _php_conv {
typedef struct _php_conv_base64_encode {
php_conv _super;
- unsigned char erem[3];
+ const char *lbchars;
+ size_t lbchars_len;
size_t erem_len;
unsigned int line_ccnt;
unsigned int line_len;
- const char *lbchars;
int lbchars_dup;
- size_t lbchars_len;
int persistent;
+ unsigned char erem[3];
} php_conv_base64_encode;
static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *inst, const char **in_p, size_t *in_left, char **out_p, size_t *out_left);
@@ -735,12 +735,12 @@ static php_conv_err_t php_conv_base64_decode_convert(php_conv_base64_decode *ins
typedef struct _php_conv_qprint_encode {
php_conv _super;
+ const char *lbchars;
+ size_t lbchars_len;
int opts;
unsigned int line_ccnt;
unsigned int line_len;
- const char *lbchars;
int lbchars_dup;
- size_t lbchars_len;
int persistent;
unsigned int lb_ptr;
unsigned int lb_cnt;
@@ -987,11 +987,11 @@ static php_conv_err_t php_conv_qprint_encode_ctor(php_conv_qprint_encode *inst,
typedef struct _php_conv_qprint_decode {
php_conv _super;
+ const char *lbchars;
+ size_t lbchars_len;
int scan_stat;
unsigned int next_char;
- const char *lbchars;
int lbchars_dup;
- size_t lbchars_len;
int persistent;
unsigned int lb_ptr;
unsigned int lb_cnt;
@@ -1699,7 +1699,7 @@ static int strfilter_convert_append_bucket(
}
}
- if (out_buf_size - ocnt > 0) {
+ if (out_buf_size > ocnt) {
if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
goto out_failure;
}
@@ -1831,9 +1831,9 @@ static php_stream_filter_factory strfilter_convert_factory = {
/* {{{ consumed filter implementation */
typedef struct _php_consumed_filter_data {
- int persistent;
size_t consumed;
- off_t offset;
+ zend_off_t offset;
+ int persistent;
} php_consumed_filter_data;
static php_stream_filter_status_t consumed_filter_filter(
@@ -1926,8 +1926,8 @@ typedef enum _php_chunked_filter_state {
} php_chunked_filter_state;
typedef struct _php_chunked_filter_data {
- php_chunked_filter_state state;
size_t chunk_size;
+ php_chunked_filter_state state;
int persistent;
} php_chunked_filter_data;
diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c
index 05e0175311..d5d73f4c36 100644
--- a/ext/standard/flock_compat.c
+++ b/ext/standard/flock_compat.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h
index ab9c445561..14405022b6 100644
--- a/ext/standard/flock_compat.h
+++ b/ext/standard/flock_compat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 587474346a..4574667c94 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 4fcdff276a..090d3f8f32 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h
index 8ecb889162..7a9b67eb8c 100644
--- a/ext/standard/fsock.h
+++ b/ext/standard/fsock.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c
index 497b283524..536fccaa3e 100644
--- a/ext/standard/ftok.c
+++ b/ext/standard/ftok.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index cb96c190db..2bf4e02a41 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -636,7 +636,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
/* Trim off trailing whitespace characters */
tmp_len--;
- while (tmp_len >= 0 &&
+ while (tmp_len > 0 &&
(ent->d_name[tmp_len] == '\n' || ent->d_name[tmp_len] == '\r' ||
ent->d_name[tmp_len] == '\t' || ent->d_name[tmp_len] == ' ')) {
ent->d_name[tmp_len--] = '\0';
diff --git a/ext/standard/head.c b/ext/standard/head.c
index 9dae9f8759..3dd18ee0fd 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/head.h b/ext/standard/head.h
index 59b1518676..e32810a6f3 100644
--- a/ext/standard/head.h
+++ b/ext/standard/head.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/html.c b/ext/standard/html.c
index a7c58d5bce..dfe30d9b3e 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -392,9 +392,9 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
if (zenc != NULL) {
charset_hint = (char *)zend_multibyte_get_encoding_name(zenc);
if (charset_hint != NULL && (len=strlen(charset_hint)) != 0) {
- if ((len == 4) /* sizeof (none|auto|pass) */ &&
+ if ((len == 4) /* sizeof (auto|pass) */ &&
+ /* XXX should the "wchar" be ignored as well?? */
(!memcmp("pass", charset_hint, 4) ||
- !memcmp("auto", charset_hint, 4) ||
!memcmp("auto", charset_hint, 4))) {
charset_hint = NULL;
len = 0;
diff --git a/ext/standard/html.h b/ext/standard/html.h
index 0777130e0f..c7c297c90b 100644
--- a/ext/standard/html.h
+++ b/ext/standard/html.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/html_tables.h b/ext/standard/html_tables.h
index 83c78b5d78..4680343f2c 100644
--- a/ext/standard/html_tables.h
+++ b/ext/standard/html_tables.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1094,18 +1094,17 @@ static const uni_to_enc unimap_macroman[] = {
#define ENT_STAGE3_INDEX(k) ((k) & 0x3F)
#define ENT_CODE_POINT_FROM_STAGES(i,j,k) (((i) << 12) | ((j) << 6) | (k))
-/* Table should be organized with a leading row telling the size of
- * the table and the default entity (maybe NULL) and the rest being
- * normal rows ordered by code point so that we can do a binary search */
+/* The default entity may be NULL. Binary search is still possible while
+ is senseless as there are just two rows (see also find_entity_for_char()). */
typedef union {
struct {
- unsigned size; /* number of remaining entries in the table */
const char *default_entity;
+ unsigned size; /* number of remaining entries in the table */
unsigned short default_entity_len;
} leading_entry;
struct {
- unsigned second_cp; /* second code point */
const char *entity;
+ unsigned second_cp; /* second code point */
unsigned short entity_len;
} normal_entry;
} entity_multicodepoint_row;
@@ -1145,258 +1144,258 @@ typedef struct {
/* {{{ Start of double code point tables for HTML5 */
static const entity_multicodepoint_row multi_cp_html5_0003C[] = {
- { {01, "lt", 2} },
- { {0x020D2, "nvlt", 4} },
+ { {"lt", 01, 2} },
+ { {"nvlt", 0x020D2, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_0003D[] = {
- { {01, "equals", 6} },
- { {0x020E5, "bne", 3} },
+ { {"equals", 01, 6} },
+ { {"bne", 0x020E5, 3} },
};
static const entity_multicodepoint_row multi_cp_html5_0003E[] = {
- { {01, "gt", 2} },
- { {0x020D2, "nvgt", 4} },
+ { {"gt", 01, 2} },
+ { {"nvgt", 0x020D2, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_00066[] = {
- { {01, NULL , 0} },
- { {0x0006A, "fjlig", 5} },
+ { {NULL, 01, 0} },
+ { {"fjlig", 0x0006A, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_0205F[] = {
- { {01, "MediumSpace", 11} },
- { {0x0200A, "ThickSpace", 10} },
+ { {"MediumSpace", 01, 11} },
+ { {"ThickSpace", 0x0200A, 10} },
};
static const entity_multicodepoint_row multi_cp_html5_0219D[] = {
- { {01, "rarrw", 5} },
- { {0x00338, "nrarrw", 6} },
+ { {"rarrw", 01, 5} },
+ { {"nrarrw", 0x00338, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_02202[] = {
- { {01, "part", 4} },
- { {0x00338, "npart", 5} },
+ { {"part", 01, 4} },
+ { {"npart", 0x00338, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_02220[] = {
- { {01, "angle", 5} },
- { {0x020D2, "nang", 4} },
+ { {"angle", 01, 5} },
+ { {"nang", 0x020D2, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_02229[] = {
- { {01, "cap", 3} },
- { {0x0FE00, "caps", 4} },
+ { {"cap", 01, 3} },
+ { {"caps", 0x0FE00, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_0222A[] = {
- { {01, "cup", 3} },
- { {0x0FE00, "cups", 4} },
+ { {"cup", 01, 3} },
+ { {"cups", 0x0FE00, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_0223C[] = {
- { {01, "sim", 3} },
- { {0x020D2, "nvsim", 5} },
+ { {"sim", 01, 3} },
+ { {"nvsim", 0x020D2, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_0223D[] = {
- { {01, "bsim", 4} },
- { {0x00331, "race", 4} },
+ { {"bsim", 01, 4} },
+ { {"race", 0x00331, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_0223E[] = {
- { {01, "ac", 2} },
- { {0x00333, "acE", 3} },
+ { {"ac", 01, 2} },
+ { {"acE", 0x00333, 3} },
};
static const entity_multicodepoint_row multi_cp_html5_02242[] = {
- { {01, "esim", 4} },
- { {0x00338, "nesim", 5} },
+ { {"esim", 01, 4} },
+ { {"nesim", 0x00338, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_0224B[] = {
- { {01, "apid", 4} },
- { {0x00338, "napid", 5} },
+ { {"apid", 01, 4} },
+ { {"napid", 0x00338, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_0224D[] = {
- { {01, "CupCap", 6} },
- { {0x020D2, "nvap", 4} },
+ { {"CupCap", 01, 6} },
+ { {"nvap", 0x020D2, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_0224E[] = {
- { {01, "bump", 4} },
- { {0x00338, "nbump", 5} },
+ { {"bump", 01, 4} },
+ { {"nbump", 0x00338, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_0224F[] = {
- { {01, "HumpEqual", 9} },
- { {0x00338, "nbumpe", 6} },
+ { {"HumpEqual", 01, 9} },
+ { {"nbumpe", 0x00338, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_02250[] = {
- { {01, "esdot", 5} },
- { {0x00338, "nedot", 5} },
+ { {"esdot", 01, 5} },
+ { {"nedot", 0x00338, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_02261[] = {
- { {01, "Congruent", 9} },
- { {0x020E5, "bnequiv", 7} },
+ { {"Congruent", 01, 9} },
+ { {"bnequiv", 0x020E5, 7} },
};
static const entity_multicodepoint_row multi_cp_html5_02264[] = {
- { {01, "leq", 3} },
- { {0x020D2, "nvle", 4} },
+ { {"leq", 01, 3} },
+ { {"nvle", 0x020D2, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_02265[] = {
- { {01, "ge", 2} },
- { {0x020D2, "nvge", 4} },
+ { {"ge", 01, 2} },
+ { {"nvge", 0x020D2, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_02266[] = {
- { {01, "lE", 2} },
- { {0x00338, "nlE", 3} },
+ { {"lE", 01, 2} },
+ { {"nlE", 0x00338, 3} },
};
static const entity_multicodepoint_row multi_cp_html5_02267[] = {
- { {01, "geqq", 4} },
- { {0x00338, "NotGreaterFullEqual", 19} },
+ { {"geqq", 01, 4} },
+ { {"NotGreaterFullEqual", 0x00338, 19} },
};
static const entity_multicodepoint_row multi_cp_html5_02268[] = {
- { {01, "lneqq", 5} },
- { {0x0FE00, "lvertneqq", 9} },
+ { {"lneqq", 01, 5} },
+ { {"lvertneqq", 0x0FE00, 9} },
};
static const entity_multicodepoint_row multi_cp_html5_02269[] = {
- { {01, "gneqq", 5} },
- { {0x0FE00, "gvertneqq", 9} },
+ { {"gneqq", 01, 5} },
+ { {"gvertneqq", 0x0FE00, 9} },
};
static const entity_multicodepoint_row multi_cp_html5_0226A[] = {
- { {02, "ll", 2} },
- { {0x00338, "nLtv", 4} },
- { {0x020D2, "nLt", 3} },
+ { {"ll", 02, 2} },
+ { {"nLtv", 0x00338, 4} },
+ { {"nLt", 0x020D2, 3} },
};
static const entity_multicodepoint_row multi_cp_html5_0226B[] = {
- { {02, "gg", 2} },
- { {0x00338, "NotGreaterGreater", 17} },
- { {0x020D2, "nGt", 3} },
+ { {"gg", 02, 2} },
+ { {"NotGreaterGreater", 0x00338, 17} },
+ { {"nGt", 0x020D2, 3} },
};
static const entity_multicodepoint_row multi_cp_html5_0227F[] = {
- { {01, "SucceedsTilde", 13} },
- { {0x00338, "NotSucceedsTilde", 16} },
+ { {"SucceedsTilde", 01, 13} },
+ { {"NotSucceedsTilde", 0x00338, 16} },
};
static const entity_multicodepoint_row multi_cp_html5_02282[] = {
- { {01, "sub", 3} },
- { {0x020D2, "vnsub", 5} },
+ { {"sub", 01, 3} },
+ { {"vnsub", 0x020D2, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_02283[] = {
- { {01, "sup", 3} },
- { {0x020D2, "nsupset", 7} },
+ { {"sup", 01, 3} },
+ { {"nsupset", 0x020D2, 7} },
};
static const entity_multicodepoint_row multi_cp_html5_0228A[] = {
- { {01, "subsetneq", 9} },
- { {0x0FE00, "vsubne", 6} },
+ { {"subsetneq", 01, 9} },
+ { {"vsubne", 0x0FE00, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_0228B[] = {
- { {01, "supsetneq", 9} },
- { {0x0FE00, "vsupne", 6} },
+ { {"supsetneq", 01, 9} },
+ { {"vsupne", 0x0FE00, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_0228F[] = {
- { {01, "sqsub", 5} },
- { {0x00338, "NotSquareSubset", 15} },
+ { {"sqsub", 01, 5} },
+ { {"NotSquareSubset", 0x00338, 15} },
};
static const entity_multicodepoint_row multi_cp_html5_02290[] = {
- { {01, "sqsupset", 8} },
- { {0x00338, "NotSquareSuperset", 17} },
+ { {"sqsupset", 01, 8} },
+ { {"NotSquareSuperset", 0x00338, 17} },
};
static const entity_multicodepoint_row multi_cp_html5_02293[] = {
- { {01, "sqcap", 5} },
- { {0x0FE00, "sqcaps", 6} },
+ { {"sqcap", 01, 5} },
+ { {"sqcaps", 0x0FE00, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_02294[] = {
- { {01, "sqcup", 5} },
- { {0x0FE00, "sqcups", 6} },
+ { {"sqcup", 01, 5} },
+ { {"sqcups", 0x0FE00, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_022B4[] = {
- { {01, "LeftTriangleEqual", 17} },
- { {0x020D2, "nvltrie", 7} },
+ { {"LeftTriangleEqual", 01, 17} },
+ { {"nvltrie", 0x020D2, 7} },
};
static const entity_multicodepoint_row multi_cp_html5_022B5[] = {
- { {01, "RightTriangleEqual", 18} },
- { {0x020D2, "nvrtrie", 7} },
+ { {"RightTriangleEqual", 01, 18} },
+ { {"nvrtrie", 0x020D2, 7} },
};
static const entity_multicodepoint_row multi_cp_html5_022D8[] = {
- { {01, "Ll", 2} },
- { {0x00338, "nLl", 3} },
+ { {"Ll", 01, 2} },
+ { {"nLl", 0x00338, 3} },
};
static const entity_multicodepoint_row multi_cp_html5_022D9[] = {
- { {01, "Gg", 2} },
- { {0x00338, "nGg", 3} },
+ { {"Gg", 01, 2} },
+ { {"nGg", 0x00338, 3} },
};
static const entity_multicodepoint_row multi_cp_html5_022DA[] = {
- { {01, "lesseqgtr", 9} },
- { {0x0FE00, "lesg", 4} },
+ { {"lesseqgtr", 01, 9} },
+ { {"lesg", 0x0FE00, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_022DB[] = {
- { {01, "gtreqless", 9} },
- { {0x0FE00, "gesl", 4} },
+ { {"gtreqless", 01, 9} },
+ { {"gesl", 0x0FE00, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_022F5[] = {
- { {01, "isindot", 7} },
- { {0x00338, "notindot", 8} },
+ { {"isindot", 01, 7} },
+ { {"notindot", 0x00338, 8} },
};
static const entity_multicodepoint_row multi_cp_html5_022F9[] = {
- { {01, "isinE", 5} },
- { {0x00338, "notinE", 6} },
+ { {"isinE", 01, 5} },
+ { {"notinE", 0x00338, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_02933[] = {
- { {01, "rarrc", 5} },
- { {0x00338, "nrarrc", 6} },
+ { {"rarrc", 01, 5} },
+ { {"nrarrc", 0x00338, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_029CF[] = {
- { {01, "LeftTriangleBar", 15} },
- { {0x00338, "NotLeftTriangleBar", 18} },
+ { {"LeftTriangleBar", 01, 15} },
+ { {"NotLeftTriangleBar", 0x00338, 18} },
};
static const entity_multicodepoint_row multi_cp_html5_029D0[] = {
- { {01, "RightTriangleBar", 16} },
- { {0x00338, "NotRightTriangleBar", 19} },
+ { {"RightTriangleBar", 01, 16} },
+ { {"NotRightTriangleBar", 0x00338, 19} },
};
static const entity_multicodepoint_row multi_cp_html5_02A6D[] = {
- { {01, "congdot", 7} },
- { {0x00338, "ncongdot", 8} },
+ { {"congdot", 01, 7} },
+ { {"ncongdot", 0x00338, 8} },
};
static const entity_multicodepoint_row multi_cp_html5_02A70[] = {
- { {01, "apE", 3} },
- { {0x00338, "napE", 4} },
+ { {"apE", 01, 3} },
+ { {"napE", 0x00338, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_02A7D[] = {
- { {01, "les", 3} },
- { {0x00338, "nles", 4} },
+ { {"les", 01, 3} },
+ { {"nles", 0x00338, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_02A7E[] = {
- { {01, "ges", 3} },
- { {0x00338, "nges", 4} },
+ { {"ges", 01, 3} },
+ { {"nges", 0x00338, 4} },
};
static const entity_multicodepoint_row multi_cp_html5_02AA1[] = {
- { {01, "LessLess", 8} },
- { {0x00338, "NotNestedLessLess", 17} },
+ { {"LessLess", 01, 8} },
+ { {"NotNestedLessLess", 0x00338, 17} },
};
static const entity_multicodepoint_row multi_cp_html5_02AA2[] = {
- { {01, "GreaterGreater", 14} },
- { {0x00338, "NotNestedGreaterGreater", 23} },
+ { {"GreaterGreater", 01, 14} },
+ { {"NotNestedGreaterGreater", 0x00338, 23} },
};
static const entity_multicodepoint_row multi_cp_html5_02AAC[] = {
- { {01, "smte", 4} },
- { {0x0FE00, "smtes", 5} },
+ { {"smte", 01, 4} },
+ { {"smtes", 0x0FE00, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_02AAD[] = {
- { {01, "late", 4} },
- { {0x0FE00, "lates", 5} },
+ { {"late", 01, 4} },
+ { {"lates", 0x0FE00, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_02AAF[] = {
- { {01, "preceq", 6} },
- { {0x00338, "NotPrecedesEqual", 16} },
+ { {"preceq", 01, 6} },
+ { {"NotPrecedesEqual", 0x00338, 16} },
};
static const entity_multicodepoint_row multi_cp_html5_02AB0[] = {
- { {01, "SucceedsEqual", 13} },
- { {0x00338, "NotSucceedsEqual", 16} },
+ { {"SucceedsEqual", 01, 13} },
+ { {"NotSucceedsEqual", 0x00338, 16} },
};
static const entity_multicodepoint_row multi_cp_html5_02AC5[] = {
- { {01, "subE", 4} },
- { {0x00338, "nsubE", 5} },
+ { {"subE", 01, 4} },
+ { {"nsubE", 0x00338, 5} },
};
static const entity_multicodepoint_row multi_cp_html5_02AC6[] = {
- { {01, "supseteqq", 9} },
- { {0x00338, "nsupseteqq", 10} },
+ { {"supseteqq", 01, 9} },
+ { {"nsupseteqq", 0x00338, 10} },
};
static const entity_multicodepoint_row multi_cp_html5_02ACB[] = {
- { {01, "subsetneqq", 10} },
- { {0x0FE00, "vsubnE", 6} },
+ { {"subsetneqq", 01, 10} },
+ { {"vsubnE", 0x0FE00, 6} },
};
static const entity_multicodepoint_row multi_cp_html5_02ACC[] = {
- { {01, "supnE", 5} },
- { {0x0FE00, "varsupsetneqq", 13} },
+ { {"supnE", 01, 5} },
+ { {"varsupsetneqq", 0x0FE00, 13} },
};
static const entity_multicodepoint_row multi_cp_html5_02AFD[] = {
- { {01, "parsl", 5} },
- { {0x020E5, "nparsl", 6} },
+ { {"parsl", 01, 5} },
+ { {"nparsl", 0x020E5, 6} },
};
/* End of double code point tables }}} */
diff --git a/ext/standard/html_tables/html_table_gen.php b/ext/standard/html_tables/html_table_gen.php
index 2aae24475a..45ae5f832b 100644
--- a/ext/standard/html_tables/html_table_gen.php
+++ b/ext/standard/html_tables/html_table_gen.php
@@ -1,7 +1,7 @@
<?php
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
@@ -23,7 +23,7 @@
$t = <<<CODE
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-%s The PHP Group |
+----------------------------------------------------------------------+
@@ -371,18 +371,17 @@ $t = <<<'CODE'
#define ENT_STAGE3_INDEX(k) ((k) & 0x3F)
#define ENT_CODE_POINT_FROM_STAGES(i,j,k) (((i) << 12) | ((j) << 6) | (k))
-/* Table should be organized with a leading row telling the size of
- * the table and the default entity (maybe NULL) and the rest being
- * normal rows ordered by code point so that we can do a binary search */
+/* The default entity may be NULL. Binary search is still possible while
+ is senseless as there are just two rows (see also find_entity_for_char()). */
typedef union {
struct {
- unsigned size; /* number of remaining entries in the table */
const char *default_entity;
+ unsigned size; /* number of remaining entries in the table */
unsigned short default_entity_len;
} leading_entry;
struct {
- unsigned second_cp; /* second code point */
const char *entity;
+ unsigned second_cp; /* second code point */
unsigned short entity_len;
} normal_entry;
} entity_multicodepoint_row;
@@ -475,16 +474,16 @@ foreach ($multicp_rows as $k => $v) {
if (key_exists("default", $v)) {
if ($v['default'] == 'GT') /* hack to make > translate to &gt; not GT; */
$v['default'] = "gt";
- echo "\t{ {", sprintf("%02d", count($v) - 1),
- ",\t\t", sprintf("\"%-21s", $v["default"].'",'), "\t",
+ echo "\t{ {", sprintf("\"%-21s", $v["default"].'",'),
+ "\t", sprintf("%02d", (count($v) - 1)), ",\t\t",
sprintf("% 2d", strlen($v["default"])), '} },', "\n";
} else {
- echo "\t{ {", sprintf("%02d", count($v)),
- ",\t\t", sprintf("%-22s", 'NULL'), ",\t0} },\n";
+ echo "\t{ {", sprintf("%-22s", 'NULL,'),
+ "\t", sprintf("%02d", count($v)), ",\t\t0} },\n";
}
unset($v["default"]);
foreach ($v as $l => $w) {
- echo "\t{ {", sprintf("0x%05s", $l), ",\t", sprintf("\"%-21s", $w.'",'), "\t",
+ echo "\t{ {", sprintf("\"%-21s", $w.'",'), "\t", sprintf("0x%05s", $l), ",\t",
sprintf("% 2d", strlen($w)), '} },', "\n";
}
echo "};\n";
diff --git a/ext/standard/http.c b/ext/standard/http.c
index 62b05ed7b5..45ff3890aa 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -66,7 +66,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
/* private or protected property access outside of the class */
continue;
}
- zend_unmangle_property_name_ex(key->val, key->len, &tmp, &prop_name, (int *)&prop_len);
+ zend_unmangle_property_name_ex(key, &tmp, &prop_name, &prop_len);
} else {
prop_name = key->val;
prop_len = key->len;
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 4bf86a4947..83e894c123 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -437,7 +437,7 @@ finish:
/* Remove newlines and spaces from start and end php_trim will estrndup() */
tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC);
}
- if (tmp && strlen(tmp) > 0) {
+ if (tmp && tmp[0] != '\0') {
char *s;
user_headers = estrdup(tmp);
diff --git a/ext/standard/image.c b/ext/standard/image.c
index b2b5dcd369..54159e3785 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -366,8 +366,8 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC)
{
unsigned char a[2];
- /* just return 0 if we hit the end-of-file */
- if((php_stream_read(stream, (char*)a, sizeof(a))) <= 0) return 0;
+ /* return 0 if we couldn't read enough data */
+ if((php_stream_read(stream, a, sizeof(a))) < sizeof(a)) return 0;
return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]);
}
@@ -647,7 +647,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
#endif
result->channels = php_read2(stream TSRMLS_CC); /* Csiz */
- if (result->channels < 0 || result->channels > 256) {
+ if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) {
efree(result);
return NULL;
}
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index 4a6a39d4ed..011407da29 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 49244c6676..bc0ddddcc0 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -219,7 +219,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
php_info_print(string_key->val);
}
} else {
- php_info_printf("%pd", num_key);
+ php_info_printf(ZEND_ULONG_FMT, num_key);
}
php_info_print("\"]");
if (!sapi_module.phpinfo_as_text) {
@@ -585,6 +585,8 @@ PHPAPI zend_string *php_get_uname(char mode)
char *winver = php_get_windows_name();
char wincpu[20];
+ ZEND_ASSERT(winver != NULL);
+
php_get_windows_cpu(wincpu, sizeof(wincpu));
dwBuild = (DWORD)(HIWORD(dwVersion));
@@ -1187,7 +1189,7 @@ PHP_FUNCTION(phpinfo)
PHP_FUNCTION(phpversion)
{
char *ext_name = NULL;
- int ext_name_len = 0;
+ size_t ext_name_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ext_name, &ext_name_len) == FAILURE) {
return;
diff --git a/ext/standard/info.h b/ext/standard/info.h
index 8be58160ed..a28ac564ab 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index e815c6bfb1..692d856757 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index 051dfc61c8..8bfa05555b 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index 14d75bf571..df822f45d4 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/link.c b/ext/standard/link.c
index fcd6b8eed9..4618ffe983 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c
index a1b745af8d..ab904d9571 100644
--- a/ext/standard/link_win32.c
+++ b/ext/standard/link_win32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 3404ebe2ac..96363f4cb9 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/math.c b/ext/standard/math.c
index a1dda23eda..4185cd48f4 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -219,7 +219,16 @@ static double php_asinh(double z)
#ifdef HAVE_ASINH
return(asinh(z));
#else
+# ifdef _WIN64
+ if (z > 0) {
+ return log(z + sqrt(z * z + 1));
+ }
+ else {
+ return -log(-z + sqrt(z * z + 1));
+ }
+# else
return(log(z + sqrt(1 + pow(z, 2))) / log(M_E));
+# endif
#endif
}
/* }}} */
@@ -231,7 +240,15 @@ static double php_acosh(double x)
#ifdef HAVE_ACOSH
return(acosh(x));
#else
+# ifdef _WIN64
+ if (x >= 1) {
+ return log(x + sqrt(x * x - 1));
+ } else {
+ return (DBL_MAX+DBL_MAX)-(DBL_MAX+DBL_MAX);
+ }
+# else
return(log(x + sqrt(x * x - 1)));
+# endif
#endif
}
/* }}} */
diff --git a/ext/standard/md5.c b/ext/standard/md5.c
index 4938babf7a..dc241180ed 100644
--- a/ext/standard/md5.c
+++ b/ext/standard/md5.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -99,14 +99,18 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
PHP_MD5Update(&context, buf, n);
}
- PHP_MD5Final(digest, &context);
-
- php_stream_close(stream);
+ /* XXX this probably can be improved with some number of retries */
+ if (!php_stream_eof(stream)) {
+ php_stream_close(stream);
+ PHP_MD5Final(digest, &context);
- if (n<0) {
RETURN_FALSE;
}
+ php_stream_close(stream);
+
+ PHP_MD5Final(digest, &context);
+
if (raw_output) {
RETURN_STRINGL(digest, 16);
} else {
@@ -384,5 +388,5 @@ PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx)
result[14] = ctx->d >> 16;
result[15] = ctx->d >> 24;
- memset(ctx, 0, sizeof(*ctx));
+ ZEND_SECURE_ZERO(ctx, sizeof(*ctx));
}
diff --git a/ext/standard/md5.h b/ext/standard/md5.h
index 43f425e402..d62ade6b26 100644
--- a/ext/standard/md5.h
+++ b/ext/standard/md5.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index f2feb72ebf..5327869a50 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c
index e20223b011..811731ee20 100644
--- a/ext/standard/microtime.c
+++ b/ext/standard/microtime.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/microtime.h b/ext/standard/microtime.h
index 2af8a677c5..0a8b0dc666 100644
--- a/ext/standard/microtime.h
+++ b/ext/standard/microtime.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index d0792c1c17..f2bcb09723 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/pack.h b/ext/standard/pack.h
index 601cc202c2..dc4c7d6173 100644
--- a/ext/standard/pack.h
+++ b/ext/standard/pack.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c
index 61a4ae6ec2..8db9995d27 100644
--- a/ext/standard/pageinfo.c
+++ b/ext/standard/pageinfo.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h
index 204fb85c19..ec5823246a 100644
--- a/ext/standard/pageinfo.h
+++ b/ext/standard/pageinfo.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/password.c b/ext/standard/password.c
index 4fc93c3416..0f75272d0e 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -86,7 +86,7 @@ static int php_password_salt_to64(const char *str, const size_t str_len, const s
if ((int) str_len < 0) {
return FAILURE;
}
- buffer = php_base64_encode((unsigned char*) str, (int) str_len);
+ buffer = php_base64_encode((unsigned char*) str, str_len);
if (buffer->len < out_len) {
/* Too short of an encoded string generated */
zend_string_release(buffer);
@@ -163,7 +163,7 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
efree(result);
return FAILURE;
}
- memcpy(ret, result, (int) length);
+ memcpy(ret, result, length);
efree(result);
efree(buffer);
ret[length] = 0;
@@ -182,11 +182,6 @@ PHP_FUNCTION(password_get_info)
return;
}
- if (hash_len < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied password hash too long to safely identify");
- RETURN_FALSE;
- }
-
array_init(&options);
algo = php_password_determine_algo(hash, (size_t) hash_len);
@@ -225,11 +220,6 @@ PHP_FUNCTION(password_needs_rehash)
return;
}
- if (hash_len < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied password hash too long to safely identify");
- RETURN_FALSE;
- }
-
algo = php_password_determine_algo(hash, (size_t) hash_len);
if (algo != new_algo) {
@@ -342,7 +332,7 @@ PHP_FUNCTION(password_hash)
required_salt_len = 22;
hash_format = emalloc(8);
- sprintf(hash_format, "$2y$%02ld$", cost);
+ sprintf(hash_format, "$2y$%02ld$", (long) cost);
hash_format_len = 7;
}
break;
@@ -409,7 +399,7 @@ PHP_FUNCTION(password_hash)
salt_len = required_salt_len;
} else {
salt = safe_emalloc(required_salt_len, 1, 1);
- memcpy(salt, buffer, (int) required_salt_len);
+ memcpy(salt, buffer, required_salt_len);
salt_len = required_salt_len;
}
efree(buffer);
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index c001ee5509..d86121b277 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h
index 04c85427c3..d8029b2f4f 100644
--- a/ext/standard/php_assert.h
+++ b/ext/standard/php_assert.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h
index dbe1891af3..467809dbf5 100644
--- a/ext/standard/php_browscap.h
+++ b/ext/standard/php_browscap.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h
index a23811c320..c861187649 100644
--- a/ext/standard/php_crypt.h
+++ b/ext/standard/php_crypt.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c
index 3098f247ef..dc4e27b112 100644
--- a/ext/standard/php_crypt_r.c
+++ b/ext/standard/php_crypt_r.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -206,7 +206,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
}
/* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof(final));
+ ZEND_SECURE_ZERO(final, sizeof(final));
/* Then something really weird... */
for (i = pwl; i != 0; i >>= 1) {
@@ -288,7 +288,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
*p = '\0';
- memset(final, 0, sizeof(final));
+ ZEND_SECURE_ZERO(final, sizeof(final));
_destroyCtx1:
diff --git a/ext/standard/php_crypt_r.h b/ext/standard/php_crypt_r.h
index 8b78d95d3d..da5744c9df 100644
--- a/ext/standard/php_crypt_r.h
+++ b/ext/standard/php_crypt_r.h
@@ -1,7 +1,7 @@
/* $Id$ */
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h
index 2b9313aac4..c7999277da 100644
--- a/ext/standard/php_dir.h
+++ b/ext/standard/php_dir.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h
index 5823f5f20f..f37bce539a 100644
--- a/ext/standard/php_dns.h
+++ b/ext/standard/php_dns.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h
index e3fc582cd2..6e915bdf1d 100644
--- a/ext/standard/php_ext_syslog.h
+++ b/ext/standard/php_ext_syslog.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h
index 4f29553aea..e32c4a2cb9 100644
--- a/ext/standard/php_filestat.h
+++ b/ext/standard/php_filestat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 3859e5b9a4..575e8fff98 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 341c7ad829..084efc291c 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_ftok.h b/ext/standard/php_ftok.h
index 7e702c942f..54666031fe 100644
--- a/ext/standard/php_ftok.h
+++ b/ext/standard/php_ftok.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h
index 54321b39a2..0351b2a59c 100644
--- a/ext/standard/php_http.h
+++ b/ext/standard/php_http.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h
index c8bb4ccc7a..3853b0e6c3 100644
--- a/ext/standard/php_image.h
+++ b/ext/standard/php_image.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index efca24acce..6001e35bbe 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_iptc.h b/ext/standard/php_iptc.h
index a076aea343..af0269ce78 100644
--- a/ext/standard/php_iptc.h
+++ b/ext/standard/php_iptc.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h
index 82141e6af2..dcc82e9511 100644
--- a/ext/standard/php_lcg.h
+++ b/ext/standard/php_lcg.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_link.h b/ext/standard/php_link.h
index 1ca4acee25..2633a33ae4 100644
--- a/ext/standard/php_link.h
+++ b/ext/standard/php_link.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h
index 925f58ebd5..f7ee5e983a 100644
--- a/ext/standard/php_mail.h
+++ b/ext/standard/php_mail.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h
index afdf54166f..7fb6909e7f 100644
--- a/ext/standard/php_math.h
+++ b/ext/standard/php_math.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h
index 14da9d8191..100b1a8bc2 100644
--- a/ext/standard/php_metaphone.h
+++ b/ext/standard/php_metaphone.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_password.h b/ext/standard/php_password.h
index a38af97626..66adc07934 100644
--- a/ext/standard/php_password.h
+++ b/ext/standard/php_password.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h
index 6ec0f38706..bbdf16d385 100644
--- a/ext/standard/php_rand.h
+++ b/ext/standard/php_rand.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h
index c153fa884c..e32def2307 100644
--- a/ext/standard/php_smart_str.h
+++ b/ext/standard/php_smart_str.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -24,15 +24,7 @@
#include "php_smart_str_public.h"
#include <stdlib.h>
-#ifndef SMART_STR_USE_REALLOC
#include <zend.h>
-#endif
-
-#define smart_str_0(x) do { \
- if ((x)->s) { \
- (x)->s->val[(x)->s->len] = '\0'; \
- } \
-} while (0)
#ifndef SMART_STR_PREALLOC
#define SMART_STR_PREALLOC 128
@@ -42,132 +34,91 @@
#define SMART_STR_START_SIZE 78
#endif
-
-#ifdef SMART_STR_USE_REALLOC
-#define SMART_STR_DO_REALLOC(b, w) do { \
- int oldlen = (b)->s->len; \
- (b)->s = erealloc((buf)->s, _STR_HEADER_SIZE + (b)->a + 1); \
- (b)->s->len = oldlen; \
-} while (0)
-#else
-#define SMART_STR_DO_REALLOC(b, w) do { \
- (b)->s = perealloc((b)->s, _STR_HEADER_SIZE + (b)->a + 1, (w)); \
-} while (0)
-#endif
-
-
-#define smart_str_alloc4(d, n, what, newlen) do { \
- if (!(d)->s) { \
- newlen = (n); \
- (d)->a = newlen < SMART_STR_START_SIZE \
- ? SMART_STR_START_SIZE \
- : newlen + SMART_STR_PREALLOC; \
- (d)->s = zend_string_alloc((d)->a, (what)); \
- (d)->s->len = 0; \
- } else { \
- newlen = (d)->s->len + (n); \
- if (newlen >= (d)->a) { \
- (d)->a = newlen + SMART_STR_PREALLOC; \
- SMART_STR_DO_REALLOC((d), (what)); \
- } \
- } \
-} while (0)
-
-#define smart_str_alloc(d, n, what) \
- smart_str_alloc4((d), (n), (what), newlen)
-
/* wrapper */
#define smart_str_appends_ex(dest, src, what) \
smart_str_appendl_ex((dest), (src), strlen(src), (what))
#define smart_str_appends(dest, src) \
smart_str_appendl((dest), (src), strlen(src))
-
#define smart_str_appendc(dest, c) \
smart_str_appendc_ex((dest), (c), 0)
-#define smart_str_free(s) \
- smart_str_free_ex((s), 0)
#define smart_str_appendl(dest, src, len) \
smart_str_appendl_ex((dest), (src), (len), 0)
#define smart_str_append(dest, src) \
smart_str_append_ex((dest), (src), 0)
+#define smart_str_sets(dest, src) \
+ smart_str_setl((dest), (src), strlen(src));
#define smart_str_append_long(dest, val) \
smart_str_append_long_ex((dest), (val), 0)
-#define smart_str_append_off_t(dest, val) \
- smart_str_append_off_t_ex((dest), (val), 0)
#define smart_str_append_unsigned(dest, val) \
smart_str_append_unsigned_ex((dest), (val), 0)
-#define smart_str_appendc_ex(dest, ch, what) do { \
- register size_t __nl; \
- smart_str_alloc4((dest), 1, (what), __nl); \
- (dest)->s->len = __nl; \
- ((unsigned char *) (dest)->s->val)[(dest)->s->len - 1] = (ch); \
-} while (0)
-
-#define smart_str_free_ex(buf, what) do { \
- smart_str *__s = (smart_str *) (buf); \
- if (__s->s) { \
- zend_string_release(__s->s); \
- __s->s = NULL; \
- } \
- __s->a = 0; \
-} while (0)
-
-#define smart_str_appendl_ex(dest, src, nlen, what) do { \
- register size_t __nl; \
- smart_str *__dest = (smart_str *) (dest); \
- \
- smart_str_alloc4(__dest, (nlen), (what), __nl); \
- memcpy(__dest->s->val + __dest->s->len, (src), (nlen)); \
- __dest->s->len = __nl; \
-} while (0)
+static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, zend_bool persistent) {
+ size_t newlen;
+ if (!str->s) {
+ newlen = len;
+ str->a = newlen < SMART_STR_START_SIZE
+ ? SMART_STR_START_SIZE
+ : newlen + SMART_STR_PREALLOC;
+ str->s = zend_string_alloc(str->a, persistent);
+ str->s->len = 0;
+ } else {
+ newlen = str->s->len + len;
+ if (newlen >= str->a) {
+ str->a = newlen + SMART_STR_PREALLOC;
+ str->s = (zend_string *) perealloc(str->s, _STR_HEADER_SIZE + str->a + 1, persistent);
+ }
+ }
+ return newlen;
+}
-/*
- * these could be replaced using a braced-group inside an expression
- * for GCC compatible compilers, e.g.
- *
- * #define f(..) ({char *r;..;__r;})
- */
-
-static inline char *smart_str_print_long(char *buf, zend_long num) {
- char *r;
- _zend_print_signed_to_buf(buf, num, zend_long, r);
- return r;
+static zend_always_inline void smart_str_free(smart_str *str) {
+ if (str->s) {
+ zend_string_release(str->s);
+ str->s = NULL;
+ }
+ str->a = 0;
}
-static inline char *smart_str_print_unsigned(char *buf, zend_long num) {
- char *r;
- _zend_print_unsigned_to_buf(buf, num, zend_ulong, r);
- return r;
+static zend_always_inline void smart_str_0(smart_str *str) {
+ if (str->s) {
+ str->s->val[str->s->len] = '\0';
+ }
}
-#define smart_str_append_generic_ex(dest, num, type, vartype, func) do { \
- char __b[32]; \
- char *__t; \
- _zend_print##func##_to_buf (__b + sizeof(__b) - 1, (num), vartype, __t); \
- smart_str_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type)); \
-} while (0)
-
-#define smart_str_append_unsigned_ex(dest, num, type) \
- smart_str_append_generic_ex((dest), (num), (type), zend_ulong, _unsigned)
+static zend_always_inline void smart_str_appendc_ex(smart_str *dest, char ch, zend_bool persistent) {
+ size_t new_len = smart_str_alloc(dest, 1, persistent);
+ dest->s->val[new_len - 1] = ch;
+ dest->s->len = new_len;
+}
-#define smart_str_append_long_ex(dest, num, type) \
- smart_str_append_generic_ex((dest), (num), (type), zend_ulong, _signed)
+static zend_always_inline void smart_str_appendl_ex(smart_str *dest, const char *str, size_t len, zend_bool persistent) {
+ size_t new_len = smart_str_alloc(dest, len, persistent);
+ memcpy(dest->s->val + dest->s->len, str, len);
+ dest->s->len = new_len;
+}
-#define smart_str_append_off_t_ex(dest, num, type) \
- smart_str_append_generic_ex((dest), (num), (type), zend_off_t, _signed)
+static zend_always_inline void smart_str_append_ex(smart_str *dest, const smart_str *src, zend_bool persistent) {
+ if (src->s && src->s->len) {
+ smart_str_appendl_ex(dest, src->s->val, src->s->len, persistent);
+ }
+}
-#define smart_str_append_ex(dest, src, what) \
- smart_str_appendl_ex((dest), ((smart_str *)(src))->s->val, \
- ((smart_str *)(src))->s->len, (what));
+static zend_always_inline void smart_str_append_long_ex(smart_str *dest, zend_long num, zend_bool persistent) {
+ char buf[32];
+ char *result = zend_print_long_to_buf(buf + sizeof(buf) - 1, num);
+ smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent);
+}
-#define smart_str_setl(dest, src, nlen) do { \
- smart_str_free((dest)); \
- smart_str_appendl_ex((dest), (src), (nlen), 0); \
-} while (0)
+static zend_always_inline void smart_str_append_unsigned_ex(smart_str *dest, zend_ulong num, zend_bool persistent) {
+ char buf[32];
+ char *result = zend_print_ulong_to_buf(buf + sizeof(buf) - 1, num);
+ smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent);
+}
-#define smart_str_sets(dest, src) \
- smart_str_setl((dest), (src), strlen(src));
+static zend_always_inline void smart_str_setl(smart_str *dest, const char *src, size_t len) {
+ smart_str_free(dest);
+ smart_str_appendl(dest, src, len);
+}
#endif
diff --git a/ext/standard/php_smart_str_public.h b/ext/standard/php_smart_str_public.h
index 7ce299e442..e33348efd6 100644
--- a/ext/standard/php_smart_str_public.h
+++ b/ext/standard/php_smart_str_public.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_smart_string.h b/ext/standard/php_smart_string.h
index 91530d94d3..e052574a34 100644
--- a/ext/standard/php_smart_string.h
+++ b/ext/standard/php_smart_string.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -89,8 +89,6 @@
smart_string_append_ex((dest), (src), 0)
#define smart_string_append_long(dest, val) \
smart_string_append_long_ex((dest), (val), 0)
-#define smart_string_append_off_t(dest, val) \
- smart_string_append_off_t_ex((dest), (val), 0)
#define smart_string_append_unsigned(dest, val) \
smart_string_append_unsigned_ex((dest), (val), 0)
@@ -119,33 +117,17 @@
__dest->len = __nl; \
} while (0)
-static inline char *smart_string_print_long(char *buf, zend_long num) {
- char *r;
- _zend_print_signed_to_buf(buf, num, unsigned long, r);
- return r;
-}
-
-static inline char *smart_string_print_unsigned(char *buf, zend_long num) {
- char *r;
- _zend_print_unsigned_to_buf(buf, num, unsigned long, r);
- return r;
-}
-
#define smart_string_append_generic_ex(dest, num, type, vartype, func) do { \
char __b[32]; \
- char *__t; \
- _zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num), vartype, __t); \
+ char *__t = zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num)); \
smart_string_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type)); \
} while (0)
#define smart_string_append_unsigned_ex(dest, num, type) \
- smart_string_append_generic_ex((dest), (num), (type), unsigned long, _unsigned)
+ smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _ulong)
#define smart_string_append_long_ex(dest, num, type) \
- smart_string_append_generic_ex((dest), (num), (type), unsigned long, _signed)
-
-#define smart_string_append_off_t_ex(dest, num, type) \
- smart_string_append_generic_ex((dest), (num), (type), off_t, _signed)
+ smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _long)
#define smart_string_append_ex(dest, src, what) \
smart_string_appendl_ex((dest), ((smart_string *)(src))->c, \
diff --git a/ext/standard/php_smart_string_public.h b/ext/standard/php_smart_string_public.h
index 215f182224..d4cd1180a4 100644
--- a/ext/standard/php_smart_string_public.h
+++ b/ext/standard/php_smart_string_public.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h
index d7476cb397..5f1716d849 100644
--- a/ext/standard/php_standard.h
+++ b/ext/standard/php_standard.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index e0ffff5e23..9e872222fd 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -154,12 +154,13 @@ PHPAPI char *php_strerror(int errnum);
#ifndef HAVE_MBLEN
# define php_mblen(ptr, len) 1
+# define php_mb_reset()
+#elif defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
+# define php_mblen(ptr, len) ((int) mbrlen(ptr, len, &BG(mblen_state)))
+# define php_mb_reset() memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)))
#else
-# if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
-# define php_mblen(ptr, len) ((ptr) == NULL ? memset(&BG(mblen_state), 0, sizeof(BG(mblen_state))): (int)mbrlen(ptr, len, &BG(mblen_state)))
-# else
-# define php_mblen(ptr, len) mblen(ptr, len)
-# endif
+# define php_mblen(ptr, len) mblen(ptr, len)
+# define php_mb_reset() mblen(NULL, 0)
#endif
void register_string_constants(INIT_FUNC_ARGS);
diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h
index 8b71f87e5e..e6d8152b1b 100644
--- a/ext/standard/php_type.h
+++ b/ext/standard/php_type.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h
index f1dda2de45..0c8ceb72a3 100644
--- a/ext/standard/php_uuencode.h
+++ b/ext/standard/php_uuencode.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index 2dc13f4012..5a9aae1a24 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h
index b3ea4f8f4d..3e34b8f8be 100644
--- a/ext/standard/php_versioning.h
+++ b/ext/standard/php_versioning.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 8f79fffdf8..66c0c2e7e3 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h
index 8545f201f2..955cca2e3d 100644
--- a/ext/standard/proc_open.h
+++ b/ext/standard/proc_open.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c
index 8abccaf820..c7eddc576b 100644
--- a/ext/standard/quot_print.c
+++ b/ext/standard/quot_print.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h
index 7055d05717..99d3db8451 100644
--- a/ext/standard/quot_print.h
+++ b/ext/standard/quot_print.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index fdc86632cd..55388e3c13 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c
index 83fd551c19..62437831bb 100644
--- a/ext/standard/scanf.c
+++ b/ext/standard/scanf.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h
index 8d5fee22e1..ddb9803512 100644
--- a/ext/standard/scanf.h
+++ b/ext/standard/scanf.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c
index 8a05f50416..cd8b82f5e1 100644
--- a/ext/standard/sha1.c
+++ b/ext/standard/sha1.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h
index f852386a62..14787892e7 100644
--- a/ext/standard/sha1.h
+++ b/ext/standard/sha1.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c
index ede06637fa..feb9a6780e 100644
--- a/ext/standard/soundex.c
+++ b/ext/standard/soundex.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 5557ba1356..f864994d28 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h
index 926cf2d5b5..a65f86e3a4 100644
--- a/ext/standard/streamsfuncs.h
+++ b/ext/standard/streamsfuncs.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/string.c b/ext/standard/string.c
index a85a73fe6a..559fb8b57f 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -780,7 +780,7 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM
*/
PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC)
{
- register zend_long i;
+ register size_t i;
size_t trimmed = 0;
char mask[256];
@@ -802,12 +802,15 @@ PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *re
c += trimmed;
}
if (mode & 2) {
- for (i = len - 1; i >= 0; i--) {
- if (mask[(unsigned char)c[i]]) {
- len--;
- } else {
- break;
- }
+ if (len > 0) {
+ i = len - 1;
+ do {
+ if (mask[(unsigned char)c[i]]) {
+ len--;
+ } else {
+ break;
+ }
+ } while (i-- != 0);
}
}
@@ -1410,13 +1413,13 @@ PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t
cnt = len;
state = 0;
while (cnt > 0) {
- inc_len = (*c == '\0' ? 1: php_mblen(c, cnt));
+ inc_len = (*c == '\0' ? 1 : php_mblen(c, cnt));
switch (inc_len) {
case -2:
case -1:
inc_len = 1;
- php_ignore_value(php_mblen(NULL, 0));
+ php_mb_reset();
break;
case 0:
goto quit_loop;
@@ -1810,7 +1813,7 @@ PHP_FUNCTION(strpos)
ZEND_PARSE_PARAMETERS_END();
#endif
- if (offset < 0 || offset > haystack->len) {
+ if (offset < 0 || (size_t)offset > haystack->len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
@@ -1860,7 +1863,7 @@ PHP_FUNCTION(stripos)
return;
}
- if (offset < 0 || offset > haystack->len) {
+ if (offset < 0 || (size_t)offset > haystack->len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
@@ -1948,20 +1951,20 @@ PHP_FUNCTION(strrpos)
}
if (offset >= 0) {
- if (offset > haystack->len) {
+ if ((size_t)offset > haystack->len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
- p = haystack->val + offset;
+ p = haystack->val + (size_t)offset;
e = haystack->val + haystack->len - needle_len;
} else {
- if (offset < -INT_MAX || -offset > haystack->len) {
+ if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack->val;
- if (needle_len > -offset) {
+ if (needle_len > (size_t)(-offset)) {
e = haystack->val + haystack->len - needle_len;
} else {
e = haystack->val + haystack->len + offset;
@@ -2026,7 +2029,7 @@ PHP_FUNCTION(strripos)
/* Single character search can shortcut memcmps
Can also avoid tolower emallocs */
if (offset >= 0) {
- if (offset > haystack->len) {
+ if ((size_t)offset > haystack->len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
@@ -2034,7 +2037,7 @@ PHP_FUNCTION(strripos)
e = haystack->val + haystack->len - 1;
} else {
p = haystack->val;
- if (offset < -INT_MAX || -offset > haystack->len) {
+ if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
@@ -2057,7 +2060,7 @@ PHP_FUNCTION(strripos)
php_strtolower(haystack_dup, haystack->len);
if (offset >= 0) {
- if (offset > haystack->len) {
+ if ((size_t)offset > haystack->len) {
efree(needle_dup);
efree(haystack_dup);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
@@ -2066,14 +2069,14 @@ PHP_FUNCTION(strripos)
p = haystack_dup + offset;
e = haystack_dup + haystack->len - needle_len;
} else {
- if (offset < -INT_MAX || -offset > haystack->len) {
+ if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
efree(needle_dup);
efree(haystack_dup);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack_dup;
- if (needle_len > -offset) {
+ if (needle_len > (size_t)(-offset)) {
e = haystack_dup + haystack->len - needle_len;
} else {
e = haystack_dup + haystack->len + offset;
@@ -2197,7 +2200,7 @@ PHP_FUNCTION(chunk_split)
RETURN_FALSE;
}
- if (chunklen > str->len) {
+ if ((size_t)chunklen > str->len) {
/* to maintain BC, we must return original string + ending */
result = zend_string_alloc(endlen + str->len, 0);
memcpy(result->val, str->val, str->len);
@@ -2210,7 +2213,7 @@ PHP_FUNCTION(chunk_split)
RETURN_EMPTY_STRING();
}
- result = php_chunk_split(str->val, str->len, end, endlen, chunklen);
+ result = php_chunk_split(str->val, str->len, end, endlen, (size_t)chunklen);
if (result) {
RETURN_STR(result);
@@ -2242,7 +2245,7 @@ PHP_FUNCTION(substr)
#endif
if (argc > 2) {
- if ((l < 0 && -l > str->len)) {
+ if ((l < 0 && (size_t)(-l) > str->len)) {
RETURN_FALSE;
} else if (l > (zend_long)str->len) {
l = str->len;
@@ -2556,7 +2559,7 @@ PHP_FUNCTION(substr_replace)
if (str_index) {
zval tmp;
- ZVAL_STR(&tmp, result);
+ ZVAL_NEW_STR(&tmp, result);
zend_symtable_update(Z_ARRVAL_P(return_value), str_index, &tmp);
} else {
add_index_str(return_value, num_index, result);
@@ -3794,7 +3797,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
zval result;
zend_string *string_key;
zend_ulong num_key;
- zend_long count = 0;
+ size_t count = 0;
int argc = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
@@ -4156,7 +4159,7 @@ PHP_FUNCTION(strip_tags)
if (allow != NULL) {
convert_to_string_ex(allow);
// TODO: reimplement to avoid reallocation ???
- if (IS_INTERNED(Z_STR_P(allow))) {
+ if (!Z_REFCOUNTED_P(allow)) {
allowed_tags = estrndup(Z_STRVAL_P(allow), Z_STRLEN_P(allow));
allowed_tags_len = Z_STRLEN_P(allow);
} else {
@@ -4169,7 +4172,7 @@ PHP_FUNCTION(strip_tags)
buf->len = php_strip_tags_ex(buf->val, str->len, NULL, allowed_tags, allowed_tags_len, 0);
// TODO: reimplement to avoid reallocation ???
- if (allow && IS_INTERNED(Z_STR_P(allow))) {
+ if (allow && !Z_REFCOUNTED_P(allow)) {
efree(allowed_tags);
}
RETURN_STR(buf);
@@ -4999,7 +5002,7 @@ PHP_FUNCTION(substr_count)
RETURN_FALSE;
}
- if (offset > haystack_len) {
+ if ((size_t)offset > haystack_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset);
RETURN_FALSE;
}
@@ -5058,7 +5061,7 @@ PHP_FUNCTION(str_pad)
/* If resulting string turns out to be shorter than input string,
we simply copy the input and return. */
- if (pad_length < 0 || pad_length <= input->len) {
+ if (pad_length < 0 || (size_t)pad_length <= input->len) {
RETURN_STRINGL(input->val, input->len);
}
@@ -5347,7 +5350,7 @@ PHP_FUNCTION(str_split)
}
- if (0 == str->len || split_length >= str->len) {
+ if (0 == str->len || (size_t)split_length >= str->len) {
array_init_size(return_value, 1);
add_next_index_stringl(return_value, str->val, str->len);
return;
@@ -5424,7 +5427,7 @@ PHP_FUNCTION(substr_compare)
offset = (offset < 0) ? 0 : offset;
}
- if (offset >= s1->len) {
+ if ((size_t)offset >= s1->len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length");
RETURN_FALSE;
}
diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c
index face191a6e..de6f727343 100644
--- a/ext/standard/strnatcmp.c
+++ b/ext/standard/strnatcmp.c
@@ -108,8 +108,9 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
int fractional, result;
short leading = 1;
- if (a_len == 0 || b_len == 0)
- return a_len - b_len;
+ if (a_len == 0 || b_len == 0) {
+ return (a_len == b_len ? 0 : (a_len > b_len ? 1 : -1));
+ }
ap = a;
bp = b;
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 900b118a4e..036c189e75 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/tests/file/bug65701.phpt b/ext/standard/tests/file/bug65701.phpt
index 2b1b5d491d..42d8d3e628 100644
--- a/ext/standard/tests/file/bug65701.phpt
+++ b/ext/standard/tests/file/bug65701.phpt
@@ -6,7 +6,9 @@ Boro Sitnikovski <buritomath@yahoo.com>
<?php
$file_path = dirname(__FILE__) . "/bug65701/";
-mkdir($file_path);
+if (!is_dir($file_path)) {
+ mkdir($file_path);
+}
$src = $file_path . '/srcbug65701_file.txt';
$dst = tempnam($file_path, 'dstbug65701_file.txt');
diff --git a/ext/standard/tests/file/pathinfo_basic1-win32.phpt b/ext/standard/tests/file/pathinfo_basic1-win32.phpt
index 9e84b99790..f783a6b179 100644
--- a/ext/standard/tests/file/pathinfo_basic1-win32.phpt
+++ b/ext/standard/tests/file/pathinfo_basic1-win32.phpt
@@ -99,42 +99,42 @@ array(3) {
}
-- Iteration 3 --
string(2) "c:"
-string(2) "c:"
+string(1) "c"
string(0) ""
-string(2) "c:"
+string(1) "c"
array(3) {
["dirname"]=>
string(2) "c:"
["basename"]=>
- string(2) "c:"
+ string(1) "c"
["filename"]=>
- string(2) "c:"
+ string(1) "c"
}
-- Iteration 4 --
string(3) "c:\"
-string(2) "c:"
+string(1) "c"
string(0) ""
-string(2) "c:"
+string(1) "c"
array(3) {
["dirname"]=>
string(3) "c:\"
["basename"]=>
- string(2) "c:"
+ string(1) "c"
["filename"]=>
- string(2) "c:"
+ string(1) "c"
}
-- Iteration 5 --
string(3) "c:\"
-string(2) "c:"
+string(1) "c"
string(0) ""
-string(2) "c:"
+string(1) "c"
array(3) {
["dirname"]=>
string(3) "c:\"
["basename"]=>
- string(2) "c:"
+ string(1) "c"
["filename"]=>
- string(2) "c:"
+ string(1) "c"
}
-- Iteration 6 --
string(1) "."
diff --git a/ext/standard/tests/file/pathinfo_basic2-win32.phpt b/ext/standard/tests/file/pathinfo_basic2-win32.phpt
index c88bc25ffc..4c2fd2cacf 100644
--- a/ext/standard/tests/file/pathinfo_basic2-win32.phpt
+++ b/ext/standard/tests/file/pathinfo_basic2-win32.phpt
@@ -168,18 +168,18 @@ array(3) {
}
-- Iteration 9 --
string(3) "c:."
-string(11) "c:afile.txt"
+string(9) "afile.txt"
string(3) "txt"
-string(7) "c:afile"
+string(5) "afile"
array(4) {
["dirname"]=>
string(3) "c:."
["basename"]=>
- string(11) "c:afile.txt"
+ string(9) "afile.txt"
["extension"]=>
string(3) "txt"
["filename"]=>
- string(7) "c:afile"
+ string(5) "afile"
}
-- Iteration 10 --
string(12) "..\.\..\test"
@@ -267,4 +267,4 @@ array(3) {
["filename"]=>
string(5) "afile"
}
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/general_functions/parse_ini_string_003.phpt b/ext/standard/tests/general_functions/parse_ini_string_003.phpt
new file mode 100644
index 0000000000..570570dbfe
--- /dev/null
+++ b/ext/standard/tests/general_functions/parse_ini_string_003.phpt
@@ -0,0 +1,40 @@
+--TEST--
+parse_ini_string() typed scanner mode
+--FILE--
+<?php
+
+$contents = <<<EOS
+foo = 1
+bar = 1.3
+baz = null
+qux[] = false
+qux[] = off
+qux[] = something
+qux[] = "something else"
+EOS;
+
+var_dump(parse_ini_string($contents, false, INI_SCANNER_TYPED));
+
+?>
+Done
+--EXPECTF--
+array(4) {
+ ["foo"]=>
+ int(1)
+ ["bar"]=>
+ float(1.3)
+ ["baz"]=>
+ NULL
+ ["qux"]=>
+ array(4) {
+ [0]=>
+ bool(false)
+ [1]=>
+ bool(false)
+ [2]=>
+ string(9) "something"
+ [3]=>
+ string(14) "something else"
+ }
+}
+Done
diff --git a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt
index fb0fb79ae5..e74f6b73e9 100644
--- a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt
+++ b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt
@@ -48,8 +48,8 @@ str_dump($a, $b);
--EXPECT--
*** Testing strnatcasecmp() : variation ***
int(1)
-int(6)
-int(-2)
+int(1)
+int(-1)
int(-1)
int(0)
int(0)
diff --git a/ext/standard/tests/versioning/phpversion.phpt b/ext/standard/tests/versioning/phpversion.phpt
new file mode 100644
index 0000000000..ef8c354c36
--- /dev/null
+++ b/ext/standard/tests/versioning/phpversion.phpt
@@ -0,0 +1,12 @@
+--TEST--
+phpversion test
+--FILE--
+<?php
+
+print phpversion();
+print "\n";
+print phpversion('standard');
+
+--EXPECTF--
+%s
+%s
diff --git a/ext/standard/type.c b/ext/standard/type.c
index b320d9e5c5..fa5cd4639e 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c
index 65cbcf12c3..1014f5d9ba 100644
--- a/ext/standard/uniqid.c
+++ b/ext/standard/uniqid.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h
index 0ea57fa52a..2247e8c2ee 100644
--- a/ext/standard/uniqid.h
+++ b/ext/standard/uniqid.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 60ce808f4e..81f9b2ac9a 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/url.h b/ext/standard/url.h
index d23f0a1f17..4d7a1f5b56 100644
--- a/ext/standard/url.h
+++ b/ext/standard/url.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index 48910515f7..b7c9403f8b 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -2,7 +2,7 @@
#line 1 "ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -58,7 +58,7 @@ static PHP_INI_MH(OnUpdateTags)
ctx = &BG(url_adapt_state_ex);
- tmp = estrndup(new_value, new_value_length);
+ tmp = estrndup(new_value->val, new_value->len);
if (ctx->tags)
zend_hash_destroy(ctx->tags);
diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h
index 0a7925e245..00dd9fbfb0 100644
--- a/ext/standard/url_scanner_ex.h
+++ b/ext/standard/url_scanner_ex.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index cfee6c31a7..28a5ca3196 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -56,7 +56,7 @@ static PHP_INI_MH(OnUpdateTags)
ctx = &BG(url_adapt_state_ex);
- tmp = estrndup(new_value, new_value_length);
+ tmp = estrndup(new_value->val, new_value->len);
if (ctx->tags)
zend_hash_destroy(ctx->tags);
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index ea73662db6..19e8e454df 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index 40ab379a30..6582e7de65 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/standard/var.c b/ext/standard/var.c
index f005258fcb..532e53a110 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -74,7 +74,7 @@ static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *ke
if (key == NULL) { /* numeric key */
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
} else { /* string key */
- int unmangle = zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name);
+ int unmangle = zend_unmangle_property_name(key, &class_name, &prop_name);
php_printf("%*c[", level + 1, ' ');
if (class_name && unmangle == SUCCESS) {
@@ -247,7 +247,7 @@ static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *k
if (key == NULL) { /* numeric key */
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
} else { /* string key */
- zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name);
+ zend_unmangle_property_name(key, &class_name, &prop_name);
php_printf("%*c[", level + 1, ' ');
if (class_name) {
@@ -299,7 +299,7 @@ again:
case IS_STRING:
php_printf("%sstring(%d) \"", COMMON, Z_STRLEN_P(struc));
PHPWRITE(Z_STRVAL_P(struc), Z_STRLEN_P(struc));
- php_printf("\" refcount(%u)\n", IS_INTERNED(Z_STR_P(struc)) ? 1 : Z_REFCOUNT_P(struc));
+ php_printf("\" refcount(%u)\n", Z_REFCOUNTED_P(struc) ? Z_REFCOUNT_P(struc) : 1);
break;
case IS_ARRAY:
myht = Z_ARRVAL_P(struc);
@@ -430,13 +430,12 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k
{
buffer_append_spaces(buf, level + 2);
if (key != NULL) {
- const char *class_name; /* ignored, but must be passed to unmangle */
- const char *pname;
+ const char *class_name, *prop_name;
+ size_t prop_name_len;
zend_string *pname_esc;
- zend_unmangle_property_name(key->val, key->len,
- &class_name, &pname);
- pname_esc = php_addcslashes(pname, strlen(pname), 0, "'\\", 2 TSRMLS_CC);
+ zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len);
+ pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2 TSRMLS_CC);
smart_str_appendc(buf, '\'');
smart_str_appendl(buf, pname_esc->val, pname_esc->len);
@@ -612,17 +611,17 @@ static inline int php_add_var_hash(HashTable *var_hash, zval *var_ptr, zval *var
var = Z_REFVAL_P(var);
}
if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) {
- p = smart_str_print_long(id + sizeof(id) - 1,
+ p = zend_print_long_to_buf(id + sizeof(id) - 1,
(zend_long) Z_OBJ_P(var));
*(--p) = 'O';
len = id + sizeof(id) - 1 - p;
} else if (var_ptr != var) {
- p = smart_str_print_long(id + sizeof(id) - 1,
+ p = zend_print_long_to_buf(id + sizeof(id) - 1,
(zend_long) Z_REF_P(var_ptr));
*(--p) = 'R';
len = id + sizeof(id) - 1 - p;
} else {
- p = smart_str_print_long(id + sizeof(id) - 1, (zend_long) var);
+ p = zend_print_long_to_buf(id + sizeof(id) - 1, (zend_long) var);
len = id + sizeof(id) - 1 - p;
}
@@ -658,10 +657,10 @@ static inline void php_var_serialize_long(smart_str *buf, zend_long val) /* {{{
}
/* }}} */
-static inline void php_var_serialize_string(smart_str *buf, char *str, int len) /* {{{ */
+static inline void php_var_serialize_string(smart_str *buf, char *str, size_t len) /* {{{ */
{
smart_str_appendl(buf, "s:", 2);
- smart_str_append_long(buf, len);
+ smart_str_append_unsigned(buf, len);
smart_str_appendl(buf, ":\"", 2);
smart_str_appendl(buf, str, len);
smart_str_appendl(buf, "\";", 2);
@@ -674,7 +673,7 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc
PHP_SET_CLASS_ATTRIBUTES(struc);
smart_str_appendl(buf, "O:", 2);
- smart_str_append_long(buf, (int)class_name->len);
+ smart_str_append_unsigned(buf, class_name->len);
smart_str_appendl(buf, ":\"", 2);
smart_str_appendl(buf, class_name->val, class_name->len);
smart_str_appendl(buf, "\":", 2);
@@ -685,7 +684,7 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc
static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, HashTable *var_hash TSRMLS_DC) /* {{{ */
{
- int count;
+ uint32_t count;
zend_bool incomplete_class;
incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC);
@@ -695,7 +694,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
if (incomplete_class) {
--count;
}
- smart_str_append_long(buf, count);
+ smart_str_append_unsigned(buf, count);
smart_str_appendl(buf, ":{", 2);
if (count > 0) {
@@ -783,7 +782,6 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var_hash TSRMLS_DC) /* {{{ */
{
- int i;
zval var_already;
HashTable *myht;
@@ -855,18 +853,18 @@ again:
if (ce && ce->serialize != NULL) {
/* has custom handler */
unsigned char *serialized_data = NULL;
- uint32_t serialized_length;
+ size_t serialized_length;
if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) {
smart_str_appendl(buf, "C:", 2);
- smart_str_append_long(buf, (int)Z_OBJCE_P(struc)->name->len);
+ smart_str_append_unsigned(buf, Z_OBJCE_P(struc)->name->len);
smart_str_appendl(buf, ":\"", 2);
smart_str_appendl(buf, Z_OBJCE_P(struc)->name->val, Z_OBJCE_P(struc)->name->len);
smart_str_appendl(buf, "\":", 2);
- smart_str_append_long(buf, (int)serialized_length);
+ smart_str_append_unsigned(buf, serialized_length);
smart_str_appendl(buf, ":{", 2);
- smart_str_appendl(buf, serialized_data, serialized_length);
+ smart_str_appendl(buf, (char *) serialized_data, serialized_length);
smart_str_appendc(buf, '}');
} else {
smart_str_appendl(buf, "N;", 2);
@@ -909,6 +907,7 @@ again:
/* fall-through */
}
case IS_ARRAY: {
+ uint32_t i;
zend_bool incomplete_class = 0;
if (Z_TYPE_P(struc) == IS_ARRAY) {
smart_str_appendl(buf, "a:", 2);
@@ -923,7 +922,7 @@ again:
if (i > 0 && incomplete_class) {
--i;
}
- smart_str_append_long(buf, i);
+ smart_str_append_unsigned(buf, i);
smart_str_appendl(buf, ":{", 2);
if (i > 0) {
zend_string *key;
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 8d9899f81f..c94f3eec58 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -2,7 +2,7 @@
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -387,7 +387,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
if (datalen < 0 || (*p) + datalen >= max) {
- zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %pd present", datalen, (zend_long)(max - (*p)));
+ zend_error(E_WARNING, "Insufficient data for unserializing - %pd required, %pd present", datalen, (zend_long)(max - (*p)));
return 0;
}
@@ -700,7 +700,7 @@ yy20:
/* Call unserialize callback */
ZVAL_STRING(&user_func, PG(unserialize_callback_func));
- ZVAL_STR(&args[0], zend_string_copy(class_name));
+ ZVAL_STR_COPY(&args[0], class_name);
BG(serialize_lock)++;
if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
BG(serialize_lock)--;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 988666b2de..a11f556f7e 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -391,7 +391,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
if (datalen < 0 || (*p) + datalen >= max) {
- zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %pd present", datalen, (zend_long)(max - (*p)));
+ zend_error(E_WARNING, "Insufficient data for unserializing - %pd required, %pd present", datalen, (zend_long)(max - (*p)));
return 0;
}
@@ -755,7 +755,7 @@ object ":" uiv ":" ["] {
/* Call unserialize callback */
ZVAL_STRING(&user_func, PG(unserialize_callback_func));
- ZVAL_STR(&args[0], zend_string_copy(class_name));
+ ZVAL_STR_COPY(&args[0], class_name);
BG(serialize_lock)++;
if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
BG(serialize_lock)--;
diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c
index e6f5e480ae..ffdd5abf0d 100644
--- a/ext/standard/versioning.c
+++ b/ext/standard/versioning.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index 12afe6f278..c079ff383d 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sybase_ct/php_sybase_ct.h b/ext/sybase_ct/php_sybase_ct.h
index 8e4993e0ed..476e620588 100644
--- a/ext/sybase_ct/php_sybase_ct.h
+++ b/ext/sybase_ct/php_sybase_ct.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg.h
index 53ac7fc0ee..139d37fe38 100644
--- a/ext/sysvmsg/php_sysvmsg.h
+++ b/ext/sysvmsg/php_sysvmsg.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index d6b8638ddd..15021783a6 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sysvsem/php_sysvsem.h b/ext/sysvsem/php_sysvsem.h
index 964c3d3de4..8c2c2e5d3b 100644
--- a/ext/sysvsem/php_sysvsem.h
+++ b/ext/sysvsem/php_sysvsem.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c
index 6f7948519e..299c725c6b 100644
--- a/ext/sysvsem/sysvsem.c
+++ b/ext/sysvsem/sysvsem.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -66,6 +66,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_acquire, 0, 0, 1)
ZEND_ARG_INFO(0, sem_identifier)
+ ZEND_ARG_INFO(0, nowait)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_release, 0, 0, 1)
@@ -299,11 +300,18 @@ PHP_FUNCTION(sem_get)
static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
{
zval *arg_id;
+ zend_bool nowait = 0;
sysvsem_sem *sem_ptr;
struct sembuf sop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
- return;
+ if (acquire) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &arg_id, &nowait) == FAILURE) {
+ return;
+ }
+ } else {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
+ return;
+ }
}
ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem);
@@ -315,11 +323,13 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
sop.sem_num = SYSVSEM_SEM;
sop.sem_op = acquire ? -1 : 1;
- sop.sem_flg = SEM_UNDO;
+ sop.sem_flg = SEM_UNDO | (nowait ? IPC_NOWAIT : 0);
while (semop(sem_ptr->semid, &sop, 1) == -1) {
if (errno != EINTR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
+ if (errno != EAGAIN) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
+ }
RETURN_FALSE;
}
}
diff --git a/ext/sysvsem/tests/nowait.phpt b/ext/sysvsem/tests/nowait.phpt
new file mode 100644
index 0000000000..0a6fdf4a50
--- /dev/null
+++ b/ext/sysvsem/tests/nowait.phpt
@@ -0,0 +1,103 @@
+--TEST--
+sem_acquire with nowait
+--SKIPIF--
+<?php // vim600: ts=4 sw=4 syn=php fdm=marker
+if(!extension_loaded('sysvsem') || !extension_loaded('pcntl')) {
+ die("skip sysvsem and pcntl required");
+}
+?>
+--FILE--
+<?php
+$SEMKEY = ftok(__FILE__, 'P'); // Semaphore key
+
+$pid = pcntl_fork();
+
+if ($pid) {
+ echo "Parent.\n";
+
+ pcntl_signal(SIGCHLD, SIG_IGN);
+
+ // Get semaphore
+ $sem_id = sem_get($SEMKEY, 1);
+ if ($sem_id === FALSE) {
+ echo "P: fail to get semaphore";
+ exit;
+ }
+ echo "P: got semaphore $sem_id.\n";
+
+ register_shutdown_function(function () use ($sem_id) {
+ echo "P: cleanup.\n";
+ sem_remove($sem_id);
+ });
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id)) {
+ echo "P: fail to acquire semaphore $sem_id.\n";
+ sem_remove($sem_id);
+ exit;
+ }
+ echo "P: success acquire semaphore $sem_id.\n";
+
+ usleep(20000);
+
+ echo "P: releases.\n";
+ sem_release($sem_id);
+
+ usleep(5000);
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id)) {
+ echo "P: fail to acquire semaphore $sem_id.\n";
+ sem_remove($sem_id);
+ exit;
+ }
+ echo "P: success acquire semaphore $sem_id.\n";
+
+ $status = null;
+ pcntl_waitpid($pid, $status);
+
+} else {
+ usleep(10000);
+ echo "Child.\n";
+
+ // Get semaphore
+ $sem_id = sem_get($SEMKEY, 1);
+ if ($sem_id === FALSE) {
+ echo "C: fail to get semaphore";
+ exit;
+ }
+ echo "C: got semaphore $sem_id.\n";
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id)) {
+ echo "C: fail to acquire semaphore $sem_id.\n";
+ exit;
+ }
+ echo "C: success acquire semaphore $sem_id.\n";
+
+ echo "C: releases.\n";
+ sem_release($sem_id);
+
+ usleep(10000);
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id, true)) {
+ echo "C: fail to acquire semaphore $sem_id.\n";
+ exit;
+ }
+ echo "C: success acquire semaphore $sem_id.\n";
+}
+
+?>
+--EXPECTF--
+Parent.
+P: got semaphore Resource id #%i.
+P: success acquire semaphore Resource id #%i.
+Child.
+C: got semaphore Resource id #%i.
+P: releases.
+C: success acquire semaphore Resource id #%i.
+C: releases.
+P: success acquire semaphore Resource id #%i.
+C: fail to acquire semaphore Resource id #%i.
+P: cleanup.
diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt
index 6f52f3bd7e..ccfcf03d32 100644
--- a/ext/sysvsem/tests/sysv.phpt
+++ b/ext/sysvsem/tests/sysv.phpt
@@ -9,8 +9,8 @@ if(!extension_loaded('sysvsem') || !extension_loaded('sysvshm')) {
--FILE--
<?php
$MEMSIZE = 512; // size of shared memory to allocate
-$SEMKEY = 1; // Semaphore key
-$SHMKEY = 2; // Shared memory key
+$SEMKEY = ftok(__FILE__, 'P'); // Semaphore key
+$SHMKEY = ftok(__FILE__, 'Q'); // Shared memory key
echo "Start.\n";
// Get semaphore
diff --git a/ext/sysvshm/php_sysvshm.h b/ext/sysvshm/php_sysvshm.h
index 0d174002b1..9dd9272dfe 100644
--- a/ext/sysvshm/php_sysvshm.h
+++ b/ext/sysvshm/php_sysvshm.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index 2a0d0e8246..e0f9df3ac3 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h
index efeba3baa9..cd78f37a17 100644
--- a/ext/tidy/php_tidy.h
+++ b/ext/tidy/php_tidy.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index 820715ca05..63ccf52370 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1080,14 +1080,14 @@ static PHP_INI_MH(php_tidy_set_clean_output)
int status;
zend_bool value;
- if (new_value_length==2 && strcasecmp("on", new_value)==0) {
+ if (new_value->len==2 && strcasecmp("on", new_value->val)==0) {
value = (zend_bool) 1;
- } else if (new_value_length==3 && strcasecmp("yes", new_value)==0) {
+ } else if (new_value->len==3 && strcasecmp("yes", new_value->val)==0) {
value = (zend_bool) 1;
- } else if (new_value_length==4 && strcasecmp("true", new_value)==0) {
+ } else if (new_value->len==4 && strcasecmp("true", new_value->val)==0) {
value = (zend_bool) 1;
} else {
- value = (zend_bool) atoi(new_value);
+ value = (zend_bool) atoi(new_value->val);
}
if (stage == PHP_INI_STAGE_RUNTIME) {
@@ -1103,7 +1103,7 @@ static PHP_INI_MH(php_tidy_set_clean_output)
}
}
- status = OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ status = OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
if (stage == PHP_INI_STAGE_RUNTIME && value) {
if (!php_output_handler_started(ZEND_STRL("ob_tidyhandler") TSRMLS_CC)) {
diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h
index 1b5490d257..c6946c7078 100644
--- a/ext/tokenizer/php_tokenizer.h
+++ b/ext/tokenizer/php_tokenizer.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c
index 1847b0537d..26e05c2be3 100644
--- a/ext/tokenizer/tokenizer.c
+++ b/ext/tokenizer/tokenizer.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -185,7 +185,7 @@ PHP_FUNCTION(token_get_all)
return;
}
- ZVAL_STR(&source_zval, zend_string_copy(source));
+ ZVAL_STR_COPY(&source_zval, source);
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
if (zend_prepare_string_for_scanning(&source_zval, "" TSRMLS_CC) == FAILURE) {
diff --git a/ext/tokenizer/tokenizer_data.c b/ext/tokenizer/tokenizer_data.c
index beb9ea8e5b..49dec7c150 100644
--- a/ext/tokenizer/tokenizer_data.c
+++ b/ext/tokenizer/tokenizer_data.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/tokenizer/tokenizer_data_gen.sh b/ext/tokenizer/tokenizer_data_gen.sh
index 1ed76e3617..a00d341528 100755
--- a/ext/tokenizer/tokenizer_data_gen.sh
+++ b/ext/tokenizer/tokenizer_data_gen.sh
@@ -14,7 +14,7 @@ fi
echo '/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/wddx/php_wddx.h b/ext/wddx/php_wddx.h
index 7e823f7c8f..3809c0a3e1 100644
--- a/ext/wddx/php_wddx.h
+++ b/ext/wddx/php_wddx.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index d20f007345..420377eb22 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 931ea81c4e..be5913d521 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -289,7 +289,7 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
zval retval;
zval *ent;
zend_string *key;
- ulong idx;
+ zend_ulong idx;
int ret;
if (vallen == 0) {
@@ -442,7 +442,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
zval *ent, fname, *varname;
zval retval;
zend_string *key;
- ulong idx;
+ zend_ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
TSRMLS_FETCH();
@@ -505,10 +505,11 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
}
if (key) {
const char *class_name, *prop_name;
+ size_t prop_name_len;
zend_string *tmp;
- zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name);
- tmp = zend_string_init(prop_name, strlen(prop_name), 0);
+ zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len);
+ tmp = zend_string_init(prop_name, prop_name_len, 0);
php_wddx_serialize_var(packet, ent, tmp TSRMLS_CC);
zend_string_release(tmp);
} else {
@@ -532,10 +533,10 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
zval *ent;
zend_string *key;
int is_struct = 0;
- ulong idx;
+ zend_ulong idx;
HashTable *target_hash;
char tmp_buf[WDDX_BUF_LEN];
- ulong ind = 0;
+ zend_ulong ind = 0;
TSRMLS_FETCH();
target_hash = HASH_OF(arr);
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index 41f5d42012..c046e150da 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -198,15 +198,6 @@ _start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix
}
static void
-_namespace_handler(XML_Parser parser, xmlNsPtr nsptr)
-{
- if (nsptr != NULL) {
- _namespace_handler(parser, nsptr->next);
- parser->h_end_ns(parser->user, nsptr->prefix);
- }
-}
-
-static void
_end_element_handler(void *user, const xmlChar *name)
{
xmlChar *qualified_name;
@@ -368,7 +359,7 @@ _external_entity_ref_handler(void *user, const xmlChar *names, int type, const x
return;
}
- parser->h_external_entity_ref(parser, names, "", sys_id, pub_id);
+ parser->h_external_entity_ref(parser, names, (XML_Char *) "", sys_id, pub_id);
}
static xmlEntityPtr
@@ -602,7 +593,7 @@ has been defined and none can be detected */
}
#endif
- error = xmlParseChunk(parser->parser, data, data_len, is_final);
+ error = xmlParseChunk(parser->parser, (char *) data, data_len, is_final);
if (!error) {
return 1;
} else if (parser->parser->lastError.level > XML_ERR_WARNING ){
@@ -728,7 +719,7 @@ PHPAPI const XML_Char *
XML_ErrorString(int code)
{
if (code < 0 || code >= (int)(sizeof(error_mapping) / sizeof(error_mapping[0]))) {
- return "Unknown";
+ return (const XML_Char *) "Unknown";
}
return error_mapping[code];
}
@@ -763,7 +754,7 @@ XML_GetCurrentByteCount(XML_Parser parser)
PHPAPI const XML_Char *XML_ExpatVersion(void)
{
- return "1.0";
+ return (const XML_Char *) "1.0";
}
PHPAPI void
diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h
index dab9812122..54673f9ad0 100644
--- a/ext/xml/expat_compat.h
+++ b/ext/xml/expat_compat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h
index 0195bb5836..cdb08f812e 100644
--- a/ext/xml/php_xml.h
+++ b/ext/xml/php_xml.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -134,8 +134,8 @@ PHP_FUNCTION(utf8_decode);
PHP_FUNCTION(xml_parse_into_struct);
PHPAPI char *_xml_zval_strdup(zval *);
-PHPAPI zend_string *xml_utf8_decode(const XML_Char *, int, const XML_Char *);
-PHPAPI zend_string *xml_utf8_encode(const char *, int, const XML_Char *);
+PHPAPI zend_string *xml_utf8_decode(const XML_Char *, size_t, const XML_Char *);
+PHPAPI zend_string *xml_utf8_encode(const char *, size_t, const XML_Char *);
#endif /* HAVE_LIBEXPAT */
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 2ad53e77e9..f1a3442b6d 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -554,9 +554,9 @@ static xml_encoding *xml_get_encoding(const XML_Char *name)
/* }}} */
/* {{{ xml_utf8_encode() */
-PHPAPI zend_string *xml_utf8_encode(const char *s, int len, const XML_Char *encoding)
+PHPAPI zend_string *xml_utf8_encode(const char *s, size_t len, const XML_Char *encoding)
{
- int pos = len;
+ size_t pos = len;
zend_string *str;
unsigned int c;
unsigned short (*encoder)(unsigned char) = NULL;
@@ -605,7 +605,7 @@ PHPAPI zend_string *xml_utf8_encode(const char *s, int len, const XML_Char *enco
/* }}} */
/* {{{ xml_utf8_decode() */
-PHPAPI zend_string *xml_utf8_decode(const XML_Char *s, int len, const XML_Char *encoding)
+PHPAPI zend_string *xml_utf8_decode(const XML_Char *s, size_t len, const XML_Char *encoding)
{
size_t pos = 0;
unsigned int c;
@@ -627,7 +627,7 @@ PHPAPI zend_string *xml_utf8_decode(const XML_Char *s, int len, const XML_Char *
str = zend_string_alloc(len, 0);
str->len = 0;
- while (pos < (size_t)len) {
+ while (pos < len) {
int status = FAILURE;
c = php_next_utf8_char((const unsigned char*)s, (size_t) len, &pos, &status);
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index a90f727cb8..43e585dd33 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h
index 4107396d39..7a721dcc6f 100644
--- a/ext/xmlreader/php_xmlreader.h
+++ b/ext/xmlreader/php_xmlreader.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xmlrpc/php_xmlrpc.h b/ext/xmlrpc/php_xmlrpc.h
index 286711b505..4e059788de 100644
--- a/ext/xmlrpc/php_xmlrpc.h
+++ b/ext/xmlrpc/php_xmlrpc.h
@@ -35,7 +35,7 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index b5b7e87161..d43a31be11 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -35,7 +35,7 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -472,7 +472,7 @@ static void set_output_options(php_output_options* options, zval* output_opts)
static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht)
{
int bArray = 0, bStruct = 0, bMixed = 0;
- unsigned long num_index, last_num = 0;
+ zend_ulong num_index, last_num = 0;
zend_string* my_key;
ZEND_HASH_FOREACH_KEY(ht, num_index, my_key) {
@@ -541,7 +541,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
break;
case xmlrpc_vector:
{
- unsigned long num_index;
+ zend_ulong num_index;
zval* pIter;
zend_string* my_key;
HashTable *ht = NULL;
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index becfbc2157..6e3475e8d0 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xmlwriter/php_xmlwriter.h b/ext/xmlwriter/php_xmlwriter.h
index a4f43baaf5..fc00a9d578 100644
--- a/ext/xmlwriter/php_xmlwriter.h
+++ b/ext/xmlwriter/php_xmlwriter.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index bda02498ed..2763d83326 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h
index 375cb32fb0..b6603321a3 100644
--- a/ext/xsl/php_xsl.h
+++ b/ext/xsl/php_xsl.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h
index 89726da724..e987554a4d 100644
--- a/ext/xsl/xsl_fe.h
+++ b/ext/xsl/xsl_fe.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index cd828c75a0..20af855aa4 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -791,7 +791,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
intern = Z_XSL_P(id);
- ZVAL_STR(&new_string, zend_string_copy(value));
+ ZVAL_STR_COPY(&new_string, value);
zend_hash_update(intern->parameter, name, &new_string);
RETURN_TRUE;
diff --git a/ext/zip/lib/config.h b/ext/zip/lib/config.h
index 8c11baa5e2..3d524f3923 100644
--- a/ext/zip/lib/config.h
+++ b/ext/zip/lib/config.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c
index 02fa1272d6..4793c54534 100644
--- a/ext/zip/lib/zip_set_name.c
+++ b/ext/zip/lib/zip_set_name.c
@@ -58,7 +58,7 @@ _zip_set_name(struct zip *za, zip_uint64_t idx, const char *name, zip_flags_t fl
return -1;
}
- if (name && strlen(name) > 0) {
+ if (name && name[0] != '\0') {
/* TODO: check for string too long */
if ((str=_zip_string_new((const zip_uint8_t *)name, (zip_uint16_t)strlen(name), flags, &za->error)) == NULL)
return -1;
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 734ee19d0e..4accc22e30 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -956,7 +956,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
HashTable *props;
zip_prop_handler *hnd;
zend_string *key;
- ulong num_key;
+ zend_ulong num_key;
obj = Z_ZIP_P(object);
props = zend_std_get_properties(object TSRMLS_CC);
@@ -1609,9 +1609,11 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
RETURN_FALSE;
}
- if (remove_path && remove_path_len > 1 && (remove_path[strlen(remove_path) - 1] == '/' ||
- remove_path[strlen(remove_path) - 1] == '\\')) {
- remove_path[strlen(remove_path) - 1] = '\0';
+ if (remove_path && remove_path_len > 1) {
+ size_t real_len = strlen(remove_path);
+ if (real_len > 1 && remove_path[real_len - 1] == '/' || remove_path[real_len - 1] == '\\') {
+ remove_path[real_len - 1] = '\0';
+ }
}
if (type == 1) {
diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h
index 15c085271a..7fab823297 100644
--- a/ext/zip/php_zip.h
+++ b/ext/zip/php_zip.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -76,11 +76,11 @@ typedef struct _ze_zip_read_rsrc {
/* Extends zend object */
typedef struct _ze_zip_object {
struct zip *za;
- int buffers_cnt;
char **buffers;
HashTable *prop_handler;
char *filename;
int filename_len;
+ int buffers_cnt;
zend_object zo;
} ze_zip_object;
diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c
index 44d5507b77..c542340170 100644
--- a/ext/zip/zip_stream.c
+++ b/ext/zip/zip_stream.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index f76e4c2266..ba829b5888 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -49,13 +49,13 @@ typedef struct _php_zlib_context {
ZEND_BEGIN_MODULE_GLOBALS(zlib)
/* variables for transparent gzip encoding */
- int compression_coding;
zend_long output_compression;
zend_long output_compression_level;
char *output_handler;
php_zlib_context *ob_gzhandler;
zend_long output_compression_default;
zend_bool handler_registered;
+ int compression_coding;
ZEND_END_MODULE_GLOBALS(zlib);
php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 20346c04e3..000b96ad8e 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -863,22 +863,28 @@ static const zend_function_entry php_zlib_functions[] = {
/* {{{ OnUpdate_zlib_output_compression */
static PHP_INI_MH(OnUpdate_zlib_output_compression)
{
- int status, int_value;
+ int int_value;
char *ini_value;
+ zend_long *p;
+#ifndef ZTS
+ char *base = (char *) mh_arg2;
+#else
+ char *base;
+
+ base = (char *) ts_resource(*((int *) mh_arg2));
+#endif
if (new_value == NULL) {
return FAILURE;
}
- if (!strncasecmp(new_value, "off", sizeof("off"))) {
- new_value = "0";
- new_value_length = sizeof("0");
- } else if (!strncasecmp(new_value, "on", sizeof("on"))) {
- new_value = "1";
- new_value_length = sizeof("1");
+ if (!strncasecmp(new_value->val, "off", sizeof("off"))) {
+ int_value = 0;
+ } else if (!strncasecmp(new_value->val, "on", sizeof("on"))) {
+ int_value = 1;
+ } else {
+ int_value = zend_atoi(new_value->val, new_value->len);
}
-
- int_value = zend_atoi(new_value, new_value_length);
ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0);
if (ini_value && *ini_value && int_value) {
@@ -886,14 +892,15 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
return FAILURE;
}
if (stage == PHP_INI_STAGE_RUNTIME) {
- status = php_output_get_status(TSRMLS_C);
+ int status = php_output_get_status(TSRMLS_C);
if (status & PHP_OUTPUT_SENT) {
php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent");
return FAILURE;
}
}
- status = OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ p = (zend_long *) (base+(size_t) mh_arg1);
+ *p = int_value;
ZLIBG(output_compression) = ZLIBG(output_compression_default);
if (stage == PHP_INI_STAGE_RUNTIME && int_value) {
@@ -902,7 +909,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
}
}
- return status;
+ return SUCCESS;
}
/* }}} */
@@ -914,7 +921,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_handler)
return FAILURE;
}
- return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
/* }}} */
@@ -999,7 +1006,7 @@ static PHP_MINFO_FUNCTION(zlib)
/* }}} */
/* {{{ ZEND_MODULE_GLOBALS_CTOR */
-static ZEND_MODULE_GLOBALS_CTOR_D(zlib)
+static PHP_GINIT_FUNCTION(zlib)
{
zlib_globals->ob_gzhandler = NULL;
zlib_globals->handler_registered = 0;
@@ -1018,7 +1025,7 @@ zend_module_entry php_zlib_module_entry = {
PHP_MINFO(zlib),
"2.0",
PHP_MODULE_GLOBALS(zlib),
- ZEND_MODULE_GLOBALS_CTOR_N(zlib),
+ PHP_GINIT(zlib),
NULL,
NULL,
STANDARD_MODULE_PROPERTIES_EX
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
index 53bc2e4269..6966c2a9ff 100644
--- a/ext/zlib/zlib_filter.c
+++ b/ext/zlib/zlib_filter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -25,12 +25,12 @@
/* Passed as opaque in malloc callbacks */
typedef struct _php_zlib_filter_data {
- int persistent;
z_stream strm;
char *inbuf;
size_t inbuf_len;
char *outbuf;
size_t outbuf_len;
+ int persistent;
zend_bool finished;
} php_zlib_filter_data;
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index 713a6ecfb2..796b8a54e0 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -37,13 +37,14 @@ static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int read;
+ /* XXX this needs to be looped for the case count > UINT_MAX */
read = gzread(self->gz_file, buf, count);
if (gzeof(self->gz_file)) {
stream->eof = 1;
}
- return (read < 0) ? 0 : read;
+ return (size_t)((read < 0) ? 0 : read);
}
static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
@@ -51,9 +52,10 @@ static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int wrote;
+ /* XXX this needs to be looped for the case count > UINT_MAX */
wrote = gzwrite(self->gz_file, (char *) buf, count);
- return (wrote < 0) ? 0 : wrote;
+ return (size_t)((wrote < 0) ? 0 : wrote);
}
static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
diff --git a/header b/header
index fcbcaea9e3..1d22bbb0b1 100644
--- a/header
+++ b/header
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/SAPI.c b/main/SAPI.c
index e80dcb01ec..50ea8c0a16 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -739,7 +739,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
return SUCCESS;
} else {
/* new line/NUL character safety check */
- int i;
+ uint i;
for (i = 0; i < header_line_len; i++) {
/* RFC 2616 allows new lines if followed by SP or HT */
int illegal_break =
@@ -790,7 +790,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
/* Disable possible output compression for images */
if (!strncmp(ptr, "image/", sizeof("image/")-1)) {
zend_string *key = zend_string_init("zlib.output_compression", sizeof("zlib.output_compression")-1, 0);
- zend_alter_ini_entry(key, "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ zend_alter_ini_entry_chars(key, "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(key);
}
@@ -818,7 +818,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
* portable between setups that have and don't have zlib compression
* enabled globally. See req #44164 */
zend_string *key = zend_string_init("zlib.output_compression", sizeof("zlib.output_compression")-1, 0);
- zend_alter_ini_entry(key,
+ zend_alter_ini_entry_chars(key,
"0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(key);
} else if (!STRCASECMP(header_line, "Location")) {
diff --git a/main/SAPI.h b/main/SAPI.h
index 9172a3e4dd..79661371d9 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/build-defs.h.in b/main/build-defs.h.in
index aa1fbf0321..6821b631f5 100644
--- a/main/build-defs.h.in
+++ b/main/build-defs.h.in
@@ -1,6 +1,6 @@
/* -*- C -*-
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 981c5c5a15..8d6bf3d0bc 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -94,24 +94,24 @@ PHPAPI ZEND_INI_MH(OnUpdateBaseDir)
if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) {
/* We're in a PHP_INI_SYSTEM context, no restrictions */
- *p = new_value;
+ *p = new_value ? new_value->val : NULL;
return SUCCESS;
}
/* Otherwise we're in runtime */
if (!*p || !**p) {
/* open_basedir not set yet, go ahead and give it a value */
- *p = new_value;
+ *p = new_value->val;
return SUCCESS;
}
/* Shortcut: When we have a open_basedir and someone tries to unset, we know it'll fail */
- if (!new_value || !*new_value) {
+ if (!new_value || !*new_value->val) {
return FAILURE;
}
/* Is the proposed open_basedir at least as restrictive as the current setting? */
- ptr = pathbuf = estrdup(new_value);
+ ptr = pathbuf = estrdup(new_value->val);
while (ptr && *ptr) {
end = strchr(ptr, DEFAULT_DIR_SEPARATOR);
if (end != NULL) {
@@ -128,7 +128,7 @@ PHPAPI ZEND_INI_MH(OnUpdateBaseDir)
efree(pathbuf);
/* Everything checks out, set it */
- *p = new_value;
+ *p = new_value->val;
return SUCCESS;
}
@@ -226,12 +226,13 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
/* Resolve open_basedir to resolved_basedir */
if (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL) {
+ int basedir_len = (int)strlen(basedir);
/* Handler for basedirs that end with a / */
- resolved_basedir_len = strlen(resolved_basedir);
+ resolved_basedir_len = (int)strlen(resolved_basedir);
#if defined(PHP_WIN32) || defined(NETWARE)
- if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR || basedir[strlen(basedir) - 1] == '/') {
+ if (basedir[basedir_len - 1] == PHP_DIR_SEPARATOR || basedir[basedir_len - 1] == '/') {
#else
- if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) {
+ if (basedir[basedir_len - 1] == PHP_DIR_SEPARATOR) {
#endif
if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) {
resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR;
@@ -758,10 +759,15 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co
cwd_state new_state;
char cwd[MAXPATHLEN];
int copy_len;
+ int path_len;
if (!filepath[0]) {
return NULL;
- } else if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) {
+ }
+
+ path_len = (int)strlen(filepath);
+
+ if (IS_ABSOLUTE_PATH(filepath, path_len)) {
cwd[0] = '\0';
} else {
const char *iam = SG(request_info).path_translated;
@@ -784,7 +790,7 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co
/* return a relative file path if for any reason
* we cannot cannot getcwd() and the requested,
* relatively referenced file is accessible */
- copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath);
+ copy_len = path_len > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : path_len;
if (real_path) {
memcpy(real_path, filepath, copy_len);
real_path[copy_len] = '\0';
diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h
index 4dde0e35eb..b58f54dce8 100644
--- a/main/fopen_wrappers.h
+++ b/main/fopen_wrappers.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/getopt.c b/main/getopt.c
index 315467a095..8126d577b4 100644
--- a/main/getopt.c
+++ b/main/getopt.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in
index f1e66b160a..3f02921ddf 100644
--- a/main/internal_functions.c.in
+++ b/main/internal_functions.c.in
@@ -1,6 +1,6 @@
/* -*- C -*-
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c
index 86ba57d486..dcb84c346c 100644
--- a/main/internal_functions_nw.c
+++ b/main/internal_functions_nw.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c
index 8b5518ca90..355013f501 100644
--- a/main/internal_functions_win32.c
+++ b/main/internal_functions_win32.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/main.c b/main/main.c
index 9338fee8d2..63144de418 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -163,7 +163,7 @@ static PHP_INI_MH(OnSetPrecision)
{
zend_long i;
- ZEND_ATOL(i, new_value);
+ ZEND_ATOL(i, new_value->val);
if (i >= 0) {
EG(precision) = i;
return SUCCESS;
@@ -178,7 +178,7 @@ static PHP_INI_MH(OnSetPrecision)
static PHP_INI_MH(OnChangeMemoryLimit)
{
if (new_value) {
- PG(memory_limit) = zend_atol(new_value, new_value_length);
+ PG(memory_limit) = zend_atol(new_value->val, new_value->len);
} else {
PG(memory_limit) = 1<<30; /* effectively, no limit */
}
@@ -319,11 +319,11 @@ static PHP_INI_MH(OnUpdateTimeout)
{
if (stage==PHP_INI_STAGE_STARTUP) {
/* Don't set a timeout on startup, only per-request */
- ZEND_ATOL(EG(timeout_seconds), new_value);
+ ZEND_ATOL(EG(timeout_seconds), new_value->val);
return SUCCESS;
}
zend_unset_timeout(TSRMLS_C);
- ZEND_ATOL(EG(timeout_seconds), new_value);
+ ZEND_ATOL(EG(timeout_seconds), new_value->val);
zend_set_timeout(EG(timeout_seconds), 0);
return SUCCESS;
}
@@ -364,7 +364,7 @@ static int php_get_display_errors_mode(char *value, int value_length)
*/
static PHP_INI_MH(OnUpdateDisplayErrors)
{
- PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value, new_value_length);
+ PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value->val, new_value->len);
return SUCCESS;
}
@@ -379,11 +379,11 @@ static PHP_INI_DISP(display_errors_mode)
TSRMLS_FETCH();
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
- tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL );
- tmp_value_length = ini_entry->orig_value_length;
+ tmp_value = (ini_entry->orig_value ? ini_entry->orig_value->val : NULL );
+ tmp_value_length = ini_entry->orig_value->len;
} else if (ini_entry->value) {
- tmp_value = ini_entry->value;
- tmp_value_length = ini_entry->value_length;
+ tmp_value = ini_entry->value->val;
+ tmp_value_length = ini_entry->value->len;
} else {
tmp_value = NULL;
tmp_value_length = 0;
@@ -423,9 +423,9 @@ static PHP_INI_DISP(display_errors_mode)
static PHP_INI_MH(OnUpdateInternalEncoding)
{
if (new_value) {
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
} else {
- OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ PG(internal_encoding) = SG(default_charset);
}
return SUCCESS;
}
@@ -436,9 +436,9 @@ static PHP_INI_MH(OnUpdateInternalEncoding)
static PHP_INI_MH(OnUpdateInputEncoding)
{
if (new_value) {
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
} else {
- OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ PG(input_encoding) = SG(default_charset);
}
return SUCCESS;
}
@@ -449,9 +449,9 @@ static PHP_INI_MH(OnUpdateInputEncoding)
static PHP_INI_MH(OnUpdateOutputEncoding)
{
if (new_value) {
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
} else {
- OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ PG(output_encoding) = SG(default_charset);
}
return SUCCESS;
}
@@ -462,12 +462,12 @@ static PHP_INI_MH(OnUpdateOutputEncoding)
static PHP_INI_MH(OnUpdateErrorLog)
{
/* Only do the safemode/open_basedir check at runtime */
- if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(new_value, "syslog")) {
- if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) {
+ if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(new_value->val, "syslog")) {
+ if (PG(open_basedir) && php_check_open_basedir(new_value->val TSRMLS_CC)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
/* }}} */
@@ -478,11 +478,11 @@ static PHP_INI_MH(OnUpdateMailLog)
{
/* Only do the safemode/open_basedir check at runtime */
if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value) {
- if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) {
+ if (PG(open_basedir) && php_check_open_basedir(new_value->val TSRMLS_CC)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
/* }}} */
@@ -1130,7 +1130,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
if (PG(display_errors) && ((module_initialized && !PG(during_request_startup)) || (PG(display_startup_errors)))) {
if (PG(xmlrpc_errors)) {
- php_printf("<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%ld</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno);
+ php_printf("<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%pd</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno);
} else {
char *prepend_string = INI_STR("error_prepend_string");
char *append_string = INI_STR("error_append_string");
@@ -1149,10 +1149,10 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR
) {
#ifdef PHP_WIN32
- fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno);
+ fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno);
fflush(stderr);
#else
- fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno);
+ fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno);
#endif
} else {
php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string));
@@ -1341,7 +1341,7 @@ PHP_FUNCTION(set_time_limit)
new_timeout_strlen = zend_spprintf(&new_timeout_str, 0, ZEND_LONG_FMT, new_timeout);
key = zend_string_init("max_execution_time", sizeof("max_execution_time")-1, 0);
- if (zend_alter_ini_entry_ex(key, new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) {
+ if (zend_alter_ini_entry_chars_ex(key, new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -1439,16 +1439,9 @@ static char *php_resolve_path_for_zend(const char *filename, int filename_len TS
/* {{{ php_get_configuration_directive_for_zend
*/
-static int php_get_configuration_directive_for_zend(const char *name, uint name_length, zval *contents)
+static zval *php_get_configuration_directive_for_zend(zend_string *name)
{
- zval *retval = cfg_get_entry(name, name_length);
-
- if (retval) {
- *contents = *retval;
- return SUCCESS;
- } else {
- return FAILURE;
- }
+ return cfg_get_entry_ex(name);
}
/* }}} */
@@ -2030,7 +2023,7 @@ void dummy_invalid_parameter_handler(
called = 1;
if (function) {
if (file) {
- len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws' (%ws:%d)", function, file, line);
+ len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws' (%ws:%u)", function, file, line);
} else {
len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws'", function);
}
diff --git a/main/network.c b/main/network.c
index 0b018c2e87..bb21f0ffe4 100644
--- a/main/network.c
+++ b/main/network.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/output.c b/main/output.c
index b51892c140..f44ae178b4 100644
--- a/main/output.c
+++ b/main/output.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php.h b/main/php.h
index 47e1e10733..2a683e1924 100644
--- a/main/php.h
+++ b/main/php.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -281,9 +281,12 @@ ssize_t pread(int, void *, size_t, off64_t);
BEGIN_EXTERN_C()
void phperror(char *error);
PHPAPI size_t php_write(void *buf, size_t size TSRMLS_DC);
-PHPAPI size_t php_printf(const char *format, ...);
+PHPAPI size_t php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1,
+ 2);
PHPAPI int php_get_module_initialized(void);
PHPAPI void php_log_err(char *log_message TSRMLS_DC);
+int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2);
+int cfgparse(void);
END_EXTERN_C()
#define php_error zend_error
@@ -305,9 +308,12 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
#endif
/* PHPAPI void php_error(int type, const char *format, ...); */
-PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...);
-PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...);
-PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...);
+PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...)
+ PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 3, PHP_ATTR_FMT_OFFSET + 4);
+PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...)
+ PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 4, PHP_ATTR_FMT_OFFSET + 5);
+PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...)
+ PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 5, PHP_ATTR_FMT_OFFSET + 6);
#ifdef PHP_WIN32
PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2 TSRMLS_DC);
#endif
diff --git a/main/php_compat.h b/main/php_compat.h
index 20951ba427..5e6af03c59 100644
--- a/main/php_compat.h
+++ b/main/php_compat.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_content_types.c b/main/php_content_types.c
index c8db921421..8765a507bc 100644
--- a/main/php_content_types.c
+++ b/main/php_content_types.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_content_types.h b/main/php_content_types.h
index ed5346c843..0a49d1e2cd 100644
--- a/main/php_content_types.h
+++ b/main/php_content_types.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_getopt.h b/main/php_getopt.h
index f536ac8a96..8f70181786 100644
--- a/main/php_getopt.h
+++ b/main/php_getopt.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_globals.h b/main/php_globals.h
index 14d0a03868..a60efe69de 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_ini.c b/main/php_ini.c
index 783802c806..c90dc9f29f 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -83,9 +83,9 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC)
uint display_string_length, esc_html=0;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
- if (ini_entry->orig_value && ini_entry->orig_value[0]) {
- display_string = ini_entry->orig_value;
- display_string_length = ini_entry->orig_value_length;
+ if (ini_entry->orig_value && ini_entry->orig_value->val[0]) {
+ display_string = ini_entry->orig_value->val;
+ display_string_length = ini_entry->orig_value->len;
esc_html = !sapi_module.phpinfo_as_text;
} else {
if (!sapi_module.phpinfo_as_text) {
@@ -96,9 +96,9 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC)
display_string_length = sizeof("no value") - 1;
}
}
- } else if (ini_entry->value && ini_entry->value[0]) {
- display_string = ini_entry->value;
- display_string_length = ini_entry->value_length;
+ } else if (ini_entry->value && ini_entry->value->val[0]) {
+ display_string = ini_entry->value->val;
+ display_string_length = ini_entry->value->len;
esc_html = !sapi_module.phpinfo_as_text;
} else {
if (!sapi_module.phpinfo_as_text) {
@@ -132,14 +132,14 @@ static int php_ini_displayer(zval *el, void *arg TSRMLS_DC)
if (!sapi_module.phpinfo_as_text) {
PUTS("<tr>");
PUTS("<td class=\"e\">");
- PHPWRITE(ini_entry->name, ini_entry->name_length);
+ PHPWRITE(ini_entry->name->val, ini_entry->name->len);
PUTS("</td><td class=\"v\">");
php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC);
PUTS("</td><td class=\"v\">");
php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC);
PUTS("</td></tr>\n");
} else {
- PHPWRITE(ini_entry->name, ini_entry->name_length);
+ PHPWRITE(ini_entry->name->val, ini_entry->name->len);
PUTS(" => ");
php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC);
PUTS(" => ");
@@ -786,7 +786,7 @@ PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int
zend_hash_move_forward(source_hash)
) {
data = zend_hash_get_current_data(source_hash);
- zend_alter_ini_entry_ex(str, Z_STRVAL_P(data), Z_STRLEN_P(data), modify_type, stage, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(str, Z_STR_P(data), modify_type, stage, 0 TSRMLS_CC);
}
}
/* }}} */
@@ -867,6 +867,14 @@ PHPAPI void php_ini_activate_per_host_config(const char *host, uint host_len TSR
/* {{{ cfg_get_entry
*/
+PHPAPI zval *cfg_get_entry_ex(zend_string *name)
+{
+ return zend_hash_find(&configuration_hash, name);
+}
+/* }}} */
+
+/* {{{ cfg_get_entry
+ */
PHPAPI zval *cfg_get_entry(const char *name, uint name_length)
{
return zend_hash_str_find(&configuration_hash, name, name_length);
diff --git a/main/php_ini.h b/main/php_ini.h
index 5e6f03680a..99f6a07a07 100644
--- a/main/php_ini.h
+++ b/main/php_ini.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -28,6 +28,7 @@ PHPAPI void config_zval_dtor(zval *zvalue);
int php_init_config(TSRMLS_D);
int php_shutdown_config(void);
void php_ini_register_extensions(TSRMLS_D);
+PHPAPI zval *cfg_get_entry_ex(zend_string *name);
PHPAPI zval *cfg_get_entry(const char *name, uint name_length);
PHPAPI int cfg_get_long(const char *varname, zend_long *result);
PHPAPI int cfg_get_double(const char *varname, double *result);
diff --git a/main/php_main.h b/main/php_main.h
index 92dafde4d8..07d7dc2280 100644
--- a/main/php_main.h
+++ b/main/php_main.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h
index 229ed1902e..a7823817bc 100644
--- a/main/php_memory_streams.h
+++ b/main/php_memory_streams.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_network.h b/main/php_network.h
index 1528447c73..b0b1787ea5 100644
--- a/main/php_network.h
+++ b/main/php_network.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c
index ebe5350ef2..a52619ed47 100644
--- a/main/php_open_temporary_file.c
+++ b/main/php_open_temporary_file.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h
index 873bffcb0a..a11cb79014 100644
--- a/main/php_open_temporary_file.h
+++ b/main/php_open_temporary_file.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_output.h b/main/php_output.h
index f8b961c7c3..02b2b85d13 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -143,12 +143,12 @@ typedef struct _php_output_handler {
} php_output_handler;
ZEND_BEGIN_MODULE_GLOBALS(output)
- int flags;
zend_stack handlers;
php_output_handler *active;
php_output_handler *running;
const char *output_start_filename;
int output_start_lineno;
+ int flags;
ZEND_END_MODULE_GLOBALS(output)
/* there should not be a need to use OG() from outside of output.c */
diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h
index 2f2e99c0b4..5aac0262a8 100644
--- a/main/php_reentrancy.h
+++ b/main/php_reentrancy.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_scandir.c b/main/php_scandir.c
index 36c0c648e1..7dfec7bff7 100644
--- a/main/php_scandir.c
+++ b/main/php_scandir.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_scandir.h b/main/php_scandir.h
index 90708c6872..848f525732 100644
--- a/main/php_scandir.h
+++ b/main/php_scandir.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_sprintf.c b/main/php_sprintf.c
index e9f956f8dd..f93c16e9aa 100644
--- a/main/php_sprintf.c
+++ b/main/php_sprintf.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_stdint.h b/main/php_stdint.h
index 527ee3493d..4d0d723af6 100644
--- a/main/php_stdint.h
+++ b/main/php_stdint.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_streams.h b/main/php_streams.h
index ecc6557f63..34d7676f09 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -299,9 +299,9 @@ PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_
#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC)
#ifdef ZTS
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...);
+PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#else
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...);
+PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
#endif
/* php_stream_printf macro & function require TSRMLS_CC */
@@ -560,9 +560,9 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS
/* pushes an error message onto the stack for a wrapper instance */
#ifdef ZTS
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...);
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5);
#else
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...);
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#endif
#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */
diff --git a/main/php_syslog.h b/main/php_syslog.h
index f8280a8a50..d39fc9b5b2 100644
--- a/main/php_syslog.h
+++ b/main/php_syslog.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_ticks.c b/main/php_ticks.c
index 248b5a9e04..daa6cde6ff 100644
--- a/main/php_ticks.c
+++ b/main/php_ticks.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_ticks.h b/main/php_ticks.h
index b511949d80..0f8277cc7f 100644
--- a/main/php_ticks.h
+++ b/main/php_ticks.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/php_variables.c b/main/php_variables.c
index 37af78b98d..c1d69532e0 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -243,7 +243,7 @@ typedef struct post_var_data {
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC)
{
- char *ksep, *vsep;
+ char *ksep, *vsep, *val;
size_t klen, vlen;
/* FIXME: string-size_t */
size_t new_vlen;
@@ -274,15 +274,17 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR
vlen = 0;
}
-
php_url_decode(var->ptr, klen);
+
+ val = estrndup(ksep, vlen);
if (vlen) {
- vlen = php_url_decode(ksep, vlen);
+ vlen = php_url_decode(val, vlen);
}
- if (sapi_module.input_filter(PARSE_POST, var->ptr, &ksep, vlen, &new_vlen TSRMLS_CC)) {
- php_register_variable_safe(var->ptr, ksep, new_vlen, arr TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_POST, var->ptr, &val, vlen, &new_vlen TSRMLS_CC)) {
+ php_register_variable_safe(var->ptr, val, new_vlen, arr TSRMLS_CC);
}
+ efree(val);
var->ptr = vsep + (vsep != var->end);
return 1;
diff --git a/main/php_variables.h b/main/php_variables.h
index 70f5e1dc7f..08abeb5267 100644
--- a/main/php_variables.h
+++ b/main/php_variables.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/reentrancy.c b/main/reentrancy.c
index dd411f478b..4aca23eb1a 100644
--- a/main/reentrancy.c
+++ b/main/reentrancy.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 0f2941ef98..0eacf896c3 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/rfc1867.h b/main/rfc1867.h
index b76e3598f5..ab5f50f8d6 100644
--- a/main/rfc1867.h
+++ b/main/rfc1867.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/snprintf.c b/main/snprintf.c
index 0675538ac5..062ccc4eee 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/snprintf.h b/main/snprintf.h
index 98742e00b0..d133ad7aaa 100644
--- a/main/snprintf.h
+++ b/main/snprintf.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -84,7 +84,7 @@ PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...);
PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap);
PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap);
PHPAPI int ap_php_asprintf(char **buf, const char *format, ...);
-PHPAPI int php_sprintf (char* s, const char* format, ...);
+PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf);
PHPAPI char * php_conv_fp(register char format, register double num,
boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, size_t *len);
diff --git a/main/spprintf.c b/main/spprintf.c
index 67ab15dce5..12443a7769 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/spprintf.h b/main/spprintf.h
index 70e4b0df7a..1e7c034cfa 100644
--- a/main/spprintf.h
+++ b/main/spprintf.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -37,9 +37,9 @@ There is also snprintf: See difference explained in snprintf.h
#include "snprintf.h"
BEGIN_EXTERN_C()
-PHPAPI size_t spprintf( char **pbuf, size_t max_len, const char *format, ...);
+PHPAPI size_t spprintf( char **pbuf, size_t max_len, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
-PHPAPI size_t vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap);
+PHPAPI size_t vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0);
PHPAPI zend_string *vstrpprintf(size_t max_len, const char *format, va_list ap);
diff --git a/main/streams/cast.c b/main/streams/cast.c
index cb4f081655..3291a9ca8f 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/filter.c b/main/streams/filter.c
index a74802eb14..36585fa9bf 100644
--- a/main/streams/filter.c
+++ b/main/streams/filter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c
index f0c8a347f0..e62fbfb662 100644
--- a/main/streams/glob_wrapper.c
+++ b/main/streams/glob_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/memory.c b/main/streams/memory.c
index f08c192581..9788954988 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/mmap.c b/main/streams/mmap.c
index a99c8994aa..8746959bbe 100644
--- a/main/streams/mmap.c
+++ b/main/streams/mmap.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h
index c0b70934c6..ac90a0ba3c 100644
--- a/main/streams/php_stream_context.h
+++ b/main/streams/php_stream_context.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h
index 31e73ff6e4..dfa4ae2937 100644
--- a/main/streams/php_stream_filter_api.h
+++ b/main/streams/php_stream_filter_api.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h
index b6746b72ed..69b67d4c85 100644
--- a/main/streams/php_stream_glob_wrapper.h
+++ b/main/streams/php_stream_glob_wrapper.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h
index 5d200d729a..a25c4ac6b9 100644
--- a/main/streams/php_stream_mmap.h
+++ b/main/streams/php_stream_mmap.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h
index 4370867995..7d5278c620 100644
--- a/main/streams/php_stream_plain_wrapper.h
+++ b/main/streams/php_stream_plain_wrapper.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h
index a6797ed898..9674314c49 100644
--- a/main/streams/php_stream_transport.h
+++ b/main/streams/php_stream_transport.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -142,21 +142,21 @@ typedef struct _php_stream_xport_param {
struct {
char *name;
size_t namelen;
- int backlog;
struct timeval *timeout;
struct sockaddr *addr;
- socklen_t addrlen;
char *buf;
size_t buflen;
- long flags;
+ zend_long flags;
+ socklen_t addrlen;
+ int backlog;
} inputs;
struct {
php_stream *client;
- int returncode;
struct sockaddr *addr;
socklen_t addrlen;
zend_string *textaddr;
zend_string *error_text;
+ int returncode;
int error_code;
} outputs;
} php_stream_xport_param;
@@ -191,18 +191,18 @@ PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRML
END_EXTERN_C()
typedef struct _php_stream_xport_crypto_param {
- enum {
- STREAM_XPORT_CRYPTO_OP_SETUP,
- STREAM_XPORT_CRYPTO_OP_ENABLE
- } op;
struct {
+ php_stream *session;
int activate;
php_stream_xport_crypt_method_t method;
- php_stream *session;
} inputs;
struct {
int returncode;
} outputs;
+ enum {
+ STREAM_XPORT_CRYPTO_OP_SETUP,
+ STREAM_XPORT_CRYPTO_OP_ENABLE
+ } op;
} php_stream_xport_crypto_param;
BEGIN_EXTERN_C()
diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h
index 28985a5e1e..7a03690a8f 100644
--- a/main/streams/php_stream_userspace.h
+++ b/main/streams/php_stream_userspace.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h
index 489e18b26f..d8799fcefb 100644
--- a/main/streams/php_streams_int.h
+++ b/main/streams/php_streams_int.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 36b56645c2..2b8dcc478e 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1336,7 +1336,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
break;
#endif
case PHP_STREAM_META_ACCESS:
- mode = (mode_t)*(long *)value;
+ mode = (mode_t)*(zend_long *)value;
ret = VCWD_CHMOD(url, mode);
break;
default:
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 5cce2c66bf..bc84d52655 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/transports.c b/main/streams/transports.c
index b1f0acfa73..a75f77c5bd 100644
--- a/main/streams/transports.c
+++ b/main/streams/transports.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/userspace.c b/main/streams/userspace.c
index a286104e29..1ff80cdfa6 100644
--- a/main/streams/userspace.c
+++ b/main/streams/userspace.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 12111511d6..bce6a09fb0 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/strlcat.c b/main/strlcat.c
index b7aa06e8a2..65811e90c2 100644
--- a/main/strlcat.c
+++ b/main/strlcat.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/strlcpy.c b/main/strlcpy.c
index 7738238bd5..737036c4a1 100644
--- a/main/strlcpy.c
+++ b/main/strlcpy.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/win32_internal_function_disabled.h b/main/win32_internal_function_disabled.h
index 7365262772..a412305ea3 100644
--- a/main/win32_internal_function_disabled.h
+++ b/main/win32_internal_function_disabled.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/main/win95nt.h b/main/win95nt.h
index ce2b002f38..76bec05ea5 100644
--- a/main/win95nt.h
+++ b/main/win95nt.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/netware/start.c b/netware/start.c
index e0569b1b89..d2445bbda0 100644
--- a/netware/start.c
+++ b/netware/start.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/run-tests.php b/run-tests.php
index 1b5bcec253..7de8cf8001 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -2,7 +2,7 @@
<?php
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
@@ -1189,6 +1189,7 @@ function run_test($php, $file, $env)
global $no_clean;
global $valgrind_version;
global $JUNIT;
+ global $SHOW_ONLY_GROUPS;
$temp_filenames = null;
$org_file = $file;
@@ -1363,7 +1364,9 @@ TEST $file
}
}
- show_test($test_idx, $shortname);
+ if (!$SHOW_ONLY_GROUPS) {
+ show_test($test_idx, $shortname);
+ }
if (is_array($IN_REDIRECT)) {
$temp_dir = $test_dir = $IN_REDIRECT['dir'];
@@ -2569,7 +2572,7 @@ function show_result($result, $tested, $tested_file, $extra = '', $temp_filename
if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
echo "$result $tested [$tested_file] $extra\n";
- } else {
+ } else if (!$SHOW_ONLY_GROUPS) {
// Write over the last line to avoid random trailing chars on next echo
echo str_repeat(" ", $line_length), "\r";
}
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 13091b908a..2796dd23a5 100644
--- a/sapi/aolserver/aolserver.c
+++ b/sapi/aolserver/aolserver.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache/libpre.c b/sapi/apache/libpre.c
index ca10e34cdd..f7ab68b62c 100644
--- a/sapi/apache/libpre.c
+++ b/sapi/apache/libpre.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache/mod_php7.c b/sapi/apache/mod_php7.c
index 582de522ac..687586952f 100644
--- a/sapi/apache/mod_php7.c
+++ b/sapi/apache/mod_php7.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -567,7 +567,7 @@ static void init_request_info(TSRMLS_D)
static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC)
{
zend_string *key = STR_INIT(per_dir_entry->key, per_dir_entry->key_length, 0);
- zend_alter_ini_entry(key, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, per_dir_entry->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE);
+ zend_alter_ini_entry_chars(key, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, per_dir_entry->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE);
STR_RELEASE(key);
return 0;
}
diff --git a/sapi/apache/mod_php7.h b/sapi/apache/mod_php7.h
index de8aa1b7ff..947d8b44d4 100644
--- a/sapi/apache/mod_php7.h
+++ b/sapi/apache/mod_php7.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 3a88a1210e..f6e9e61203 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h
index 30d9f8ee17..ed586372d7 100644
--- a/sapi/apache/php_apache_http.h
+++ b/sapi/apache/php_apache_http.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index f19586da1f..466cf6b8ff 100644
--- a/sapi/apache/sapi_apache.c
+++ b/sapi/apache/sapi_apache.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c
index 6de4b3ab36..f87a04bbd1 100644
--- a/sapi/apache2filter/apache_config.c
+++ b/sapi/apache2filter/apache_config.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h
index 600aa647b7..7918cf6de8 100644
--- a/sapi/apache2filter/php_apache.h
+++ b/sapi/apache2filter/php_apache.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c
index 3a0b3ee0b9..321df14416 100644
--- a/sapi/apache2filter/php_functions.c
+++ b/sapi/apache2filter/php_functions.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index afc9f06043..9d159327c0 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c
index 5302afcf18..9eed8dba0f 100644
--- a/sapi/apache2handler/apache_config.c
+++ b/sapi/apache2handler/apache_config.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -192,7 +192,7 @@ void apply_config(void *dummy)
ZEND_HASH_FOREACH_STR_KEY_PTR(&d->config, str, data) {
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
- if (zend_alter_ini_entry(str, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) {
+ if (zend_alter_ini_entry_chars(str, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
} ZEND_HASH_FOREACH_END();
diff --git a/sapi/apache2handler/mod_php7.c b/sapi/apache2handler/mod_php7.c
index d51642fc87..ddc98e153c 100644
--- a/sapi/apache2handler/mod_php7.c
+++ b/sapi/apache2handler/mod_php7.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h
index fa8dd6ca6e..f6f4f7a7c9 100644
--- a/sapi/apache2handler/php_apache.h
+++ b/sapi/apache2handler/php_apache.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index 084f411c2f..27643b8917 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 65e02065a9..08e6caff3c 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -482,7 +482,11 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
r->no_local_copy = 1;
content_length = (char *) apr_table_get(r->headers_in, "Content-Length");
- SG(request_info).content_length = (content_length ? atol(content_length) : 0);
+ if (content_length) {
+ ZEND_ATOL(SG(request_info).content_length, content_length);
+ } else {
+ SG(request_info).content_length = 0;
+ }
apr_table_unset(r->headers_out, "Content-Length");
apr_table_unset(r->headers_out, "Last-Modified");
diff --git a/sapi/apache_hooks/mod_php7.h b/sapi/apache_hooks/mod_php7.h
index 612aab523a..325ae1f721 100644
--- a/sapi/apache_hooks/mod_php7.h
+++ b/sapi/apache_hooks/mod_php7.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c
index 8045bbce32..e5bd3f5d61 100644
--- a/sapi/apache_hooks/php_apache.c
+++ b/sapi/apache_hooks/php_apache.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c
index 9ed93aea6d..daaad4e39d 100644
--- a/sapi/apache_hooks/sapi_apache.c
+++ b/sapi/apache_hooks/sapi_apache.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index 1b9754dc2c..b1ffddb460 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 9845d6cb74..dead1c3213 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -159,6 +159,8 @@ static const opt_struct OPTIONS[] = {
};
typedef struct _php_cgi_globals_struct {
+ HashTable user_config_cache;
+ char *redirect_status_env;
zend_bool rfc2616_headers;
zend_bool nph;
zend_bool check_shebang_line;
@@ -166,11 +168,9 @@ typedef struct _php_cgi_globals_struct {
zend_bool force_redirect;
zend_bool discard_path;
zend_bool fcgi_logging;
- char *redirect_status_env;
#ifdef PHP_WIN32
zend_bool impersonate;
#endif
- HashTable user_config_cache;
} php_cgi_globals_struct;
/* {{{ user_config_cache
@@ -1751,6 +1751,7 @@ int main(int argc, char *argv[])
char *bindpath = NULL;
int fcgi_fd = 0;
fcgi_request *request = NULL;
+ int warmup_repeats = 0;
int repeats = 1;
int benchmark = 0;
#if HAVE_GETTIMEOFDAY
@@ -2094,7 +2095,15 @@ consult the installation file that came with this distribution, or visit \n\
switch (c) {
case 'T':
benchmark = 1;
- repeats = atoi(php_optarg);
+ {
+ char *comma = strchr(php_optarg, ',');
+ if (comma) {
+ warmup_repeats = atoi(php_optarg);
+ repeats = atoi(comma + 1);
+ } else {
+ repeats = atoi(php_optarg);
+ }
+ }
#ifdef HAVE_GETTIMEOFDAY
gettimeofday(&start, NULL);
#else
@@ -2396,8 +2405,8 @@ consult the installation file that came with this distribution, or visit \n\
/* handle situations where line is terminated by \r\n */
if (c == '\r') {
if (fgetc(file_handle.handle.fp) != '\n') {
- long pos = ftell(file_handle.handle.fp);
- fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
+ zend_long pos = zend_ftell(file_handle.handle.fp);
+ zend_fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
}
}
CG(start_lineno) = 2;
@@ -2512,12 +2521,24 @@ fastcgi_request_done:
if (!fastcgi) {
if (benchmark) {
- repeats--;
- if (repeats > 0) {
- script_file = NULL;
- php_optind = orig_optind;
- php_optarg = orig_optarg;
+ if (warmup_repeats) {
+ warmup_repeats--;
+ if (!warmup_repeats) {
+#ifdef HAVE_GETTIMEOFDAY
+ gettimeofday(&start, NULL);
+#else
+ time(&start);
+#endif
+ }
continue;
+ } else {
+ repeats--;
+ if (repeats > 0) {
+ script_file = NULL;
+ php_optind = orig_optind;
+ php_optarg = orig_optarg;
+ continue;
+ }
}
}
break;
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index 115c4289c0..0cd3096e4d 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1111,7 +1111,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
shutdown(req->fd, 1);
/* read the last FCGI_STDIN header (it may be omitted) */
- recv(req->fd, (char *)&buf, sizeof(buf), 0);
+ recv(req->fd, (char *)(&buf), sizeof(buf), 0);
}
closesocket(req->fd);
}
@@ -1121,7 +1121,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
shutdown(req->fd, 1);
/* read the last FCGI_STDIN header (it may be omitted) */
- recv(req->fd, &buf, sizeof(buf), 0);
+ recv(req->fd, (char *)(&buf), sizeof(buf), 0);
}
close(req->fd);
#endif
diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h
index d5f141cd1b..4a30a207b1 100644
--- a/sapi/cgi/fastcgi.h
+++ b/sapi/cgi/fastcgi.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h
index b04f6c91f0..e49a203821 100644
--- a/sapi/cli/cli.h
+++ b/sapi/cli/cli.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cli/generate_mime_type_map.php b/sapi/cli/generate_mime_type_map.php
index 4475004985..772569a426 100644
--- a/sapi/cli/generate_mime_type_map.php
+++ b/sapi/cli/generate_mime_type_map.php
@@ -30,7 +30,7 @@ array_walk($types, function ($line) use (&$extensions) {
?>
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cli/mime_type_map.h b/sapi/cli/mime_type_map.h
index 72c05d4149..16f9b7f3ff 100644
--- a/sapi/cli/mime_type_map.h
+++ b/sapi/cli/mime_type_map.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 2e714c4a90..04cbdeb8f1 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -627,8 +627,8 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
/* handle situations where line is terminated by \r\n */
if (c == '\r') {
if (fgetc(file_handle->handle.fp) != '\n') {
- long pos = ftell(file_handle->handle.fp);
- fseek(file_handle->handle.fp, pos - 1, SEEK_SET);
+ zend_long pos = zend_ftell(file_handle->handle.fp);
+ zend_fseek(file_handle->handle.fp, pos - 1, SEEK_SET);
}
}
*lineno = 2;
diff --git a/sapi/cli/php_cli_process_title.c b/sapi/cli/php_cli_process_title.c
index 24f26f383c..28fbdfb518 100644
--- a/sapi/cli/php_cli_process_title.c
+++ b/sapi/cli/php_cli_process_title.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cli/php_cli_process_title.h b/sapi/cli/php_cli_process_title.h
index bd44d99111..b93947a81f 100644
--- a/sapi/cli/php_cli_process_title.h
+++ b/sapi/cli/php_cli_process_title.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 88a1010db1..b2defe0841 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -380,11 +380,11 @@ static void append_http_status_line(smart_str *buffer, int protocol_version, int
}
smart_str_appendl_ex(buffer, "HTTP", 4, persistent);
smart_str_appendc_ex(buffer, '/', persistent);
- smart_str_append_generic_ex(buffer, protocol_version / 100, persistent, int, _unsigned);
+ smart_str_append_long_ex(buffer, protocol_version / 100, persistent);
smart_str_appendc_ex(buffer, '.', persistent);
- smart_str_append_generic_ex(buffer, protocol_version % 100, persistent, int, _unsigned);
+ smart_str_append_long_ex(buffer, protocol_version % 100, persistent);
smart_str_appendc_ex(buffer, ' ', persistent);
- smart_str_append_generic_ex(buffer, response_code, persistent, int, _unsigned);
+ smart_str_append_long_ex(buffer, response_code, persistent);
smart_str_appendc_ex(buffer, ' ', persistent);
smart_str_appends_ex(buffer, get_status_string(response_code), persistent);
smart_str_appendl_ex(buffer, "\r\n", 2, persistent);
@@ -1902,13 +1902,13 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
append_essential_headers(&buffer, client, 1);
smart_str_appends_ex(&buffer, "Content-Type: text/html; charset=UTF-8\r\n", 1);
smart_str_appends_ex(&buffer, "Content-Length: ", 1);
- smart_str_append_generic_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1, size_t, _unsigned);
+ smart_str_append_unsigned_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1);
smart_str_appendl_ex(&buffer, "\r\n", 2, 1);
smart_str_appendl_ex(&buffer, "\r\n", 2, 1);
chunk = php_cli_server_chunk_heap_new(buffer.s, buffer.s->val, buffer.s->len);
if (!chunk) {
- smart_str_free_ex(&buffer, 1);
+ smart_str_free(&buffer);
goto fail;
}
php_cli_server_buffer_prepend(&client->content_sender.buffer, chunk);
@@ -1993,12 +1993,12 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv
}
smart_str_appendl_ex(&buffer, "\r\n", 2, 1);
smart_str_appends_ex(&buffer, "Content-Length: ", 1);
- smart_str_append_generic_ex(&buffer, client->request.sb.st_size, 1, size_t, _unsigned);
+ smart_str_append_unsigned_ex(&buffer, client->request.sb.st_size, 1);
smart_str_appendl_ex(&buffer, "\r\n", 2, 1);
smart_str_appendl_ex(&buffer, "\r\n", 2, 1);
chunk = php_cli_server_chunk_heap_new(buffer.s, buffer.s->val, buffer.s->len);
if (!chunk) {
- smart_str_free_ex(&buffer, 1);
+ smart_str_free(&buffer);
php_cli_server_log_response(client, 500, NULL TSRMLS_CC);
return FAILURE;
}
diff --git a/sapi/cli/php_cli_server.h b/sapi/cli/php_cli_server.h
index a8d7f46e7c..476ee2919c 100644
--- a/sapi/cli/php_cli_server.h
+++ b/sapi/cli/php_cli_server.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/cli/ps_title.c b/sapi/cli/ps_title.c
index 53cd5fc9a0..0be94e3eb0 100644
--- a/sapi/cli/ps_title.c
+++ b/sapi/cli/ps_title.c
@@ -311,7 +311,7 @@ const char* ps_title_errno(int rc)
#ifdef PS_USE_WIN32
case PS_TITLE_WINDOWS_ERROR:
- sprintf(windows_error_details, "Windows error code: %d", GetLastError());
+ sprintf(windows_error_details, "Windows error code: %u", GetLastError());
return windows_error_details;
#endif
}
diff --git a/sapi/cli/ps_title.h b/sapi/cli/ps_title.h
index 09650fed08..30a16b5a0c 100644
--- a/sapi/cli/ps_title.h
+++ b/sapi/cli/ps_title.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c
index 30d10ed0a0..aebfb9f671 100644
--- a/sapi/continuity/capi.c
+++ b/sapi/continuity/capi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index 230b3a649d..e0df666108 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h
index 84c0e36336..b62fd9fe24 100644
--- a/sapi/embed/php_embed.h
+++ b/sapi/embed/php_embed.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/devpoll.c b/sapi/fpm/fpm/events/devpoll.c
index 3fa7cd4545..c843940638 100644
--- a/sapi/fpm/fpm/events/devpoll.c
+++ b/sapi/fpm/fpm/events/devpoll.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/devpoll.h b/sapi/fpm/fpm/events/devpoll.h
index 2753cb5abe..3cb744c023 100644
--- a/sapi/fpm/fpm/events/devpoll.h
+++ b/sapi/fpm/fpm/events/devpoll.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/epoll.c b/sapi/fpm/fpm/events/epoll.c
index b55cb44b15..aa4881649b 100644
--- a/sapi/fpm/fpm/events/epoll.c
+++ b/sapi/fpm/fpm/events/epoll.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/epoll.h b/sapi/fpm/fpm/events/epoll.h
index f89e59a5f5..965fe4dc4e 100644
--- a/sapi/fpm/fpm/events/epoll.h
+++ b/sapi/fpm/fpm/events/epoll.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/kqueue.c b/sapi/fpm/fpm/events/kqueue.c
index 9fde33842b..df0724c3d4 100644
--- a/sapi/fpm/fpm/events/kqueue.c
+++ b/sapi/fpm/fpm/events/kqueue.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/kqueue.h b/sapi/fpm/fpm/events/kqueue.h
index 16f8046529..4b52faba21 100644
--- a/sapi/fpm/fpm/events/kqueue.h
+++ b/sapi/fpm/fpm/events/kqueue.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/poll.c b/sapi/fpm/fpm/events/poll.c
index d49661413c..a97c64c2d0 100644
--- a/sapi/fpm/fpm/events/poll.c
+++ b/sapi/fpm/fpm/events/poll.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/poll.h b/sapi/fpm/fpm/events/poll.h
index 4a05755d07..6378074a14 100644
--- a/sapi/fpm/fpm/events/poll.h
+++ b/sapi/fpm/fpm/events/poll.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/port.c b/sapi/fpm/fpm/events/port.c
index 0e6a880554..faf67343c7 100644
--- a/sapi/fpm/fpm/events/port.c
+++ b/sapi/fpm/fpm/events/port.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/port.h b/sapi/fpm/fpm/events/port.h
index f127b8cdad..1e57feb194 100644
--- a/sapi/fpm/fpm/events/port.h
+++ b/sapi/fpm/fpm/events/port.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/select.c b/sapi/fpm/fpm/events/select.c
index cf3331c04b..1be074c43c 100644
--- a/sapi/fpm/fpm/events/select.c
+++ b/sapi/fpm/fpm/events/select.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/events/select.h b/sapi/fpm/fpm/events/select.h
index 74f7be2bc1..cd3652e4bd 100644
--- a/sapi/fpm/fpm/events/select.h
+++ b/sapi/fpm/fpm/events/select.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 39621b839c..4f7f5eab9c 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1064,7 +1064,7 @@ char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val)
void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len)
{
zval zvalue;
- ZVAL_STR(&zvalue, zend_string_init(value, value_len, 1));
+ ZVAL_NEW_STR(&zvalue, zend_string_init(value, value_len, 1));
zend_hash_str_add(&fcgi_mgmt_vars, name, name_len, &zvalue);
}
diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h
index 5a8aa0e70e..6d1bb38dba 100644
--- a/sapi/fpm/fpm/fastcgi.h
+++ b/sapi/fpm/fpm/fastcgi.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index ff30369697..2552f9afe0 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1226,6 +1226,17 @@ static void init_request_info(TSRMLS_D)
SG(request_info).request_uri = orig_script_name;
}
path_info[0] = old;
+ } else if (apache_was_here && env_script_name) {
+ /* Using mod_proxy_fcgi and ProxyPass, apache cannot set PATH_INFO
+ * As we can extract PATH_INFO from PATH_TRANSLATED
+ * it is probably also in SCRIPT_NAME and need to be removed
+ */
+ int snlen = strlen(env_script_name);
+ if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) {
+ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
+ env_script_name[snlen-slen] = 0;
+ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC);
+ }
}
env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC);
}
diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c
index 7112cb923b..e0de217c00 100644
--- a/sapi/fpm/fpm/fpm_php.c
+++ b/sapi/fpm/fpm/fpm_php.c
@@ -26,22 +26,21 @@ static char **limit_extensions = NULL;
static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int mode, int stage TSRMLS_DC) /* {{{ */
{
zend_ini_entry *ini_entry;
- char *duplicate;
+ zend_string *duplicate;
if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length))) {
return FAILURE;
}
- duplicate = strdup(new_value);
+ duplicate = zend_string_init(new_value, new_value_length, 1);
if (!ini_entry->on_modify
- || ini_entry->on_modify(ini_entry, duplicate, new_value_length,
+ || ini_entry->on_modify(ini_entry, duplicate,
ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
ini_entry->value = duplicate;
- ini_entry->value_length = new_value_length;
ini_entry->modifiable = mode;
} else {
- free(duplicate);
+ zend_string_release(duplicate);
}
return SUCCESS;
@@ -92,7 +91,7 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */
return Z_TYPE(zv) == IS_TRUE;
}
- if (fpm_php_zend_ini_alter_master(name, name_len+1, value, value_len, mode, PHP_INI_STAGE_ACTIVATE TSRMLS_CC) == FAILURE) {
+ if (fpm_php_zend_ini_alter_master(name, name_len, value, value_len, mode, PHP_INI_STAGE_ACTIVATE TSRMLS_CC) == FAILURE) {
return -1;
}
diff --git a/sapi/isapi/php7isapi.c b/sapi/isapi/php7isapi.c
index d83c81ad9e..27eb1c9353 100644
--- a/sapi/isapi/php7isapi.c
+++ b/sapi/isapi/php7isapi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 3a4ed748e3..6793d5c9a4 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -195,15 +195,22 @@ 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 )
{
- php_register_variable_safe((char *)pKey, (char *)pValue, valLen, (zval *)arg TSRMLS_CC);
- return 1;
+ int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
+ char * new_val = (char *) pValue;
+ unsigned int new_val_len;
+
+ if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len TSRMLS_CC)) {
+ php_register_variable_safe((char *)pKey, new_val, new_val_len, (zval *)arg );
+ }
+ return 1;
}
-*/
+/*
static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen,
void * arg )
{
@@ -222,6 +229,55 @@ static int add_variable( const char * pKey, int keyLen, const char * pValue, int
#endif
return 1;
}
+*/
+
+static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
+{
+ char buf[128];
+ char **env, *p, *t = buf;
+ 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
+ ) {
+ 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;
+ }
+
+ for (env = environ; env != NULL && *env != NULL; env++) {
+ p = strchr(*env, '=');
+ if (!p) { /* malformed entry? */
+ continue;
+ }
+ nlen = p - *env;
+ if (nlen >= alloc_size) {
+ alloc_size = nlen + 64;
+ t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size));
+ }
+ memcpy(t, *env, nlen);
+ t[nlen] = '\0';
+ add_variable(t, nlen, p + 1, strlen( p + 1 ), array_ptr TSRMLS_CC);
+ }
+ if (t != buf && t != NULL) {
+ efree(t);
+ }
+}
#if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5)
@@ -255,6 +311,8 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
if ( (SG(request_info).request_uri ) )
php_self = (SG(request_info).request_uri );
+ litespeed_php_import_environment_variables(track_vars_array TSRMLS_CC);
+
#if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5)
if (!PG(magic_quotes_gpc)) {
#endif
@@ -268,7 +326,6 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
add_variable_magic_quote("PHP_SELF", 8, php_self, strlen( php_self ), track_vars_array );
}
#endif
- php_import_environment_variables(track_vars_array TSRMLS_CC);
} else {
php_import_environment_variables(track_vars_array TSRMLS_CC);
@@ -370,7 +427,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC)
static sapi_module_struct lsapi_sapi_module =
{
"litespeed",
- "LiteSpeed V6.6",
+ "LiteSpeed V6.7",
php_lsapi_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */
diff --git a/sapi/litespeed/lsapidef.h b/sapi/litespeed/lsapidef.h
index fb75d01a17..5c604a57c4 100644
--- a/sapi/litespeed/lsapidef.h
+++ b/sapi/litespeed/lsapidef.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index 786a3bd20b..cf63f6ab1c 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1912,9 +1912,13 @@ int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq,
int ret;
int count = 0;
struct _headerInfo headers[512];
+
if ( !pReq || !fn )
return -1;
-
+
+ if ( !pReq->m_pHeaderIndex )
+ return 0;
+
for( i = 0; i < H_TRANSFER_ENCODING; ++i )
{
if ( pReq->m_pHeaderIndex->m_headerOff[i] )
diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h
index cae1863c79..cacf7d97b8 100644
--- a/sapi/litespeed/lsapilib.h
+++ b/sapi/litespeed/lsapilib.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c
index 57f8190ec4..d82089ca1f 100644
--- a/sapi/milter/php_milter.c
+++ b/sapi/milter/php_milter.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index 814b12737a..bb99c31652 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/.travis.yml b/sapi/phpdbg/.travis.yml
index d5b492e7cf..2e777fbe13 100644
--- a/sapi/phpdbg/.travis.yml
+++ b/sapi/phpdbg/.travis.yml
@@ -4,7 +4,6 @@ env:
- PHP="PHP-5.4"
- PHP="PHP-5.5"
- PHP="PHP-5.6"
-- PHP="master"
before_script: ./travis/ci.sh
diff --git a/sapi/phpdbg/README.md b/sapi/phpdbg/README.md
index e7e5c731a8..a2a84deb7b 100644
--- a/sapi/phpdbg/README.md
+++ b/sapi/phpdbg/README.md
@@ -1,7 +1,7 @@
The interactive PHP debugger
============================
-Implemented as a SAPI module, phpdbg can excert complete control over the environment without impacting the functionality or performance of your code.
+Implemented as a SAPI module, phpdbg can exert complete control over the environment without impacting the functionality or performance of your code.
phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP 5.4+
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 6fe06a9f65..4388b4f86d 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -1296,14 +1296,14 @@ phpdbg_main:
/* do not install sigint handlers for remote consoles */
/* sending SIGINT then provides a decent way of shutting down the server */
-#if defined(ZEND_SIGNALS) && !defined(_WIN32)
- if (listen[0] < 0) {
- zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try();
- }
-#elif !defined(_WIN32)
+#ifndef _WIN32
if (listen[0] < 0) {
#endif
+#if defined(ZEND_SIGNALS) && !defined(_WIN32)
+ zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try();
+#else
signal(SIGINT, phpdbg_sigint_handler);
+#endif
#ifndef _WIN32
}
#endif
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index 7d720f157b..364ef7d176 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index 09bdc1931f..e30b87c313 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h
index 97980e7ed7..9c3f097d78 100644
--- a/sapi/phpdbg/phpdbg_bp.h
+++ b/sapi/phpdbg/phpdbg_bp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c
index be76b22b05..d04f2f8bb4 100644
--- a/sapi/phpdbg/phpdbg_break.c
+++ b/sapi/phpdbg/phpdbg_break.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_break.h b/sapi/phpdbg/phpdbg_break.h
index dc06da62b7..de1eff1b56 100644
--- a/sapi/phpdbg/phpdbg_break.h
+++ b/sapi/phpdbg/phpdbg_break.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_btree.c b/sapi/phpdbg/phpdbg_btree.c
index 491445399b..a155efbf9a 100644
--- a/sapi/phpdbg/phpdbg_btree.c
+++ b/sapi/phpdbg/phpdbg_btree.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_btree.h b/sapi/phpdbg/phpdbg_btree.h
index af2a6ac314..c714d8dc4c 100644
--- a/sapi/phpdbg/phpdbg_btree.h
+++ b/sapi/phpdbg/phpdbg_btree.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index 72dc484098..0437455054 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h
index 571d065f59..08b50de39e 100644
--- a/sapi/phpdbg/phpdbg_cmd.h
+++ b/sapi/phpdbg/phpdbg_cmd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c
index 5a6a37d5f9..5678534005 100644
--- a/sapi/phpdbg/phpdbg_frame.c
+++ b/sapi/phpdbg/phpdbg_frame.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h
index 7c4574ed28..757f98fd71 100644
--- a/sapi/phpdbg/phpdbg_frame.h
+++ b/sapi/phpdbg/phpdbg_frame.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c
index c552529930..3421f7ebeb 100644
--- a/sapi/phpdbg/phpdbg_help.c
+++ b/sapi/phpdbg/phpdbg_help.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_help.h b/sapi/phpdbg/phpdbg_help.h
index 16a1e771e3..c7af5c894b 100644
--- a/sapi/phpdbg/phpdbg_help.h
+++ b/sapi/phpdbg/phpdbg_help.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c
index 97f88bfa1e..5911185300 100644
--- a/sapi/phpdbg/phpdbg_info.c
+++ b/sapi/phpdbg/phpdbg_info.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_info.h b/sapi/phpdbg/phpdbg_info.h
index c36e6bebd6..fcdc131fd5 100644
--- a/sapi/phpdbg/phpdbg_info.h
+++ b/sapi/phpdbg/phpdbg_info.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h
index ab51e7daa8..d0e259f453 100644
--- a/sapi/phpdbg/phpdbg_lexer.h
+++ b/sapi/phpdbg/phpdbg_lexer.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index e8db4e605c..eac17ba6a7 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h
index 14905f6567..84f6b63195 100644
--- a/sapi/phpdbg/phpdbg_list.h
+++ b/sapi/phpdbg/phpdbg_list.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index 4e693c4414..84bf246d65 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -104,9 +104,6 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM
#ifdef ZEND_JMP_SET
case ZEND_JMP_SET:
#endif
-#ifdef ZEND_JMP_SET_VAR
- case ZEND_JMP_SET_VAR:
-#endif
decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC);
asprintf(
&decode[2], "J%ld", op->op2.jmp_addr - ops->opcodes);
@@ -333,12 +330,6 @@ const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */
#ifdef ZEND_SEPARATE
CASE(ZEND_SEPARATE);
#endif
-#ifdef ZEND_QM_ASSIGN_VAR
- CASE(ZEND_QM_ASSIGN_VAR);
-#endif
-#ifdef ZEND_JMP_SET_VAR
- CASE(ZEND_JMP_SET_VAR);
-#endif
#ifdef ZEND_DISCARD_EXCEPTION
CASE(ZEND_DISCARD_EXCEPTION);
#endif
diff --git a/sapi/phpdbg/phpdbg_opcode.h b/sapi/phpdbg/phpdbg_opcode.h
index 144442981d..647237119c 100644
--- a/sapi/phpdbg/phpdbg_opcode.h
+++ b/sapi/phpdbg/phpdbg_opcode.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 376373e4a1..eba7ed7666 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_print.h b/sapi/phpdbg/phpdbg_print.h
index ed85e965c1..7bd096bf4e 100644
--- a/sapi/phpdbg/phpdbg_print.h
+++ b/sapi/phpdbg/phpdbg_print.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 7f78b58e53..134ef33f6d 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h
index ef648aabeb..0bd03f03bb 100644
--- a/sapi/phpdbg/phpdbg_prompt.h
+++ b/sapi/phpdbg/phpdbg_prompt.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c
index 54269a8193..3d3eced705 100644
--- a/sapi/phpdbg/phpdbg_set.c
+++ b/sapi/phpdbg/phpdbg_set.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_set.h b/sapi/phpdbg/phpdbg_set.h
index dea61ed382..18618cd007 100644
--- a/sapi/phpdbg/phpdbg_set.h
+++ b/sapi/phpdbg/phpdbg_set.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 3ce2fade17..b57986b55c 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h
index 56bacfc459..0edc40a262 100644
--- a/sapi/phpdbg/phpdbg_utils.h
+++ b/sapi/phpdbg/phpdbg_utils.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index e88622444b..054bea6d00 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h
index d00bcff77e..7a4e49ec8f 100644
--- a/sapi/phpdbg/phpdbg_watch.h
+++ b/sapi/phpdbg/phpdbg_watch.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c
index b0cbdf267a..b55abd9e1b 100644
--- a/sapi/phpdbg/phpdbg_win.c
+++ b/sapi/phpdbg/phpdbg_win.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phpdbg/phpdbg_win.h b/sapi/phpdbg/phpdbg_win.h
index 68c3052790..3f87c216f6 100644
--- a/sapi/phpdbg/phpdbg_win.h
+++ b/sapi/phpdbg/phpdbg_win.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phttpd/php_phttpd.h b/sapi/phttpd/php_phttpd.h
index 92409ac905..73c76cec0b 100644
--- a/sapi/phttpd/php_phttpd.h
+++ b/sapi/phttpd/php_phttpd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c
index 60fc48ba35..ba8dfe3838 100644
--- a/sapi/phttpd/phttpd.c
+++ b/sapi/phttpd/phttpd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index d6bc2997f4..d92526cf5e 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index 0a0e49be54..756f7353e9 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/thttpd/php_thttpd.h b/sapi/thttpd/php_thttpd.h
index 75e79b4054..df7fb455e1 100644
--- a/sapi/thttpd/php_thttpd.h
+++ b/sapi/thttpd/php_thttpd.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index f6ba8585b9..1671a5b65b 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -181,7 +181,7 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
if (!SG(sapi_headers).http_status_line) {
ADD_VEC_S("HTTP/1.1 ");
- p = smart_str_print_long(buf+sizeof(buf)-1,
+ p = zend_print_long_to_buf(buf+sizeof(buf)-1,
SG(sapi_headers).http_response_code);
ADD_VEC(p, strlen(p));
ADD_VEC_S(" HTTP\r\n");
@@ -293,7 +293,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC)
ADD_STRING_EX("REMOTE_HOST", p);
ADD_STRING_EX("SERVER_PORT",
- smart_str_print_long(buf + sizeof(buf) - 1,
+ zend_print_long_to_buf(buf + sizeof(buf) - 1,
TG(hc)->hs->port));
buf[0] = '/';
@@ -323,7 +323,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC)
if (TG(hc)->contentlength != -1) {
ADD_STRING_EX("CONTENT_LENGTH",
- smart_str_print_long(buf + sizeof(buf) - 1,
+ zend_print_long_to_buf(buf + sizeof(buf) - 1,
TG(hc)->contentlength));
}
@@ -468,7 +468,7 @@ static void thttpd_request_ctor(TSRMLS_D)
static void thttpd_request_dtor(TSRMLS_D)
{
- smart_str_free_ex(&TG(sbuf), 1);
+ smart_str_free(&TG(sbuf));
if (SG(request_info).query_string)
free(SG(request_info).query_string);
free(SG(request_info).request_uri);
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index 9dba8efbfe..9bff4f1695 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/webjames/php_webjames.h b/sapi/webjames/php_webjames.h
index dcb6cdb911..08f4a11442 100644
--- a/sapi/webjames/php_webjames.h
+++ b/sapi/webjames/php_webjames.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c
index 264f910af4..2978131ac1 100644
--- a/sapi/webjames/webjames.c
+++ b/sapi/webjames/webjames.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/scripts/dev/check_parameters.php b/scripts/dev/check_parameters.php
index c9f5169eec..658471ef2a 100644
--- a/scripts/dev/check_parameters.php
+++ b/scripts/dev/check_parameters.php
@@ -1,7 +1,7 @@
<?php
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/scripts/dev/search_underscores.php b/scripts/dev/search_underscores.php
index 445228b8c5..67ed02f160 100755
--- a/scripts/dev/search_underscores.php
+++ b/scripts/dev/search_underscores.php
@@ -3,7 +3,7 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/server-tests.php b/server-tests.php
index 688fee485a..8666895a96 100755
--- a/server-tests.php
+++ b/server-tests.php
@@ -1,7 +1,7 @@
<?php
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/tests/lang/operators/preinc_variationStr.phpt b/tests/lang/operators/preinc_variationStr.phpt
index 010a237034..4e607057f7 100644
--- a/tests/lang/operators/preinc_variationStr.phpt
+++ b/tests/lang/operators/preinc_variationStr.phpt
@@ -1,22 +1,23 @@
---TEST--
-Test ++N operator : various numbers as strings
---FILE--
-<?php
-
-$strVals = array(
- "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
- "a5.9"
-);
-
-
-foreach ($strVals as $strVal) {
- echo "--- testing: '$strVal' ---\n";
- var_dump(++$strVal);
-}
-
-?>
-===DONE===
---EXPECT--
+--TEST--
+Test ++N operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7",
+ "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", "a5.9",
+ "z", "az", "zz", "Z", "AZ", "ZZ", "9z", "19z", "99z",
+);
+
+
+foreach ($strVals as $strVal) {
+ echo "--- testing: '$strVal' ---\n";
+ var_dump(++$strVal);
+}
+
+?>
+===DONE===
+--EXPECT--
--- testing: '0' ---
int(1)
--- testing: '65' ---
@@ -44,5 +45,23 @@ string(7) "123abc "
--- testing: '3.4a' ---
string(4) "3.4b"
--- testing: 'a5.9' ---
-string(4) "a5.0"
-===DONE===
+string(4) "a5.0"
+--- testing: 'z' ---
+string(2) "aa"
+--- testing: 'az' ---
+string(2) "ba"
+--- testing: 'zz' ---
+string(3) "aaa"
+--- testing: 'Z' ---
+string(2) "AA"
+--- testing: 'AZ' ---
+string(2) "BA"
+--- testing: 'ZZ' ---
+string(3) "AAA"
+--- testing: '9z' ---
+string(3) "10a"
+--- testing: '19z' ---
+string(3) "20a"
+--- testing: '99z' ---
+string(4) "100a"
+===DONE===
diff --git a/win32/build/Makefile b/win32/build/Makefile
index fc1127cbcf..b2918b7117 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -1,5 +1,5 @@
# +----------------------------------------------------------------------+
-# | PHP Version 5 |
+# | PHP Version 7 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2008 The PHP Group |
# +----------------------------------------------------------------------+
diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js
index b4194ad203..2fa134a3b4 100644
--- a/win32/build/buildconf.js
+++ b/win32/build/buildconf.js
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 1d2949c5ae..82378b536d 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -362,7 +362,8 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \
zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \
zend_object_handlers.c zend_objects_API.c \
zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \
- zend_float.c zend_string.c zend_generators.c zend_virtual_cwd.c zend_ast.c");
+ zend_float.c zend_string.c zend_generators.c zend_virtual_cwd.c zend_ast.c \
+ zend_inheritance.c");
if (VCVERS == 1200) {
AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in
index 9efdfdea3e..e74108ce96 100644
--- a/win32/build/config.w32.h.in
+++ b/win32/build/config.w32.h.in
@@ -174,3 +174,8 @@
# define _USE_32BIT_TIME_T 1
#endif
#define HAVE_STDLIB_H 1
+
+#define _REENTRANT 1
+#define HAVE_MBRLEN 1
+#define HAVE_MBSTATE_T 1
+
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index d8155bbaa8..4b6abe1615 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1,7 +1,7 @@
// Utils for configure script
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
@@ -1887,6 +1887,14 @@ function generate_config_h()
outfile.WriteLine("#define " + keys[i] + " " + pieces);
}
+
+ if (VCVERS >= 1800) {
+ outfile.WriteLine("");
+ outfile.WriteLine("#define HAVE_ACOSH 1");
+ outfile.WriteLine("#define HAVE_ASINH 1");
+ outfile.WriteLine("#define HAVE_ATANH 1");
+ }
+
outfile.Close();
}
diff --git a/win32/build/deplister.c b/win32/build/deplister.c
index 31f1f07e67..bae6d031f6 100644
--- a/win32/build/deplister.c
+++ b/win32/build/deplister.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/build/phpize.js.in b/win32/build/phpize.js.in
index c99dece618..a843cb91a4 100644
--- a/win32/build/phpize.js.in
+++ b/win32/build/phpize.js.in
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/globals.c b/win32/globals.c
index 0f88e4cc63..ec4180db38 100644
--- a/win32/globals.c
+++ b/win32/globals.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/grp.h b/win32/grp.h
index 899d3ac0cd..71454fc3b6 100644
--- a/win32/grp.h
+++ b/win32/grp.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h
index 6bf9ba5b71..42f5ec9411 100644
--- a/win32/php_win32_globals.h
+++ b/win32/php_win32_globals.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/registry.c b/win32/registry.c
index 8ed838b1d1..10372cd624 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -244,7 +244,7 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC)
zval *data;
ZEND_HASH_FOREACH_KEY_VAL(ht, num, index, data) {
- zend_alter_ini_entry(index, Z_STRVAL_P(data), Z_STRLEN_P(data), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+ zend_alter_ini_entry(index, Z_STR_P(data), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
} ZEND_HASH_FOREACH_END();
/*
for (zend_hash_internal_pointer_reset_ex(ht, &pos);
diff --git a/win32/select.c b/win32/select.c
index 8e44636945..636c84364a 100644
--- a/win32/select.c
+++ b/win32/select.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/select.h b/win32/select.h
index a8d8496295..dafe76c1bc 100644
--- a/win32/select.h
+++ b/win32/select.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/sockets.c b/win32/sockets.c
index 8b3898bb3c..1fceabb90a 100644
--- a/win32/sockets.c
+++ b/win32/sockets.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/sockets.h b/win32/sockets.h
index 78a0d3a967..c5cd4d19ed 100644
--- a/win32/sockets.h
+++ b/win32/sockets.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/syslog.h b/win32/syslog.h
index 06397d0f90..5274f64c44 100644
--- a/win32/syslog.h
+++ b/win32/syslog.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/winutil.c b/win32/winutil.c
index 9984d3addc..5203fb4e66 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
diff --git a/win32/winutil.h b/win32/winutil.h
index e0193d33f3..74d72062c4 100644
--- a/win32/winutil.h
+++ b/win32/winutil.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+